Merge pull request #9159 from grandoc/new_branch_25_07_2018
Clean and update code
This commit is contained in:
commit
fcd9d49b16
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('banks', 'categories', 'compta', 'bills'));
|
||||
$langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other'));
|
||||
if (! empty($conf->adherent->enabled)) $langs->load("members");
|
||||
if (! empty($conf->don->enabled)) $langs->load("donations");
|
||||
if (! empty($conf->loan->enabled)) $langs->load("loan");
|
||||
|
||||
@ -703,7 +703,7 @@ if ($massaction == 'confirm_createbills')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
|
||||
setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
|
||||
|
||||
// Make a redirect to avoid to bill twice if we make a refresh or back
|
||||
$param='';
|
||||
|
||||
@ -1201,7 +1201,7 @@ function activateModulesRequiredByCountry($country_code)
|
||||
{
|
||||
activateModule($modName);
|
||||
|
||||
setEventMessage($objMod->automatic_activation[$country_code],'warnings');
|
||||
setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -152,9 +152,12 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
if ($mailfile->error)
|
||||
{
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
|
||||
@ -276,7 +276,7 @@ if (empty($reshook))
|
||||
// We try to set an amount
|
||||
// Case we dont use the list of available qty for each warehouse/lot
|
||||
// GUI does not allow this yet
|
||||
setEventMessage('StockIsRequiredToChooseWhichLotToUse', 'errors');
|
||||
setEventMessages($langs->trans("StockIsRequiredToChooseWhichLotToUse"), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Ion Agorria <ion@agorria.com>
|
||||
@ -350,8 +350,10 @@ if (empty($reshook))
|
||||
|
||||
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
|
||||
$idprod = $res->fk_product_child;
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ if (empty($reshook))
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
|
||||
setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1160,8 +1160,10 @@ if (empty($reshook))
|
||||
|
||||
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
|
||||
$idprod = $res->fk_product_child;
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,13 +180,13 @@ if ($action == 'specimen') // For products
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($obj->error,'errors');
|
||||
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -689,7 +689,7 @@ if (empty($reshook))
|
||||
if (($result = $propal->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
|
||||
{
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -732,7 +732,7 @@ if (empty($reshook))
|
||||
if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
|
||||
{
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -775,7 +775,7 @@ if (empty($reshook))
|
||||
if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent'), $object->id)) < 0)
|
||||
{
|
||||
dol_syslog($langs->trans('FailedToGetCostPrice'));
|
||||
setEventMessage($langs->trans('FailedToGetCostPrice'), 'errors');
|
||||
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2014-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
@ -46,7 +46,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'bills', 'companies'));
|
||||
$langs->loadLangs(array('products', 'bills', 'companies', 'other'));
|
||||
|
||||
$mesg=''; $error=0; $errors=array();
|
||||
|
||||
@ -464,8 +464,10 @@ if (empty($reshook))
|
||||
$sql .= " WHERE rowid = " . $rowid;
|
||||
|
||||
$result = $db->query($sql);
|
||||
} else {
|
||||
setEventMessage('delete_price_by_qty Missing Ids','errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,8 +479,10 @@ if (empty($reshook))
|
||||
$sql .= " WHERE fk_product_price = " . $priceid;
|
||||
|
||||
$result = $db->query($sql);
|
||||
} else {
|
||||
setEventMessage('delete_all_price_by_qty Missing Ids','errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
|
||||
// Update
|
||||
$pse->seuil_stock_alerte = $seuil_stock_alerte;
|
||||
$pse->desiredstock = $desiredstock;
|
||||
if($pse->update($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseUpdated'));
|
||||
if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs');
|
||||
|
||||
} else {
|
||||
|
||||
@ -144,7 +144,7 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)
|
||||
$pse->fk_product = $id;
|
||||
$pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte');
|
||||
$pse->desiredstock = GETPOST('desiredstock');
|
||||
if($pse->create($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseCreated'));
|
||||
if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs');
|
||||
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c
|
||||
|
||||
$pse = new ProductStockEntrepot($db);
|
||||
$pse->fetch(GETPOST('fk_productstockwarehouse'));
|
||||
if($pse->delete($user) > 0) setEventMessage($langs->trans('ProductStockWarehouseDeleted'));
|
||||
if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs');
|
||||
|
||||
$action = '';
|
||||
|
||||
@ -176,7 +176,7 @@ if ($action == 'setseuil_stock_alerte' && !empty($user->rights->produit->creer))
|
||||
if ($result < 0)
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
//else
|
||||
// setEventMessage($lans->trans("SavedRecordSuccessfully"));
|
||||
// setEventMessages($lans->trans("SavedRecordSuccessfully"), null, 'mesgs');
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$action = "infos_success";
|
||||
} else {
|
||||
$object->db->rollback();
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create_ticket';
|
||||
}
|
||||
|
||||
@ -226,9 +226,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
if ($mailfile->error || $mailfile->errors)
|
||||
{
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
@ -287,9 +290,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
if ($mailfile->error || $mailfile->errors)
|
||||
{
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
@ -308,10 +314,12 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$formmail->remove_attached_files($i);
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans('YourTicketSuccessfullySaved'));
|
||||
setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -121,8 +121,9 @@ if ($action == "view_ticketlist") {
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
if ($error || $errors)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,8 +112,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
if ($error || $errors)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
|
||||
* Copyright (C) 2016 Gilles Poirier <glgpoirier@gmail.com>
|
||||
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -47,7 +47,7 @@ $result = $object->fetch($id,$ref);
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'un nouveau contact
|
||||
* Add a new contact
|
||||
*/
|
||||
|
||||
if ($action == 'addcontact' && $user->rights->resource->write)
|
||||
@ -72,17 +72,17 @@ if ($action == 'addcontact' && $user->rights->resource->write)
|
||||
$mesg = $object->error;
|
||||
}
|
||||
|
||||
setEventMessage($mesg, 'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// bascule du statut d'un contact
|
||||
// Toggle the status of a contact
|
||||
else if ($action == 'swapstatut' && $user->rights->resource->write)
|
||||
{
|
||||
$result=$object->swapContactStatus(GETPOST('ligne','int'));
|
||||
}
|
||||
|
||||
// Efface un contact
|
||||
// Erase a contact
|
||||
else if ($action == 'deletecontact' && $user->rights->resource->write)
|
||||
{
|
||||
$result = $object->delete_contact(GETPOST('lineid','int'));
|
||||
|
||||
@ -1614,9 +1614,12 @@ class Ticket extends CommonObject
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
|
||||
if ($mailfile->error) {
|
||||
setEventMessage($mailfile->error, 'errors');
|
||||
} else {
|
||||
if ($mailfile->error || $mailfile->errors)
|
||||
{
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result > 0) {
|
||||
$nb_sent++;
|
||||
@ -1627,7 +1630,7 @@ class Ticket extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans('TicketNotificationNumberEmailSent', $nb_sent));
|
||||
setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs');
|
||||
}
|
||||
|
||||
return $nb_sent;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Abbes Bahfir <contact@dolibarrpar.com>
|
||||
*
|
||||
@ -67,7 +67,7 @@ if ($action == 'add')
|
||||
|
||||
if ($actionid <= 0)
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@ -31,15 +31,15 @@ if ($_POST) {
|
||||
$value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD');
|
||||
|
||||
if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
}
|
||||
|
||||
if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -50,9 +50,9 @@ if ($_POST) {
|
||||
$object->label = $label;
|
||||
|
||||
if ($object->update($user) < 1) {
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
} else {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.dol_buildpath('/variants/card.php?id='.$id, 2));
|
||||
exit();
|
||||
}
|
||||
@ -77,9 +77,9 @@ if ($_POST) {
|
||||
if (! $error)
|
||||
{
|
||||
if ($objectval->update($user) > 0) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,11 +99,11 @@ if ($confirm == 'yes') {
|
||||
|
||||
if ($res < 1 || ($object->delete() < 1)) {
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.dol_buildpath('/variants/list.php', 2));
|
||||
}
|
||||
exit();
|
||||
@ -113,9 +113,9 @@ if ($confirm == 'yes') {
|
||||
if ($objectval->fetch($valueid) > 0) {
|
||||
|
||||
if ($objectval->delete() < 1) {
|
||||
setEventMessage($langs->trans('CoreErrorMessage'), 'errors');
|
||||
setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors');
|
||||
} else {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
}
|
||||
|
||||
header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2));
|
||||
|
||||
@ -104,7 +104,7 @@ if ($_POST) {
|
||||
$features = $_SESSION['addvariant_'.$object->id];
|
||||
|
||||
if (!$features) {
|
||||
setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -147,7 +147,7 @@ if ($_POST) {
|
||||
$result = $prodcomb->createProductCombination($object, $sanit_features, array(), $price_impact_percent, $price_impact, $weight_impact);
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
unset($_SESSION['addvariant_'.$object->id]);
|
||||
|
||||
$db->commit();
|
||||
@ -214,7 +214,7 @@ if ($_POST) {
|
||||
|
||||
} else {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
}
|
||||
|
||||
}
|
||||
@ -230,7 +230,7 @@ if ($_POST) {
|
||||
$prodcomb->variation_weight = $weight_impact;
|
||||
|
||||
if ($prodcomb->update($user) > 0) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2));
|
||||
exit();
|
||||
} else {
|
||||
@ -250,13 +250,13 @@ if ($action === 'confirm_deletecombination') {
|
||||
|
||||
if ($prodcomb->delete($user) > 0 && $prodstatic->fetch($prodcomb->fk_product_child) > 0 && $prodstatic->delete($user) > 0) {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$object->id, 2));
|
||||
exit();
|
||||
}
|
||||
|
||||
$db->rollback();
|
||||
setEventMessage($langs->trans('ProductCombinationAlreadyUsed'), 'errors');
|
||||
setEventMessages($langs->trans('ProductCombinationAlreadyUsed'), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
} elseif ($action === 'edit') {
|
||||
@ -284,12 +284,12 @@ if ($action === 'confirm_deletecombination') {
|
||||
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$prodstatic->id, 2));
|
||||
exit();
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorCopyProductCombinations'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorDestinationProductNotFound'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
if ($_POST) {
|
||||
if (empty($ref) || empty($label)) {
|
||||
setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
|
||||
} else {
|
||||
|
||||
$prodattr = new ProductAttribute($db);
|
||||
@ -38,7 +38,7 @@ if ($_POST) {
|
||||
|
||||
$resid = $prodattr->create($user);
|
||||
if ($resid > 0) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
if ($backtopage)
|
||||
{
|
||||
header('Location: '.$backtopage);
|
||||
|
||||
@ -58,7 +58,7 @@ if ($cancel)
|
||||
if ($action == 'add')
|
||||
{
|
||||
if (empty($ref) || empty($value)) {
|
||||
setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
|
||||
} else {
|
||||
|
||||
$objectval->fk_product_attribute = $object->id;
|
||||
@ -66,11 +66,11 @@ if ($action == 'add')
|
||||
$objectval->value = $value;
|
||||
|
||||
if ($objectval->create($user) > 0) {
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$object->id);
|
||||
exit();
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorCreatingProductAttributeValue'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorCreatingProductAttributeValue'), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,18 +115,18 @@ if ($_POST) {
|
||||
|
||||
if ($res > 0) {
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans('RecordSaved'));
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header('Location: '.dol_buildpath('/variants/combinations.php?id='.$id, 2));
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorDeletingGeneratedProducts'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorDeletingGeneratedProducts'), null, 'errors');
|
||||
}
|
||||
|
||||
$db->rollback();
|
||||
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorFieldsRequired'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user