Clean and update code
This commit is contained in:
parent
efa6ad0659
commit
4eacad52f2
@ -121,8 +121,9 @@ if ($action == "view_ticketlist") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) {
|
if ($error || $errors)
|
||||||
setEventMessage($object->errors, 'errors');
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,8 +112,9 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) {
|
if ($error || $errors)
|
||||||
setEventMessage($object->errors, 'errors');
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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)
|
if ($action == 'addcontact' && $user->rights->resource->write)
|
||||||
@ -72,17 +72,17 @@ if ($action == 'addcontact' && $user->rights->resource->write)
|
|||||||
$mesg = $object->error;
|
$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)
|
else if ($action == 'swapstatut' && $user->rights->resource->write)
|
||||||
{
|
{
|
||||||
$result=$object->swapContactStatus(GETPOST('ligne','int'));
|
$result=$object->swapContactStatus(GETPOST('ligne','int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Efface un contact
|
// Erase a contact
|
||||||
else if ($action == 'deletecontact' && $user->rights->resource->write)
|
else if ($action == 'deletecontact' && $user->rights->resource->write)
|
||||||
{
|
{
|
||||||
$result = $object->delete_contact(GETPOST('lineid','int'));
|
$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';
|
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);
|
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
|
||||||
if ($mailfile->error) {
|
if ($mailfile->error || $mailfile->errors)
|
||||||
setEventMessage($mailfile->error, 'errors');
|
{
|
||||||
} else {
|
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$result = $mailfile->sendfile();
|
$result = $mailfile->sendfile();
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$nb_sent++;
|
$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;
|
return $nb_sent;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user