<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>136954</bug_id>
          
          <creation_ts>2006-11-06 16:57:56 +0000</creation_ts>
          <short_desc>Reminders from outlook invites are set to unknown in exchange resources</short_desc>
          <delta_ts>2006-12-18 17:07:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>korganizer</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Henrik Segesten">hnordin</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>484658</commentid>
    <comment_count>0</comment_count>
    <who name="Henrik Segesten">hnordin</who>
    <bug_when>2006-11-06 16:57:56 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          GCC 4.1.1 stable gentoo 
OS:                Linux

I have configured two resources in korganizer one regular local calendar and one exchange calendar. When I receive invites to meetings via email and press the accept button I get to choose which of the two resources the event should be saved to. If I select the local calendar the event is saved fine with the correct reminder. But if I instead select the exchange calendar the event is still saved but the type of the reminder of the event is set to &quot;Unknown&quot; which results in that I get no reminder at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493279</commentid>
    <comment_count>1</comment_count>
    <who name="Uli">o_kinobi</who>
    <bug_when>2006-12-12 20:27:41 +0000</bug_when>
    <thetext>Unfortunately, the problem is bigger than just the missing setting for the alarm type.
The reminder process (icon in system tray) fetches alarms from a cache that is never updated.
I am not a kde programmer, but the patch I attached works for me. It fetches all events since the last check and doesnt use the cache.

I also attached a one-liner to set the alarm type to &quot;display&quot;, also it is not neccessary if you just want to be reminded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493281</commentid>
    <comment_count>2</comment_count>
      <attachid>18903</attachid>
    <who name="Uli">o_kinobi</who>
    <bug_when>2006-12-12 20:32:32 +0000</bug_when>
    <thetext>Created attachment 18903
fixes missing reminders for events in an exchange resource

When alarms are queried from an exchange resource, events will be fetched from
the server. Previously, they were returned from the (always empty) cache.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>493282</commentid>
    <comment_count>3</comment_count>
      <attachid>18904</attachid>
    <who name="Uli">o_kinobi</who>
    <bug_when>2006-12-12 20:33:44 +0000</bug_when>
    <thetext>Created attachment 18904
one-liner to set alarm type of events fetched from an exchange server</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494635</commentid>
    <comment_count>4</comment_count>
    <who name="Henrik Segesten">hnordin</who>
    <bug_when>2006-12-18 12:59:42 +0000</bug_when>
    <thetext>What do I need to do to get these patches accepted into SVN?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494703</commentid>
    <comment_count>5</comment_count>
    <who name="Allen Winter">winter</who>
    <bug_when>2006-12-18 17:04:20 +0000</bug_when>
    <thetext>SVN commit 614667 by winterz:

Fix for &quot;Reminders from outlook invites are set to unknown in exchange resources&quot;
Patch from Uli.  Thanks!
Approved by Reinhold.

BUGS: 136954


 M  +20 -2     resourceexchange.cpp  


--- branches/KDE/3.5/kdepim/kresources/exchange/resourceexchange.cpp #614666:614667
@@ -403,12 +403,30 @@
   return list;
 }
 
+/* Invoked by korgac when checking alarms. Always updates the cache. */
 Alarm::List ResourceExchange::alarms( const QDateTime &amp;from, const QDateTime &amp;to )
 {
   kdDebug(5800) &lt;&lt; &quot;ResourceExchange::alarms(&quot; &lt;&lt; from.toString() &lt;&lt; &quot; - &quot; &lt;&lt; to.toString() &lt;&lt; &quot;)\n&quot;;
   Alarm::List list;
-  if ( mCache )
-  	list = mCache-&gt;alarms( from, to );
+
+  QDate start = from.date();
+  QDate end = to.date();
+
+  if ( mCache ) {
+
+    /* Clear the cache */
+    Event::List oldEvents = mCache-&gt;rawEvents( start, end, false );
+
+    Event::List::ConstIterator it;
+    for( it = oldEvents.begin(); it != oldEvents.end(); ++it ) {
+      mCache-&gt;deleteEvent( *it );
+    }
+
+    /* Fetch events */
+    mClient-&gt;downloadSynchronous( mCache, start, end, false );
+
+    list = mCache-&gt;alarms( from, to );
+  }
   return list;
 }
 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>494704</commentid>
    <comment_count>6</comment_count>
    <who name="Allen Winter">winter</who>
    <bug_when>2006-12-18 17:07:49 +0000</bug_when>
    <thetext>SVN commit 614668 by winterz:

forgot this as part of the fix for the exhange alarms.
CCBUGS: 136954


 M  +18 -17    exchangedownload.cpp  


--- branches/KDE/3.5/kdepim/libkpimexchange/core/exchangedownload.cpp #614667:614668
@@ -91,7 +91,7 @@
     //kdDebug() &lt;&lt; &quot;Creating progress dialog&quot; &lt;&lt; endl;
     mProgress = new ExchangeProgress();
     mProgress-&gt;show();
-  
+
     connect( this, SIGNAL( startDownload() ), mProgress,
              SLOT( slotTransferStarted() ) );
     connect( this, SIGNAL(finishDownload() ), mProgress,
@@ -100,7 +100,7 @@
   }
 
   QString sql = dateSelectQuery( start, end.addDays( 1 ) );
- 
+
   kdDebug() &lt;&lt; &quot;Exchange download query: &quot; &lt;&lt; endl &lt;&lt; sql &lt;&lt; endl;
 
   increaseDownloads();
@@ -125,13 +125,13 @@
     //kdDebug() &lt;&lt; &quot;Creating progress dialog&quot; &lt;&lt; endl;
     mProgress = new ExchangeProgress();
     mProgress-&gt;show();
-  
+
     connect( this, SIGNAL(startDownload()), mProgress, SLOT(slotTransferStarted()) );
     connect( this, SIGNAL(finishDownload()), mProgress, SLOT(slotTransferFinished()) );
   }
 
   QString sql = dateSelectQuery( start, end.addDays( 1 ) );
- 
+
   increaseDownloads();
 
   KIO::DavJob *job = KIO::davSearch( mAccount-&gt;calendarURL(), &quot;DAV:&quot;, &quot;sql&quot;, sql, false );
@@ -148,7 +148,7 @@
   startString.sprintf(&quot;%04i/%02i/%02i&quot;,start.year(),start.month(),start.day());
   QString endString;
   endString.sprintf(&quot;%04i/%02i/%02i&quot;,end.year(),end.month(),end.day());
-  QString sql = 
+  QString sql =
         &quot;SELECT \&quot;DAV:href\&quot;, \&quot;urn:schemas:calendar:instancetype\&quot;, \&quot;urn:schemas:calendar:uid\&quot;\r\n&quot;
         &quot;FROM Scope(&apos;shallow traversal of \&quot;\&quot;&apos;)\r\n&quot;
         &quot;WHERE \&quot;urn:schemas:calendar:dtend\&quot; &gt; &apos;&quot; + startString + &quot;&apos;\r\n&quot;
@@ -166,7 +166,7 @@
   QString endString;
   endString.sprintf( &quot;%04i-%02i-%02iT23:59:59Z&quot;, end.year(), end.month(),
                      end.day() );
-  QString sql = 
+  QString sql =
         &quot;SELECT \&quot;DAV:href\&quot;, \&quot;urn:schemas:calendar:instancetype\&quot;, &quot;
         &quot;\&quot;urn:schemas:calendar:uid\&quot;\r\n&quot;
         &quot;FROM Scope(&apos;shallow traversal of \&quot;\&quot;&apos;)\r\n&quot;
@@ -193,7 +193,7 @@
   kdDebug() &lt;&lt; &quot;Search result: &quot; &lt;&lt; endl &lt;&lt; response.toString() &lt;&lt; endl;
 
   handleAppointments( response, true );
-  
+
   decreaseDownloads();
 }
 
@@ -210,7 +210,7 @@
   kdDebug() &lt;&lt; &quot;Search (master) result: &quot; &lt;&lt; endl &lt;&lt; response.toString() &lt;&lt; endl;
 
   handleAppointments( response, false );
-  
+
   decreaseDownloads();
 }
 
@@ -231,7 +231,7 @@
        item = item.nextSibling().toElement() ) {
     //kdDebug() &lt;&lt; &quot;Current item:&quot; &lt;&lt; item.tagName() &lt;&lt; endl;
     QDomNodeList propstats = item.elementsByTagNameNS( &quot;DAV:&quot;, &quot;propstat&quot; );
-    // kdDebug() &lt;&lt; &quot;Item has &quot; &lt;&lt; propstats.count() &lt;&lt; &quot; propstat children&quot; &lt;&lt; endl; 
+    // kdDebug() &lt;&lt; &quot;Item has &quot; &lt;&lt; propstats.count() &lt;&lt; &quot; propstat children&quot; &lt;&lt; endl;
     for( uint i=0; i &lt; propstats.count(); i++ ) {
       QDomElement propstat = propstats.item(i).toElement();
       QDomElement prop = propstat.namedItem( &quot;prop&quot; ).toElement();
@@ -247,7 +247,7 @@
       }
       int instanceType = instancetypeElement.text().toInt();
       //kdDebug() &lt;&lt; &quot;Instance type: &quot; &lt;&lt; instanceType &lt;&lt; endl;
-    
+
       if ( recurrence &amp;&amp; instanceType &gt; 0 ) {
         QDomElement uidElement = prop.namedItem( &quot;uid&quot; ).toElement();
         if ( uidElement.isNull() ) {
@@ -286,7 +286,7 @@
 void ExchangeDownload::handleRecurrence( QString uid )
 {
   // kdDebug() &lt;&lt; &quot;Handling recurrence info for uid=&quot; &lt;&lt; uid &lt;&lt; endl;
-  QString query = 
+  QString query =
         &quot;SELECT \&quot;DAV:href\&quot;, \&quot;urn:schemas:calendar:instancetype\&quot;\r\n&quot;
         &quot;FROM Scope(&apos;shallow traversal of \&quot;\&quot;&apos;)\r\n&quot;
         &quot;WHERE \&quot;urn:schemas:calendar:uid\&quot; = &apos;&quot; + uid + &quot;&apos;\r\n&quot;
@@ -333,7 +333,7 @@
   addElement( doc, prop, &quot;urn:schemas:calendar:&quot;, &quot;exdate&quot; );
   addElement( doc, prop, &quot;urn:schemas:mailheader:&quot;, &quot;sensitivity&quot; );
   addElement( doc, prop, &quot;urn:schemas:calendar:&quot;, &quot;reminderoffset&quot; );
-  
+
   addElement( doc, prop, &quot;urn:schemas-microsoft-com:office:office&quot;,
               &quot;Keywords&quot; );
 
@@ -357,7 +357,7 @@
 {
   kdDebug() &lt;&lt; &quot;slotPropFindResult&quot; &lt;&lt; endl;
 
-  int error = job-&gt;error(); 
+  int error = job-&gt;error();
   if ( error ) {
     job-&gt;showErrorDialog( 0 );
     finishUp( ExchangeClient::CommunicationError, job );
@@ -370,7 +370,7 @@
 
   QDomElement prop = response.documentElement().namedItem( &quot;response&quot; )
                      .namedItem( &quot;propstat&quot; ).namedItem( &quot;prop&quot; ).toElement();
- 
+
   KCal::Event* event = new KCal::Event();
 
   QDomElement uidElement = prop.namedItem( &quot;uid&quot; ).toElement();
@@ -485,7 +485,7 @@
   QString rrule = prop.namedItem( &quot;rrule&quot; ).toElement().text();
   kdDebug() &lt;&lt; &quot;Got rrule: &quot; &lt;&lt; rrule &lt;&lt; endl;
   if ( !rrule.isEmpty() ) {
-    // Timezone should be handled automatically 
+    // Timezone should be handled automatically
     // because we used mFormat-&gt;setTimeZone() earlier
     KCal::RecurrenceRule *rr = event-&gt;recurrence()-&gt;defaultRRule( true );
 
@@ -522,7 +522,7 @@
   // 2 Private
   // 3 Company Confidential
   QString sensitivity = prop.namedItem( &quot;sensitivity&quot; ).toElement().text();
-  if ( ! sensitivity.isNull() ) 
+  if ( ! sensitivity.isNull() )
   switch( sensitivity.toInt() ) {
     case 0: event-&gt;setSecrecy( KCal::Incidence::SecrecyPublic ); break;
     case 1: event-&gt;setSecrecy( KCal::Incidence::SecrecyPrivate ); break;
@@ -540,6 +540,7 @@
     KCal::Duration offset( - reminder.toInt() );
     KCal::Alarm *alarm = event-&gt;newAlarm();
     alarm-&gt;setStartOffset( offset );
+    alarm-&gt;setDisplayAlarm(&quot;&quot;);
     alarm-&gt;setEnabled( true );
     // TODO: multiple alarms; alarm-&gt;setType( KCal::Alarm::xxxx );
   }
@@ -555,7 +556,7 @@
 
     /** set the list of attachments/associated files for this event */
     //void setAttachments(const QStringList &amp;attachments);
- 
+
      /** set resources used, such as Office, Car, etc. */
     //void setResources(const QStringList &amp;resources);
 
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18903</attachid>
            <date>2006-12-12 20:32:32 +0000</date>
            <delta_ts>2006-12-12 20:32:32 +0000</delta_ts>
            <desc>fixes missing reminders for events in an exchange resource</desc>
            <filename>kdepim-kresources-3.5.5-exchange-reminder.patch</filename>
            <type>text/plain</type>
            <size>1031</size>
            <attacher name="Uli">o_kinobi</attacher>
            
              <data encoding="base64">LS0tIGtyZXNvdXJjZXMvZXhjaGFuZ2UvcmVzb3VyY2VleGNoYW5nZS5jcHAub3JpZwkyMDA2LTEy
LTEyIDE3OjM3OjU1LjAwMDAwMDAwMCArMDEwMAorKysga3Jlc291cmNlcy9leGNoYW5nZS9yZXNv
dXJjZWV4Y2hhbmdlLmNwcAkyMDA2LTEyLTEyIDE5OjQ5OjMzLjAwMDAwMDAwMCArMDEwMApAQCAt
NDAzLDEyICs0MDMsMzAgQEAKICAgcmV0dXJuIGxpc3Q7CiB9CiAKKy8qIEludm9rZWQgYnkga29y
Z2FjIHdoZW4gY2hlY2tpbmcgYWxhcm1zLiBBbHdheXMgdXBkYXRlcyB0aGUgY2FjaGUuICovCiBB
bGFybTo6TGlzdCBSZXNvdXJjZUV4Y2hhbmdlOjphbGFybXMoIGNvbnN0IFFEYXRlVGltZSAmZnJv
bSwgY29uc3QgUURhdGVUaW1lICZ0byApCiB7CiAgIGtkRGVidWcoNTgwMCkgPDwgIlJlc291cmNl
RXhjaGFuZ2U6OmFsYXJtcygiIDw8IGZyb20udG9TdHJpbmcoKSA8PCAiIC0gIiA8PCB0by50b1N0
cmluZygpIDw8ICIpXG4iOwogICBBbGFybTo6TGlzdCBsaXN0OwotICBpZiAoIG1DYWNoZSApCi0g
IAlsaXN0ID0gbUNhY2hlLT5hbGFybXMoIGZyb20sIHRvICk7CisKKyAgUURhdGUgc3RhcnQgPSBm
cm9tLmRhdGUoKTsKKyAgUURhdGUgZW5kID0gdG8uZGF0ZSgpOworCisgIGlmICggbUNhY2hlICkg
eworCisgICAgLyogQ2xlYXIgdGhlIGNhY2hlICovCisgICAgRXZlbnQ6Okxpc3Qgb2xkRXZlbnRz
ID0gbUNhY2hlLT5yYXdFdmVudHMoIHN0YXJ0LCBlbmQsIGZhbHNlICk7CisKKyAgICBFdmVudDo6
TGlzdDo6Q29uc3RJdGVyYXRvciBpdDsKKyAgICBmb3IoIGl0ID0gb2xkRXZlbnRzLmJlZ2luKCk7
IGl0ICE9IG9sZEV2ZW50cy5lbmQoKTsgKytpdCApIHsKKyAgICAgIG1DYWNoZS0+ZGVsZXRlRXZl
bnQoICppdCApOworICAgIH0KKworICAgIC8qIEZldGNoIGV2ZW50cyAqLworICAgIG1DbGllbnQt
PmRvd25sb2FkU3luY2hyb25vdXMoIG1DYWNoZSwgc3RhcnQsIGVuZCwgZmFsc2UgKTsKKworICAg
IGxpc3QgPSBtQ2FjaGUtPmFsYXJtcyggZnJvbSwgdG8gKTsKKyAgfQogICByZXR1cm4gbGlzdDsK
IH0KIAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18904</attachid>
            <date>2006-12-12 20:33:44 +0000</date>
            <delta_ts>2006-12-12 20:33:44 +0000</delta_ts>
            <desc>one-liner to set alarm type of events fetched from an exchange server</desc>
            <filename>libkpimexchange-3.5.5-exchange-alarmtype.patch</filename>
            <type>text/plain</type>
            <size>479</size>
            <attacher name="Uli">o_kinobi</attacher>
            
              <data encoding="base64">LS0tIGxpYmtwaW1leGNoYW5nZS9jb3JlL2V4Y2hhbmdlZG93bmxvYWQuY3BwLm9yaWcJMjAwNS0w
OS0xMCAxMDoyMzo1My4wMDAwMDAwMDAgKzAyMDAKKysrIGxpYmtwaW1leGNoYW5nZS9jb3JlL2V4
Y2hhbmdlZG93bmxvYWQuY3BwCTIwMDYtMTItMTEgMjA6MDU6MTEuMDAwMDAwMDAwICswMTAwCkBA
IC01NDAsNiArNTQwLDcgQEAKICAgICBLQ2FsOjpEdXJhdGlvbiBvZmZzZXQoIC0gcmVtaW5kZXIu
dG9JbnQoKSApOwogICAgIEtDYWw6OkFsYXJtICphbGFybSA9IGV2ZW50LT5uZXdBbGFybSgpOwog
ICAgIGFsYXJtLT5zZXRTdGFydE9mZnNldCggb2Zmc2V0ICk7CisgICAgYWxhcm0tPnNldERpc3Bs
YXlBbGFybSgiUmVtaW5kZXIgKEV4Y2hhbmdlKSIpOwogICAgIGFsYXJtLT5zZXRFbmFibGVkKCB0
cnVlICk7CiAgICAgLy8gVE9ETzogbXVsdGlwbGUgYWxhcm1zOyBhbGFybS0+c2V0VHlwZSggS0Nh
bDo6QWxhcm06Onh4eHggKTsKICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>