gunnar: server/kolab-webclient/turba/patches/turba-2.3.3 t_turba_HK_GW_ZpushAnnotations.diff, NONE, 1.1 series, 1.4, 1.5

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


Author: gunnar

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

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

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

Allows to modify the Zpush configuration.

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

diff -Naur a/addressbooks/edit.php b/addressbooks/edit.php
--- a/addressbooks/edit.php	2010-05-10 08:30:03.000000000 +0200
+++ b/addressbooks/edit.php	2010-05-10 08:31:19.000000000 +0200
@@ -53,6 +53,26 @@
 
 $vars->set('name', $addressbook->get('name'));
 $vars->set('description', $addressbook->get('desc'));
+
+$params = @unserialize($addressbook->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 TURBA_TEMPLATES . '/common-header.inc';
 require TURBA_TEMPLATES . '/menu.inc';
diff -Naur a/lib/Forms/EditAddressBook.php b/lib/Forms/EditAddressBook.php
--- a/lib/Forms/EditAddressBook.php	2010-05-10 08:30:05.000000000 +0200
+++ b/lib/Forms/EditAddressBook.php	2010-05-10 08:32:28.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->_addressbook->set('name', $this->_vars->get('name'));
         $this->_addressbook->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->_addressbook->set('params', serialize($params));
+        }
+
         $result = $this->_addressbook->save();
         if (is_a($result, 'PEAR_Error')) {
             return PEAR::raiseError(sprintf(_("Unable to save address book \"%s\": %s"), $id, $result->getMessage()));

Index: series
===================================================================
RCS file: /kolabrepository/server/kolab-webclient/turba/patches/turba-2.3.3/series,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- series	24 Mar 2010 07:55:48 -0000	1.4
+++ series	10 May 2010 07:11:29 -0000	1.5
@@ -3,3 +3,4 @@
 t_turba_HK_GW_SyncMLrefresh.diff
 t_turba_HK_GW_ConfigurationOverride.diff
 t_turba_HK_GW_AlternativeNameDetailView.diff
+t_turba_HK_GW_ZpushAnnotations.diff
\ No newline at end of file





More information about the commits mailing list