diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index ef5887c58ac..9cebbc3b36d 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -664,28 +664,30 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''; } -// Texte d'introduction -$mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_MESSAGE_MAIL_INTRO : $langs->trans('TicketMessageMailIntroText'); -print ''.$langs->trans("TicketMessageMailIntroLabelAdmin"); +// Message header +//$mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText')); +$mail_intro = getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO', ''); +print ''.$langs->trans("TicketMessageMailIntro"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; print $formcategory->textwithpicto('', $langs->trans("TicketMessageMailIntroHelpAdmin"), 1, 'help'); print ''; -// Texte de signature -$mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE : $langs->trans('TicketMessageMailSignatureText'); -print ''.$langs->trans("TicketMessageMailSignatureLabelAdmin").''; +// Message footer +//$mail_signature = getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailFooterText')); +$mail_signature = getDolGlobalString('TICKET_MESSAGE_MAIL_SIGNATURE'); +print ''.$langs->trans("TicketMessageMailFooter").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); +$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 90, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; -print $formcategory->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelpAdmin"), 1, 'help'); +print $formcategory->textwithpicto('', $langs->trans("TicketMessageMailFooterHelpAdmin"), 1, 'help'); print ''; print ''; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cfc066c4295..7cb3bdf58de 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1071,7 +1071,7 @@ class FormTicket console.log("We select a new value into combo child_id="+child_id); - // Hide all selected box that are child of the one modified + // Hide all selected box that are child of the one modified $(".groupticketchild").each(function(){ if ($(this).attr("child_id") > child_id) { console.log("hide child_id="+$(this).attr("child_id")); @@ -1080,7 +1080,7 @@ class FormTicket } }) - // Now we enable the next combo + // Now we enable the next combo $("#'.$htmlname.'_child_'.$levelid.'").val(""); if (!arraynotparents.includes($(this).val()) && $("#'.$htmlname.'_child_'.$levelid.' option").length > 1) { console.log($("#'.$htmlname.'_child_'.$levelid.' option").length); @@ -1230,7 +1230,11 @@ class FormTicket dol_delete_dir_recursive($upload_dir); } - $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid + if (!empty($this->trackid)) { // TODO Always use trackid (ticXXX) instead of track_id (abcd123) + $keytoavoidconflict = '-'.$this->trackid; + } else { + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; + } unset($_SESSION["listofpaths".$keytoavoidconflict]); unset($_SESSION["listofnames".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]); @@ -1278,7 +1282,7 @@ class FormTicket if ($this->param['models'] != 'none') { $model_id = 0; if (array_key_exists('models_id', $this->param)) { - $model_id = $this->param["models_id"]; + $model_id = (int) $this->param["models_id"]; } $arraydefaultmessage = $formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); // If $model_id is empty, preselect the first one @@ -1288,8 +1292,13 @@ class FormTicket $listofpaths = array(); $listofnames = array(); $listofmimes = array(); - $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid + if (!empty($this->trackid)) { + $keytoavoidconflict = '-'.$this->trackid; + } else { + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid + } +//var_dump($keytoavoidconflict); if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) { foreach ($this->param['fileinit'] as $file) { @@ -1297,7 +1306,8 @@ class FormTicket } } } - +//var_dump($_SESSION); +//var_dump($_SESSION["listofpaths".$keytoavoidconflict]); if (!empty($_SESSION["listofpaths".$keytoavoidconflict])) { $listofpaths = explode(';', $_SESSION["listofpaths".$keytoavoidconflict]); } @@ -1368,6 +1378,7 @@ class FormTicket print ''; print ''; print ''; + print ''; foreach ($this->param as $key => $value) { print ''; } @@ -1395,6 +1406,16 @@ class FormTicket $ticketstat = new Ticket($this->db); $res = $ticketstat->fetch('', '', $this->track_id); + // Private message (not visible by customer/external user) + if (!$user->socid) { + print ''; + $checkbox_selected = (GETPOST('private_message', 'alpha') == "1" ? ' checked' : ''); + print ' '; + print ''; + print ' '.$form->textwithpicto('', $langs->trans("TicketMessagePrivateHelp"), 1, 'help'); + print ''; + } + print ''; $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); print ' '; @@ -1413,16 +1434,6 @@ class FormTicket print ''; } - // Private message (not visible by customer/external user) - if (!$user->socid) { - print ''; - $checkbox_selected = (GETPOST('private_message', 'alpha') == "1" ? ' checked' : ''); - print ' '; - print ''; - print ' '.$form->textwithpicto('', $langs->trans("TicketMessagePrivateHelp"), 1, 'help'); - print ''; - } - // Subject print ''.$langs->trans('Subject').''; print 'ref.'] '.$langs->trans('TicketNewMessage').'" />'; @@ -1478,7 +1489,8 @@ class FormTicket // Intro // External users can't send message email - if ($user->rights->ticket->write && !$user->socid) { + /* + if ($user->rights->ticket->write && !$user->socid && !empty($conf->global->TICKET_MESSAGE_MAIL_INTRO)) { $mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKET_MESSAGE_MAIL_INTRO; print '