From 00db16e0deab03cb0fcf85458db42d6f7d1acfe4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 08:49:00 +0200 Subject: [PATCH 1/6] Fix: force jquery cal if MAIN_POPUP_CALENDAR=eldy (showDP commented) --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93c24990af0..7c4948789b1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4742,7 +4742,9 @@ class Form // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; - if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) $usecalendar=empty($conf->global->MAIN_POPUP_CALENDAR)?'jquery':$conf->global->MAIN_POPUP_CALENDAR; + if (! empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) { + $usecalendar = ((empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR == 'eldy')?'jquery':$conf->global->MAIN_POPUP_CALENDAR); + } //if (! empty($conf->browser->phone)) $usecalendar='combo'; if ($d) From f51c0db7059862c78ecd5fb8d9e4941f9e19c732 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 09:16:14 +0200 Subject: [PATCH 2/6] NEW add translation and possibility to change month and year --- htdocs/core/class/html.form.class.php | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7c4948789b1..4af8364a751 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4790,7 +4790,54 @@ class Form $retstring.="'."\n"; - // Add datepicker default options - /*if (! defined('DISABLE_DATE_PICKER')) + // Add datepicker default options (needed by jquery datepicker!) + if (! defined('DISABLE_DATE_PICKER')) { print ''."\n"; - }*/ + } // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) From 4530f94fa67b93675619a4903771a21c097c37ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 10 Oct 2017 10:07:52 +0200 Subject: [PATCH 5/6] Fix: restore parameters, needed for save in place --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index a763533f9b3..3de57f0543f 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -119,7 +119,9 @@ $(document).ready(function() { $.datepicker.setDefaults({ autoSize: true, changeMonth: true, - changeYear: true + changeYear: true, + altField: '#timestamp', + altFormat: '@' // Gives a timestamp dateformat }); }); From 5aa3352e58b1a29f8ad33e572a552cbffb4ea74a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Oct 2017 11:48:38 +0200 Subject: [PATCH 6/6] Restore TODO for future feature --- htdocs/core/js/datepicker.js.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/js/datepicker.js.php b/htdocs/core/js/datepicker.js.php index 3de57f0543f..32b7ca43f5e 100644 --- a/htdocs/core/js/datepicker.js.php +++ b/htdocs/core/js/datepicker.js.php @@ -139,7 +139,9 @@ jQuery(function($){ weekHeader: 'trans("Week"); ?>', dateFormat: 'trans("FormatDateShortJQuery"); ?>', firstDay: global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'); ?>, - isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?> + isRTL: trans("DIRECTION")=='rtl'?'true':'false'); ?>, + showMonthAfterYear: false, /* TODO add specific to country */ + yearSuffix: '' /* TODO add specific to country */ }; $.datepicker.setDefaults($.datepicker.regional['defaultlang ?>']); });