|
@@ -272,7 +272,7 @@ class Ticket extends CommonObject
|
|
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
|
|
* 'label' the translation key.
|
|
|
* 'picto' is code of a picto to show before value in forms
|
|
|
- * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
|
|
+ * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString('MY_SETUP_PARAM'))
|
|
|
* 'position' is the sort order of field.
|
|
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
|
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
|
@@ -542,7 +542,7 @@ class Ticket extends CommonObject
|
|
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."ticket");
|
|
|
}
|
|
|
|
|
|
- if (!$error && !empty($conf->global->TICKET_ADD_AUTHOR_AS_CONTACT)) {
|
|
|
+ if (!$error && getDolGlobalString('TICKET_ADD_AUTHOR_AS_CONTACT')) {
|
|
|
// add creator as contributor
|
|
|
if ($this->add_contact($user->id, 'CONTRIBUTOR', 'internal') < 0) {
|
|
|
$error++;
|
|
@@ -1530,7 +1530,7 @@ class Ticket extends CommonObject
|
|
|
|
|
|
$linkclose = '';
|
|
|
if (empty($notooltip)) {
|
|
|
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
|
|
+ if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
|
|
$label = $langs->trans("ShowTicket");
|
|
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
|
|
}
|
|
@@ -1825,7 +1825,7 @@ class Ticket extends CommonObject
|
|
|
$error = 0;
|
|
|
|
|
|
// Valid and close fichinter linked
|
|
|
- if (isModEnabled('ficheinter') && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
|
|
|
+ if (isModEnabled('ficheinter') && getDolGlobalString('WORKFLOW_TICKET_CLOSE_INTERVENTION')) {
|
|
|
dol_syslog("We have closed the ticket, so we close all linked interventions");
|
|
|
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
|
|
|
if ($this->linkedObjectsIds) {
|
|
@@ -2285,7 +2285,7 @@ class Ticket extends CommonObject
|
|
|
global $conf;
|
|
|
|
|
|
$defaultref = '';
|
|
|
- $modele = empty($conf->global->TICKET_ADDON) ? 'mod_ticket_simple' : $conf->global->TICKET_ADDON;
|
|
|
+ $modele = getDolGlobalString('TICKET_ADDON', 'mod_ticket_simple');
|
|
|
|
|
|
// Search template files
|
|
|
$file = '';
|
|
@@ -2547,7 +2547,7 @@ class Ticket extends CommonObject
|
|
|
*
|
|
|
* Send emails to assigned users (public area notification)
|
|
|
*/
|
|
|
- if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED)) {
|
|
|
+ if (getDolGlobalString('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED')) {
|
|
|
// Retrieve internal contact datas
|
|
|
$internal_contacts = $object->getInfosTicketInternalContact(1);
|
|
|
|
|
@@ -2580,22 +2580,22 @@ class Ticket extends CommonObject
|
|
|
}
|
|
|
|
|
|
if (empty($sendto)) {
|
|
|
- if (!empty($conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL)) {
|
|
|
- $sendto[$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL] = $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL;
|
|
|
- } elseif (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) {
|
|
|
- $sendto[$conf->global->TICKET_NOTIFICATION_EMAIL_TO] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
|
|
+ if (getDolGlobalString('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL')) {
|
|
|
+ $sendto[getDolGlobalString('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL')] = getDolGlobalString('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL');
|
|
|
+ } elseif (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) {
|
|
|
+ $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Add global email address recipient
|
|
|
- if (!empty($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS) &&
|
|
|
- !empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && !array_key_exists($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)
|
|
|
+ if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') &&
|
|
|
+ getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)
|
|
|
) {
|
|
|
- $sendto[$conf->global->TICKET_NOTIFICATION_EMAIL_TO] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
|
|
+ $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
|
|
|
}
|
|
|
|
|
|
if (!empty($sendto)) {
|
|
|
- $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
|
|
|
+ $label_title = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
|
|
|
$subject = '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
|
|
|
|
|
|
// Message send
|
|
@@ -2644,7 +2644,7 @@ class Ticket extends CommonObject
|
|
|
$sendto = array();
|
|
|
if (is_array($internal_contacts) && count($internal_contacts) > 0) {
|
|
|
// Set default subject
|
|
|
- $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
|
|
|
+ $label_title = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
|
|
|
$appli = $label_title;
|
|
|
$subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
|
|
|
|
|
@@ -2691,9 +2691,9 @@ class Ticket extends CommonObject
|
|
|
$message .= '<br>'.$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : <a href="'.$url_internal_ticket.'">'.$object->track_id.'</a><br>';
|
|
|
|
|
|
// Add global email address recipient
|
|
|
- if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !array_key_exists($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
|
|
- if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) {
|
|
|
- $sendto[$conf->global->TICKET_NOTIFICATION_EMAIL_TO] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
|
|
+ if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) {
|
|
|
+ if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) {
|
|
|
+ $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2725,7 +2725,7 @@ class Ticket extends CommonObject
|
|
|
$sendto = array();
|
|
|
if (is_array($external_contacts) && count($external_contacts) > 0) {
|
|
|
// Get default subject for email to external contacts
|
|
|
- $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE;
|
|
|
+ $label_title = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name);
|
|
|
$appli = $mysoc->name;
|
|
|
$subject = GETPOST('subject') ? GETPOST('subject') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage');
|
|
|
|
|
@@ -2763,8 +2763,7 @@ class Ticket extends CommonObject
|
|
|
}
|
|
|
|
|
|
// If public interface is not enable, use link to internal page into mail
|
|
|
- $url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ?
|
|
|
- (!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id;
|
|
|
+ $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/view.php', 2)) . '/view.php?track_id='.$object->track_id;
|
|
|
$message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>';
|
|
|
|
|
|
// Build final message
|
|
@@ -2786,9 +2785,9 @@ class Ticket extends CommonObject
|
|
|
}
|
|
|
|
|
|
// Add global email address recipient
|
|
|
- if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !array_key_exists($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
|
|
|
- if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO)) {
|
|
|
- $sendto[$conf->global->TICKET_NOTIFICATION_EMAIL_TO] = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
|
|
+ if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) {
|
|
|
+ if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) {
|
|
|
+ $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO');
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2830,7 +2829,7 @@ class Ticket extends CommonObject
|
|
|
*
|
|
|
* @param string $subject Email subject
|
|
|
* @param string $message Email message
|
|
|
- * @param int $send_internal_cc Receive a copy on internal email ($conf->global->TICKET_NOTIFICATION_EMAIL_FROM)
|
|
|
+ * @param int $send_internal_cc Receive a copy on internal email (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM')
|
|
|
* @param array $array_receiver Array of receiver. exemple array('name' => 'John Doe', 'email' => 'john@doe.com', etc...)
|
|
|
* @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
|
|
@@ -2841,7 +2840,7 @@ class Ticket extends CommonObject
|
|
|
{
|
|
|
global $conf, $langs;
|
|
|
|
|
|
- if ($conf->global->TICKET_DISABLE_ALL_MAILS) {
|
|
|
+ if (getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) {
|
|
|
dol_syslog(get_class($this).'::sendTicketMessageByEmail: Emails are disable into ticket setup by option TICKET_DISABLE_ALL_MAILS', LOG_WARNING);
|
|
|
return false;
|
|
|
}
|
|
@@ -2857,11 +2856,12 @@ class Ticket extends CommonObject
|
|
|
$array_receiver = array_merge($array_receiver, $this->getInfosTicketExternalContact(1));
|
|
|
}
|
|
|
|
|
|
+ $sendtocc = "";
|
|
|
if ($send_internal_cc) {
|
|
|
- $sendtocc = $conf->global->TICKET_NOTIFICATION_EMAIL_FROM;
|
|
|
+ $sendtocc = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
|
|
|
}
|
|
|
|
|
|
- $from = $conf->global->TICKET_NOTIFICATION_EMAIL_FROM;
|
|
|
+ $from = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM');
|
|
|
$is_sent = false;
|
|
|
if (is_array($array_receiver) && count($array_receiver) > 0) {
|
|
|
foreach ($array_receiver as $key => $receiver) {
|
|
@@ -2874,7 +2874,7 @@ class Ticket extends CommonObject
|
|
|
|
|
|
$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
|
|
|
|
|
|
- if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
|
|
+ if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
|
|
$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
|
|
|
}
|
|
|
|
|
@@ -2909,7 +2909,7 @@ class Ticket extends CommonObject
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
|
|
|
+ if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
|
|
|
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
|
|
}
|
|
|
}
|