Small fixes and improvements for tasks listing in mail view

This commit is contained in:
Thomas Bruederli 2014-10-14 09:20:50 +02:00
parent 256ad459d3
commit 738b56cfd8
2 changed files with 14 additions and 2 deletions

View file

@ -166,7 +166,7 @@ $labels['itipdeclinetask'] = 'Decline your assignment to this task to the organi
$labels['declinedeleteconfirm'] = 'Do you also want to delete this declined task from your tasks list?';
$labels['itipcomment'] = 'Invitation/notification comment';
$labels['itipcommenttitle'] = 'This comment will be attached to the invitation/notification message sent to assignees';
$labels['itipsendsuccess'] = 'Invitation sent to assignees';
$labels['itipsendsuccess'] = 'Notification sent to assignees';
$labels['errornotifying'] = 'Failed to send notifications to task assignees';
$labels['removefromcalendar'] = 'Remove from my tasks';

View file

@ -231,6 +231,7 @@ class tasklist extends rcube_plugin
break;
}
$oldrec = $rec;
$rec['status'] = $complete ? 'COMPLETED' : ($rec['complete'] > 0 ? 'IN-PROCESS' : 'NEEDS-ACTION');
// sent itip notifications if enabled (no user interaction here)
@ -762,7 +763,6 @@ class tasklist extends rcube_plugin
if ($attendee['noreply'] && $itip_notify & 2) {
continue;
}
// which template to use for mail text
$is_new = !in_array($attendee['email'], $old_attendees);
$is_rsvp = $is_new || $task['sequence'] > $old['sequence'];
@ -1524,6 +1524,18 @@ class tasklist extends rcube_plugin
if (!$p['object']->headers->others['x-kolab-type']) {
$this->load_driver();
$this->message_tasks = $this->driver->get_message_related_tasks($p['object']->headers, $p['object']->folder);
// sort message tasks by completeness and due date
$driver = $this->driver;
array_walk($this->message_tasks, array($this, 'encode_task'));
usort($this->message_tasks, function($a, $b) use ($driver) {
$a_complete = intval($driver->is_complete($a));
$b_complete = intval($driver->is_complete($b));
$d = $a_complete - $b_complete;
if (!$d) $d = $b['_hasdate'] - $a['_hasdate'];
if (!$d) $d = $a['datetime'] - $b['datetime'];
return $d;
});
}
}