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