Debug ticket module

This commit is contained in:
Laurent Destailleur 2019-04-10 16:23:16 +02:00
parent 05c14e4f2f
commit 4f2a3d6bdd
4 changed files with 34 additions and 36 deletions

View File

@ -1265,7 +1265,6 @@ class EmailCollector extends CommonObject
}
// Do operations
foreach($this->actions as $operation)
{
@ -1476,7 +1475,7 @@ class EmailCollector extends CommonObject
//$actioncomm->extraparams = $extraparams;
// Overwrite values with values extracted from source email
$errorforthisaction = $this->overwritePropertiesOfObject($actioncommn, $operation['actionparam'], $messagetext, $subject, $header);
$errorforthisaction = $this->overwritePropertiesOfObject($actioncomm, $operation['actionparam'], $messagetext, $subject, $header);
if ($errorforthisaction)
{
@ -1610,10 +1609,11 @@ class EmailCollector extends CommonObject
$descriptionfull = dol_concatdesc($descriptionfull, $header);
$tickettocreate->title = $subject;
$tickettocreate->message = $description;
$tickettocreate->type_code = 0;
$tickettocreate->category_code = 0;
$tickettocreate->severity_code = 0;
$tickettocreate->origin_email = $fromstring;
$tickettocreate->origin_email = $from;
$tickettocreate->fk_user_create = $user->id;
$tickettocreate->entity = $conf->entity;
$tickettocreate->datec = $date;

View File

@ -246,9 +246,10 @@ YourPasswordHasBeenReset=Your password has been reset successfully
ApplicantIpAddress=IP address of applicant
SMSSentTo=SMS sent to %s
MissingIds=Missing ids
ThirdPartyCreatedByEmailCollector=Third party created by email collector from email ID %s
ContactCreatedByEmailCollector=Contact/address created by email collector from email ID %s
ProjectCreatedByEmailCollector=Project created by email collector from email ID %s
ThirdPartyCreatedByEmailCollector=Third party created by email collector from email MSGID %s
ContactCreatedByEmailCollector=Contact/address created by email collector from email MSGID %s
ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s
TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s
##### Export #####
ExportsArea=Exports area

View File

@ -644,7 +644,6 @@ if ($action == 'create' || $action == 'presend')
if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink')
{
if ($res > 0)
{
// or for unauthorized internals users
@ -959,12 +958,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$actionobject->viewTicketOriginalMessage($user, $action, $object);
/***************************************************
*
* Classification and actions on ticket
*
***************************************************/
// Classification of ticket
print '<form method="post" name="formticketproperties" action="' . $url_page_current . '">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="change_property">';
@ -991,19 +985,14 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '</tr>';
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
print '<tr>';
// Type
print '<td class="titlefield">';
print $langs->trans('TicketChangeType');
print '</td><td>';
print $formticket->selectTypesTickets($object->type_code, 'update_value_type', '', 2);
print '</td>';
print '</tr>';
print '<tr>';
print '<td>';
print $langs->trans('TicketChangeSeverity');
print '</td><td>';
print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
print '</td>';
print '</tr>';
// Group
print '<tr>';
print '<td>';
print $langs->trans('TicketChangeCategory');
@ -1011,6 +1000,14 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print $formticket->selectGroupTickets($object->category_code, 'update_value_category', '', 2);
print '</td>';
print '</tr>';
// Severity
print '<tr>';
print '<td>';
print $langs->trans('TicketChangeSeverity');
print '</td><td>';
print $formticket->selectSeveritiesTickets($object->severity_code, 'update_value_severity', '', 2);
print '</td>';
print '</tr>';
} else {
// Type
print '<tr><td class="titlefield">' . $langs->trans("Type") . '</td><td>';
@ -1019,15 +1016,6 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';
// Severity
print '<tr><td>' . $langs->trans("TicketSeverity") . '</td><td>';
print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';
// Group
print '<tr><td>' . $langs->trans("TicketGroup") . '</td><td>';
print $langs->getLabelFromKey($db, $object->category_code, 'c_ticket_category', 'code', 'label');
@ -1035,6 +1023,13 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';
// Severity
print '<tr><td>' . $langs->trans("TicketSeverity") . '</td><td>';
print $langs->getLabelFromKey($db, $object->severity_code, 'c_ticket_severity', 'code', 'label');
/*if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}*/
print '</td></tr>';
}
print '</table>'; // End table actions
@ -1215,7 +1210,6 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$action = 'presend';
}
//if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'delete' || $action == 'edit_message_init')
if ($action != 'add_message')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
@ -1236,7 +1230,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
print '</div><!-- fichecenter -->';
print '<br style="clear: both">';
}
elseif ($action == 'add_message')
else
{
$action='new_message';
$modelmail='ticket_send';

View File

@ -286,6 +286,8 @@ class ActionsTicket
public function viewTicketOriginalMessage($user, $action, $object)
{
global $langs;
print '<!-- initial message of ticket -->'."\n";
if (!empty($user->rights->ticket->manage) && $action == 'edit_message_init') {
// MESSAGE
@ -326,14 +328,15 @@ class ActionsTicket
//print '<div>' . $object->message . '</div>';
}
if ($user->rights->ticket->manage && $action == 'edit_message_init') {
print '<div class="center">';
print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print ' <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '">';
print '</div>';
}
print '</td>';
print '</tr>';
print '</table>';
if ($user->rights->ticket->manage && $action == 'edit_message_init') {
print ' <input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print ' <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '">';
print '</form>';
}
}
/**
* View html list of message for ticket