gunnar: server/patches/horde-webmail/1.2.0/tg t_kronolith_HK_UV_dateInputFieldOrder.diff, NONE, 1.1.2.1 series, 1.5.2.8, 1.5.2.9

cvs at kolab.org cvs at kolab.org
Thu Nov 5 12:14:11 CET 2009


Author: gunnar

Update of /kolabrepository/server/patches/horde-webmail/1.2.0/tg
In directory doto:/tmp/cvs-serv9695/patches/horde-webmail/1.2.0/tg

Modified Files:
      Tag: kolab_2_2_branch
	series 
Added Files:
      Tag: kolab_2_2_branch
	t_kronolith_HK_UV_dateInputFieldOrder.diff 
Log Message:
 kolab/issue3844 (New user preference to specify order of date input fields)

--- NEW FILE: t_kronolith_HK_UV_dateInputFieldOrder.diff ---
From: Soenke Schwardt-Krummrich <schwardt at univention.de>
Subject: [PATCH] t/kronolith/HK/UV/dateInputFieldOrder

Currently in kronolith the order of date input fields is hardcoded to
year-month-day. Some parts of the world usually use a different order.
The attached patch adds a user preference to specify input field order.

REFERENCE_KOLAB: https://issues.kolab.org/issue3844
REFERENCE_HORDE:

STATUS_KOLAB_2.2:             UNTESTED
STATUS_KOLAB_2.3:             NONE
STATUS_HORDE_KRONOLITH_2.3.3: SUBMIT
STATUS_HORDE_KRONOLITH_3.0:   SUBMIT

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

---
 horde-webmail/config/prefs.php                     |   17 ++++++++++-
 horde-webmail/config/prefs.php.dist                |   17 ++++++++++-
 .../kronolith/templates/edit/edit_timespan.inc     |   30 +++++++++++++------
 3 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/horde-webmail/config/prefs.php b/horde-webmail/config/prefs.php
index c9e5d80..e3c591b 100644
--- a/horde-webmail/config/prefs.php
+++ b/horde-webmail/config/prefs.php
@@ -105,7 +105,7 @@ $prefGroups['language'] = array(
     'column' => _("Your Information"),
     'label' => _("Locale and Time"),
     'desc' => _("Set your preferred language, timezone and date options."),
-    'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'first_week_day')
+    'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'date_input_format', 'first_week_day')
 );
 
 $prefGroups['categories'] = array(
@@ -346,6 +346,21 @@ $_prefs['date_format'] = array(
     'desc' => _("Choose how to display dates:"),
 );
 
+// date input format
+$_prefs['date_input_format'] = array(
+    'value' => 'year-month-day',
+    'locked' => false,
+    'shared' => true,
+    'type' => 'enum',
+    'enum' => array(
+        'day-month-year' => strftime('%d %b %Y'),
+        'month-day-year' => strftime('%b %d %Y'),
+        'year-day-month' => strftime('%Y %d %b'),
+        'year-month-day' => strftime('%Y %b %d'),
+    ),
+    'desc' => _("Choose order how to enter dates:"),
+);
+
 // what day should be displayed as the first day of the week?
 $_prefs['first_week_day'] = array(
     'value' => '0',
diff --git a/horde-webmail/config/prefs.php.dist b/horde-webmail/config/prefs.php.dist
index 6e513ae..2d745f9 100644
--- a/horde-webmail/config/prefs.php.dist
+++ b/horde-webmail/config/prefs.php.dist
@@ -105,7 +105,7 @@ $prefGroups['language'] = array(
     'column' => _("Your Information"),
     'label' => _("Locale and Time"),
     'desc' => _("Set your preferred language, timezone and date options."),
-    'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'first_week_day')
+    'members' => array('language', 'timezone', 'twentyFour', 'date_format', 'date_input_format', 'first_week_day')
 );
 
 $prefGroups['categories'] = array(
@@ -344,6 +344,21 @@ $_prefs['date_format'] = array(
     'desc' => _("Choose how to display dates:"),
 );
 
+// date input format
+$_prefs['date_input_format'] = array(
+    'value' => 'year-month-day',
+    'locked' => false,
+    'shared' => true,
+    'type' => 'enum',
+    'enum' => array(
+        'day-month-year' => strftime('%d %b %Y'),
+        'month-day-year' => strftime('%b %d %Y'),
+        'year-day-month' => strftime('%Y %d %b'),
+        'year-month-day' => strftime('%Y %b %d'),
+    ),
+    'desc' => _("Choose order how to enter dates:"),
+);
+
 // what day should be displayed as the first day of the week?
 $_prefs['first_week_day'] = array(
     'value' => '0',
diff --git a/horde-webmail/kronolith/templates/edit/edit_timespan.inc b/horde-webmail/kronolith/templates/edit/edit_timespan.inc
index 9926617..05f5042 100644
--- a/horde-webmail/kronolith/templates/edit/edit_timespan.inc
+++ b/horde-webmail/kronolith/templates/edit/edit_timespan.inc
@@ -12,11 +12,16 @@
  </td>
  <td colspan="2" class="rightAlign"><?php echo _("On") ?> </td>
  <td>
-  <?php echo $event->html('start[year]') ?>
-  -
-  <?php echo $event->html('start[month]') ?>
-  -
-  <?php echo $event->html('start[day]') ?>
+ <?php
+     $dateorder = $GLOBALS['prefs']->getValue('date_input_format');
+     $dateorder = $dateorder != "" ? $dateorder : "year-month-day";
+     $dateorder = explode("-", $dateorder );
+     $datefields = array();
+     foreach ($dateorder as $fld) {
+	   $datefields[] = $event->html('start['.$fld.']');
+	 }
+     echo implode("-", $datefields);
+ ?>
 <?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
   <span id="start_wday"></span>
   <script type="text/javascript">
@@ -62,11 +67,16 @@
   <?php echo Horde::label('end_year', _("On")) ?> 
  </td>
  <td>
-  <?php echo $event->html('end[year]') ?>
-  -
-  <?php echo $event->html('end[month]') ?>
-  -
-  <?php echo $event->html('end[day]') ?>
+ <?php
+     $dateorder = $GLOBALS['prefs']->getValue('date_input_format');
+     $dateorder = $dateorder != "" ? $dateorder : "year-month-day";
+     $dateorder = explode("-", $dateorder );
+     $datefields = array();
+     foreach ($dateorder as $fld) {
+	   $datefields[] = $event->html('end['.$fld.']');
+	 }
+     echo implode("-", $datefields);
+ ?>
 <?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
   <span id="end_wday"></span>
   <script type="text/javascript">
-- 
tg: (8d3a749..) t/kronolith/HK/UV/dateInputFieldOrder (depends on: t/kronolith/HK/GW/ExportEventList)
-- 
TOPGIT patch commit log
=======================

commit 09e3d2df656b820ae7fbaacce1060958e4b889b9
Author: Gunnar Wrobel <p at rdus.de>
Date:   Thu Nov 5 09:26:25 2009 +0100

    Imported patch from kolab/issue3844 (New user preference to specify order of date input fields)

Index: series
===================================================================
RCS file: /kolabrepository/server/patches/horde-webmail/1.2.0/tg/Attic/series,v
retrieving revision 1.5.2.8
retrieving revision 1.5.2.9
diff -u -d -r1.5.2.8 -r1.5.2.9
--- series	13 Oct 2009 13:24:08 -0000	1.5.2.8
+++ series	5 Nov 2009 11:14:09 -0000	1.5.2.9
@@ -73,3 +73,4 @@
 t_framework_HK_GW_Prefs_FileDriverHotfix.diff -p1
 t_kronolith_HK_GW_AnonymousiCalDownload.diff -p1
 t_kronolith_HK_GW_ExportEventList.diff -p1
+t_kronolith_HK_UV_dateInputFieldOrder.diff -p1





More information about the commits mailing list