From 3fc0478293371876d9db4c95dbdaa811fa90d529 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Aug 2022 22:39:18 +0200 Subject: [PATCH] Debug v16 --- htdocs/langs/en_US/main.lang | 4 +- .../recruitmentcandidature_card.php | 17 +++++++++ htdocs/ticket/card.php | 38 +++++++++++++------ htdocs/ticket/class/ticket.class.php | 10 ++--- htdocs/ticket/contact.php | 11 ++++-- htdocs/ticket/document.php | 13 ++++--- htdocs/ticket/list.php | 4 +- htdocs/ticket/messaging.php | 11 ++++-- 8 files changed, 75 insertions(+), 33 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4e6e274b25b..2c532f339c3 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1185,4 +1185,6 @@ CommercialAffected=Sales representative affected YourMessage=Your message YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible. UrlToCheck=Url to check -Automation=Automation \ No newline at end of file +Automation=Automation +CreatedByEmailCollector=Created by Email collector +CreatedByPublicPortal=Created from Public portal diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 3d11afc5900..721ed4c4a2a 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -477,6 +477,23 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } }*/ + // Author + if (!empty($object->email_msgid)) { + $morehtmlref .= $langs->trans("CreatedBy").' : '; + + if ($object->fk_user_creat > 0) { + $fuser = new User($db); + $fuser->fetch($object->fk_user_creat); + $morehtmlref .= $fuser->getNomUrl(-1); + } + if (!empty($object->email_msgid)) { + $morehtmlref .= ' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } + } /* elseif (!empty($object->origin_email)) { + $morehtmlref .= $langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; + } */ $morehtmlref .= ''; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9638e763dba..cb7e71f8356 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -925,15 +925,17 @@ if ($action == 'create' || $action == 'presend') { if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty @@ -1019,6 +1021,23 @@ if ($action == 'create' || $action == 'presend') { print ' - '.$langs->trans("TimeElapsedSince").': '.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).''; print ''; + // Origin + /* + if ($object->email_msgid) { + $texttoshow = $langs->trans("CreatedByEmailCollector"); + } elseif ($object->origin_email) { + $texttoshow = $langs->trans("FromPublicEmail"); + } + if ($texttoshow) { + print ''; + print $langs->trans("Origin"); + print ''; + print ''; + print $texttoshow; + print ''; + } + */ + // Read date print ''.$langs->trans("TicketReadOn").''; if (!empty($object->date_read)) { @@ -1118,6 +1137,7 @@ if ($action == 'create' || $action == 'presend') { // Fin colonne gauche et début colonne droite print '
'; + print '
'; print ''; print ''; @@ -1127,13 +1147,10 @@ if ($action == 'create' || $action == 'presend') { // Categories if (isModEnabled('categorie')) { - print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - - print ''; - + print '
'; print ''; print '
'; - print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; } elseif ($key == 'fk_statut') { $arrayofstatus = array(); @@ -1005,7 +1005,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } elseif ($key == 'subject') { $s = $obj->subject; print ''; - print $s; + print dol_escape_htmltag($s); print ''; } elseif ($key == 'type_code') { $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 4b887691f01..df829a010ec 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -157,14 +157,17 @@ $morehtmlref .= $object->subject; if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); -} -if (!empty($object->origin_email)) { +} elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; +} elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty
'; + print ''; @@ -1170,11 +1187,8 @@ if ($action == 'create' || $action == 'presend') { } print '
'; print $langs->trans("Categories"); if ($action != 'categories' && !$user->socid) { print ''.img_edit($langs->trans('Modify')).'
'; - - print ''; } - // View Original message $actionobject->viewTicketOriginalMessage($user, $action, $object); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5b49a5d095e..82c2142d786 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -266,20 +266,20 @@ class Ticket extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'', 'showoncombobox'=>1), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TicketTrackId', 'visible'=>-2, 'enabled'=>1, 'position'=>11, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), - 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'css'=>'tdoverflowmax125 maxwidth150onsmartphone'), - 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'tdoverflowmax150'), + 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>15, 'notnull'=>1, 'csslist'=>'tdoverflowmax100 maxwidth150onsmartphone'), + 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'csslist'=>'tdoverflowmax150'), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth200 tdoverflowmax200', 'autofocusoncreate'=>1), - 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth125 tdoverflowmax50'), + 'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'help'=>"", 'csslist'=>'maxwidth125 tdoverflowmax50'), 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketCategory', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100 tdoverflowmax200'), 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), //'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ? - 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1), + 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1, 'csslist'=>'nowraponall'), 'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1), 'date_last_msg_sent' => array('type'=>'datetime', 'label'=>'TicketLastMessageDate', 'visible'=>0, 'enabled'=>1, 'position'=>502, 'notnull'=>-1), - 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'css'=>'tdoverflowmax125'), + 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'csslist'=>'tdoverflowmax100 maxwidth150onsmartphone'), 'date_close' => array('type'=>'datetime', 'label'=>'TicketCloseOn', 'visible'=>-1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>520, 'notnull'=>1), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 5b1b73799f2..d32ab88eb1c 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -196,14 +196,17 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { if ($object->fk_user_create > 0) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index bf2b1c51fc4..234c5e92918 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -129,16 +129,19 @@ if ($object->id) { $morehtmlref .= $object->subject; // Author if ($object->fk_user_create > 0) { - $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); $morehtmlref .= $fuser->getNomUrl(-1); - } - if (!empty($object->origin_email)) { + } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + } elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index f09388fa0ac..693a40fbb5f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -824,7 +824,7 @@ foreach ($object->fields as $key => $val) { print '
'; - print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth125')); + print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth100')); print '