gunnar: server/kolab-webclient/nag/patches/nag-2.3.4 series, NONE, 1.1 t_nag_HK_GW_ZpushAnnotations.diff, NONE, 1.1

cvs at kolab.org cvs at kolab.org
Mon May 10 09:11:31 CEST 2010


Author: gunnar

Update of /kolabrepository/server/kolab-webclient/nag/patches/nag-2.3.4
In directory doto:/tmp/cvs-serv17827/d/nag/patches/nag-2.3.4

Added Files:
	series t_nag_HK_GW_ZpushAnnotations.diff 
Log Message:
Complete active sync configuration management GUI.

--- NEW FILE: series ---
t_nag_HK_UV_SyncMLSyncBackendBeforeSync.diff
t_nag_HK_GW_StoreCreatorAndOrganizer.diff
t_nag_HK_GW_ZpushAnnotations.diff

--- NEW FILE: t_nag_HK_GW_ZpushAnnotations.diff ---
From: Gunnar Wrobel <p at rdus.de>
Subject: [PATCH] t/nag/HK/GW/ZpushAnnotations

Allows to modify the Zpush configuration.

Signed-off-by: Gunnar Wrobel <p at rdus.de>

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 @@
         $this->setButtons(array(_("Save")));
     }
 
+    function activeSyncSegment($devices, $default)
+    {
+        $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);
+        }
+    }
+
     function execute()
     {
         $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;
+            }
+            $this->_tasklist->set('params', serialize($params));
+        }
+
         $result = $this->_tasklist->save();
         if (is_a($result, 'PEAR_Error')) {
             return PEAR::raiseError(sprintf(_("Unable to save task list \"%s\": %s"), $id, $result->getMessage()));
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 @@
 
 $vars->set('name', $tasklist->get('name'));
 $vars->set('description', $tasklist->get('desc'));
+
+$params = @unserialize($tasklist->get('params'));
+if (isset($params['activesync'])) {
+    if ($params['activesync']['NAMESPACE'] == Horde_Kolab_Storage_Namespace::PERSONAL) {
+        $default = 1;
+    } else {
+        $default = 0;
+    }
+    $devices = $params['activesync']['DEVICE'];
+    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);
+        }
+        $form->activeSyncSegment($devices, $default);
+    }
+}
+
 $title = $form->getTitle();
 require NAG_TEMPLATES . '/common-header.inc';
 require NAG_TEMPLATES . '/menu.inc';





More information about the commits mailing list