35 global $langs, $conf, $db;
38 $extrafields->fetch_name_optionals_label(
'ticket');
40 $langs->load(
"ticket");
45 $head[$h][0] = DOL_URL_ROOT.
'/admin/ticket.php';
46 $head[$h][1] = $langs->trans(
"TicketSettings");
47 $head[$h][2] =
'settings';
50 $head[$h][0] = DOL_URL_ROOT.
'/admin/ticket_extrafields.php';
51 $head[$h][1] = $langs->trans(
"ExtraFieldsTicket");
52 $nbExtrafields = $extrafields->attributes[
'ticket'][
'count'];
53 if ($nbExtrafields > 0) {
54 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
56 $head[$h][2] =
'attributes';
59 $head[$h][0] = DOL_URL_ROOT.
'/admin/ticket_public.php';
60 $head[$h][1] = $langs->trans(
"PublicInterface");
61 $head[$h][2] =
'public';
87 global $langs, $conf, $user, $db;
91 $head[$h][0] = DOL_URL_ROOT.
'/ticket/card.php?track_id='.
$object->track_id;
92 $head[$h][1] = $langs->trans(
"Ticket");
93 $head[$h][2] =
'tabTicket';
96 if (!
getDolGlobalInt(
'MAIN_DISABLE_CONTACTS_TAB') && empty($user->socid) && isModEnabled(
"societe")) {
97 $nbContact = count(
$object->liste_contact(-1,
'internal')) + count(
$object->liste_contact(-1,
'external'));
98 $head[$h][0] = DOL_URL_ROOT.
'/ticket/contact.php?track_id='.
$object->track_id;
99 $head[$h][1] = $langs->trans(
'ContactsAddresses');
100 if ($nbContact > 0) {
101 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbContact.
'</span>';
103 $head[$h][2] =
'contact';
110 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
111 $upload_dir = $conf->ticket->dir_output.
"/".
$object->ref;
125 $head[$h][0] = DOL_URL_ROOT.
'/ticket/document.php?id='.
$object->id;
126 $head[$h][1] = $langs->trans(
"Documents");
128 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbFiles.
'</span>';
131 $head[$h][2] =
'tabTicketDocument';
136 $ticketViewType =
"messaging";
137 if (empty($_SESSION[
'ticket-view-type'])) {
138 $_SESSION[
'ticket-view-type'] = $ticketViewType;
140 $ticketViewType = $_SESSION[
'ticket-view-type'];
143 if ($ticketViewType ==
"messaging") {
144 $head[$h][0] = DOL_URL_ROOT.
'/ticket/messaging.php?track_id='.
$object->track_id;
147 $head[$h][0] = DOL_URL_ROOT.
'/ticket/agenda.php?track_id='.
$object->track_id;
149 $head[$h][1] = $langs->trans(
'Events');
150 if (isModEnabled(
'agenda') && ($user->hasRight(
'agenda',
'myactions',
'read') || $user->hasRight(
'agenda',
'allactions',
'read'))) {
152 $head[$h][1] .= $langs->trans(
"Agenda");
154 $head[$h][2] =
'tabTicketLogs';
173 global $conf, $langs;
175 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
184 $langs->load(
'errors');
185 $out .=
'<span class="opacitymedium">'.$langs->trans(
"ErrorPublicInterfaceNotEnabled").
'</span>';
187 $out .=
img_picto(
'',
'object_globe.png').
' <span class="opacitymedium">'.$langs->trans(
"TicketPublicAccess").
'</span><br>';
189 $out .=
'<div class="urllink">';
190 $out .=
'<input type="text" id="directpubliclink" class="quatrevingtpercentminusx" value="'.$url.
'">';
191 $out .=
'<a href="'.$url.
'" target="_blank" rel="noopener noreferrer">'.
img_picto(
'',
'object_globe.png',
'class="paddingleft"').
'</a>';
195 $out .=
'<span class="opacitymedium">'.$langs->trans(
"TicketNotCreatedFromPublicInterface").
'</span>';
211 $chaine =
"abcdefghijklmnopqrstuvwxyz123456789";
212 mt_srand((
int) ((
float) microtime() * 1000000));
213 for ($i = 0; $i < $car; $i++) {
214 $string .= $chaine[mt_rand() % strlen($chaine)];
230function llxHeaderTicket($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [])
232 global $user, $conf, $langs, $mysoc;
235 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1);
237 print
'<body id="mainbody" class="publicnewticketform">';
238 print
'<div class="publicnewticketform2 flexcontainer centpercent" style="min-height: 100%;">';
240 print
'<header class="center centpercent">';
246 $urllogo = DOL_URL_ROOT.
'/theme/common/login_logo.png';
248 if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$mysoc->logo_small)) {
249 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$mysoc->logo_small);
250 } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$mysoc->logo)) {
251 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$mysoc->logo);
252 } elseif (is_readable(DOL_DOCUMENT_ROOT.
'/theme/dolibarr_logo.svg')) {
253 $urllogo = DOL_URL_ROOT.
'/theme/dolibarr_logo.svg';
260 print
'<div class="backgreypublicpayment">';
261 print
'<div class="logopublicpayment">';
263 print
'<a href="'.(getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE') ?
getDolGlobalString(
'TICKET_URL_PUBLIC_INTERFACE') :
dol_buildpath(
'/public/ticket/index.php?entity='.$conf->entity, 1)).
'">';
264 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
269 print
'<div class="clearboth"></div><strong>'.(getDolGlobalString(
'TICKET_PUBLIC_INTERFACE_TOPIC') ?
getDolGlobalString(
'TICKET_PUBLIC_INTERFACE_TOPIC') : $langs->trans(
"TicketSystem")).
'</strong>';
273 print
'<div class="poweredbypublicpayment opacitymedium right hideonsmartphone"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans(
"PoweredBy").
'<br><img src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
279 print
'<div class="backimagepublicticket">';
280 print
'<img id="idTICKET_IMAGE_PUBLIC_INTERFACE" src="'.getDolGlobalString(
'TICKET_IMAGE_PUBLIC_INTERFACE').
'">';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
static getValidAddress($address, $format, $encode=0, $maxnumberofemail=0)
Return a formatted address string for SMTP protocol.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
generate_random_id($car=16)
Generate a random id.
llxHeaderTicket($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[])
Show http header, open body tag and show HTML header banner for public pages for tickets.
ticketAdminPrepareHead()
Build tabs for admin page.
showDirectPublicLink($object)
Return string with full Url.
ticket_prepare_head($object)
Build tabs for a Ticket object.