From 940b946dfb4e38675a667cebdaaa071988e9696a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jul 2024 13:19:35 +0200 Subject: [PATCH] Debug v20 --- htdocs/admin/emailcollector_list.php | 2 +- .../class/emailcollector.class.php | 16 ++++++++------ htdocs/langs/en_US/mails.lang | 2 +- htdocs/ticket/card.php | 15 +++++++------ htdocs/ticket/class/actions_ticket.class.php | 22 +++++++++---------- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 351a4fbbf18..be297d9423d 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -722,7 +722,7 @@ if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER", $arrval, $conf->global->TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND); + print $form->selectarray("MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER", $arrval, getDolGlobalString('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND')); } print ''; print ''; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 03f1c319454..ba322abf602 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2356,7 +2356,9 @@ class EmailCollector extends CommonObject $description = $descriptiontitle = $descriptionmeta = $descriptionfull = ''; - $descriptiontitle = $langs->trans("RecordCreatedByEmailCollector", $this->ref, $msgid); + $descriptiontitle = $langs->transnoentitiesnoconv("RecordCreatedByEmailCollector", $this->ref); + + $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("EmailMsgID").' : '.dol_escape_htmltag($msgid)); $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailTopic").' : '.dol_escape_htmltag($subject)); $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailDate").($langs->trans("MailDate") != 'Date' ? ' (Date)' : '').' : '.dol_escape_htmltag(dol_print_date($date, "dayhourtext"))); $descriptionmeta = dol_concatdesc($descriptionmeta, $langs->trans("MailFrom").($langs->trans("MailFrom") != 'From' ? ' (From)' : '').' : '.dol_escape_htmltag($fromstring)); @@ -2747,7 +2749,7 @@ class EmailCollector extends CommonObject } $description = $descriptiontitle; - $description = dol_concatdesc($description, "-----"); + $description = dol_concatdesc($description, $descriptionmeta); $description = dol_concatdesc($description, "-----"); $description = dol_concatdesc($description, $messagetext); @@ -3038,7 +3040,7 @@ class EmailCollector extends CommonObject } $description = $descriptiontitle; - $description = dol_concatdesc($description, "-----"); + $description = dol_concatdesc($description, $descriptionmeta); $description = dol_concatdesc($description, "-----"); $description = dol_concatdesc($description, $messagetext); @@ -3173,7 +3175,7 @@ class EmailCollector extends CommonObject } $description = $descriptiontitle; - $description = dol_concatdesc($description, "-----"); + $description = dol_concatdesc($description, $descriptionmeta); $description = dol_concatdesc($description, "-----"); $description = dol_concatdesc($description, $messagetext); @@ -3186,9 +3188,9 @@ class EmailCollector extends CommonObject $tickettocreate->subject = $subject; $tickettocreate->message = $description; - $tickettocreate->type_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_TYPE_CODE') ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_TYPE_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_type', 'use_default', 'code', 1)); - $tickettocreate->category_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_CATEGORY_CODE') ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_CATEGORY_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_category', 'use_default', 'code', 1)); - $tickettocreate->severity_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE') ? $conf->global->MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE : dol_getIdFromCode($this->db, 1, 'c_ticket_severity', 'use_default', 'code', 1)); + $tickettocreate->type_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_TYPE_CODE', dol_getIdFromCode($this->db, 1, 'c_ticket_type', 'use_default', 'code', 1))); + $tickettocreate->category_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_CATEGORY_CODE', dol_getIdFromCode($this->db, 1, 'c_ticket_category', 'use_default', 'code', 1))); + $tickettocreate->severity_code = (getDolGlobalString('MAIN_EMAILCOLLECTOR_TICKET_SEVERITY_CODE', dol_getIdFromCode($this->db, 1, 'c_ticket_severity', 'use_default', 'code', 1))); $tickettocreate->origin_email = $from; $tickettocreate->origin_replyto = (!empty($replyto) ? $replyto : null); $tickettocreate->origin_references = (!empty($headers['References']) ? $headers['References'] : null); diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 40e94f779e7..3570e6a36c4 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -182,7 +182,7 @@ Unanswered=Unanswered Answered=Answered IsNotAnAnswer=Is not answer (initial email) IsAnAnswer=Is an answer of an initial email -RecordCreatedByEmailCollector=Record created by the Email Collector %s from email %s +RecordCreatedByEmailCollector=Record created by the Email Collector %s DefaultBlacklistMailingStatus=Default value for field '%s' when creating a new contact DefaultStatusEmptyMandatory=Empty but mandatory WarningLimitSendByDay=WARNING: The setup or contract of your instance limits your number of emails per day to %s. Trying to send more may result in having your instance slow down or suspended. Please contact your support if you need a higher quota. diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index d922ce933a1..b99beae3d83 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1139,20 +1139,18 @@ if ($action == 'create' || $action == 'presend') { print '
'; + + + print '
'; print ''; print ''; print ''; print ''; - //print '
'; - - // View Original message - $actionobject->viewTicketOriginalMessage($user, $action, $object); - // Classification of ticket print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table - print ''; + print '
'; print ''; print '
'; print $langs->trans('TicketProperties'); @@ -1265,10 +1263,13 @@ if ($action == 'create' || $action == 'presend') { print '
'; } + // View Original message + $actionobject->viewTicketOriginalMessage($user, $action, $object); + // Display navbar with links to change ticket status print ''; - if (!$user->socid && $user->hasRight('ticket', 'write') && isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set') !== 'properties') { + if (!$user->socid && $user->hasRight('ticket', 'write') && isset($object->status) && $object->status < $object::STATUS_CLOSED) { $actionobject->viewStatusActions($object); } diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index e75f6c0f59d..7bb1dbc713a 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -199,19 +199,24 @@ class ActionsTicket extends CommonHookActions // Initial message print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table - print ''; + print '
'; print ''; print ''; print ''; print ''; print '
'; print $langs->trans("InitialMessage"); print ''; if ($user->hasRight("ticket", "manage")) { - print ''.img_edit($langs->trans('Modify')).''; + if ($action != 'edit_message_init') { + print ''.img_edit($langs->trans('Modify')).''; + } else { + print ''; + print ' '; + } } print '
'; if ($user->hasRight('ticket', 'manage') && $action == 'edit_message_init') { - // MESSAGE + // Message $msg = GETPOSTISSET('message_initial') ? GETPOST('message_initial', 'restricthtml') : $object->message; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $uselocalbrowser = true; @@ -222,9 +227,8 @@ class ActionsTicket extends CommonHookActions $doleditor = new DolEditor('message_initial', $msg, '100%', 250, 'dolibarr_details', 'In', true, $uselocalbrowser, $ckeditorenabledforticket, ROWS_9, '95%'); $doleditor->Create(); } else { - print '
'; - //print dol_escape_htmltag(dol_htmlwithnojs(dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->message), 1, 1, 1, 0)), 1, 1, 'common', 0, 1); - print nl2br($object->message); + print '
'; + print dolPrintHTML($object->message); print '
'; /*print '
'; print $langs->trans("More").'...'; @@ -232,12 +236,6 @@ class ActionsTicket extends CommonHookActions //print '
' . $object->message . '
'; } - if ($user->hasRight('ticket', 'manage') && $action == 'edit_message_init') { - print '
'; - print ' '; - print ' '; - print '
'; - } print '
';