|
@@ -81,14 +81,14 @@ if (!$action) {
|
|
|
// Security check
|
|
|
$id = GETPOST("id", 'int');
|
|
|
if ($user->socid > 0) $socid = $user->socid;
|
|
|
-$result = restrictedArea($user, 'ticket', $id, '');
|
|
|
+$result = restrictedArea($user, 'ticket', $object->id, '');
|
|
|
|
|
|
// restrict access for externals users
|
|
|
if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
|
|
|
accessforbidden();
|
|
|
}
|
|
|
// or for unauthorized internals users
|
|
|
-if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
|
|
+if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
|
|
accessforbidden();
|
|
|
}
|
|
|
|
|
@@ -144,7 +144,7 @@ if ($socid > 0) {
|
|
|
print dol_get_fiche_end();
|
|
|
}
|
|
|
|
|
|
-if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
|
|
+if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
|
|
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
|
|
|
} elseif ($user->socid > 0) {
|
|
|
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
|
|
@@ -162,11 +162,15 @@ if ($object->fk_user_create > 0) {
|
|
|
$langs->load("users");
|
|
|
$fuser = new User($db);
|
|
|
$fuser->fetch($object->fk_user_create);
|
|
|
- $morehtmlref .= $fuser->getNomUrl(0);
|
|
|
-}
|
|
|
-if (!empty($object->origin_email)) {
|
|
|
+ $morehtmlref .= $fuser->getNomUrl(-1);
|
|
|
+} 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">('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')</small>';
|
|
|
+} elseif (!empty($object->origin_email)) {
|
|
|
$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">('.$langs->trans("CreatedByPublicPortal").')</small>';
|
|
|
}
|
|
|
|
|
|
// Thirdparty
|