Debug ticket form to add a local file

This commit is contained in:
Laurent Destailleur 2021-06-07 01:43:24 +02:00
parent 242f8b2544
commit d6cbb9007f
3 changed files with 17 additions and 7 deletions

View File

@ -1099,6 +1099,8 @@ class FormTicket
print '</td></tr>';
}
$uselocalbrowser = false;
// Intro
// External users can't send message email
if ($user->rights->ticket->write && !$user->socid) {
@ -1109,15 +1111,15 @@ class FormTicket
print '</td><td>';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$uselocalbrowser = true;
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td></tr>';
}
// MESSAGE
$defaultmessage = "";
if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) {
$defaultmessage = $arraydefaultmessage->content;
@ -1147,7 +1149,7 @@ class FormTicket
//$toolbarname = 'dolibarr_details';
$toolbarname = 'dolibarr_notes';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70);
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70);
$doleditor->Create();
print '</td></tr>';
@ -1159,7 +1161,7 @@ class FormTicket
print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help');
print '</td><td>';
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
$doleditor->Create();
print '</td></tr>';
}

View File

@ -3499,7 +3499,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building',
'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype',
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'multicurrency',
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes',
'multicurrency',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice',
'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus',

View File

@ -234,6 +234,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
// Ref
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
print img_picto('', 'ticket', 'class="pictofixedwidth"');
print dol_escape_htmltag($object->dao->ref);
print '</td></tr>';
@ -244,7 +245,9 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
// Subject
print '<tr><td>'.$langs->trans("Subject").'</td><td>';
print '<span class="bold">';
print dol_escape_htmltag($object->dao->subject);
print '</span>';
print '</td></tr>';
// Statut
@ -259,6 +262,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
// Category
print '<tr><td>'.$langs->trans("Category").'</td><td>';
print img_picto('', 'category', 'class="pictofixedwidth"');
print dol_escape_htmltag($object->dao->category_label);
print '</td></tr>';
@ -278,8 +282,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
$langs->load("users");
$fuser = new User($db);
$fuser->fetch($object->dao->fk_user_create);
print img_picto('', 'user', 'class="pictofixedwidth"');
print $fuser->getFullName($langs);
} else {
print img_picto('', 'email', 'class="pictofixedwidth"');
print dol_escape_htmltag($object->dao->origin_email);
}
@ -304,6 +310,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
if ($object->dao->fk_user_assign > 0) {
$fuser = new User($db);
$fuser->fetch($object->dao->fk_user_assign);
print img_picto('', 'user', 'class="pictofixedwidth"');
print $fuser->getFullName($langs, 1);
}
print '</td></tr>';
@ -320,7 +327,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
print '<div style="clear: both; margin-top: 1.5em;"></div>';
if ($action == 'presend') {
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket');
print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'conversation');
$formticket = new FormTicket($db);
@ -364,7 +371,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
// Message list
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation');
print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation');
$object->viewTicketMessages(false, true, $object->dao);
} else {
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?track_id='.$object->dao->track_id.'" rel="nofollow noopener">'.$langs->trans('Back').'</a></div>';