mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
[Qual] Uniformize code
This commit is contained in:
parent
3760f247a2
commit
975fe064ae
|
|
@ -92,7 +92,7 @@ if ($action == 'initbarcodeproducts')
|
|||
if (! is_object($modBarCodeProduct))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($langs->trans("NoBarcodeNumberingTemplateDefined"),'errors');
|
||||
setEventMessages($langs->trans("NoBarcodeNumberingTemplateDefined"), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
|
@ -109,7 +109,7 @@ if ($action == 'initbarcodeproducts')
|
|||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
setEventMessage($langs->trans("AllBarcodeReset"),'mesgs');
|
||||
setEventMessages($langs->trans("AllBarcodeReset"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -160,7 +160,7 @@ if ($action == 'initbarcodeproducts')
|
|||
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("RecordsModified",$nbok),'mesgs');
|
||||
setEventMessages($langs->trans("RecordsModified",$nbok), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ if (GETPOST('submitproduct') && GETPOST('submitproduct'))
|
|||
|
||||
if (empty($forbarcode) || empty($fk_barcode_type))
|
||||
{
|
||||
setEventMessage($langs->trans("DefinitionOfBarCodeForProductNotComplete",$producttmp->getNomUrl()), 'warnings');
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete",$producttmp->getNomUrl()), null, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty'))
|
|||
|
||||
if (empty($forbarcode) || empty($fk_barcode_type))
|
||||
{
|
||||
setEventMessage($langs->trans("DefinitionOfBarCodeForProductNotComplete",$thirdpartytmp->getNomUrl()), 'warnings');
|
||||
setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete",$thirdpartytmp->getNomUrl()), null, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ if ($action == 'builddoc')
|
|||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage('Failed to get bar code type information '.$stdobject->error, 'errors');
|
||||
setEventMessages('Failed to get bar code type information '.$stdobject->error, $stdobject->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -158,13 +158,13 @@ if ($action == 'builddoc')
|
|||
if ($result <= 0 || ! dol_is_file($barcodeimage))
|
||||
{
|
||||
$error++;
|
||||
setEventMessage('Failed to generate image file of barcode for code='.$code.' encoding='.$encoding.' file='.basename($barcodeimage), 'errors');
|
||||
setEventMessages('Failed to generate image file of barcode for code='.$code.' encoding='.$encoding.' file='.basename($barcodeimage), null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
setEventMessage("Error, encoding ".$encoding." is not supported by encoder ".$generator.'. You must choose another barcode type or install a barcode generation engine that support '.$encoding, 'errors');
|
||||
setEventMessages("Error, encoding ".$encoding." is not supported by encoder ".$generator.'. You must choose another barcode type or install a barcode generation engine that support '.$encoding, null, 'errors');
|
||||
}
|
||||
} else {
|
||||
$template = 'tcpdflabel';
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ if ($action == 'setvalue')
|
|||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,12 +78,12 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||
|
||||
if (! $title) {
|
||||
$error++;
|
||||
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("BookmarkTitle")), 'errors');
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("BookmarkTitle")), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $url) {
|
||||
$error++;
|
||||
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("UrlOrLink")), 'errors');
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("UrlOrLink")), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
|
@ -104,11 +104,11 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||
if ($bookmark->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->transnoentities("WarningBookmarkAlreadyExists"), 'warnings');
|
||||
setEventMessages($langs->transnoentities("WarningBookmarkAlreadyExists"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($bookmark->error, 'errors');
|
||||
setEventMessages($bookmark->error, $bookmark->errors, 'errors');
|
||||
}
|
||||
$action = $invertedaction;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ if ($_GET["action"] == 'delete')
|
|||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($bookmark->error, 'errors');
|
||||
setEventMessages($bookmark->error, $bookmark->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user