From c0eef25b3130163b748215fe216f4183d061db21 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Fri, 28 Dec 2018 23:06:04 +0100 Subject: [PATCH] FIX Can set payment mode to empty on thirdparty page --- htdocs/comm/card.php | 4 ++-- htdocs/core/class/html.form.class.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9cd85e4ad36..3ac0ab2822b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -327,7 +327,7 @@ if ($object->id > 0) print ''; 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 ''; 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 { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 618c7832659..51a36d758ee 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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 '
'; print ''; print ''; - $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 ''; print '
'; }