Fix iTip replies to organizer (don't increment sequence if I'm not the owner)
This commit is contained in:
parent
f8b6706074
commit
f5e93184e3
4 changed files with 28 additions and 13 deletions
|
@ -902,9 +902,15 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
unset($object['attachments']);
|
unset($object['attachments']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$object['_owner'] = $identity['email'];
|
// allow sequence increments if I'm the organizer
|
||||||
|
if ($this->plugin->is_organizer($object)) {
|
||||||
|
unset($object['sequence']);
|
||||||
|
}
|
||||||
|
else if (isset($old['sequence'])) {
|
||||||
|
$object['sequence'] = $old['sequence'];
|
||||||
|
}
|
||||||
|
|
||||||
unset($object['tempid'], $object['raw'], $object['list'], $object['flagged'], $object['tags'], $object['sequence']);
|
unset($object['tempid'], $object['raw'], $object['list'], $object['flagged'], $object['tags']);
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -949,10 +949,11 @@ a.morelink:hover {
|
||||||
display: block;
|
display: block;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 8px 4px 3px 30px;
|
padding: 3px 4px 3px 30px;
|
||||||
text-shadow: 0px 1px 1px #fff;
|
text-shadow: 0px 1px 1px #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#taskedit-attachments ul li a.file {
|
#taskedit-attachments ul li a.file {
|
||||||
|
|
|
@ -992,8 +992,7 @@ function rcube_tasklist_ui(settings)
|
||||||
notify = false, partstat = false, html = '';
|
notify = false, partstat = false, html = '';
|
||||||
|
|
||||||
// task has attendees, ask whether to notify them
|
// task has attendees, ask whether to notify them
|
||||||
if (has_attendees(rec)) {
|
if (has_attendees(rec) && is_organizer(rec)) {
|
||||||
if (is_organizer(rec)) {
|
|
||||||
notify = true;
|
notify = true;
|
||||||
html = rcmail.gettext('changeconfirmnotifications', 'tasklist');
|
html = rcmail.gettext('changeconfirmnotifications', 'tasklist');
|
||||||
}
|
}
|
||||||
|
@ -1002,7 +1001,6 @@ function rcube_tasklist_ui(settings)
|
||||||
partstat = true;
|
partstat = true;
|
||||||
html = rcmail.gettext('partstatupdatenotification', 'tasklist');
|
html = rcmail.gettext('partstatupdatenotification', 'tasklist');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// remove to avoid endless recursion
|
// remove to avoid endless recursion
|
||||||
delete data._status_before;
|
delete data._status_before;
|
||||||
|
|
|
@ -1097,6 +1097,16 @@ class tasklist extends rcube_plugin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the current user is the organizer of the given task
|
||||||
|
*/
|
||||||
|
public function is_organizer($task)
|
||||||
|
{
|
||||||
|
$emails = $this->lib->get_user_emails();
|
||||||
|
return (empty($task['organizer']) || in_array(strtolower($task['organizer']['email']), $emails));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******* UI functions ********/
|
/******* UI functions ********/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue