NEW Add link to the public interface on the ticket card.
This commit is contained in:
parent
5c11a0d6cd
commit
031c5523d4
@ -139,6 +139,45 @@ function ticket_prepare_head($object)
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return string with full Url. The file qualified is the one defined by relative path in $object->last_main_doc
|
||||||
|
*
|
||||||
|
* @param Object $object Object
|
||||||
|
* @return string Url string
|
||||||
|
*/
|
||||||
|
function showDirectPublicLink($object)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
|
$email = CMailFile::getValidAddress($object->origin_email, 2);
|
||||||
|
if ($email)
|
||||||
|
{
|
||||||
|
$url = dol_buildpath('/public/ticket/view.php', 3).'?track_id='.$object->track_id.'&email='.$email;
|
||||||
|
}
|
||||||
|
|
||||||
|
$out='';
|
||||||
|
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||||
|
{
|
||||||
|
$out.= '<span class="opacitymedium">'.$langs->trans("PublicInterfaceNotEnabled").'</span>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$out.= img_picto('', 'object_globe.png').' '.$langs->trans("TicketPublicAccess").':<br>';
|
||||||
|
if ($url)
|
||||||
|
{
|
||||||
|
$out.= '<input type="text" id="directpubliclink" class="quatrevingtpercent" value="'.$url.'">';
|
||||||
|
$out.= ajax_autoselect("directpubliclink", 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$out.= '<span class="opacitymedium">'.$langs->trans("TicketNotCreatedFromPublicInterface").'</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a random id
|
* Generate a random id
|
||||||
*
|
*
|
||||||
|
|||||||
@ -226,6 +226,8 @@ TicketConfirmChangeStatus=Confirm the status change: %s ?
|
|||||||
TicketLogStatusChanged=Status changed: %s to %s
|
TicketLogStatusChanged=Status changed: %s to %s
|
||||||
TicketNotNotifyTiersAtCreate=Not notify company at create
|
TicketNotNotifyTiersAtCreate=Not notify company at create
|
||||||
Unread=Unread
|
Unread=Unread
|
||||||
|
TicketNotCreatedFromPublicInterface=Not available. Ticket was not created from public interface.
|
||||||
|
PublicInterfaceNotEnabled=Public interface was not enabled
|
||||||
|
|
||||||
#
|
#
|
||||||
# Logs
|
# Logs
|
||||||
|
|||||||
@ -769,7 +769,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
}
|
}
|
||||||
if (!empty($object->origin_email)) {
|
if (!empty($object->origin_email)) {
|
||||||
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
$morehtmlref .= '<br>' . $langs->trans("CreatedBy") . ' : ';
|
||||||
$morehtmlref .= $object->origin_email . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
$morehtmlref .= dol_escape_htmltag($object->origin_email) . ' <small>(' . $langs->trans("TicketEmailOriginIssuer") . ')</small>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
@ -983,6 +983,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
|
if (GETPOST('set', 'alpha') == 'properties' && $user->rights->ticket->write) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
// Type
|
// Type
|
||||||
@ -1212,6 +1213,10 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
|
|||||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('ticket'));
|
$linktoelem = $form->showLinkToObjectBlock($object, null, array('ticket'));
|
||||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||||
|
|
||||||
|
// Show direct link to public interface
|
||||||
|
print '<br><!-- Link to public interface -->'."\n";
|
||||||
|
print showDirectPublicLink($object).'<br>';
|
||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user