gunnar: server/kolab-webclient/horde/patches/horde-3.3.6 series, 1.2, 1.3 t_horde_HK_GW_ZpushAnnotations.diff, NONE, 1.1

cvs at kolab.org cvs at kolab.org
Thu May 6 09:10:08 CEST 2010


Author: gunnar

Update of /kolabrepository/server/kolab-webclient/horde/patches/horde-3.3.6
In directory doto:/tmp/cvs-serv14778/kolab-webclient/horde/patches/horde-3.3.6

Added Files:
	series t_horde_HK_GW_ZpushAnnotations.diff 
Log Message:
Support setting Zpush configuration values.


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

Allows to modify the Zpush configuration.

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

diff -Naur a/config/prefs.php b/config/prefs.php
--- a/config/prefs.php.dist	2010-05-04 22:00:29.938760839 +0200
+++ b/config/prefs.php.dist	2010-05-04 22:02:27.177573941 +0200
@@ -165,6 +165,14 @@
     'members' => array()
 );
 
+$prefGroups['activesync'] = array(
+    'column' => _("Other Information"),
+    'label' => _("ActiveSync"),
+    'desc' => _("Configuration for syncing with PDAs, Smartphones and Outlook."),
+    'url' => 'services/portal/activesync.php',
+    'members' => array()
+);
+
 // Personal Information preferences
 
 // default identity
diff -Naur a/services/portal/activesync.php b/services/portal/activesync.php
--- a/services/portal/activesync.php	1970-01-01 01:00:00.000000000 +0100
+++ b/services/portal/activesync.php	2010-05-06 06:52:58.250251515 +0200
@@ -0,0 +1,72 @@
+<?php
+/**
+ * $Horde: horde/services/portal/syncml.php,v 1.3.2.15 2009-01-06 15:27:33 jan Exp $
+ *
+ * Copyright 2005-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Karsten Fourmont <karsten at horde.org>
+ */
+
+require_once dirname(__FILE__) . '/../../lib/base.php';
+
+if (!Auth::isAuthenticated()) {
+    Horde::authenticationFailureRedirect();
+}
+
+require_once 'Horde/Kolab/Storage.php';
+$folder = Kolab_Storage::getFolder('INBOX');
+$result = $folder->getActiveSync();
+$devices = isset($result['DEVICE']) ? $result['DEVICE'] : null;
+
+$actionID = Util::getFormData('actionID');
+switch ($actionID) {
+case 'save':
+    if (Util::getFormData('delete')) {
+        $deviceids = array_keys(Util::getFormData('delete'));
+        $deviceid = $deviceids[0];
+        $result = $folder->deleteActiveSyncDevice($deviceid);
+        if (is_a($result, 'PEAR_Error')) {
+            $notification->push(_("Error deleting device:")
+                                . ' ' . $result->getMessage(),
+                                'horde.error');
+        } else {
+            $notification->push(sprintf(_("Deleted ActiveSync device \"%s\"."),
+                                        $deviceid),
+                                'horde.success');
+            unset($devices[$deviceid]);
+        }
+    } else {
+        $modes = Util::getFormData('mode_select', array());
+        foreach ($modes as $deviceid => $mode) {
+            $devices[$deviceid]['MODE'] = $mode;
+        }
+        $data = array('DEVICE' => $devices);
+        $result = $folder->setActiveSyncDeviceData($data, 'DEVICE');
+        if (is_a($result, 'PEAR_Error')) {
+            $notification->push(_("Error storing synchronization modes:")
+                                . ' ' . $result->getMessage(),
+                                'horde.error');
+        } else {
+            $notification->push(_("Synchronization modes stored successfully."),
+                                'horde.success');
+        }
+    }
+}
+
+/* Show the header. */
+require_once 'Horde/Prefs/UI.php';
+$result = Horde::loadConfiguration('prefs.php', array('prefGroups', '_prefs'), 'horde');
+if (!is_a($result, 'PEAR_Error')) {
+    extract($result);
+}
+$app = 'horde';
+$chunk = Util::nonInputVar('chunk');
+Prefs_UI::generateHeader('activesync', $chunk);
+
+require HORDE_TEMPLATES . '/activesync/activesync.inc';
+if (!$chunk) {
+    require HORDE_TEMPLATES . '/common-footer.inc';
+}
diff -Naur a/templates/activesync/activesync.inc b/templates/activesync/activesync.inc
--- a/templates/activesync/activesync.inc	1970-01-01 01:00:00.000000000 +0100
+++ b/templates/activesync/activesync.inc	2010-05-05 06:08:23.358849561 +0200
@@ -0,0 +1,41 @@
+<div class="smallheader">
+ <?php echo _("Known ActiveSync synchronisation devices") ?>
+</div>
+<?php if (!$devices): ?>
+<em><?php echo _("None") ?></em>
+<?php else: ?>
+<table class="striped">
+<tr>
+ <th><?php echo _("Device") ?></th>
+ <th><?php echo _("Type") ?></th>
+ <th><?php echo _("Mode") ?></th>
+</tr>
+<?php
+foreach ($devices as $device => $data) {
+?>
+<tr>
+ <td><?php echo htmlspecialchars($device) ?></td>
+ <td><?php echo htmlspecialchars($data['TYPE']) ?></td>
+ <td>
+   <select id="mode_select[<?php echo $device; ?>]" name="mode_select[<?php echo $device; ?>]">
+     <option value=""><?php echo _("Select the device mode:"); ?></option>
+     <option value="-1" <?php echo ($data['MODE'] === null || $data['MODE'] === '-1') ? 'selected="selected"' : ''; ?>>Default</option>
+     <option value="0" <?php echo ($data['MODE'] === '0') ? 'selected="selected"' : ''; ?>>Flat mode</option>
+     <option value="1" <?php echo ($data['MODE'] === '1') ? 'selected="selected"' : ''; ?>>Folder mode</option>
+   </select>
+ </td>
+ <td>
+   <input type="submit" class="button" value="<?php echo _("Delete") ?>" name="delete[<?php echo htmlspecialchars($device) ?>]"/>
+ </td>
+</tr>
+<?php } ?>
+</table>
+<?php endif; ?>
+<p>
+ <input type="hidden" name="actionID" value="save" />
+ <input type="submit" class="button" value="<?php echo _("Store device modes") ?>" />
+ <input id="prefs_return" type="button" class="button" onclick="cancelSubmit=true;document.location.href='<?php echo Horde::applicationUrl(Util::addParameter('services/prefs.php', 'app', 'horde'), true) ?>'" value="<?php echo _("Return to Options") ?>" />
+</p>
+
+</div>
+</form>





More information about the commits mailing list