Clean and update code
This commit is contained in:
parent
ff04cb64c0
commit
efa6ad0659
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user