Debug v16

This commit is contained in:
Laurent Destailleur 2022-08-02 22:39:18 +02:00
parent 706706d9ed
commit 3fc0478293
8 changed files with 75 additions and 33 deletions

View File

@ -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
Automation=Automation
CreatedByEmailCollector=Created by Email collector
CreatedByPublicPortal=Created from Public portal

View File

@ -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 .= ' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
}
} /* elseif (!empty($object->origin_email)) {
$morehtmlref .= $langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
} */
$morehtmlref .= '</div>';

View File

@ -925,15 +925,17 @@ if ($action == 'create' || $action == 'presend') {
if ($object->fk_user_create > 0) {
$morehtmlref .= '<br>'.$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 .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("TicketEmailOriginIssuer").')</small>';
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
} elseif (!empty($object->origin_email)) {
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
}
// Thirdparty
@ -1019,6 +1021,23 @@ if ($action == 'create' || $action == 'presend') {
print '<span class="opacitymedium"> - '.$langs->trans("TimeElapsedSince").': <i>'.convertSecondToTime(roundUpToNextMultiple($now - $object->datec, 60)).'</i></span>';
print '</td></tr>';
// Origin
/*
if ($object->email_msgid) {
$texttoshow = $langs->trans("CreatedByEmailCollector");
} elseif ($object->origin_email) {
$texttoshow = $langs->trans("FromPublicEmail");
}
if ($texttoshow) {
print '<tr><td class="titlefield fieldname_email_origin">';
print $langs->trans("Origin");
print '</td>';
print '<td class="valuefield fieldname_email_origin">';
print $texttoshow;
print '</td></tr>';
}
*/
// Read date
print '<tr><td>'.$langs->trans("TicketReadOn").'</td><td>';
if (!empty($object->date_read)) {
@ -1118,6 +1137,7 @@ if ($action == 'create' || $action == 'presend') {
// Fin colonne gauche et début colonne droite
print '</div><div class="fichehalfright">';
print '<form method="post" name="formticketproperties" action="'.$url_page_current.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="change_property">';
@ -1127,13 +1147,10 @@ if ($action == 'create' || $action == 'presend') {
// Categories
if (isModEnabled('categorie')) {
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="border tableforfield centpercent noborderbottom">';
print '<table class="border centpercent tableforfield">';
print '<tr>';
print '<td class="valignmiddle titlefield">';
print '<table class="nobordernopadding centpercent"><tr><td class="nowrap">';
print '<table class="nobordernopadding centpercent"><tr><td class="titlefield">';
print $langs->trans("Categories");
if ($action != 'categories' && !$user->socid) {
print '<td class="right"><a class="editfielda" href="'.$url_page_current.'?action=categories&amp;track_id='.$object->track_id.'">'.img_edit($langs->trans('Modify')).'</a></td>';
@ -1170,11 +1187,8 @@ if ($action == 'create' || $action == 'presend') {
}
print '</table>';
print '</div>';
}
// View Original message
$actionobject->viewTicketOriginalMessage($user, $action, $object);

View File

@ -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,),

View File

@ -196,14 +196,17 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
if ($object->fk_user_create > 0) {
$morehtmlref .= '<br>'.$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 .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= $object->origin_email.' <small>('.$langs->trans("TicketEmailOriginIssuer").')</small>';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
} elseif (!empty($object->origin_email)) {
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
}
// Thirdparty

View File

@ -129,16 +129,19 @@ if ($object->id) {
$morehtmlref .= $object->subject;
// Author
if ($object->fk_user_create > 0) {
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= '<br>'.$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 .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= $object->origin_email.' <small>('.$langs->trans("TicketEmailOriginIssuer").')</small>';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
} elseif (!empty($object->origin_email)) {
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
}
// Thirdparty

View File

@ -824,7 +824,7 @@ foreach ($object->fields as $key => $val) {
print '</td>';
} elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') {
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
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 '</td>';
} elseif ($key == 'fk_statut') {
$arrayofstatus = array();
@ -1005,7 +1005,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
} elseif ($key == 'subject') {
$s = $obj->subject;
print '<span title="'.dol_escape_htmltag($s).'">';
print $s;
print dol_escape_htmltag($s);
print '</span>';
} elseif ($key == 'type_code') {
$s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);

View File

@ -157,14 +157,17 @@ $morehtmlref .= $object->subject;
if ($object->fk_user_create > 0) {
$morehtmlref .= '<br>'.$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 .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= $object->origin_email.' <small>('.$langs->trans("TicketEmailOriginIssuer").')</small>';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
} elseif (!empty($object->origin_email)) {
$morehtmlref .= '<br>'.$langs->trans("CreatedBy").' : ';
$morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"');
$morehtmlref .= dol_escape_htmltag($object->origin_email).' <small class="hideonsmartphone opacitymedium">('.$langs->trans("CreatedByPublicPortal").')</small>';
}
// Thirdparty