diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index c9fe7c41001..d440930bbf5 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1385,7 +1385,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' $morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create'); - print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, ''); + print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, 'bank'); $rib_list = $object->get_all_rib(); if (is_array($rib_list)) diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index af70ce966d2..186cc57d36e 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -67,6 +67,17 @@ if ($id > 0 || !empty($ref)) $object->getrights(); } +$account = new UserBankAccount($db); +if (!$bankid) +{ + $account->fetch(0, '', $id); +} +else +{ + $account->fetch($bankid); +} +if (empty($account->userid)) $account->userid = $object->id; + /* * Actions @@ -74,9 +85,6 @@ if ($id > 0 || !empty($ref)) if ($action == 'add' && !$cancel) { - // Modification - $account = new UserBankAccount($db); - $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -108,11 +116,6 @@ if ($action == 'add' && !$cancel) if ($action == 'update' && !$cancel) { - // Modification - $account = new UserBankAccount($db); - - $account->fetch($bankid); - $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -153,18 +156,6 @@ llxHeader(null, $langs->trans("BankAccounts")); $head = user_prepare_head($object); -$account = new UserBankAccount($db); -if (!$bankid) -{ - $account->fetch(0, '', $id); -} -else -{ - $account->fetch($bankid); -} -if (empty($account->userid)) $account->userid = $object->id; - - if ($id && $bankid && $action == 'edit' && $user->rights->user->user->creer) { print '