FIX Can set payment mode to empty on thirdparty page

This commit is contained in:
ldestailleur 2018-12-28 23:06:04 +01:00
parent 713d71bd95
commit c0eef25b31
2 changed files with 5 additions and 4 deletions

View File

@ -327,7 +327,7 @@ if ($object->id > 0)
print '</td><td>';
if ($action == 'editconditions')
{
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id',1);
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id', 1);
}
else
{
@ -346,7 +346,7 @@ if ($object->id > 0)
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
}
else
{

View File

@ -4296,9 +4296,10 @@ class Form
* @param string $htmlname Name of select html field
* @param string $filtertype To filter on field type in llx_c_paiement (array('code'=>xx,'label'=>zz))
* @param int $active Active or not, -1 = all
* @param int $addempty 1=Add empty entry
* @return void
*/
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1)
function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1, $addempty=0)
{
// phpcs:enable
global $langs;
@ -4307,7 +4308,7 @@ class Form
print '<form method="POST" action="'.$page.'">';
print '<input type="hidden" name="action" value="setmode">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$this->select_types_paiements($selected,$htmlname,$filtertype,0,0,0,0,$active);
$this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
}