New: Add option to show long or short (by default) label in select_month()
This commit is contained in:
parent
6f6ff6697a
commit
8163563753
@ -543,7 +543,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
|||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td width="35%"><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
print '<tr '.$bc[$var].'><td width="35%"><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||||
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',1) . '</td></tr>';
|
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '</td></tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
|
|||||||
@ -776,17 +776,19 @@ 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 Nom de la zone select
|
* @param string $htmlname Name of HTML select object
|
||||||
* @param int $useempty Affiche valeur vide dans liste
|
* @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)
|
function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
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 = '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
$select_month = '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||||
if ($useempty)
|
if ($useempty)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user