From d06a445e01bde00de76d0304ff9806a413be9e68 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Tue, 10 Nov 2015 19:22:27 +0100 Subject: [PATCH 1/2] [Qual] Uniformize code --- htdocs/comm/card.php | 4 +- htdocs/commande/card.php | 66 ++++++++++++++--------------- htdocs/commande/contact.php | 6 +-- htdocs/commande/orderstoinvoice.php | 10 ++--- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 3083ac9505c02..0045316d41995 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -139,7 +139,7 @@ $object->fetch($id); $object->fk_prospectlevel=GETPOST('prospect_level_id','alpha'); $result=$object->set_prospect_level($user); - if ($result < 0) setEventMessage($object->error,$object->errors,'errors'); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // set communication status @@ -148,7 +148,7 @@ $object->fetch($id); $object->stcomm_id=dol_getIdFromCode($db, GETPOST('stcomm','alpha'), 'c_stcomm'); $result=$object->set_commnucation_level($user); - if ($result < 0) setEventMessages($object->error,$object->errors,'errors'); + if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // update outstandng limit diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a3d303165229c..bc033df4e18a8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -5,10 +5,10 @@ * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2012 Marcos García - * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry @@ -123,7 +123,7 @@ { if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) { - setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); + setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } else { @@ -140,7 +140,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $object = $orig; $action=''; } @@ -161,7 +161,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -177,7 +177,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -208,7 +208,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -225,7 +225,7 @@ $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); if ($datecommande == '') { - setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors'); $action = 'create'; $error++; } @@ -374,11 +374,11 @@ if ($reshook < 0) $error++; } else { - setEventMessage($srcobject->error, 'errors'); + setEventMessages($srcobject->error, $srcobject->errors, 'errors'); $error++; } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $error++; } } else { @@ -414,7 +414,7 @@ { $result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external'); if ($result < 0) { - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); $error++; } } @@ -432,7 +432,7 @@ } else { $db->rollback(); $action = 'create'; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -442,7 +442,7 @@ $ret=$object->classifyBilled(); if ($ret < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -471,7 +471,7 @@ $result = $object->set_date($user, $date); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -481,7 +481,7 @@ $result = $object->set_date_livraison($user, $datelivraison); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -586,11 +586,11 @@ } if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { - setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); + setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { - setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' @@ -599,11 +599,11 @@ $error++; } if ($qty == '') { - setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { - setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); $error++; } @@ -664,7 +664,7 @@ } else { - setEventMessage($prodcustprice->error,'errors'); + setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } } @@ -748,7 +748,7 @@ if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); - setEventMessage($mesg, 'errors'); + setEventMessages($mesg, null, 'errors'); } else { // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $info_bits, 0, $price_base_type, $pu_ttc, $date_start, $date_end, $type, - 1, 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $fk_unit); @@ -802,7 +802,7 @@ unset($_POST['date_endmonth']); unset($_POST['date_endyear']); } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -866,7 +866,7 @@ $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : ''); if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors'); + setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors'); $error++; } } else { @@ -914,7 +914,7 @@ unset($_POST['fournprice']); unset($_POST['buying_price']); } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -947,7 +947,7 @@ if (! $idwarehouse || $idwarehouse == -1) { $error++; - setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action=''; } } @@ -1000,7 +1000,7 @@ if (! $idwarehouse || $idwarehouse == -1) { $error++; - setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action=''; } } @@ -1032,7 +1032,7 @@ else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) { $result = $object->cloture($user); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1059,7 +1059,7 @@ if (! $idwarehouse || $idwarehouse == -1) { $error++; - setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $action=''; } } @@ -1068,7 +1068,7 @@ $result = $object->cancel($idwarehouse); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -1115,9 +1115,9 @@ $file = $upload_dir . '/' . GETPOST('file'); $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) - setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); else - setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action = ''; } } @@ -1181,9 +1181,9 @@ } else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 6a322e8681e65..c72e040e61c66 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Patrick Rouillon * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2015 Philippe Grand * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -69,11 +69,11 @@ if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 136ac6c1b8940..1abffe069f430 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -74,7 +74,7 @@ if (is_array($selected) == false) { $error++; - setEventMessage($langs->trans('Error_OrderNotChecked'), 'errors'); + setEventMessages($langs->trans('Error_OrderNotChecked'), null, 'errors'); } else { @@ -251,7 +251,7 @@ } else { - setEventMessage($discount->error, 'errors'); + setEventMessages($discount->error, $discount->errors, 'errors'); $error++; break; } @@ -320,7 +320,7 @@ } else { - setEventMessage($objectsrc->error, 'errors'); + setEventMessages($objectsrc->error, $objectsrc->errors, 'errors'); $error++; } $ii++; @@ -328,7 +328,7 @@ } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $error++; } } @@ -348,7 +348,7 @@ $action='create'; $_GET["origin"]=$_POST["origin"]; $_GET["originid"]=$_POST["originid"]; - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $error++; } } From 12c5d02a7aa589dae3f1ebbcfc2aa45efa1afa89 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Wed, 11 Nov 2015 12:27:09 +0100 Subject: [PATCH 2/2] [Qual] Uniformize code --- htdocs/compta/bank/account.php | 4 ++-- htdocs/compta/bank/annuel.php | 2 +- htdocs/compta/bank/card.php | 18 +++++++++--------- htdocs/compta/bank/document.php | 4 ++-- htdocs/compta/bank/graph.php | 12 ++++++------ htdocs/compta/bank/index.php | 4 ++-- htdocs/compta/bank/ligne.php | 8 ++++---- htdocs/compta/bank/rappro.php | 4 ++-- htdocs/compta/bank/virement.php | 8 ++++---- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index b9c0d3821bc2f..d6f8652d31ce3 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -152,13 +152,13 @@ $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); if ($insertid > 0) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id."&action=addline"); exit; } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 68ef0a42e32aa..7b53d775cb672 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -291,7 +291,7 @@ { $langs->load("errors"); $error++; - setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } else { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 063fee8ca786c..fb8383cd91a6c 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2014-2015 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,19 +102,19 @@ if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'error'); $action='create'; // Force chargement page en mode creation $error++; } if (empty($account->ref)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors'); $action='create'; // Force chargement page en mode creation $error++; } if (empty($account->label)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors'); $action='create'; // Force chargement page en mode creation $error++; } @@ -130,7 +130,7 @@ $_GET["id"]=$id; // Force chargement page en mode visu } else { - setEventMessage($account->error,'errors'); + setEventMessages($account->error, $account->errors, 'errors'); $action='create'; // Force chargement page en mode creation } } @@ -177,19 +177,19 @@ if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($account->account_number)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), 'error'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountancyCode")), null, 'error'); $action='edit'; // Force chargement page en mode creation $error++; } if (empty($account->ref)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors'); $action='edit'; // Force chargement page en mode creation $error++; } if (empty($account->label)) { - setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), null, 'errors'); $action='edit'; // Force chargement page en mode creation $error++; } @@ -206,7 +206,7 @@ } else { - setEventMessage($account->error, 'errors'); + setEventMessages($account->error, $account->errors, 'errors'); $action='edit'; // Force chargement page edition } } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 0b588fa64d025..3b6957df40f44 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -133,9 +133,9 @@ $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) { - setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); + setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); } else { - setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 6f885e12bde80..0764c87f5abf7 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -81,7 +81,7 @@ { $langs->load("errors"); $error++; - setEventMessage($langs->trans("ErrorFailedToCreateDir"), 'errors'); + setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } else { @@ -113,7 +113,7 @@ if ($mode == 'standard') { - // Chargement du tableau $amounts + // Loading table $amounts $amounts = array(); $monthnext = $month+1; @@ -153,7 +153,7 @@ dol_print_error($db); } - // Calcul de $solde avant le debut du graphe + // Calculation of $solde before the start of the graph $solde = 0; $sql = "SELECT SUM(b.amount)"; @@ -265,7 +265,7 @@ if ($mode == 'standard') { - // Chargement du tableau $amounts + // Loading table $amounts $amounts = array(); $sql = "SELECT date_format(b.datev,'%Y%m%d')"; $sql.= ", SUM(b.amount)"; @@ -296,7 +296,7 @@ dol_print_error($db); } - // Calcul de $solde avant le debut du graphe + // Calculation of $solde before the start of the graph $solde = 0; $sql = "SELECT SUM(b.amount)"; @@ -403,7 +403,7 @@ if ($mode == 'showalltime') { - // Chargement du tableau $amounts + // Loading table $amounts $amounts = array(); $sql = "SELECT date_format(b.datev,'%Y%m%d')"; diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 46b382ed0805f..7ea3bf1be5a91 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -113,7 +113,7 @@ { $result=$acc->load_board($user,$acc->id); if ($result<0) { - setEventMessage($acc->error, 'errors'); + setEventMessages($acc->error, $acc->errors, 'errors'); } else { print $result->nbtodo; if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')'; @@ -229,7 +229,7 @@ { $result=$acc->load_board($user,$acc->id); if ($result<0) { - setEventMessage($acc->error, 'errors'); + setEventMessages($acc->error, $acc->errors, 'errors'); } else { print $result->nbtodo; if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')'; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index d210e209b59ee..0f73e5cb6cff6 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -104,7 +104,7 @@ if ($ac->courant == 2 && $_POST['value'] != 'LIQ') { - setEventMessage($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), 'errors'); + setEventMessages($langs->trans("ErrorCashAccountAcceptsOnlyCashMoney"), null, 'errors'); $error++; } @@ -146,7 +146,7 @@ $result = $db->query($sql); if ($result) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } else @@ -184,7 +184,7 @@ $result = $db->query($sql); if ($result) { - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } else @@ -205,7 +205,7 @@ llxHeader(); -// On initialise la liste des categories +// The list of categories is initialized $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_categ"; $sql.= " ORDER BY label"; diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index 332e7fffe603f..82070a957e2b2 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -71,7 +71,7 @@ $result=$bankline->update_conciliation($user,$_POST["cat"]); if ($result < 0) { - setEventMessage($bankline->error, 'errors'); + setEventMessages($bankline->error, $bankline->errors, 'errors'); $error++; break; } @@ -83,7 +83,7 @@ { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorPleaseTypeBankTransactionReportName"), 'errors'); + setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); } if (! $error) diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 56071d61f9b62..4e323893d85ec 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -113,18 +113,18 @@ if (! $error) { $mesgs = $langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); - setEventMessage($mesgs); + setEventMessages($mesgs, null, 'mesgs'); $db->commit(); } else { - setEventMessage($accountfrom->error.' '.$accountto->error, 'errors'); + setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors'); $db->rollback(); } } else { - setEventMessage($langs->trans("ErrorFromToAccountsMustDiffers"), 'errors'); + setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } } } @@ -132,7 +132,7 @@ /* - * Affichage + * View */ llxHeader();