From cd888a2149e6fad8982d97ed11cc1b1256a1b1d9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 12 Sep 2017 15:13:12 +0200 Subject: [PATCH] Fix: hide bank account field if module disabled --- htdocs/comm/card.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index dfdc9183886..2da33334a92 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -330,25 +330,27 @@ if ($id > 0) print ""; print ''; - // Compte bancaire par défaut - print ''; - print ''; - print '
'; - print $langs->trans('PaymentBankAccount'); - print ''; - if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; - print ''; - if ($action == 'editbankaccount') + if (! empty($conf->banque->enabled)) { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); + // Compte bancaire par défaut + print ''; + print ''; + print '
'; + print $langs->trans('PaymentBankAccount'); + print ''; + if (($action != 'editbankaccount') && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; + print ''; + if ($action == 'editbankaccount') + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1); + } + else + { + $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none'); + } + print ""; + print ''; } - else - { - $form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none'); - } - print ""; - print ''; - // Relative discounts (Discounts-Drawbacks-Rebates) print '';