From d8838f9438fb5192084f7cdbaf9bccc7451bf34c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 00:11:12 +0100 Subject: [PATCH 1/4] Update codesniffer to remove travis errors. --- dev/codesniffer/ruleset.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 3cf3f08b368..b121027ad10 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -36,7 +36,10 @@ 0 - + + 0 + + 0 From 854ed90a6226eeb8c0cb62fee9a0f3af459a35c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 11:15:10 +0100 Subject: [PATCH 2/4] Fixed: bad place for the ajaxcombo. --- htdocs/core/class/html.form.class.php | 17 +++++++++++++++-- htdocs/core/lib/agenda.lib.php | 25 +------------------------ htdocs/core/lib/ajax.lib.php | 4 +++- htdocs/langs/en_US/main.lang | 1 + 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eec9318f9ba..b40438d4292 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1342,6 +1342,12 @@ class Form $out.= ''; } $out.= ''; + + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + } } else { @@ -4566,10 +4572,17 @@ class Form } else { - $out.= ''; + if ($show_empty) $out.= ''."\n"; + $out.= ''; } $out.= ''; + + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + } } else { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 236f418dd86..7bc5b931c0e 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -70,36 +70,13 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print ''; print ''; - //print $langs->trans("ActionsAskedBy"); - //print '  '; - //print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); - //print '   '.$langs->trans("or") . ' '; print $langs->trans("ActionsOwnedBy").'   '; print ''; - //print $langs->trans("User"); print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); - if (! empty($conf->use_javascript_ajax)) - { - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - print ajax_combobox('usertodo'); - } - if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '; - else print '
'; - print $langs->trans("Group").'   '; + if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '.$langs->trans("Group").'   '; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); - if (! empty($conf->use_javascript_ajax)) - { - print ajax_combobox('usergroup'); - } print ''; - /*print ''; - print ''; - print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy"); - print '  '; - print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit); - print '';*/ - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3966b29f874..74e715f7b4a 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -321,8 +321,10 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) global $conf; if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) + if (! empty($conf->dol_use_jmobile)) return ''; // combobox with jmobile (does not works) if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - + if (empty($conf->use_javascript_ajax)) return ''; + /* Some properties for combobox: minLengthToAutocomplete: 2, comboboxContainerClass: "comboboxContainer", diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cbc4deb40d7..fd07d379a44 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -169,6 +169,7 @@ User=User Users=Users Group=Group Groups=Groups +NoUserGroupDefined=No user group defined Password=Password PasswordRetype=Retype your password NoteSomeFeaturesAreDisabled=Note that a lot of features/modules are disabled in this demonstration. From 27f26bba27c604317800b46423e1c0a4c50d552a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 11:17:04 +0100 Subject: [PATCH 3/4] Fixed: Missing test --- htdocs/core/class/html.form.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fff53e9d25c..864f7792eef 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1356,15 +1356,17 @@ class Form } $out.= ''; - $out.= ''; + } } else { From c9f3267649029d2876bf5bf3e27c40b9be93b8bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 11:34:37 +0100 Subject: [PATCH 4/4] Fixed: bad conditions --- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/core/lib/agenda.lib.php | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b40438d4292..936a3b9cb53 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1343,7 +1343,7 @@ class Form } $out.= ''; - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax) && ! $show_empty) // ajaxcombo works only on list with no empty value because of   { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox($htmlname); @@ -4573,12 +4573,12 @@ class Form else { $out.= ''; - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax) && ! $show_empty) // ajax combo works only when no empty value { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox($htmlname); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 7bc5b931c0e..3d51490f6b2 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -124,16 +124,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''.$langs->trans("WorkingTimeRange").''; print ""; - print ' - '; + print ''; + if (empty($conf->dol_use_jmobile)) print ' - '; print ''; - print ' '.$langs->trans("H"); + if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); print ''; // Filter on days print ''; print ''.$langs->trans("WorkingDaysRange").''; print ""; - print ' - '; + print ''; + if (empty($conf->dol_use_jmobile)) print ' - '; print ''; print ''; }