From 807f2841d49e3db8951b9952a6c9df3d7eac0aeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Jan 2022 09:33:52 +0100 Subject: [PATCH] FIX Navigation on bank transaction list --- htdocs/categories/index.php | 9 +++++---- htdocs/compta/bank/bankentries_list.php | 17 +++++++++-------- htdocs/compta/bank/line.php | 4 ++-- htdocs/compta/bank/releve.php | 7 ++++--- htdocs/compta/bank/various_payment/card.php | 10 ++++------ htdocs/langs/en_US/admin.lang | 2 +- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index c585217dfda..04f2288ae08 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -35,10 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->load("categories"); -if (!$user->rights->categorie->lire) { - accessforbidden(); -} - $id = GETPOST('id', 'int'); $type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT); $catname = GETPOST('catname', 'alpha'); @@ -52,6 +48,11 @@ if (is_numeric($type)) { // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categoryindex')); +if (!$user->rights->categorie->lire) { + accessforbidden(); +} + + /* * View */ diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index d4cfbb83abd..2e49fc015d2 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -64,6 +64,7 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $contextpage = 'banktransactionlist'.(empty($object->ref) ? '' : '-'.$object->id); +$optioncss = GETPOST('optioncss', 'aZ09'); // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); @@ -264,7 +265,7 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } if (!$error) { - $param = 'action=reconcile&contextpage=banktransactionlist&id='.$id.'&search_account='.$id; + $param = 'action=reconcile&contextpage=banktransactionlist&id='.((int) $id).'&search_account='.((int) $id); if ($page) { $param .= '&page='.urlencode($page); } @@ -448,7 +449,7 @@ if (!empty($search_debit)) { if (!empty($search_credit)) { $param .= '&search_credit='.urlencode($search_credit); } -if (!empty($search_account)) { +if ($search_account > 0) { $param .= '&search_account='.urlencode($search_account); } if (!empty($search_num_releve)) { @@ -758,7 +759,7 @@ if ($resql) { } print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -766,7 +767,7 @@ if ($resql) { print ''; print ''; if (GETPOST('bid')) { - print ''; + print ''; } // Form to reconcile @@ -1663,16 +1664,16 @@ if ($resql) { print ''; // Transaction reconciliated or edit link if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) { // If line not conciliated and account can be conciliated - print ''; + print ''; print img_edit(); print ''; } else { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { - print ''; + print ''; print img_edit(); print ''; } else { - print ''; + print ''; print img_view(); print ''; } @@ -1682,7 +1683,7 @@ if ($resql) { } } if ($user->rights->banque->modifier) { - print 'rowid.'&page='.$page.'">'; + print 'rowid.'&page='.$page.$param.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'; print img_delete('', 'class="marginleftonly"'); print ''; } diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index e524371e29d..b3675feb63e 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -646,10 +646,10 @@ if ($result) { } print ''; - print "".$langs->trans("BankLineConciliated").""; + print ''; if ($user->rights->banque->consolidate) { print ''; - print 'rappro ? ' checked="checked"' : '')).'">'; + print 'rappro ? ' checked="checked"' : '')).'">'; print ''; } else { print ''.yn($objp->rappro).''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 97184c1b8eb..94023d65a0f 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -331,8 +331,8 @@ if (empty($numref)) { } else { print ''; print ''; - print ''; - print ''; + print ''; + print ''; } print ''; @@ -364,7 +364,7 @@ if (empty($numref)) { print ''; if ($user->rights->banque->consolidate && $action != 'editbankreceipt') { - print 'numr.'">'.img_edit().''; + print 'numr.'">'.img_edit().''; } print ''; @@ -669,6 +669,7 @@ if (empty($numref)) { var current = $(this); current.click(function() { + console.log("We click on ajaxforbankoperationchange"); var url = "'.$urlajax.'&"+current.attr("href").split("?")[1]; $.get(url, function(data) { diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 2b4a68bec90..dd734074481 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -334,11 +334,7 @@ foreach ($bankcateg->fetchAll() as $bankcategory) { $options[$bankcategory->id] = $bankcategory->label; } -/* ************************************************************************** */ -/* */ -/* Create mode */ -/* */ -/* ************************************************************************** */ +// Create mode if ($action == 'create') { // Update fields properties in realtime if (!empty($conf->use_javascript_ajax)) { @@ -350,6 +346,7 @@ if ($action == 'create') { }); function setPaymentType() { + console.log("setPaymentType"); var code = $("#selectpaymenttype option:selected").val(); if (code == \'CHQ\' || code == \'VIR\') { @@ -415,7 +412,8 @@ if ($action == 'create') { if (!empty($conf->banque->enabled)) { print ''; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; - $form->select_comptes($accountid, "accountid", 0, '', 2); // Affiche liste des comptes courant + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); + print $form->select_comptes($accountid, "accountid", 0, '', 2, '', 0, '', 1); // Show list of main accounts (comptes courants) print ''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index af1c226276b..cad22dec392 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -746,7 +746,7 @@ Permission106=Export sendings Permission109=Delete sendings Permission111=Read financial accounts Permission112=Create/modify/delete and compare transactions -Permission113=Setup financial accounts (create, manage categories) +Permission113=Setup financial accounts (create, manage categories of bank transactions) Permission114=Reconcile transactions Permission115=Export transactions and account statements Permission116=Transfers between accounts