Update function createTicketMessage
This commit is contained in:
parent
ba2aafaf6f
commit
16ee0a5c96
@ -1724,15 +1724,15 @@ class Ticket extends CommonObject
|
|||||||
* @param array $filename_list List of files to attach (full path of filename on file system)
|
* @param array $filename_list List of files to attach (full path of filename on file system)
|
||||||
* @param array $mimetype_list List of MIME type of attached files
|
* @param array $mimetype_list List of MIME type of attached files
|
||||||
* @param array $mimefilename_list List of attached file name in message
|
* @param array $mimefilename_list List of attached file name in message
|
||||||
|
* @param boolean $send_email Whether the message is sent by email
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array())
|
public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = FALSE)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$send_email = GETPOST('send_email','int');
|
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
if (isset($this->fk_track_id)) {
|
if (isset($this->fk_track_id)) {
|
||||||
@ -1753,7 +1753,7 @@ class Ticket extends CommonObject
|
|||||||
if ($this->private) {
|
if ($this->private) {
|
||||||
$actioncomm->code = 'TICKET_MSG_PRIVATE';
|
$actioncomm->code = 'TICKET_MSG_PRIVATE';
|
||||||
}
|
}
|
||||||
if ($send_email > 0){
|
if ($send_email){
|
||||||
$actioncomm->type_code = 'AC_EMAIL';
|
$actioncomm->type_code = 'AC_EMAIL';
|
||||||
}
|
}
|
||||||
$actioncomm->socid = $this->socid;
|
$actioncomm->socid = $this->socid;
|
||||||
@ -2540,7 +2540,7 @@ class Ticket extends CommonObject
|
|||||||
$listofnames = $resarray['listofnames'];
|
$listofnames = $resarray['listofnames'];
|
||||||
$listofmimes = $resarray['listofmimes'];
|
$listofmimes = $resarray['listofmimes'];
|
||||||
|
|
||||||
$id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames);
|
$id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames, $send_email);
|
||||||
if ($id <= 0) {
|
if ($id <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
$this->error = $object->error;
|
$this->error = $object->error;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user