summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-18 11:57:36 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-18 11:57:36 (GMT)
commit6bd0bdabb540e43463342f94d62c63bd32bc68e9 (patch)
tree77ff6a99a5e79dfa90a7319a1a18839dd12d4c5b
parent17867bb2773db75e61ba2226336d5802118e85c2 (diff)
downloadroundcubemail-plugins-kolab-6bd0bdabb540e43463342f94d62c63bd32bc68e9.tar.gz
Adapt client to changed Bonnie API
-rw-r--r--plugins/calendar/calendar.php2
-rw-r--r--plugins/calendar/calendar_ui.js12
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php10
-rw-r--r--plugins/calendar/drivers/kolab/kolab_invitation_calendar.php2
-rw-r--r--plugins/calendar/localization/ca_ES.inc1
-rw-r--r--plugins/calendar/localization/cs_CZ.inc1
-rw-r--r--plugins/calendar/localization/da_DK.inc1
-rw-r--r--plugins/calendar/localization/de_DE.inc2
-rw-r--r--plugins/calendar/localization/en_US.inc2
-rw-r--r--plugins/calendar/localization/es_AR.inc1
-rw-r--r--plugins/calendar/localization/fi_FI.inc1
-rw-r--r--plugins/calendar/localization/fr_FR.inc1
-rw-r--r--plugins/calendar/localization/he.inc1
-rw-r--r--plugins/calendar/localization/hr.inc1
-rw-r--r--plugins/calendar/localization/it_IT.inc1
-rw-r--r--plugins/calendar/localization/pl_PL.inc1
-rw-r--r--plugins/calendar/localization/pt_PT.inc1
-rw-r--r--plugins/calendar/localization/ru_RU.inc1
-rw-r--r--plugins/calendar/localization/sl.inc1
-rw-r--r--plugins/calendar/localization/sv_SE.inc1
-rw-r--r--plugins/libkolab/lib/kolab_bonnie_api.php20
21 files changed, 31 insertions, 33 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index c4a6656..5f27d74 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1074,7 +1074,7 @@ class calendar extends rcube_plugin
break;
case "diff":
- $data = $this->driver->get_event_diff($event, $event['rev']);
+ $data = $this->driver->get_event_diff($event, $event['rev1'], $event['rev2']);
if (is_array($data)) {
// convert some properties, similar to self::_client_event()
$lib = $this->lib;
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 9d0c919..b3bfbe0 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -1086,7 +1086,7 @@ function rcube_calendar_ui(settings)
}
me.loading_lock = rcmail.set_busy(true, 'loading', me.loading_lock);
- rcmail.http_post('event', { action:'diff', e:{ id:event.id, calendar:event.calendar, rev: rev1+':'+rev2 } }, me.loading_lock);
+ rcmail.http_post('event', { action:'diff', e:{ id:event.id, calendar:event.calendar, rev1: rev1, rev2: rev2 } }, me.loading_lock);
}
else {
alert('Invalid selection!')
@@ -1122,7 +1122,8 @@ function rcube_calendar_ui(settings)
// callback from server with changelog data
var render_event_changelog = function(data)
{
- var $dialog = $('#eventhistory');
+ var $dialog = $('#eventhistory'),
+ event = $dialog.data('event');
if (data === false || !data.length) {
// display 'unavailable' message
@@ -1133,8 +1134,9 @@ function rcube_calendar_ui(settings)
var i, change, accessible, op_append, first = data.length -1, last = 0,
op_labels = { APPEND: 'actionappend', MOVE: 'actionmove', DELETE: 'actiondelete' },
+ is_writeable = !!me.calendars[event.calendar].editable,
actions = '<a href="#show" class="iconbutton preview" title="'+ rcmail.gettext('showrevision','calendar') +'" data-rev="{rev}" /> ' +
- '<a href="#restore" class="iconbutton restore" title="'+ rcmail.gettext('restore','calendar') + '" data-rev="{rev}" />',
+ (is_writeable ? '<a href="#restore" class="iconbutton restore" title="'+ rcmail.gettext('restore','calendar') + '" data-rev="{rev}" />' : ''),
tbody = $('#event-changelog-table tbody').html('');
for (i=first; i >= 0; i--) {
@@ -1153,7 +1155,7 @@ function rcube_calendar_ui(settings)
'<input type="radio" name="rev1" class="diff-rev1" value="' + change.rev + '" title="" '+ (i == last ? 'checked="checked"' : '') +' /> '+
'<input type="radio" name="rev2" class="diff-rev2" value="' + change.rev + '" title="" '+ (i == first ? 'checked="checked"' : '') +' /></td>'
: ''))
- .append('<td class="revision">' + Q(change.rev) + '</td>')
+ .append('<td class="revision">' + Q(i+1) + '</td>')
.append('<td class="date">' + Q(change.date ? format_datetime(parseISO8601(change.date)) : '') + '</td>')
.append('<td class="user">' + Q(change.user || 'undisclosed') + '</td>')
.append('<td class="operation" title="' + op_append + '">' + Q(rcmail.gettext(op_labels[change.op] || '', 'calendar') + (op_append ? ' ...' : '')) + '</td>')
@@ -1279,7 +1281,7 @@ function rcube_calendar_ui(settings)
modal: false,
resizable: true,
closeOnEscape: true,
- title: rcmail.gettext('eventdiff','calendar').replace('$rev', data.rev) + ' - ' + event.title,
+ title: rcmail.gettext('eventdiff','calendar').replace('$rev1', data.rev1).replace('$rev2', data.rev2) + ' - ' + event.title,
open: function() {
$dialog.attr('aria-hidden', 'false');
setTimeout(function(){
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 2d5958a..8671b10 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -2016,12 +2016,13 @@ class kolab_driver extends calendar_driver
* Get a list of property changes beteen two revisions of an event
*
* @param array $event Hash array with event properties
- * @param mixed $rev Revisions: "from:to"
+ * @param mixed $rev1 Old Revision
+ * @param mixed $rev2 New Revision
*
* @return array List of property changes, each as a hash array
* @see calendar_driver::get_event_diff()
*/
- public function get_event_diff($event, $rev)
+ public function get_event_diff($event, $rev1, $rev2)
{
if (empty($this->bonnie_api)) {
return false;
@@ -2030,9 +2031,10 @@ class kolab_driver extends calendar_driver
list($uid, $mailbox) = $this->_resolve_event_identity($event);
// call Bonnie API
- $result = $this->bonnie_api->diff('event', $uid, $rev, $mailbox);
+ $result = $this->bonnie_api->diff('event', $uid, $rev1, $rev2, $mailbox);
if (is_array($result) && $result['uid'] == $uid) {
- $result['rev'] = $rev;
+ $result['rev1'] = $rev1;
+ $result['rev2'] = $rev2;
$keymap = array(
'dtstart' => 'start',
diff --git a/plugins/calendar/drivers/kolab/kolab_invitation_calendar.php b/plugins/calendar/drivers/kolab/kolab_invitation_calendar.php
index a7ea9c1..3ec82ac 100644
--- a/plugins/calendar/drivers/kolab/kolab_invitation_calendar.php
+++ b/plugins/calendar/drivers/kolab/kolab_invitation_calendar.php
@@ -197,7 +197,7 @@ class kolab_invitation_calendar
{
// find the actual folder this event resides in
if (!empty($event['_folder_id'])) {
- $cal = $this->cal->get_calendar($event['_folder_id']);
+ $cal = $this->cal->driver->get_calendar($event['_folder_id']);
}
else {
$cal = null;
diff --git a/plugins/calendar/localization/ca_ES.inc b/plugins/calendar/localization/ca_ES.inc
index e3d92ed..4318eba 100644
--- a/plugins/calendar/localization/ca_ES.inc
+++ b/plugins/calendar/localization/ca_ES.inc
@@ -240,7 +240,6 @@ $labels['birthdayscalendarsources'] = 'D\'aquestes llibretes d\'adreces';
$labels['birthdayeventtitle'] = 'Aniversari de $name';
$labels['birthdayage'] = 'Edat $age';
$labels['eventchangelog'] = 'Canvia historial';
-$labels['eventdiff'] = 'Canvis de revisions $rev';
$labels['revision'] = 'Revisió';
$labels['user'] = 'Usuari';
$labels['operation'] = 'Acció';
diff --git a/plugins/calendar/localization/cs_CZ.inc b/plugins/calendar/localization/cs_CZ.inc
index 48c95e9..9b03cd9 100644
--- a/plugins/calendar/localization/cs_CZ.inc
+++ b/plugins/calendar/localization/cs_CZ.inc
@@ -247,7 +247,6 @@ $labels['birthdayscalendarsources'] = 'Z těchto adresářů';
$labels['birthdayeventtitle'] = 'Narozeniny $name';
$labels['birthdayage'] = 'Věk $age';
$labels['eventchangelog'] = 'Historie změn';
-$labels['eventdiff'] = 'Změny od verze $rev';
$labels['revision'] = 'Verze';
$labels['user'] = 'Uživatel';
$labels['operation'] = 'Činnost';
diff --git a/plugins/calendar/localization/da_DK.inc b/plugins/calendar/localization/da_DK.inc
index 8f34498..fcfe5cc 100644
--- a/plugins/calendar/localization/da_DK.inc
+++ b/plugins/calendar/localization/da_DK.inc
@@ -248,7 +248,6 @@ $labels['birthdayscalendarsources'] = 'Fra disse adressebøger';
$labels['birthdayeventtitle'] = '$name har fødselsdag';
$labels['birthdayage'] = '$age år';
$labels['eventchangelog'] = 'Ændringshistorik';
-$labels['eventdiff'] = 'Ændringer fra revisionerne $rev';
$labels['revision'] = 'Revision';
$labels['user'] = 'Bruger';
$labels['operation'] = 'Handling';
diff --git a/plugins/calendar/localization/de_DE.inc b/plugins/calendar/localization/de_DE.inc
index 57bd0a2..1a11052 100644
--- a/plugins/calendar/localization/de_DE.inc
+++ b/plugins/calendar/localization/de_DE.inc
@@ -248,7 +248,7 @@ $labels['birthdayscalendarsources'] = 'Für diese Adressbücher';
$labels['birthdayeventtitle'] = '$names Geburtstag';
$labels['birthdayage'] = 'Alter $age';
$labels['eventchangelog'] = 'Änderungshistorie';
-$labels['eventdiff'] = 'Änderungen aus den Versionen $rev';
+$labels['eventdiff'] = 'Änderungen zwischen $rev1 und $rev2';
$labels['revision'] = 'Version';
$labels['user'] = 'Benutzer';
$labels['operation'] = 'Aktion';
diff --git a/plugins/calendar/localization/en_US.inc b/plugins/calendar/localization/en_US.inc
index 85e7e7c..2c79e34 100644
--- a/plugins/calendar/localization/en_US.inc
+++ b/plugins/calendar/localization/en_US.inc
@@ -277,7 +277,7 @@ $labels['birthdayage'] = 'Age $age';
// history dialog
$labels['eventchangelog'] = 'Change History';
-$labels['eventdiff'] = 'Changes from revisions $rev';
+$labels['eventdiff'] = 'Changes from $rev1 to $rev2';
$labels['revision'] = 'Revision';
$labels['user'] = 'User';
$labels['operation'] = 'Action';
diff --git a/plugins/calendar/localization/es_AR.inc b/plugins/calendar/localization/es_AR.inc
index 176b9b2..a22ea03 100644
--- a/plugins/calendar/localization/es_AR.inc
+++ b/plugins/calendar/localization/es_AR.inc
@@ -243,7 +243,6 @@ $labels['birthdayscalendarsources'] = 'De estas libretas de direcciones';
$labels['birthdayeventtitle'] = 'Cumpleaños de $name';
$labels['birthdayage'] = 'Edad $age';
$labels['eventchangelog'] = 'Cambiar Historial';
-$labels['eventdiff'] = 'Cambios de revisiones $rev';
$labels['revision'] = 'Revisión';
$labels['user'] = 'Usuario';
$labels['operation'] = 'Acción';
diff --git a/plugins/calendar/localization/fi_FI.inc b/plugins/calendar/localization/fi_FI.inc
index 743d851..2543934 100644
--- a/plugins/calendar/localization/fi_FI.inc
+++ b/plugins/calendar/localization/fi_FI.inc
@@ -244,7 +244,6 @@ $labels['birthdayscalendarsources'] = 'Näistä osoitekirjoista';
$labels['birthdayeventtitle'] = 'Syntymäpäivä: $name';
$labels['birthdayage'] = 'Ikä $age';
$labels['eventchangelog'] = 'Muuta historiaa';
-$labels['eventdiff'] = 'Muutokset versiosta $rev';
$labels['revision'] = 'Versio';
$labels['user'] = 'Käyttäjä';
$labels['operation'] = 'Toiminto';
diff --git a/plugins/calendar/localization/fr_FR.inc b/plugins/calendar/localization/fr_FR.inc
index 9ec3ee4..871a9ab 100644
--- a/plugins/calendar/localization/fr_FR.inc
+++ b/plugins/calendar/localization/fr_FR.inc
@@ -245,7 +245,6 @@ $labels['birthdayscalendarsources'] = 'Depuis ces carnets d\'adresses';
$labels['birthdayeventtitle'] = 'Anniversaire de $name';
$labels['birthdayage'] = 'Age $age';
$labels['eventchangelog'] = 'Historique des modifications';
-$labels['eventdiff'] = 'Modifications pour le version $rev';
$labels['revision'] = 'Version';
$labels['user'] = 'Utilisateur';
$labels['operation'] = 'Action';
diff --git a/plugins/calendar/localization/he.inc b/plugins/calendar/localization/he.inc
index 036f184..6a5284a 100644
--- a/plugins/calendar/localization/he.inc
+++ b/plugins/calendar/localization/he.inc
@@ -245,7 +245,6 @@ $labels['birthdayscalendarsources'] = 'From these address books';
$labels['birthdayeventtitle'] = '$name\'s Birthday';
$labels['birthdayage'] = 'Age $age';
$labels['eventchangelog'] = 'Change History';
-$labels['eventdiff'] = 'Changes from revisions $rev';
$labels['revision'] = 'Revision';
$labels['user'] = 'User';
$labels['operation'] = 'Action';
diff --git a/plugins/calendar/localization/hr.inc b/plugins/calendar/localization/hr.inc
index 6794804..d622f75 100644
--- a/plugins/calendar/localization/hr.inc
+++ b/plugins/calendar/localization/hr.inc
@@ -245,7 +245,6 @@ $labels['birthdayscalendarsources'] = 'From these address books';
$labels['birthdayeventtitle'] = '$name\'s Birthday';
$labels['birthdayage'] = 'Age $age';
$labels['eventchangelog'] = 'Change History';
-$labels['eventdiff'] = 'Changes from revisions $rev';
$labels['revision'] = 'Revision';
$labels['user'] = 'User';
$labels['operation'] = 'Action';
diff --git a/plugins/calendar/localization/it_IT.inc b/plugins/calendar/localization/it_IT.inc
index cf59066..64a22cb 100644
--- a/plugins/calendar/localization/it_IT.inc
+++ b/plugins/calendar/localization/it_IT.inc
@@ -247,7 +247,6 @@ $labels['birthdayscalendarsources'] = 'Da queste rubriche';
$labels['birthdayeventtitle'] = 'Compleanno di $name';
$labels['birthdayage'] = 'Età: $age anni';
$labels['eventchangelog'] = 'Storico modifiche';
-$labels['eventdiff'] = 'Cambiamenti dalle revisioni $rev';
$labels['revision'] = 'Revisione';
$labels['user'] = 'Utente';
$labels['operation'] = 'Azione';
diff --git a/plugins/calendar/localization/pl_PL.inc b/plugins/calendar/localization/pl_PL.inc
index 9eb8ecb..8a0db8a 100644
--- a/plugins/calendar/localization/pl_PL.inc
+++ b/plugins/calendar/localization/pl_PL.inc
@@ -246,7 +246,6 @@ $labels['birthdayscalendarsources'] = 'Z tych książek adresowych';
$labels['birthdayeventtitle'] = 'Urodziny $name\'s';
$labels['birthdayage'] = 'Wiek $age';
$labels['eventchangelog'] = 'Historia zmian';
-$labels['eventdiff'] = 'Zmiany od wersji $rev';
$labels['revision'] = 'Wersja';
$labels['user'] = 'Użytkownik';
$labels['operation'] = 'Akcja';
diff --git a/plugins/calendar/localization/pt_PT.inc b/plugins/calendar/localization/pt_PT.inc
index 0d62a26..75ab307 100644
--- a/plugins/calendar/localization/pt_PT.inc
+++ b/plugins/calendar/localization/pt_PT.inc
@@ -248,7 +248,6 @@ $labels['birthdayscalendarsources'] = 'From these address books';
$labels['birthdayeventtitle'] = 'Aniversário de $name';
$labels['birthdayage'] = 'Idade $age';
$labels['eventchangelog'] = 'Alterar histórico';
-$labels['eventdiff'] = 'Changes from revisions $rev';
$labels['revision'] = 'Revisão';
$labels['user'] = 'Utilizador';
$labels['operation'] = 'Ação';
diff --git a/plugins/calendar/localization/ru_RU.inc b/plugins/calendar/localization/ru_RU.inc
index 58bcf81..0ef726b 100644
--- a/plugins/calendar/localization/ru_RU.inc
+++ b/plugins/calendar/localization/ru_RU.inc
@@ -248,7 +248,6 @@ $labels['birthdayscalendarsources'] = 'Из этих адресных книг';
$labels['birthdayeventtitle'] = 'День рождения $name';
$labels['birthdayage'] = 'Возраст $age';
$labels['eventchangelog'] = 'История изменений';
-$labels['eventdiff'] = 'Изменения с ревизии $rev';
$labels['revision'] = 'Ревизия';
$labels['user'] = 'Пользователь';
$labels['operation'] = 'Действие';
diff --git a/plugins/calendar/localization/sl.inc b/plugins/calendar/localization/sl.inc
index 2e666b1..747dfe3 100644
--- a/plugins/calendar/localization/sl.inc
+++ b/plugins/calendar/localization/sl.inc
@@ -247,7 +247,6 @@ $labels['birthdayscalendarsources'] = 'Iz teh imenikov';
$labels['birthdayeventtitle'] = 'Rojstni dan osebe $name';
$labels['birthdayage'] = 'Starost $age';
$labels['eventchangelog'] = 'Spremeni Zgodovino';
-$labels['eventdiff'] = 'Spremembe iz verzij $rev';
$labels['revision'] = 'Verzija';
$labels['user'] = 'Uporabnik';
$labels['operation'] = 'Dejanje';
diff --git a/plugins/calendar/localization/sv_SE.inc b/plugins/calendar/localization/sv_SE.inc
index d048729..1947944 100644
--- a/plugins/calendar/localization/sv_SE.inc
+++ b/plugins/calendar/localization/sv_SE.inc
@@ -247,7 +247,6 @@ $labels['birthdayscalendarsources'] = 'Från dessa adressböcker';
$labels['birthdayeventtitle'] = '$name\s födelsedag';
$labels['birthdayage'] = '$age år';
$labels['eventchangelog'] = 'Ändringshistorik';
-$labels['eventdiff'] = 'Ändringar från revisioner $rev';
$labels['revision'] = 'Revision';
$labels['user'] = 'Användare';
$labels['operation'] = 'Åtgärd';
diff --git a/plugins/libkolab/lib/kolab_bonnie_api.php b/plugins/libkolab/lib/kolab_bonnie_api.php
index e8ac131..11d4845 100644
--- a/plugins/libkolab/lib/kolab_bonnie_api.php
+++ b/plugins/libkolab/lib/kolab_bonnie_api.php
@@ -50,25 +50,33 @@ class kolab_bonnie_api
/**
* Wrapper function for <object>.changelog() API call
*/
- public function changelog($type, $uid, $mailbox=null)
+ public function changelog($type, $uid, $mailbox, $msguid=null)
{
- return $this->client->execute($type.'.changelog', array('uid' => $uid, 'mailbox' => $mailbox));
+ return $this->client->execute($type.'.changelog', array('uid' => $uid, 'mailbox' => $mailbox, 'msguid' => $msguid));
}
/**
* Wrapper function for <object>.diff() API call
*/
- public function diff($type, $uid, $rev, $mailbox=null)
+ public function diff($type, $uid, $rev1, $rev2, $mailbox, $msguid=null)
{
- return $this->client->execute($type.'.diff', array('uid' => $uid, 'rev' => $rev, 'mailbox' => $mailbox));
+ return $this->client->execute($type.'.diff', array('uid' => $uid, 'rev1' => $rev1, 'rev2' => $rev2, 'mailbox' => $mailbox, 'msguid' => $msguid));
}
/**
* Wrapper function for <object>.get() API call
*/
- public function get($type, $uid, $rev, $mailbox=null)
+ public function get($type, $uid, $rev, $mailbox, $msguid=null)
{
- return $this->client->execute($type.'.get', array('uid' => $uid, 'rev' => intval($rev), 'mailbox' => $mailbox));
+ return $this->client->execute($type.'.get', array('uid' => $uid, 'rev' => $rev, 'mailbox' => $mailbox, 'msguid' => $msguid));
+ }
+
+ /**
+ * Wrapper function for <object>.rawdata() API call
+ */
+ public function rawdata($type, $uid, $rev, $mailbox, $msguid=null)
+ {
+ return $this->client->execute($type.'.rawdata', array('uid' => $uid, 'rev' => $rev, 'mailbox' => $mailbox, 'msguid' => $msguid));
}
/**