dolibarr 25.0.0-alpha
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-2026 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 = getDolUserInt('MAIN_SIZE_SHORTLIST_LIMIT', 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('ticket', 'manage_advance')));
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$colorseries = array();
195$result = $db->query($sql);
196if ($result) {
197 while ($objp = $db->fetch_object($result)) {
198 $found = 0;
199 if ($objp->fk_statut == Ticket::STATUS_NOT_READ) {
200 $tick['unread'] = $objp->nb;
201 }
202 if ($objp->fk_statut == Ticket::STATUS_READ) {
203 $tick['read'] = $objp->nb;
204 }
205 if ($objp->fk_statut == Ticket::STATUS_NEED_MORE_INFO) {
206 $tick['needmoreinfo'] = $objp->nb;
207 }
208 if ($objp->fk_statut == Ticket::STATUS_ASSIGNED) {
209 $tick['assigned'] = $objp->nb;
210 }
211 if ($objp->fk_statut == Ticket::STATUS_IN_PROGRESS) {
212 $tick['inprogress'] = $objp->nb;
213 }
214 if ($objp->fk_statut == Ticket::STATUS_WAITING) {
215 $tick['waiting'] = $objp->nb;
216 }
217 if ($objp->fk_statut == Ticket::STATUS_CLOSED) {
218 $tick['closed'] = $objp->nb;
219 }
220 if ($objp->fk_statut == Ticket::STATUS_CANCELED) {
221 $tick['canceled'] = $objp->nb;
222 }
223 }
224
235 $theme_vars_file = dol_getThemeFilePath('theme_vars.inc.php');
236 if ($theme_vars_file) {
237 include $theme_vars_file; // This define $badgeStatusX
238 }
239
240 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NOT_READ]), 'data' => round($tick['unread']));
241 $colorseries[Ticket::STATUS_NOT_READ] = '-'.$badgeStatus0;
242 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_READ]), 'data' => round($tick['read']));
243 $colorseries[Ticket::STATUS_READ] = $badgeStatus1;
244 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_ASSIGNED]), 'data' => round($tick['assigned']));
245 $colorseries[Ticket::STATUS_ASSIGNED] = $badgeStatus3;
246 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_IN_PROGRESS]), 'data' => round($tick['inprogress']));
247 $colorseries[Ticket::STATUS_IN_PROGRESS] = $badgeStatus4;
248 if (getDolGlobalString('TICKET_INCLUDE_SUSPENDED_STATUS')) {
249 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_WAITING]), 'data' => round($tick['waiting']));
250 $colorseries[Ticket::STATUS_WAITING] = '-'.$badgeStatus4;
251 }
252 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_NEED_MORE_INFO]), 'data' => round($tick['needmoreinfo']));
253 $colorseries[Ticket::STATUS_NEED_MORE_INFO] = '-'.$badgeStatus3;
254 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CANCELED]), 'data' => round($tick['canceled']));
255 $colorseries[Ticket::STATUS_CANCELED] = $badgeStatus9;
256 $dataseries[] = array('label' => $langs->transnoentitiesnoconv($object->labelStatusShort[Ticket::STATUS_CLOSED]), 'data' => round($tick['closed']));
257 $colorseries[Ticket::STATUS_CLOSED] = $badgeStatus6;
258} else {
259 dol_print_error($db);
260}
261
262$stringtoshow = '<script type="text/javascript">
263 jQuery(document).ready(function() {
264 jQuery("#idsubimgDOLUSERCOOKIE_ticket_by_status").click(function() {
265 jQuery("#idfilterDOLUSERCOOKIE_ticket_by_status").toggle();
266 });
267 });
268 </script>';
269$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_by_status">'; // hideobject is to start hidden
270$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
271$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
272$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
273$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_by_status:year,shownb,showtot">';
274$stringtoshow .= $langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
275$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', 0, 1).'">';
276$stringtoshow .= '</form>';
277$stringtoshow .= '</div>';
278
279if ($user->hasRight('ticket', 'read')) {
280 print '<div class="div-table-responsive-no-min">';
281 print '<table class="noborder centpercent">';
282 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>';
283
284 print '<tr><td class="center" colspan=2>';
285 print $stringtoshow;
286
287 // don't display graph if no series
288 $totalnb = 0;
289 if (!empty($dataseries) && count($dataseries) > 1) {
290 foreach ($dataseries as $key => $value) {
291 $totalnb += $value['data'];
292 }
293
294 $data = array();
295 foreach ($dataseries as $key => $value) {
296 $data[] = array($value['label'], $value['data']);
297 }
298 $px1 = new DolGraph();
299 $mesg = $px1->isGraphKo();
300 if (!$mesg) {
301 $px1->SetData($data);
302 $px1->SetDataColor(array_values($colorseries));
303
304 unset($data1);
305 $i = $startyear;
306 $legend = array();
307 while ($i <= $endyear) {
308 $legend[] = $i;
309 $i++;
310 }
311 $px1->setShowLegend(2);
312 $px1->SetType(array('pie'));
313 $px1->SetLegend($legend);
314 $px1->SetMaxValue($px1->GetCeilMaxValue());
315 //$px1->SetWidth($WIDTH);
316 $px1->SetHeight($HEIGHT);
317 $px1->SetYLabel($langs->trans("TicketStatByStatus"));
318 $px1->SetShading(3);
319 $px1->SetHorizTickIncrement(1);
320 $px1->SetCssPrefix("cssboxes");
321 $px1->mode = 'depth';
322 //$px1->SetTitle($langs->trans("TicketStatByStatus"));
323
324 $px1->draw($filenamenb, $fileurlnb);
325 print $px1->show($totalnb ? 0 : 1);
326 }
327 }
328 print '</td></tr>';
329 print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">'.$totalnb.'</td></tr>';
330 print '</table>';
331 print '</div>';
332}
333
334if ($user->hasRight('ticket', 'read')) {
335 // Build graphic number of object
336 $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
337
338 print '<br>'."\n";
339}
340
341print $resultboxes['boxlista'];
342
343print '</div>'."\n";
344
345print '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
346
347if ($user->hasRight('ticket', 'read')) {
348 /*
349 * Latest unread tickets
350 */
351
352 $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,";
353 $sql .= " type.code as type_code, type.label as type_label,";
354 $sql .= " category.code as category_code, category.label as category_label,";
355 $sql .= " severity.code as severity_code, severity.label as severity_label";
356 $sql .= " FROM ".MAIN_DB_PREFIX."ticket as t";
357 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_type as type ON type.code = t.type_code AND type.entity = t.entity";
358 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_category as category ON category.code = t.category_code AND category.entity = t.entity";
359 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_ticket_severity as severity ON severity.code = t.severity_code AND severity.entity = t.entity";
360 if (!$user->hasRight('societe', 'client', 'voir')) {
361 $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
362 }
363
364 $sql .= ' WHERE t.entity IN ('.getEntity('ticket').')';
365 $sql .= " AND t.fk_statut = 0";
366 if (!$user->hasRight('societe', 'client', 'voir')) {
367 $sql .= " AND t.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
368 }
369
370 if ($user->socid > 0) {
371 $sql .= " AND t.fk_soc= ".((int) $user->socid);
372 } else {
373 // Restricted to assigned user only
374 if (getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY') && !$permissiontomanage) {
375 $sql .= " AND t.fk_user_assign = ".((int) $user->id);
376 }
377 }
378 $sql .= $db->order("t.datec", "DESC");
379 $sql .= $db->plimit($max, 0);
380
381 //print $sql;
382 $result = $db->query($sql);
383 if ($result) {
384 $num = $db->num_rows($result);
385
386 $i = 0;
387
388 $tmpmax = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT_LAST_MODIFIED_TICKETS', $max);
389 $transRecordedType = $langs->trans("LatestNewTickets", $tmpmax);
390
391 print '<div class="div-table-responsive-no-min">';
392 print '<table class="noborder centpercent">';
393 print '<tr class="liste_titre"><th colspan="5">'.$transRecordedType;
394 print '<a href="'.DOL_URL_ROOT.'/ticket/list.php?search_fk_statut[]='.Ticket::STATUS_NOT_READ.'" title="'.$langs->trans("FullList").'">';
395 print '<span class="badge marginleftonlyshort">...</span>';
396 //print $langs->trans("FullList")
397 print '</a>';
398 print '</th>';
399 print '<th>';
400 print '</th>';
401 print '<th>';
402 print '</th>';
403 print '</tr>';
404 if ($num > 0) {
405 while ($i < $num) {
406 $objp = $db->fetch_object($result);
407
408 $object->id = $objp->rowid;
409 $object->ref = $objp->ref;
410 $object->track_id = $objp->track_id;
411 $object->status = $objp->status;
412 $object->progress = $objp->progress;
413 $object->subject = $objp->subject;
414
415 print '<tr class="oddeven">';
416
417 // Ref
418 print '<td class="nowraponall">';
419 print $object->getNomUrl(1);
420 print "</td>\n";
421
422 // Creation date
423 print '<td class="center nowraponall">';
424 print dol_print_date($db->jdate($objp->datec), 'dayhourreduceformat');
425 print "</td>";
426
427 // Subject
428 print '<td class="nowrap tdoverflowmax150">';
429 print '<a href="card.php?track_id='.$objp->track_id.'" title="'.dolPrintHTMLForAttribute($objp->subject).'">'.dol_trunc($objp->subject, 30).'</a>';
430 print "</td>\n";
431
432 // Type
433 print '<td class="nowrap tdoverflowmax100">';
434 $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$objp->type_code, 'c_ticket_type', 'code', 'label', $objp->type_code);
435 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
436 print '</td>';
437
438 // Category
439 print '<td class="nowrap">';
440 if (!empty($objp->category_code)) {
441 $s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$objp->category_code, 'c_ticket_category', 'code', 'label', $objp->category_code);
442 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
443 }
444 //print $objp->category_label;
445 print "</td>";
446
447 // Severity = Priority
448 print '<td class="nowrap" title="'.$langs->trans("Priority").'">';
449 $s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$objp->severity_code, 'c_ticket_severity', 'code', 'label', $objp->severity_code);
450 print '<span title="'.dol_escape_htmltag($s).'">'.$s.'</span>';
451 //print $objp->severity_label;
452 print "</td>";
453
454 print '<td class="nowraponall right">';
455 print $object->getLibStatut(5);
456 print "</td>";
457
458 print "</tr>\n";
459 $i++;
460 }
461
462 $db->free($result);
463 } else {
464 print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans('NoUnreadTicketsFound').'</span></td></tr>';
465 }
466
467 print "</table>";
468 print '</div>';
469
470 print '<br>';
471 } else {
472 dol_print_error($db);
473 }
474}
475
476print $resultboxes['boxlistb'];
477
478print '</div>';
479print '</div>';
480print '</div>';
481
482
483print '<div class="clearboth"></div>';
484
485$parameters = array('user' => $user);
486$reshook = $hookmanager->executeHooks('dashboardTickets', $parameters, $object); // Note that $action and $object may have been modified by hook
487
488
489// End of page
490llxFooter();
491$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:391
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_now($mode='gmt')
Return date for now.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
dol_getThemeFilePath($file, $theme='')
Return the full filesystem path of a file located in the currently selected theme directory.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.