dolibarr 24.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
3 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
4 * Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
33require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticketstats.class.php';
34
35
44// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
45$hookmanager->initHooks(array('ticketsindex'));
46
47// Load translation files required by the page
48$langs->loadLangs(array('companies', 'other', 'ticket'));
49
52
53// Get parameters
54$id = GETPOSTINT('id');
55$msg_id = GETPOSTINT('msg_id');
56
57$action = GETPOST('action', 'aZ09');
58
59$socid = 0;
60if ($user->socid) {
61 $socid = $user->socid;
62}
63$userid = $user->id;
64
65$nowarray = dol_getdate(dol_now(), true);
66$nowyear = $nowarray['year'];
67$year = GETPOSTINT('year') > 0 ? GETPOSTINT('year') : $nowyear;
68$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
69$endyear = $year;
70
71// Initialize objects
72$object = new Ticket($db);
73
74// Security check
75//restrictedArea($user, 'ticket|knowledgemanagement', 0, '', '', '', '');
76if (!$user->hasRight('ticket', 'read') && !$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
77 accessforbidden('Not enough permissions');
78}
79
80$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
81
82$permissiontomanage = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('ticket', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'ticket', 'manage_advance'))); // What is this permission for ?
83
84
85/*
86 * Actions
87 */
88
89// None
90
91
92
93/*
94 * View
95 */
96
97$resultboxes = FormOther::getBoxesArea($user, "11"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
98
99$help_url = '';
100llxHeader('', $langs->trans('TicketsIndex'), $help_url, '', 0, 0, '', '', '', 'mod-ticket page-dashboard');
101
102$linkback = '';
103print load_fiche_titre($langs->trans('TicketsIndex'), $resultboxes['selectboxlist'], 'ticket');
104
105
106$dir = '';
107$prefix = '';
108$filenamenb = $dir."/".$prefix."ticketinyear-".$endyear.".png";
109$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=ticket&amp;file=ticketinyear-'.$endyear.'.png';
110
111$stats = new TicketStats($db, $socid, $userid);
112$param_year = 'DOLUSERCOOKIE_ticket_by_status_year';
113$param_shownb = 'DOLUSERCOOKIE_ticket_by_status_shownb';
114$param_showtot = 'DOLUSERCOOKIE_ticket_by_status_showtot';
115$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
116$showtot = 0;
117$shownb = 0;
118if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) {
119 $endyear = GETPOSTINT($param_year);
120 $shownb = GETPOST($param_shownb, 'alpha');
121 $showtot = GETPOST($param_showtot, 'alpha');
122} elseif (!empty($_COOKIE['DOLUSERCOOKIE_ticket_by_status'])) {
123 $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticket_by_status'], true);
124 $endyear = $tmparray['year'];
125 $shownb = empty($tmparray['shownb']) ? 0 : $tmparray['shownb'];
126 $showtot = empty($tmparray['showtot']) ? 0 : $tmparray['showtot'];
127}
128if (empty($shownb) && empty($showtot)) {
129 $showtot = 1;
130 $shownb = 0;
131}
132
133if (empty($endyear)) {
134 $endyear = $nowarray['year'];
135}
136
137$startyear = $endyear - 1;
138
139// Change default WIDTH and HEIGHT (we need a smaller than default for both desktop and smartphone)
140$WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '100%' : '80%';
141if (empty($conf->dol_optimize_smallscreen)) {
142 $HEIGHT = '200';
143} else {
144 $HEIGHT = '160';
145}
146
147print '<div class="clearboth"></div>';
148print '<div class="fichecenter fichecenterbis">';
149
150print '<div class="twocolumns">';
151
152print '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
153
154/*
155 * Statistics area
156 */
157$tick = array(
158 'unread' => 0,
159 'read' => 0,
160 'needmoreinfo' => 0,
161 'answered' => 0,
162 'assigned' => 0,
163 'inprogress' => 0,
164 'waiting' => 0,
165 'closed' => 0,
166 'canceled' => 0,
167 'deleted' => 0,
168);
169
170$sql = "SELECT t.fk_statut, COUNT(t.fk_statut) as nb";
171$sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
172if (!$user->hasRight('societe', 'client', 'voir')) {
173 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
174}
175$sql .= ' WHERE t.entity IN ('.getEntity('ticket').')';
176$sql .= dolSqlDateFilter('datec', 0, 0, $endyear);
177
178if (!$user->hasRight('societe', 'client', 'voir')) {
179 $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
180}
181
182// External users restriction
183if ($user->socid > 0) {
184 $sql .= " AND t.fk_soc= ".((int) $user->socid);
185} else {
186 // For internals users,
187 if (getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY') && !$permissiontomanage) {
188 $sql .= " AND t.fk_user_assign = ".((int) $user->id);
189 }
190}
191$sql .= " GROUP BY t.fk_statut";
192
193$dataseries = array();
194$result = $db->query($sql);
195if ($result) {
196 while ($objp = $db->fetch_object($result)) {
197 $found = 0;
198 if ($objp->fk_statut == Ticket::STATUS_NOT_READ) {
199 $tick['unread'] = $objp->nb;
200 }
201 if ($objp->fk_statut == Ticket::STATUS_READ) {
202 $tick['read'] = $objp->nb;
203 }
204 if ($objp->fk_statut == Ticket::STATUS_NEED_MORE_INFO) {
205 $tick['needmoreinfo'] = $objp->nb;
206 }
207 if ($objp->fk_statut == Ticket::STATUS_ASSIGNED) {
208 $tick['assigned'] = $objp->nb;
209 }
210 if ($objp->fk_statut == Ticket::STATUS_IN_PROGRESS) {
211 $tick['inprogress'] = $objp->nb;
212 }
213 if ($objp->fk_statut == Ticket::STATUS_WAITING) {
214 $tick['waiting'] = $objp->nb;
215 }
216 if ($objp->fk_statut == Ticket::STATUS_CLOSED) {
217 $tick['closed'] = $objp->nb;
218 }
219 if ($objp->fk_statut == Ticket::STATUS_CANCELED) {
220 $tick['canceled'] = $objp->nb;
221 }
222 }
223
234 include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; // This define $badgeStatusX
235
236 $colorseries = array();
237
238 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread']));
239 $colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0;
240 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_READ]), 'data' => round($tick['read']));
241 $colorseries[Ticket::STATUS_READ] = $badgeStatus1;
242 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned']));
243 $colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3;
244 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress']));
245 $colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4;
246 if (getDolGlobalString('TICKET_INCLUDE_SUSPENDED_STATUS')) {
247 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting']));
248 $colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4;
249 }
250 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo']));
251 $colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3;
252 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled']));
253 $colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9;
254 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed']));
255 $colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6;
256} else {
258}
259
260$stringtoshow = '<script type="text/javascript">
261 jQuery(document).ready(function() {
262 jQuery("#idsubimgDOLUSERCOOKIE_ticket_by_status").click(function() {
263 jQuery("#idfilterDOLUSERCOOKIE_ticket_by_status").toggle();
264 });
265 });
266 </script>';
267$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_by_status">'; // hideobject is to start hidden
268$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
269$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
270$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
271$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_by_status:year,shownb,showtot">';
272$stringtoshow .= $langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
273$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', 0, 1).'">';
274$stringtoshow .= '</form>';
275$stringtoshow .= '</div>';
276
277if ($user->hasRight('ticket', 'read')) {
278 print '<div class="div-table-responsive-no-min">';
279 print '<table class="noborder centpercent">';
280 print '<tr class="liste_titre"><th colspan=2>'.$langs->trans("Statistics").' '.$endyear.' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_by_status" class="linkobject"').'</th></tr>';
281
282 print '<tr><td class="center" colspan=2>';
283 print $stringtoshow;
284
285 // don't display graph if no series
286 $totalnb = 0;
287 if (!empty($dataseries) && count($dataseries) > 1) {
288 foreach ($dataseries as $key => $value) {
289 $totalnb += $value['data'];
290 }
291
292 $data = array();
293 foreach ($dataseries as $key => $value) {
294 $data[] = array($value['label'], $value['data']);
295 }
296 $px1 = new DolGraph();
297 $mesg = $px1->isGraphKo();
298 if (!$mesg) {
299 $px1->SetData($data);
300 $px1->SetDataColor(array_values($colorseries));
301
302 unset($data1);
303 $i = $startyear;
304 $legend = array();
305 while ($i <= $endyear) {
306 $legend[] = $i;
307 $i++;
308 }
309 $px1->setShowLegend(2);
310 $px1->SetType(array('pie'));
311 $px1->SetLegend($legend);
312 $px1->SetMaxValue($px1->GetCeilMaxValue());
313 //$px1->SetWidth($WIDTH);
314 $px1->SetHeight($HEIGHT);
315 $px1->SetYLabel($langs->trans("TicketStatByStatus"));
316 $px1->SetShading(3);
317 $px1->SetHorizTickIncrement(1);
318 $px1->SetCssPrefix("cssboxes");
319 $px1->mode = 'depth';
320 //$px1->SetTitle($langs->trans("TicketStatByStatus"));
321
322 $px1->draw($filenamenb, $fileurlnb);
323 print $px1->show($totalnb ? 0 : 1);
324 }
325 }
326 print '</td></tr>';
327 print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$totalnb.'</td></tr>';
328 print '</table>';
329 print '</div>';
330}
331
332if ($user->hasRight('ticket', 'read')) {
333 // Build graphic number of object
334 $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
335
336 print '<br>'."\n";
337}
338
339print $resultboxes['boxlista'];
340
341print '</div>'."\n";
342
343print '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
344
345if ($user->hasRight('ticket', 'read')) {
346 /*
347 * Latest unread tickets
348 */
349
350 $sql = "SELECT t.rowid, t.ref, t.track_id, t.datec, t.subject, t.type_code, t.category_code, t.severity_code, t.fk_statut as status, t.progress,";
351 $sql .= " type.code as type_code, type.label as type_label,";
352 $sql .= " category.code as category_code, category.label as category_label,";
353 $sql .= " severity.code as severity_code, severity.label as severity_label";
354 $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
355 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity";
356 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity";
357 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity";
358 if (!$user->hasRight('societe', 'client', 'voir')) {
359 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
360 }
361
362 $sql .= ' WHERE t.entity IN ('.getEntity('ticket').')';
363 $sql .= " AND t.fk_statut = 0";
364 if (!$user->hasRight('societe', 'client', 'voir')) {
365 $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
366 }
367
368 if ($user->socid > 0) {
369 $sql .= " AND t.fk_soc= ".((int) $user->socid);
370 } else {
371 // Restricted to assigned user only
372 if (getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY') && !$permissiontomanage) {
373 $sql .= " AND t.fk_user_assign = ".((int) $user->id);
374 }
375 }
376 $sql .= $db->order("t.datec", "DESC");
377 $sql .= $db->plimit($max, 0);
378
379 //print $sql;
380 $result = $db->query($sql);
381 if ($result) {
382 $num = $db->num_rows($result);
383
384 $i = 0;
385
386 $tmpmax = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT_LAST_MODIFIED_TICKETS', $max);
387 $transRecordedType = $langs->trans("LatestNewTickets", $tmpmax);
388
389 print '<div class="div-table-responsive-no-min">';
390 print '<table class="noborder centpercent">';
391 print '<tr class="liste_titre"><th colspan="5">'.$transRecordedType;
392 print '<a href="'.DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.Ticket::STATUS_NOT_READ.'" title="'.$langs->trans("FullList").'">';
393 print '<span class="badge marginleftonlyshort">...</span>';
394 //print $langs->trans("FullList")
395 print '</a>';
396 print '</th>';
397 print '<th>';
398 print '</th>';
399 print '<th>';
400 print '</th>';
401 print '</tr>';
402 if ($num > 0) {
403 while ($i < $num) {
404 $objp = $db->fetch_object($result);
405
406 $object->id = $objp->rowid;
407 $object->ref = $objp->ref;
408 $object->track_id = $objp->track_id;
409 $object->status = $objp->status;
410 $object->progress = $objp->progress;
411 $object->subject = $objp->subject;
412
413 print '<tr class="oddeven">';
414
415 // Ref
416 print '<td class="nowraponall">';
417 print $object->getNomUrl(1);
418 print "</td>\n";
419
420 // Creation date
421 print '<td class="center nowraponall">';
422 print dol_print_date($db->jdate($objp->datec), 'dayhourreduceformat');
423 print "</td>";
424
425 // Subject
426 print '<td class="nowrap tdoverflowmax150">';
427 print '<a href="card.php?track_id='.$objp->track_id.'" title="'.dolPrintHTMLForAttribute($objp->subject).'">'.dol_trunc($objp->subject, 30).'</a>';
428 print "</td>\n";
429
430 // Type
431 print '<td class="nowrap tdoverflowmax100">';
432 $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$objp->type_code, 'c_ticket_type', 'code', 'label', $objp->type_code);
433 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
434 print '</td>';
435
436 // Category
437 print '<td class="nowrap">';
438 if (!empty($objp->category_code)) {
439 $s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$objp->category_code, 'c_ticket_category', 'code', 'label', $objp->category_code);
440 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
441 }
442 //print $objp->category_label;
443 print "</td>";
444
445 // Severity = Priority
446 print '<td class="nowrap" title="'.$langs->trans("Priority").'">';
447 $s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$objp->severity_code, 'c_ticket_severity', 'code', 'label', $objp->severity_code);
448 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
449 //print $objp->severity_label;
450 print "</td>";
451
452 print '<td class="nowraponall right">';
453 print $object->getLibStatut(5);
454 print "</td>";
455
456 print "</tr>\n";
457 $i++;
458 }
459
460 $db->free($result);
461 } else {
462 print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans('NoUnreadTicketsFound').'</span></td></tr>';
463 }
464
465 print "</table>";
466 print '</div>';
467
468 print '<br>';
469 } else {
471 }
472}
473
474print $resultboxes['boxlistb'];
475
476print '</div>';
477print '</div>';
478print '</div>';
479
480
481print '<div class="clearboth"></div>';
482
483$parameters = array('user' => $user);
484$reshook = $hookmanager->executeHooks('dashboardTickets', $parameters, $object); // Note that $action and $object may have been modified by hook
485
486
487// End of page
488llxFooter();
489$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to build graphs.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
static getBoxesArea($user, $areacode)
Get array with HTML tabs with widgets/boxes of a particular area including personalized choices of us...
const STATUS_NOT_READ
Status.
Class to manage the ticket stats.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
Definition date.lib.php:386
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_now($mode='gmt')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolPrintHTMLForAttribute($s, $escapeonlyhtmltags=0, $allowothertags=array())
Return a string ready to be output into an HTML attribute (alt, title, data-html, ....
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
Class to generate the form for creating a new ticket.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.