From 816356375310c7754a6b1cf84d08db67b2db719f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:12:02 +0200 Subject: [PATCH 1/5] New: Add option to show long or short (by default) label in select_month() --- htdocs/admin/company.php | 2 +- htdocs/core/class/html.formother.class.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 561e299b937..d5c78761989 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -543,7 +543,7 @@ if ($action == 'edit' || $action == 'updateedit') $var=!$var; print ''; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',1) . ''; + print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . ''; print ""; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3233b479b6c..7dac2c2e527 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -776,17 +776,19 @@ class FormOther * Return HTML combo list of month * * @param string $selected Preselected value - * @param string $htmlname Nom de la zone select - * @param int $useempty Affiche valeur vide dans liste + * @param string $htmlname Name of HTML select object + * @param int $useempty Show empty in list + * @param int $longlabel Show long label * @return string */ - function select_month($selected='',$htmlname='monthid',$useempty=0) + function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) { global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $montharray = monthArray($langs, 1); // Get array + if ($longlabel) $montharray = monthArray($langs, 0); // Get array + else $montharray = monthArray($langs, 1); $select_month = ''; if ($useempty) From 3a5f6db571b8149ad4653bf8e0609e4eacf5fc06 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:18:21 +0200 Subject: [PATCH 3/5] Spaces 2 : return of the vilains --- htdocs/core/class/html.formother.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index e1cbfd52047..7d93289a2fb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -773,13 +773,13 @@ class FormOther } /** - * Return HTML combo list of month + * Return HTML combo list of month * - * @param string $selected Preselected value + * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list * @param int $longlabel Show long label - * @return string + * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) { From 7062dc7b2edc480e1d2e07e61fe2ddb8d77763e2 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:20:34 +0200 Subject: [PATCH 4/5] Spaces 3 : the darkside --- htdocs/core/class/html.formother.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7d93289a2fb..d14c748e80e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -775,10 +775,10 @@ class FormOther /** * Return HTML combo list of month * - * @param string $selected Preselected value - * @param string $htmlname Name of HTML select object - * @param int $useempty Show empty in list - * @param int $longlabel Show long label + * @param string $selected Preselected value + * @param string $htmlname Name of HTML select object + * @param int $useempty Show empty in list + * @param int $longlabel Show long label * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) From 6dfd125872bc3543282ad3875416b73585f7ac9a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:25:50 +0200 Subject: [PATCH 5/5] Spaces 4 : Stop Shouting ! --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d14c748e80e..9266b8aa3a6 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -775,11 +775,11 @@ class FormOther /** * Return HTML combo list of month * - * @param string $selected Preselected value + * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list * @param int $longlabel Show long label - * @return string + * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) {