diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 0e39776946a..657d5b100e6 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -84,12 +84,12 @@ else if ($action == 'add') if (empty($object->date_start) && empty($object->date_end)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if (empty($object->label)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); $error++; } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b9224253bac..355aedb3e68 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -257,12 +257,12 @@ if (empty($reshook)) if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); } // Create new object @@ -485,14 +485,14 @@ if (empty($reshook)) // Check parameters if (empty($morphy) || $morphy == "-1") { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Nature")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Nature")), null, 'errors'); } // Test si le login existe deja if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { if (empty($login)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Login")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Login")), null, 'errors'); } else { $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$db->escape($login)."'"; @@ -508,22 +508,22 @@ if (empty($reshook)) } if (empty($pass)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Password")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Password")), null, 'errors'); } } if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Lastname")), null, 'errors'); } if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Firstname")), null, 'errors'); } if (! ($typeid > 0)) { // Keep () before ! $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) { $error++; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index c1eff57571a..62f6bbaaf2c 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -55,12 +55,12 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update')) if (empty($constname)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); $error++; } if ($constvalue == '') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Value")), null, 'errors'); $error++; } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 654d85b572b..c973d1a5852 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -169,19 +169,19 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE if (empty($_POST["frommail"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")), null, 'errors'); $action='test'; $error++; } if (empty($sendto)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTo")), null, 'errors'); $action='test'; $error++; } if (! $error) { - // Le message est-il en html + // Is the message in HTML? $msgishtml=0; // Message is not HTML if ($action == 'sendhtml') $msgishtml=1; // Force message to HTML diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 7c22a17c553..7c60a2ee055 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -135,25 +135,25 @@ if ($action == 'add') $error=0; if (! $error && ! $_POST['menu_handler']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MenuHandler")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['type']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['url']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Url")), null, 'errors'); $action = 'create'; $error++; } if (! $error && ! $_POST['titre']) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); $action = 'create'; $error++; } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 4b7818ecadb..bad71e31dc7 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -94,19 +94,19 @@ if ($action == 'send' && ! $_POST['cancel']) } if (empty($body)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors'); $action='test'; $error++; } if (empty($smsfrom) || ! str_replace('+','',$smsfrom)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors'); $action='test'; $error++; } if (empty($sendto) || ! str_replace('+','',$sendto)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors'); $action='test'; $error++; } diff --git a/htdocs/api/admin/index.html b/htdocs/api/admin/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/api/admin/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/api/class/index.html b/htdocs/api/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/api/class/index.html @@ -0,0 +1 @@ + diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 68673d9c83b..f974bbec897 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -96,12 +96,12 @@ if ($action == 'builddoc') if (empty($forbarcode)) // barcode value { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("BarcodeValue")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeValue")), null, 'errors'); $error++; } if (empty($fk_barcode_type)) // barcode type = barcode encoding { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("BarcodeType")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeType")), null, 'errors'); $error++; } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 5bd73202f15..f5921ac4d06 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -140,7 +140,7 @@ if ($action == 'add' && $user->rights->categorie->creer) if (! $object->label) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $action = 'create'; } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 836970e7a3c..0a13c3e7fab 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -87,7 +87,7 @@ if ($action == 'update' && $user->rights->categorie->creer) { $error++; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } if (! $error && empty($categorie->error)) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 272ba1e42e9..1f2f0c3b19e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -191,14 +191,14 @@ if ($action == 'add') { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors'); } // Initialisation objet cactioncomm @@ -206,7 +206,7 @@ if ($action == 'add') { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } else { @@ -289,20 +289,20 @@ if ($action == 'add') { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ActionsOwnedBy")), null, 'errors'); } if ($object->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent)))) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (! GETPOST('apyear') && ! GETPOST('adyear')) { $error++; $donotclearsession=1; $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } // Fill array 'array_options' with data from add form @@ -450,7 +450,7 @@ if ($action == 'update') { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } else { @@ -460,7 +460,7 @@ if ($action == 'update') { $error++; $donotclearsession=1; $action = 'edit'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ActionsOwnedBy")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ActionsOwnedBy")), null, 'errors'); } // Fill array 'array_options' with data from add form diff --git a/htdocs/comm/askpricesupplier/card.php b/htdocs/comm/askpricesupplier/card.php index 5821d721314..f57cb16e0e0 100644 --- a/htdocs/comm/askpricesupplier/card.php +++ b/htdocs/comm/askpricesupplier/card.php @@ -219,7 +219,7 @@ if (empty($reshook)) $date_delivery = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action = 'create'; $error ++; } @@ -434,7 +434,7 @@ if (empty($reshook)) // Close proposal else if ($action == 'setstatut' && $user->rights->askpricesupplier->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -525,17 +525,17 @@ if (empty($reshook)) } 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 == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 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 ++; } @@ -783,7 +783,7 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index fde56efb25e..8ab7fc91233 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -403,7 +403,7 @@ if (empty($reshook)) $object->sendto = $_POST["sendto"]; if (! $object->sendto) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("MailTo")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("MailTo")), null, 'errors'); $error++; } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 5119ac3851a..5d0b1133a00 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -222,7 +222,7 @@ if (empty($reshook)) if (empty($datep)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) { @@ -267,18 +267,19 @@ if (empty($reshook)) $duration = GETPOST('duree_validite'); if (empty($datep)) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action = 'create'; $error ++; } if (empty($duration)) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ValidityDuration")), null, 'errors'); $action = 'create'; $error ++; } if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); + $action = 'create'; $error ++; } @@ -575,7 +576,7 @@ if (empty($reshook)) else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -621,7 +622,7 @@ if (empty($reshook)) else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) { if (! GETPOST('statut')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'statut'; } else { // prevent browser refresh from closing proposal several times @@ -710,17 +711,17 @@ if (empty($reshook)) } 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 == '') // Unit price can be 0 but not ''. Also price can be negative for proposal. { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 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 ++; } @@ -999,7 +1000,7 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 9b764ad1c8f..e472c5fb848 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -140,7 +140,7 @@ if ($action == 'setremise') $error=0; if (empty($_POST["desc"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("ReasonDiscount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("ReasonDiscount")), null, 'errors'); $error++; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0dfcee225df..4d7456af1fd 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -231,7 +231,7 @@ if (empty($reshook)) } if ($socid < 1) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action = 'create'; $error++; } @@ -595,7 +595,7 @@ if (empty($reshook)) } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } if ($qty == '') { @@ -875,7 +875,7 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; } } diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 9a04a431ac6..500cf63b021 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -135,15 +135,15 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu if (! $dateop) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } if (! $operation) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Type")), null, 'errors'); } if (! $amount) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); } if (! $error) diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 45a87fea87c..f1bb4eb9a62 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -166,7 +166,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == // Check parameters if ($rappro && empty($num_rel)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("AccountStatement")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountStatement")), null, 'errors'); $error++; } diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 3a64d0cc3d1..56071d61f9b 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -54,22 +54,22 @@ if ($action == 'add') if (! $label) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors'); } if (! $amount) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); } if (! GETPOST('account_from','int')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferFrom")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors'); } if (! GETPOST('account_to','int')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors'); } if (! $error) { diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index d4858d5ab29..bc18d379a87 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -125,17 +125,17 @@ else if ($action == 'add' && $user->rights->deplacement->creer) if (! $object->date) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if ($object->type == '-1') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; } if (! ($object->fk_user > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Person")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Person")), null, 'errors'); $error++; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c736d4cd003..9e0875914df 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -277,7 +277,7 @@ if (empty($reshook)) $date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']); if (empty($date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id.'&action=editinvoicedate'); exit; } @@ -550,7 +550,7 @@ if (empty($reshook)) $result = $object->set_paid($user, $close_code, $close_note); if ($result<0) setEventMessage($object->error,'errors'); } else { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); } } // Classify "abandoned" else if ($action == 'confirm_canceled' && $confirm == 'yes') { @@ -561,7 +561,7 @@ if (empty($reshook)) $result = $object->set_canceled($user, $close_code, $close_note); if ($result<0) setEventMessage($object->error,'errors'); } else { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); } } @@ -671,12 +671,12 @@ if (empty($reshook)) if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! ($_POST['fac_replacement'] > 0)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } if (! $error) { @@ -716,14 +716,14 @@ if (empty($reshook)) if (! ($_POST['fac_avoir'] > 0)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } if (! $error) @@ -815,7 +815,7 @@ if (empty($reshook)) if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) @@ -843,14 +843,14 @@ if (empty($reshook)) if (GETPOST('socid', 'int') < 1) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); } $dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($dateinvoice)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } if (! $error) @@ -1245,7 +1245,7 @@ if (empty($reshook)) } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error ++; } if ($qty == '') { @@ -1555,7 +1555,7 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error ++; } } diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 7907a55fda0..fa01e9c5e9e 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -61,7 +61,7 @@ if ($action == 'confirm_rejet') if (empty($daterej)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); } elseif ($daterej > dol_now()) @@ -74,7 +74,7 @@ if ($action == 'confirm_rejet') if (GETPOST('motif','alpha') == 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefusedReason")), null, 'errors'); } if ( ! $error ) diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php index 04fc8db5b28..e658633e7b0 100644 --- a/htdocs/compta/salaries/card.php +++ b/htdocs/compta/salaries/card.php @@ -92,27 +92,27 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } if (empty($object->fk_user) || $object->fk_user < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Employee")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Employee")), null, 'errors'); $error++; } if (empty($object->type_payment) || $object->type_payment < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } if (empty($object->amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } if (! empty($conf->banque->enabled) && ! $object->accountid > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Account")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); $error++; } diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 29606fa6a9a..af975a39751 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -83,22 +83,22 @@ if ($action == 'add' && $user->rights->tax->charges->creer) $actioncode=GETPOST('actioncode'); if (! $dateech) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); $action = 'create'; } elseif (! $dateperiod) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'create'; } elseif (! $actioncode > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors'); $action = 'create'; } elseif (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } elseif (! is_numeric($amount)) @@ -133,17 +133,17 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr $amount=GETPOST('amount'); if (! $dateech) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateDue")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors'); $action = 'edit'; } elseif (! $dateperiod) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Period")), null, 'errors'); $action = 'edit'; } elseif (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'edit'; } else diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 688f88759c4..5c362fda994 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -81,22 +81,22 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) if (empty($tva->datev)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateValue")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateValue")), null, 'errors'); $error++; } if (empty($tva->datep)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DatePayment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")), null, 'errors'); $error++; } if (empty($tva->type_payment) || $tva->type_payment < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PaymentMode")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } if (empty($tva->amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Amount")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 13be2859482..4ef6556a6dd 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -125,7 +125,7 @@ if (empty($reshook)) if (! GETPOST('dateend')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (! $error) { @@ -206,13 +206,13 @@ if (empty($reshook)) if (empty($datecontrat)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $action='create'; } if ($socid<1) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors'); $action='create'; $error++; } @@ -419,12 +419,12 @@ if (empty($reshook)) 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++; } @@ -746,7 +746,7 @@ if (empty($reshook)) } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } } else if ($action == 'update_extras') diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index e8c63f2b96c..d6cadaaadec 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1506,7 +1506,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio else { $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("File")), 'warnings'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("File")), null, 'errors'); } } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 6664550e5c8..ac64bcc90bd 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -81,14 +81,14 @@ if ($action == 'update') if (empty($donation_date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); $action = "create"; $error++; } if (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); $action = "create"; $error++; } @@ -136,14 +136,14 @@ if ($action == 'add') if (empty($donation_date)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors'); $action = "create"; $error++; } if (empty($amount)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Amount")), null, 'errors'); $action = "create"; $error++; } diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php index 9f298e42b32..07c6a6029e8 100644 --- a/htdocs/ecm/docdir.php +++ b/htdocs/ecm/docdir.php @@ -100,7 +100,7 @@ if ($action == 'add' && $user->rights->ecm->setup) if (! $ecmdir->label) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; $ok=false; } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 64a9c46f0de..54c514ec1f2 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -100,7 +100,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if (empty($_FILES['userfile']['tmp_name'])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("File")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); } if (! $error) diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 47239aa3acd..0531050aa3d 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -100,7 +100,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if (empty($_FILES['userfile']['tmp_name'])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("File")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); } if (! $error) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index e7bd34583b9..f456bc0db8b 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -833,13 +833,13 @@ if ($action == "addline") if (! GETPOST('fk_c_type_fees') > 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Vat")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); $action=''; } @@ -849,7 +849,7 @@ if ($action == "addline") if (empty($object_ligne->fk_projet) || $object_ligne->fk_projet==-1) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Project")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Project")), null, 'errors'); } }*/ @@ -857,13 +857,13 @@ if ($action == "addline") if (empty($object_ligne->date) || $object_ligne->date=="--") { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); } // Si aucun prix n'est rentré if($object_ligne->value_unit==0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UP")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UP")), null, 'errors'); } // S'il y'a eu au moins une erreur @@ -956,13 +956,13 @@ if ($action == "updateligne" ) if (! GETPOST('fk_c_type_fees') > 0) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $action=''; } if (GETPOST('vatrate') < 0 || GETPOST('vatrate') == '') { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Vat")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Vat")), null, 'errors'); $action=''; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index ceab5d54714..e0870411003 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -320,7 +320,7 @@ if ($action == 'add_export_model') } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ExportModelName")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportModelName")), null, 'errors'); } } diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index c39acd9dd29..4bdfb6ca238 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Francis Appels * * 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 @@ -48,83 +49,44 @@ if ($idprod > 0) { $producttmp=new ProductFournisseur($db); $producttmp->fetch($idprod); - - $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; - $sql.= " pfp.ref_fourn,"; - $sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,"; - $sql.= " pfp.fk_supplier_price_expression, pfp.tva_tx, s.nom as name"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = pfp.fk_soc"; - $sql.= " WHERE pfp.fk_product = ".$idprod; - $sql.= " AND p.tobuy = 1"; - $sql.= " AND s.fournisseur = 1"; - $sql.= " ORDER BY s.nom, pfp.ref_fourn DESC"; - - dol_syslog("Ajax::getSupplierPrices", LOG_DEBUG); - $result=$db->query($sql); - - if ($result) + // get supplier prices sorted descending on supplier name and supplier ref + // TODO create configuration to define best price, current is not optimal + $productSupplierArray = $producttmp->list_product_fournisseur_price($idprod, 's.nom, pfp.ref_fourn', 'DESC'); + if ( is_array($productSupplierArray)) { - $num = $db->num_rows($result); - - if ($num) + foreach ($productSupplierArray as $productSupplier) { - require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; - $i = 0; - while ($i < $num) + $price = $productSupplier->fourn_price * (1 - $productSupplier->fourn_remise_percent / 100); + $unitprice = $productSupplier->fourn_unitprice * (1 - $productSupplier->fourn_remise_percent / 100); + + $title = $productSupplier->fourn_name.' - '.$productSupplier->fourn_ref.' - '; + + if ($productSupplier->fourn_qty == 1) { - $objp = $db->fetch_object($result); - - if (!empty($objp->fk_supplier_price_expression)) { - $priceparser = new PriceParser($db); - $price_result = $priceparser->parseProductSupplier($idprod, $objp->fk_supplier_price_expression, $objp->quantity, $objp->tva_tx); - if ($price_result >= 0) { - $objp->fprice = $price_result; - if ($objp->quantity >= 1) - { - $objp->unitprice = $objp->fprice / $objp->quantity; - } - } - } - - $price = $objp->fprice * (1 - $objp->remise_percent / 100); - $unitprice = $objp->unitprice * (1 - $objp->remise_percent / 100); - - $title = $objp->name.' - '.$objp->ref_fourn.' - '; - - if ($objp->quantity == 1) - { - $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/"; - } - $title.= $objp->quantity.' '.($objp->quantity == 1 ? $langs->trans("Unit") : $langs->trans("Units")); - - if ($objp->quantity > 1) - { - $title.=" - "; - $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); - - $price = $unitprice; - } - if ($objp->unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) - { - $title.=" + "; - $title.= price($objp->unitcharges,0,$langs,0,0,-1,$conf->currency); - $price += $objp->unitcharges; - } - if ($objp->duration) $label .= " - ".$objp->duration; - - $label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); - if ($objp->ref_fourn) $label.=' ('.$objp->ref_fourn.')'; - - $prices[] = array("id" => $objp->idprodfournprice, "price" => price($price,0,'',0), "label" => $label, "title" => $title); - $i++; + $title.= price($price,0,$langs,0,0,-1,$conf->currency)."/"; } - - $db->free($result); + $title.= $productSupplier->fourn_qty.' '.($productSupplier->fourn_qty == 1 ? $langs->trans("Unit") : $langs->trans("Units")); + + if ($productSupplier->fourn_qty > 1) + { + $title.=" - "; + $title.= price($unitprice,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); + $price = $unitprice; + } + if ($productSupplier->fourn_unitcharges > 0 && ($conf->global->MARGIN_TYPE == "2")) + { + $title.=" + "; + $title.= price($productSupplier->fourn_unitcharges,0,$langs,0,0,-1,$conf->currency); + $price += $productSupplier->fourn_unitcharges; + } + + $label = price($price,0,$langs,0,0,-1,$conf->currency)."/".$langs->trans("Unit"); + if ($productSupplier->fourn_ref) $label.=' ('.$productSupplier->fourn_ref.')'; + + $prices[] = array("id" => $productSupplier->product_fourn_price_id, "price" => price($price,0,'',0), "label" => $label, "title" => $title); } } - + // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => $price, "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b5cfbca52fe..37809f6bf87 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -359,7 +359,7 @@ if (empty($reshook)) // Product not selected $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), null, 'errors'); } if ($idprod == -1) { @@ -784,7 +784,7 @@ if (empty($reshook)) } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Delivery")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fc4dea21156..a8d84c7cd36 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -716,7 +716,7 @@ if (empty($reshook)) // Product not selected $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); } if ($idprod == -1) { diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index de3a470ba90..b0d6b4affa2 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -62,13 +62,13 @@ if ($action == 'add' || GETPOST('modify','alpha')) if (! GETPOST("$ftp_name",'alpha')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); } if (! GETPOST("$ftp_server",'alpha')) { $error=1; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Server")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Server")), null, 'errors'); } if (! $error) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index db53c4f2a10..d9200363f6d 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -87,7 +87,7 @@ if ($action == 'create') // If no start date if ($type <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; $action='create'; } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a103a304630..60d57f15103 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -192,7 +192,7 @@ if ($action == 'add_import_model') } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ImportModelName")), null, 'errors'); } } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index c5e60a1aced..a6e9f352d4e 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -89,17 +89,17 @@ if ($action == 'add' && $user->rights->loan->write) if (! $datestart) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateStart")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateStart")), null, 'errors'); $action = 'create'; } elseif (! $dateend) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateEnd")), null, 'errors'); $action = 'create'; } elseif (! $_POST["capital"]) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Capital")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Capital")), null, 'errors'); $action = 'create'; } else diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index e7416c1aa0d..69cfecbe5c2 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -62,17 +62,17 @@ if ($action == 'add_payment') if (! GETPOST('paymenttype', 'int') > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); $error++; } if ($datepaid == '') { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } if (! empty($conf->banque->enabled) && ! GETPOST('accountid', 'int') > 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 200659c856e..7a36a316d13 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -81,7 +81,7 @@ if ($action == 'update') if (! GETPOST('nouveautitre')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Title")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Title")), null, 'errors'); $error++; $action = 'edit'; } @@ -114,12 +114,12 @@ if (GETPOST('ajoutcomment')) if (! GETPOST('comment')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Comment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } if (! GETPOST('commentuser')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("User")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } if (! $error) diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index e710bca2adf..ca10eac09b9 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1020,7 +1020,7 @@ if ($nbofcheckbox >= 2) // S'il a oublié de remplir un nom if (isset($_POST["boutonp"]) && $_POST["nom"] == "") { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } if (isset($erreur_prenom) && $erreur_prenom) { diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php index 22dddffbff5..ec78e9789ca 100644 --- a/htdocs/opensurvey/wizard/create_survey.php +++ b/htdocs/opensurvey/wizard/create_survey.php @@ -144,7 +144,7 @@ print ''."\n"; print ''."\n"; if (! $_SESSION["titre"] && (GETPOST('creation_sondage_date') || GETPOST('creation_sondage_autre'))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("PollTitle")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PollTitle")), null, 'errors'); } print ''."\n"; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4a6cf18d0ed..8ea03e8e795 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -765,8 +765,10 @@ class Product extends CommonObject $newdir = $conf->product->dir_output . "/" . dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $res=dol_move($olddir, $newdir); + //include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + //$res = dol_move($olddir, $newdir); + // do not use dol_move with directory + $res = @rename($olddir, $newdir); if (! $res) { $this->error='ErrorFailToMoveDir'; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0f7a8f942e5..72f8ed2b0b2 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -119,7 +119,7 @@ if (empty($reshook)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("VATRateForSupplierProduct")), null, 'errors'); } if (! is_numeric($tva_tx)) { @@ -131,19 +131,19 @@ if (empty($reshook)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), null, 'errors'); } if (empty($ref_fourn)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefSupplier")), null, 'errors'); } if ($id_fourn <= 0) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Supplier")), null, 'errors'); } if ($_POST["price"] < 0 || $_POST["price"] == '') { @@ -151,7 +151,7 @@ if (empty($reshook)) { $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); } else { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index f02f78af4d4..9c7defc4643 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -9,6 +9,7 @@ * Copyright (C) 2014 Philippe Grand * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Marcos García * * 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 @@ -208,11 +209,11 @@ if (empty($reshook)) if (empty($quantity)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), null, 'errors'); } if (empty($newprice)) { $error ++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), null, 'errors'); } if (! $error) { // Calcul du prix HT et du prix unitaire @@ -378,13 +379,13 @@ print '
'. $langs->trans("PollTitle") .'
'; // Ref print ''; -print ''; print ''; // Label -print ''; +print ''; $isphoto = $object->is_photo_available($conf->product->multidir_output [$object->entity]); @@ -409,8 +410,8 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) $soc->fetch($socid); // Selling price - print ''; - print '' . $langs->trans("SellingPrice") . ''; + print ''; // Price min - print ''; // TVA - print ''; + print ''; } else { + // We show only vat for level 1 + print ''; + print ''; + for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) { - // TVA - if ($i == 1) // We show only vat for level 1 - { - print ''; - } - print ''; // Label of price @@ -455,20 +454,19 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print ''; if ($object->multiprices_base_type ["$i"] == 'TTC') { - print '';; } else { - print ' ' . $langs->trans($object->price_base_type); + print ' '.$langs->trans($object->price_base_type).'';; } - print ''; - // Prix mini - print ''; @@ -702,7 +700,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights-> print ''; // Price base - print ''; print '
' . $langs->trans("Ref") . ''; +print '' . $langs->trans("Ref") . ''; print $form->showrefnav($object, 'ref', '', 1, 'ref'); print '
' . $langs->trans("Label") . '' . $object->label . '
' . $langs->trans("Label") . '' . $object->label . '
' . $langs->trans("SellingPrice") . ''; + print '
'; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { print price($object->multiprices_ttc["$soc->price_level"]); } else { @@ -424,7 +425,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print '
' . $langs->trans("MinPrice") . ''; + print '
' . $langs->trans("MinPrice") . ''; if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { print price($object->multiprices_min_ttc["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]); @@ -434,18 +435,16 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) print '
' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '
' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '
' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . '
'.$langs->trans("PriceLevel").''.$langs->trans("SellingPrice").''.$langs->trans("MinPrice").'
' . $langs->trans("VATRate") . '' . vatrate($object->multiprices_tva_tx [1], true) . '
' . price($object->multiprices_ttc["$i"]); + print '' . price($object->multiprices_ttc["$i"]); } else { - print '' . price($object->multiprices["$i"]); + print '' . price($object->multiprices["$i"]); } if ($object->multiprices_base_type["$i"]) { - print ' ' . $langs->trans($object->multiprices_base_type ["$i"]); + print ' '.$langs->trans($object->multiprices_base_type ["$i"]).'
' . $langs->trans("MinPrice") . ' ' . $i . ''; + // Prix min + print ''; if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT"; if ($object->multiprices_base_type["$i"] == 'TTC') { @@ -652,7 +650,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) } // Status (to sell) -print '
' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; +print '
' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')'; print $object->getLibStatut(2, 0); print '
'; + print '
'; print $langs->trans('PriceBase'); print ''; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index ba322ac9c61..ff182c69c62 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -79,17 +79,17 @@ if ($action == 'addline') if (! ($id_product > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Product")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } if (! ($id_sw > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseSource")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors'); } if (! ($id_tw > 0)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("WarehouseTarget")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseTarget")), null, 'errors'); } if ($id_sw > 0 && $id_tw == $id_sw) { @@ -100,7 +100,7 @@ if ($action == 'addline') if (! $qty) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Qty")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); } // Check a batch number is provided if product need it diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index fda21a08084..73ec0a9ea8b 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -94,7 +94,7 @@ if ($action == "correct_stock") if (empty($product_id)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); $action='correction'; } if (! is_numeric($_POST["nbpiece"])) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 1d92a9994b1..775a3ae0bfe 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -99,13 +99,13 @@ if ($action == "correct_stock" && ! $cancel) { if (! (GETPOST("id_entrepot") > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; $action='correction'; } if (! GETPOST("nbpiece")) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action='correction'; } @@ -116,7 +116,7 @@ if ($action == "correct_stock" && ! $cancel) $result=$product->fetch($id); if ($product->hasbatch() && (! GETPOST("sellby")) && (! GETPOST("eatby")) && (! GETPOST("batch_number"))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("atleast1batchfield")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("atleast1batchfield")), null, 'errors'); $error++; $action='correction'; } @@ -186,13 +186,13 @@ if ($action == "transfert_stock" && ! $cancel) { if (! (GETPOST("id_entrepot_source",'int') > 0) || ! (GETPOST("id_entrepot_destination",'int') > 0)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Warehouse")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; $action='transfert'; } if (! GETPOST("nbpiece",'int')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("NumberOfUnit")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NumberOfUnit")), null, 'errors'); $error++; $action='transfert'; } @@ -335,7 +335,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans('Save')) if ($pdluo->id) { if ((! GETPOST("sellby")) && (! GETPOST("eatby")) && (! GETPOST("batch_number"))) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("atleast1batchfield")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("atleast1batchfield")), null, 'errors'); } else { diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 5d499cf766c..e5000d008f2 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -118,12 +118,12 @@ if (empty($reshook)) $error=0; if (empty($_POST["ref"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); $error++; } if (empty($_POST["title"])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $error++; } @@ -205,13 +205,13 @@ if (empty($reshook)) { $error++; //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); } if (empty($_POST["title"])) { $error++; //$_GET["id"]=$_POST["id"]; // On retourne sur la fiche projet - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } $db->begin(); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 3458b34b176..d1b26453de9 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -90,13 +90,13 @@ if ($action == 'createtask' && $user->rights->projet->creer) { if (empty($label)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action='create'; $error++; } else if (empty($_POST['task_parent'])) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ChildOfTask")), null, 'errors'); $action='create'; $error++; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index a146d8805ea..9cbe8c1289f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -71,7 +71,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) if (empty($_POST["label"])) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } if (! $error) { diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 1d2d6d2d1e6..bfa6d8f582a 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -67,12 +67,12 @@ if (GETPOST('ajoutcomment')) if (! GETPOST('comment')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Comment")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } if (! GETPOST('commentuser')) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("User")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } if (! $error) @@ -164,7 +164,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout } else { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name")), null, 'errors'); } } diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 009ffbfec75..4e22175d21e 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -76,7 +76,7 @@ if (empty($reshook)) if (empty($ref)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Ref")), null, 'errors'); } if (! $error) diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 44bafd08406..291f81a6fe8 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -68,12 +68,12 @@ if ($action == 'add') if (empty($contactid)) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors'); $error++; } if ($actionid <= 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors'); $error++; } diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index fd9f6b34217..65e61b458cb 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -104,13 +104,13 @@ if ($action == 'add' && ! $_POST["cancel"]) if (! GETPOST('label')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Label')),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); $action='create'; $error++; } if (! GETPOST('bank')) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('BankName')),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankName")), null, 'errors'); $action='create'; $error++; } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index af181347932..814d61e5be9 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -242,19 +242,19 @@ if (empty($reshook)) if (! GETPOST('name')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdPartyName")), null, 'errors'); $error++; $action='create'; } if (GETPOST('client') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProspectCustomer")), null, 'errors'); $error++; $action='create'; } if (GETPOST('fournisseur') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; $action='create'; }