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/asset/card.php b/htdocs/asset/card.php index 0f19bed4625..b5896f2817e 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -356,7 +356,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle'); } if ($object->status == $object::STATUS_DRAFT) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 3c478ff5a2c..96acf0913f9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2855,11 +2855,7 @@ if ($action == 'create') { // Send if (empty($user->socid)) { if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($usercansend) { - print ''.$langs->trans('SendMail').''; - } else { - print ''.$langs->trans('SendMail').''; - } + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend); } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c41a4d47f76..4e1b47c598c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2793,7 +2793,7 @@ if ($action == 'create' && $usercancreate) { if (empty($user->socid)) { if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { if ($usercansend) { - print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', ''); } else { print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false); } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 072aa9e67b2..1fb53bb47bd 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1385,6 +1385,7 @@ if (empty($reshook)) { $object->note_public = trim(GETPOST('note_public', 'restricthtml')); $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); + $object->ref_customer = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); @@ -5460,7 +5461,6 @@ if ($action == 'create') { if (empty($reshook)) { $params = array( 'attr' => array( - 'title' => '', 'class' => 'classfortooltip' ) ); @@ -5535,9 +5535,9 @@ if ($action == 'create') { print ''.$langs->trans('SendMail').''; } else { if ($usercansend) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params); } else { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params); } } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3509134c70f..0d03a1f2d78 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2092,9 +2092,9 @@ if ($action == 'create') { if (empty($user->socid)) { if ($object->statut == 1) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->contrat->creer)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle', '', true, $params); } else { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', '#', '', false, $params); + print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params); } } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a2abdbb7cc6..22b1b612a84 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,8 @@ class FormMail extends Form ))) { // If list of template is empty $out .= '
'."\n"; - $out .= $langs->trans('SelectMailModel').': '; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. + $out .= ''.$langs->trans('SelectMailModel').': '; + $out .= ''; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy. if ($user->admin) { $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')), 1); } @@ -750,7 +751,7 @@ class FormMail extends Form } // Ask delivery receipt - if (!empty($this->withdeliveryreceipt)) { + if (!empty($this->withdeliveryreceipt) && getDolGlobalInt('MAIN_EMAIL_SUPPORT_ACK')) { $out .= $this->getHtmlForDeliveryReceipt(); } diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cfc066c4295..12b70731896 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 '