Debug ticketsup
This commit is contained in:
parent
8acc752195
commit
0358e0f29f
@ -272,7 +272,7 @@ class FormTicketsup
|
||||
dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
|
||||
$classname = ucfirst($subelement);
|
||||
$objectsrc = new $classname($this->db);
|
||||
$objectsrc->fetch(GETPOST('originid'));
|
||||
$objectsrc->fetch(GETPOST('originid','int'));
|
||||
|
||||
if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
|
||||
$objectsrc->fetch_lines();
|
||||
@ -299,9 +299,12 @@ class FormTicketsup
|
||||
print '</td></tr>';
|
||||
|
||||
// Notify thirdparty at creation
|
||||
print '<tr><td><label for="notify_tiers_at_create">' . $langs->trans("TicketNotifyTiersAtCreation") . '</label></td><td>';
|
||||
print '<input type="checkbox" id="notify_tiers_at_create" name="notify_tiers_at_create"'.($this->withnotifytiersatcreate?' checked="checked"':'').'>';
|
||||
print '</td></tr>';
|
||||
if (empty($this->ispublic))
|
||||
{
|
||||
print '<tr><td><label for="notify_tiers_at_create">' . $langs->trans("TicketNotifyTiersAtCreation") . '</label></td><td>';
|
||||
print '<input type="checkbox" id="notify_tiers_at_create" name="notify_tiers_at_create"'.($this->withnotifytiersatcreate?' checked="checked"':'').'>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// TITLE
|
||||
if ($this->withtitletopic) {
|
||||
|
||||
@ -195,7 +195,7 @@ function showlogo()
|
||||
$urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png';
|
||||
}
|
||||
print '<center>';
|
||||
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/ticketsup/public/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
|
||||
print '<a href="' . ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE : dol_buildpath('/public/ticketsup/index.php', 1)) . '"><img alt="Logo" id="logosubscribe" title="" src="' . $urllogo . '" style="max-width: 440px" /></a><br>';
|
||||
print '<strong>' . ($conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . '</strong>';
|
||||
print '</center><br>';
|
||||
}
|
||||
|
||||
@ -182,62 +182,66 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
|
||||
// Send email to notification email
|
||||
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && $sendto)
|
||||
{
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']))
|
||||
{
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
|
||||
/* Send email to admin */
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n";
|
||||
$message_admin.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message_admin.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
if ($sendto)
|
||||
{
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
$filename = array();
|
||||
$mimetype = array();
|
||||
|
||||
/* Send email to admin */
|
||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n";
|
||||
$message_admin.='<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Type').' : '.$object->type_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Category').' : '.$object->category_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('Severity').' : '.$object->severity_label.'</li>';
|
||||
$message_admin.='<li>'.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'</li>';
|
||||
// Extrafields
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
foreach ($object->array_options as $key => $value) {
|
||||
$message_admin.='<li>'.$langs->trans($key).' : '.$value.'</li>';
|
||||
}
|
||||
}
|
||||
$message_admin.='</ul>';
|
||||
|
||||
if ($object->fk_soc > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$message_admin.='<p>'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'</p>';
|
||||
}
|
||||
|
||||
$message_admin.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message_admin.='<p><a href="'.dol_buildpath('/ticketsup/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
}
|
||||
$message_admin.='</ul>';
|
||||
|
||||
if ($object->fk_soc > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$message_admin.='<p>'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'</p>';
|
||||
}
|
||||
|
||||
$message_admin.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message_admin.='<p><a href="'.dol_buildpath('/ticketsup/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
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) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
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) {
|
||||
dol_syslog($mailfile->error, LOG_DEBUG);
|
||||
} else {
|
||||
$result=$mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send email to customer
|
||||
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableemailtothirdparty']) && $object->notify_tiers_at_create)
|
||||
if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']) && $object->notify_tiers_at_create)
|
||||
{
|
||||
$sendto = '';
|
||||
if (empty($user->socid) && empty($user->email)) {
|
||||
@ -283,7 +287,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
|
||||
$message_customer.='</ul>';
|
||||
$message_customer.='<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/public/ticketsup/view.php', 2)).'?track_id='.$object->track_id;
|
||||
$message_customer.='<p>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
||||
$message_customer.='<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
||||
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Display public form to add new ticket
|
||||
*
|
||||
* \ingroup ticketsup
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Display public form to add new ticket
|
||||
*/
|
||||
if (!defined('NOREQUIREUSER')) {
|
||||
define('NOREQUIREUSER', '1');
|
||||
@ -130,11 +130,11 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!GETPOST("subject")) {
|
||||
if (!GETPOST("subject","none")) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject")));
|
||||
$action = '';
|
||||
} elseif (!GETPOST("message")) {
|
||||
} elseif (!GETPOST("message","none")) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("message")));
|
||||
$action = '';
|
||||
@ -152,13 +152,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
|
||||
$object->track_id = generate_random_id(16);
|
||||
|
||||
$object->subject = GETPOST("subject");
|
||||
$object->message = GETPOST("message");
|
||||
$object->subject = GETPOST("subject","none");
|
||||
$object->message = GETPOST("message","none");
|
||||
$object->origin_email = $origin_email;
|
||||
|
||||
$object->type_code = GETPOST("type_code");
|
||||
$object->category_code = GETPOST("category_code");
|
||||
$object->severity_code = GETPOST("severity_code");
|
||||
$object->type_code = GETPOST("type_code", 'az09');
|
||||
$object->category_code = GETPOST("category_code", 'az09');
|
||||
$object->severity_code = GETPOST("severity_code", 'az09');
|
||||
if (is_array($searched_companies)) {
|
||||
$object->fk_soc = $searched_companies[0]->id;
|
||||
}
|
||||
@ -176,7 +176,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$user = new User($db);
|
||||
}
|
||||
|
||||
$object->context['disableemailtothirdparty']=1; // Disable email sent by ticketsup trigger when creation is done from this page
|
||||
$object->context['disableticketsupemail']=1; // Disable emails sent by ticketsup trigger when creation is done from this page, emails are already sent later
|
||||
|
||||
$id = $object->create($user);
|
||||
if ($id <= 0) {
|
||||
@ -190,9 +190,20 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
if ($usertoassign > 0) {
|
||||
$object->add_contact($usertoassign, "SUPPORTCLI", 'external', $notrigger = 0);
|
||||
}
|
||||
}
|
||||
|
||||
$object->db->commit();
|
||||
if (! $error)
|
||||
{
|
||||
$object->db->commit();
|
||||
$action = "infos_success";
|
||||
} else {
|
||||
$object->db->rollback();
|
||||
setEventMessage($object->errors, 'errors');
|
||||
$action = 'create_ticket';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$res = $object->fetch($id);
|
||||
if ($res) {
|
||||
// Create form object
|
||||
@ -211,18 +222,19 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
// Send email to customer
|
||||
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubject');
|
||||
$message .= ($conf->global->TICKETS_MESSAGE_MAIL_NEW ? $conf->global->TICKETS_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')) . "\n\n";
|
||||
$message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket') . "\n";
|
||||
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '<a href="' . $url_public_ticket . '">' . $object->track_id . '</a>') . "\n";
|
||||
$infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl') . "\n\n";
|
||||
|
||||
$message .= dol_nl2br($infos_new_ticket);
|
||||
$message .= $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE : $langs->transnoentities('TicketMessageMailSignatureText');
|
||||
|
||||
$sendto = GETPOST('email');
|
||||
$sendto = GETPOST('email','alpha');
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
@ -244,79 +256,80 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
|
||||
/* Send email to admin */
|
||||
|
||||
// Send email to TICKETS_NOTIFICATION_EMAIL_TO
|
||||
|
||||
$sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO;
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n";
|
||||
$message_admin .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('From') . ' : ' . $object->origin_email . '</li>';
|
||||
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']))
|
||||
if ($sendto)
|
||||
{
|
||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
$subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin');
|
||||
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n";
|
||||
$message_admin .= '<ul><li>' . $langs->trans('Title') . ' : ' . $object->subject . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Type') . ' : ' . $object->type_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Category') . ' : ' . $object->category_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('Severity') . ' : ' . $object->severity_label . '</li>';
|
||||
$message_admin .= '<li>' . $langs->trans('From') . ' : ' . $object->origin_email . '</li>';
|
||||
|
||||
$qualified=true;
|
||||
if (empty($enabled) || $enabled == 2) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
if ($qualified) $message_admin .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
}
|
||||
}
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']))
|
||||
{
|
||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
|
||||
{
|
||||
$enabled = 1;
|
||||
if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key]))
|
||||
{
|
||||
$enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
$perms = 1;
|
||||
if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key]))
|
||||
{
|
||||
$perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1);
|
||||
}
|
||||
|
||||
$message_admin .= '</ul>';
|
||||
$message_admin .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message_admin .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
$qualified=true;
|
||||
if (empty($enabled) || $enabled == 2) $qualified = false;
|
||||
if (empty($perms)) $qualified = false;
|
||||
if ($qualified) $message_admin .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
$message_admin .= '</ul>';
|
||||
$message_admin .= '<p>' . $langs->trans('Message') . ' : <br>' . $object->message . '</p>';
|
||||
$message_admin .= '<p><a href="' . dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $object->track_id . '">' . $langs->trans('SeeThisTicketIntomanagementInterface') . '</a></p>';
|
||||
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>';
|
||||
$replyto = $from;
|
||||
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
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 {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
$message_admin = dol_nl2br($message_admin);
|
||||
|
||||
// Copy files into ticket directory
|
||||
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
|
||||
if (!dol_is_dir($destdir)) {
|
||||
dol_mkdir($destdir);
|
||||
}
|
||||
foreach ($filename as $i => $val) {
|
||||
dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1);
|
||||
$formmail->remove_attached_files($i);
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
||||
}
|
||||
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 {
|
||||
$result = $mailfile->sendfile();
|
||||
}
|
||||
if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) {
|
||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy files into ticket directory
|
||||
$destdir = $conf->ticketsup->dir_output . '/' . $object->track_id;
|
||||
if (! dol_is_dir($destdir)) {
|
||||
dol_mkdir($destdir);
|
||||
}
|
||||
foreach ($filename as $i => $val) {
|
||||
dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1);
|
||||
$formmail->remove_attached_files($i);
|
||||
}
|
||||
|
||||
setEventMessage($langs->trans('YourTicketSuccessfullySaved'));
|
||||
$action = "infos_success";
|
||||
} else {
|
||||
$object->db->rollback();
|
||||
setEventMessage($object->errors, 'errors');
|
||||
$action = 'create_ticket';
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
* \file htdocs/public/ticketsup/list.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
@ -155,7 +155,7 @@ if ($action == "view_ticketlist") {
|
||||
$search_fk_user_assign = GETPOST("search_fk_user_assign", 'int');
|
||||
|
||||
// Store current page url
|
||||
$url_page_current = dol_buildpath('/ticketsup/public/list.php', 1);
|
||||
$url_page_current = dol_buildpath('/public/ticketsup/list.php', 1);
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x")) {
|
||||
@ -635,7 +635,7 @@ if ($action == "view_ticketlist") {
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/ticketsup/public/view.php', 1) . '" style="display:none;">';
|
||||
print '<form method="post" id="form_view_ticket" name="form_view_ticket" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/view.php', 1) . '" style="display:none;">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="view_ticket">';
|
||||
print '<input type="hidden" name="btn_view_ticket_list" value="1">';
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file ticketsup/public/index.php
|
||||
* \file htdocs/public/ticketsup/index.php
|
||||
* \ingroup ticketsup
|
||||
* \brief Public file to add and manage ticket
|
||||
*/
|
||||
@ -253,7 +253,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
|
||||
$formticket->withfile = 2;
|
||||
$formticket->showMessageForm('100%');
|
||||
} else {
|
||||
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/ticketsup/public/list.php', 1) . '">';
|
||||
print '<form method="post" id="form_view_ticket_list" name="form_view_ticket_list" enctype="multipart/form-data" action="' . dol_buildpath('/public/ticketsup/list.php', 1) . '">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="view_ticketlist">';
|
||||
print '<input type="hidden" name="track_id" value="'.$object->dao->track_id.'">';
|
||||
|
||||
@ -759,7 +759,7 @@ class ActionsTicketsup
|
||||
$url_public_ticket = (!empty($conf->global->TICKETS_ENABLE_PUBLIC_INTERFACE) ?
|
||||
(!empty($conf->global->TICKETS_URL_PUBLIC_INTERFACE) ?
|
||||
$conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' :
|
||||
dol_buildpath('/ticketsup/public/view.php', 2)
|
||||
dol_buildpath('/public/ticketsup/view.php', 2)
|
||||
) :
|
||||
dol_buildpath('/ticketsup/card.php', 2)
|
||||
) . '?track_id=' . $object->track_id;
|
||||
@ -928,7 +928,7 @@ class ActionsTicketsup
|
||||
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . "\n" : '');
|
||||
}
|
||||
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id;
|
||||
$message .= "\n\n" . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . $url_public_ticket . "\n";
|
||||
|
||||
// Add signature
|
||||
|
||||
@ -1588,7 +1588,7 @@ class Ticketsup extends CommonObject
|
||||
$url_internal_ticket = dol_buildpath('/ticketsup/card.php', 2) . '?track_id=' . $this->track_id;
|
||||
$message .= "\n" . $langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : ' . '<a href="' . $url_internal_ticket . '">' . $this->track_id . '</a>' . "\n";
|
||||
} else {
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $this->track_id;
|
||||
$url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $this->track_id;
|
||||
$message .= "\n" . $langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : ' . '<a href="' . $url_public_ticket . '">' . $this->track_id . '</a>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user