From ebba33635b7693137bd6fea7bbb9da34609e7d76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Oct 2018 18:20:57 +0200 Subject: [PATCH] Close #9674 by keeping old code present (this help for transition tests) --- htdocs/compta/bank/bankentries_list.php | 6 +++--- htdocs/compta/bank/various_payment/card.php | 3 ++- htdocs/core/menus/standard/eldy.lib.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 311335fd96b..081d674a6a3 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -302,7 +302,7 @@ if (GETPOST('save') && ! $cancel && $user->rights->banque->modifier) $error++; }*/ - if (! $error) + if (! $error && ! empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $objecttmp = new Account($db); $objecttmp->fetch($bankaccountid); @@ -630,7 +630,7 @@ if ($resql) } // Form to add a transaction with no invoice - if ($user->rights->banque->modifier && $action == 'addline') + if ($user->rights->banque->modifier && $action == 'addline' && ! empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); @@ -729,7 +729,7 @@ if ($resql) { if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - if (! empty($conf->global->BANK_USE_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments + if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments { if ($user->rights->banque->modifier) { $newcardbutton = ''.$langs->trans("AddBankRecord").''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 33757c67c6a..cc67f054bb3 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -155,7 +155,8 @@ if (empty($reshook)) if ($ret > 0) { $db->commit(); - header("Location: index.php"); + $urltogo=($backtopage ? $backtopage : DOL_URL_ROOT.'/compta/bank/various_payment/index.php'); + header("Location: ".$urltogo); exit; } else diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 4d185900f98..e0d845dcd61 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -959,7 +959,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Various payment - if (! empty($conf->banque->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 1) + if (! empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) { $langs->load("banks"); $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various');