gunnar: server/kolab-webclient/nag/patches/nag-2.3.4 t_nag_HK_GW_ZpushAnnotations.diff, 1.1, 1.2
cvs at kolab.org
cvs at kolab.org
Mon Jun 7 17:44:02 CEST 2010
Author: gunnar
Update of /kolabrepository/server/kolab-webclient/nag/patches/nag-2.3.4
In directory doto:/tmp/cvs-serv14745/nag/patches/nag-2.3.4
Modified Files:
t_nag_HK_GW_ZpushAnnotations.diff
Log Message:
- Allow modifications of foreign shares.
- Update list of devices immediately rather than reading them
from the share parameters.
- Adapt from SYNC/ALARM to S parameter.
Index: t_nag_HK_GW_ZpushAnnotations.diff
===================================================================
RCS file: /kolabrepository/server/kolab-webclient/nag/patches/nag-2.3.4/t_nag_HK_GW_ZpushAnnotations.diff,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- t_nag_HK_GW_ZpushAnnotations.diff 10 May 2010 07:11:29 -0000 1.1
+++ t_nag_HK_GW_ZpushAnnotations.diff 7 Jun 2010 15:44:00 -0000 1.2
@@ -8,38 +8,48 @@
diff -Naur a/lib/Forms/EditTaskList.php b/lib/Forms/EditTaskList.php
--- a/lib/Forms/EditTaskList.php 2010-05-10 08:10:16.000000000 +0200
+++ b/lib/Forms/EditTaskList.php 2010-05-10 08:18:34.000000000 +0200
-@@ -46,10 +46,38 @@
+@@ -40,16 +40,46 @@
+ parent::Horde_Form($vars, sprintf(_("Edit %s"), $tasklist->get('name')));
+
+ $this->addHidden('', 't', 'text', true);
+- $this->addVariable(_("Task List Name"), 'name', 'text', true);
++ if ($this->_tasklist->get('owner') != Auth::getAuth()) {
++ $this->addVariable(_("Task List Name"), 'name', 'text', false, true);
++ } else {
++ $this->addVariable(_("Task List Name"), 'name', 'text', true);
++ }
+ $this->addVariable(_("Task List Description"), 'description', 'longtext', false, false, null, array(4, 60));
+
$this->setButtons(array(_("Save")));
}
-+ function activeSyncSegment($devices, $default)
++ function activeSyncSegment($devices)
+ {
+ $this->addHidden('', 'activesync_devices', 'text');
+ $this->addVariable('', '', 'spacer');
+ $this->addVariable(_("Synchronize this calendar with the following ActiveSync devices"), '', 'header');
+ foreach ($devices as $id => $config) {
-+ $this->addVariable($id, 'activesync_' . $id . '_sync', 'boolean', false);
-+ }
-+ $this->addVariable('', '', 'spacer');
-+ $this->addVariable(_("Activate alarms for this calendar on the following ActiveSync devices"), '', 'header');
-+ foreach ($devices as $id => $config) {
-+ $this->addVariable($id, 'activesync_' . $id . '_alarm', 'boolean', false);
++ $this->addVariable(sprintf("Device \"%s\"", $id), 'activesync_' . $id, 'radio', false, false, null,
++ array(array(_("does not synchronize with this tasklist"), _("synchronizes with this tasklist but ignores alarms"), _("synchronizes with this tasklist including alarms"))));
+ }
+ }
+
function execute()
{
- $this->_tasklist->set('name', $this->_vars->get('name'));
+- $this->_tasklist->set('name', $this->_vars->get('name'));
++ if ($this->_tasklist->get('owner') == Auth::getAuth()) {
++ $this->_tasklist->set('name', $this->_vars->get('name'));
++ }
$this->_tasklist->set('desc', $this->_vars->get('description'));
+
+ if ($this->_vars->get('activesync_devices', '')) {
+ $params = array();
+ $ids = explode('|', $this->_vars->get('activesync_devices', ''));
+ foreach ($ids as $id) {
-+ $sync = $this->_vars->get('activesync_' . $id . '_sync');
-+ $alarm = $this->_vars->get('activesync_' . $id . '_alarm');
-+ $params['activesync']['FOLDER'][$id]['SYNC'] = empty($sync) ? 0 : 1;
-+ $params['activesync']['FOLDER'][$id]['ALARM'] = empty($alarm) ? 0 : 1;
++ $sync = (int) $this->_vars->get('activesync_' . $id, 0);
++ if ($sync === 0 || $sync === 1 || $sync === 2) {
++ $params['activesync']['FOLDER'][$id]['S'] = $sync;
++ }
+ }
+ $this->_tasklist->set('params', serialize($params));
+ }
@@ -50,7 +60,18 @@
diff -Naur a/tasklists/edit.php b/tasklists/edit.php
--- a/tasklists/edit.php 2010-05-10 08:10:16.000000000 +0200
+++ b/tasklists/edit.php 2010-05-10 08:22:49.000000000 +0200
-@@ -51,6 +51,26 @@
+@@ -24,10 +24,6 @@
+ $notification->push($tasklist, 'horde.error');
+ header('Location: ' . Horde::applicationUrl('tasklists/', true));
+ exit;
+-} elseif ($tasklist->get('owner') != Auth::getAuth()) {
+- $notification->push(_("You are not allowed to change this task list."), 'horde.error');
+- header('Location: ' . Horde::applicationUrl('tasklists/', true));
+- exit;
+ }
+ $form = new Nag_EditTaskListForm($vars, $tasklist);
+
+@@ -51,6 +51,28 @@
$vars->set('name', $tasklist->get('name'));
$vars->set('description', $tasklist->get('desc'));
@@ -62,15 +83,17 @@
+ } else {
+ $default = 0;
+ }
-+ $devices = $params['activesync']['DEVICE'];
++ require_once 'Horde/Kolab/Storage.php';
++ $folder = Kolab_Storage::getFolder('INBOX');
++ $result = $folder->getActiveSync();
++ $devices = isset($result['DEVICE']) ? $result['DEVICE'] : null;
+ if (!empty($devices)) {
+ $folders = $params['activesync']['FOLDER'];
+ $vars->set('activesync_devices', implode('|', array_keys($devices)));
+ foreach ($devices as $id => $config) {
-+ $vars->set('activesync_' . $id . '_sync', isset($folders[$id]['SYNC']) ? $folders[$id]['SYNC'] : $default);
-+ $vars->set('activesync_' . $id . '_alarm', isset($folders[$id]['ALARM']) ? $folders[$id]['ALARM'] : $default);
++ $vars->set('activesync_' . $id, isset($folders[$id]['S']) ? $folders[$id]['S'] : $default);
+ }
-+ $form->activeSyncSegment($devices, $default);
++ $form->activeSyncSegment($devices);
+ }
+}
+
More information about the commits
mailing list