diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 50833fc857c..99734a4541c 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4750,7 +4750,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)
@@ -4795,7 +4797,6 @@ 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'))