From 754b0e98539c91e0905e8b4916f74dc7ca030dab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Apr 2021 15:30:02 +0200 Subject: [PATCH] Debug v14 --- htdocs/compta/bank/card.php | 4 +-- htdocs/compta/bank/list.php | 46 +++++++++++++++++++++------------ htdocs/compta/bank/transfer.php | 2 ++ 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 72be65b0a4f..bf30b1831f9 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -385,7 +385,7 @@ if ($action == 'create') { print ''.$langs->trans("BankAccountCountry").''; print ''; - print $form->select_country($selectedcode, 'account_country_id'); + print img_picto('', 'country', 'class="pictofixedwidth"').$form->select_country($selectedcode, 'account_country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -883,7 +883,7 @@ if ($action == 'create') { print ''.$langs->trans("Country").''; print ''; - print $form->select_country($selectedcode, 'account_country_id'); + print img_picto('', 'country', 'class="pictofixedwidth"').$form->select_country($selectedcode, 'account_country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 84c91384038..ef190884e22 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -95,8 +95,8 @@ if (!$sortorder) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Account($db); -$hookmanager->initHooks(array('bankaccountlist')); $extrafields = new ExtraFields($db); +$hookmanager->initHooks(array('bankaccountlist')); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -129,6 +129,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); +$permissiontoadd = $user->rights->banque->modifier; +$permissiontodelete = $user->rights->banque->supprimer; /* * Actions @@ -162,7 +164,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Account'; $objectlabel = 'FinancialAccount'; - $permissiontoadd = $user->rights->banque->modifier; $uploaddir = $conf->banque->dir_output; include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; } @@ -287,13 +288,17 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( // 'presend'=>img_picto('', 'email').$langs->trans("SendByMail"), // 'builddoc'=>img_picto('', 'pdf').$langs->trans("PDFMerge"), ); -if ($user->rights->banque->supprimer) { +if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if ($user->rights->banque->modifier) { @@ -304,10 +309,7 @@ if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) { } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$newcardbutton = dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create', '', $user->rights->banque->configurer); - -// Lines of title fields -print '
'; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -316,9 +318,13 @@ print ''; print ''; print ''; +print ''; + print ''; print ''; +$newcardbutton = dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create', '', $user->rights->banque->configurer); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit, 1); $topicmail = "Information"; @@ -342,7 +348,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { // Bank accounts $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -357,11 +363,14 @@ if (!empty($moreforfilter)) { $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
'; -print ''."\n"; +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
'."\n"; -print ''; +// Fields title search +// -------------------------------------------------------------------- +print ''; // Ref if (!empty($arrayfields['b.ref']['checked'])) { @@ -411,7 +420,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { @@ -438,13 +447,14 @@ if (!empty($arrayfields['balance']['checked'])) { print ''; } // Action column -print ''; -print ''; +print ''."\n"; -// Fields title +// Fields title label +// -------------------------------------------------------------------- print ''; if (!empty($arrayfields['b.ref']['checked'])) { print_liste_field_titre($arrayfields['b.ref']['label'], $_SERVER["PHP_SELF"], 'b.ref', '', $param, '', $sortfield, $sortorder); @@ -672,7 +682,9 @@ foreach ($accounts as $key => $type) { // Balance if (!empty($arrayfields['balance']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 903c27ce8d7..9665a8a2b1f 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -269,10 +269,12 @@ print ''; print '"; print "\n";
'; -$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1); +print ''; +$searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; - print ''.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).''; + print ''; + print ''.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).''; + print ''; print '
'; +print img_picto('', 'bank_account', 'class="paddingright"'); $form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1); print "\n"; +print img_picto('', 'bank_account', 'class="paddingright"'); $form->select_comptes($account_to, 'account_to', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1); print "