Update html.form.class.php
This commit is contained in:
parent
5823e2f5ef
commit
6b6355f373
@ -3498,6 +3498,7 @@ class Form
|
|||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of payment methods
|
* Return list of payment methods
|
||||||
|
* Constant MAIN_DEFAULT_PAYMENT_TYPE_ID can used to set default value but scope is all application, probably not what you want.
|
||||||
*
|
*
|
||||||
* @param string $selected Id du mode de paiement pre-selectionne
|
* @param string $selected Id du mode de paiement pre-selectionne
|
||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
@ -3513,7 +3514,7 @@ class Form
|
|||||||
public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '')
|
public function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs, $user;
|
global $langs, $user, $conf;
|
||||||
|
|
||||||
dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
|
dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
|
||||||
|
|
||||||
@ -3524,6 +3525,9 @@ class Form
|
|||||||
|
|
||||||
$this->load_cache_types_paiements();
|
$this->load_cache_types_paiements();
|
||||||
|
|
||||||
|
// Set default value if not already set by caller
|
||||||
|
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID)) $selected = $conf->global->MAIN_DEFAULT_PAYMENT_TYPE_ID;
|
||||||
|
|
||||||
print '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
|
print '<select id="select'.$htmlname.'" class="flat selectpaymenttypes'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
|
||||||
if ($empty) print '<option value=""> </option>';
|
if ($empty) print '<option value=""> </option>';
|
||||||
foreach ($this->cache_types_paiements as $id => $arraytypes)
|
foreach ($this->cache_types_paiements as $id => $arraytypes)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user