dolibarr  7.0.0-beta
blockedlog_list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
3  * Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/authority.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
31 
32 $langs->loadLangs(array("admin", "other", "blockedlog", "bills"));
33 
34 if (! $user->admin) accessforbidden();
35 
36 $action = GETPOST('action','alpha');
37 $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'blockedloglist'; // To manage different context of search
38 $backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
39 $optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
40 
41 $search_showonlyerrors = GETPOST('search_showonlyerrors','int');
42 if ($search_showonlyerrors < 0) $search_showonlyerrors=0;
43 
44 $search_fk_user=GETPOST('search_fk_user','intcomma');
45 $search_start = -1;
46 if (GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
47 $search_end = -1;
48 if (GETPOST('search_endyear')!='') $search_end= dol_mktime(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
49 $search_code = GETPOST('search_code', 'alpha');
50 $search_ref = GETPOST('search_ref', 'alpha');
51 $search_amount = GETPOST('search_amount', 'alpha');
52 
53 if (($search_start == -1 || empty($search_start)) && ! GETPOSTISSET('search_startmonth')) $search_start = dol_time_plus_duree(dol_now(), '-1', 'w');
54 
55 // Load variable for pagination
56 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
57 $sortfield = GETPOST('sortfield','alpha');
58 $sortorder = GETPOST('sortorder','alpha');
59 $page = GETPOST('page','int');
60 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
64 
65 if (empty($sortfield)) $sortfield='rowid';
66 if (empty($sortorder)) $sortorder='DESC';
67 
68 $block_static = new BlockedLog($db);
69 
70 
71 $result = restrictedArea($user, 'blockedlog', 0, '');
72 
73 
74 /*
75  * Actions
76  */
77 
78 // Purge search criteria
79 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
80 {
81  $search_fk_user = '';
82  $search_start = -1;
83  $search_end = -1;
84  $search_code = '';
85  $search_ref = '';
86  $search_amount = '';
87  $search_showonlyerrors = 0;
88  $toselect='';
89  $search_array_options=array();
90 }
91 
92 if ($action === 'downloadblockchain') {
93 
94  $auth = new BlockedLogAuthority($db);
95 
96  $bc = $auth->getLocalBlockChain();
97 
98  header('Content-Type: application/octet-stream');
99  header("Content-Transfer-Encoding: Binary");
100  header("Content-disposition: attachment; filename=\"" .$auth->signature. ".certif\"");
101 
102  echo $bc;
103 
104  exit;
105 }
106 else if($action === 'downloadcsv') {
107 
108  $sql = "SELECT rowid,date_creation,tms,user_fullname,action,amounts,element,fk_object,date_object,ref_object,signature,fk_user,object_data";
109  $sql.= " FROM ".MAIN_DB_PREFIX."blockedlog";
110  $sql.= " WHERE entity = ".$conf->entity;
111  $sql.= " ORDER BY rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature()
112 
113  $res = $db->query($sql);
114  if($res) {
115 
116  $signature = $block_static->getSignature();
117 
118  header('Content-Type: application/octet-stream');
119  header("Content-Transfer-Encoding: Binary");
120  header("Content-disposition: attachment; filename=\"archive-log-" .$signature. ".csv\"");
121 
122  print $langs->transnoentities('Id')
123  .';'.$langs->transnoentities('Date')
124  .';'.$langs->transnoentities('User')
125  .';'.$langs->transnoentities('Action')
126  .';'.$langs->transnoentities('Element')
127  .';'.$langs->transnoentities('Amounts')
128  .';'.$langs->transnoentities('ObjectId')
129  .';'.$langs->transnoentities('Date')
130  .';'.$langs->transnoentities('Ref')
131  .';'.$langs->transnoentities('Fingerprint')
132  .';'.$langs->transnoentities('Status')
133  .';'.$langs->transnoentities('FullData')
134  ."\n";
135 
136  $previoushash = '';
137  $loweridinerror = 0;
138 
139  while ($obj = $db->fetch_object($res))
140  {
141  // We set here all data used into signature calculation (see checkSignature method) and more
142  // IMPORTANT: We must have here, the same rule for transformation of data than into the fetch method (db->jdate for date, ...)
143  $block_static->id = $obj->rowid;
144  $block_static->date_creation = $db->jdate($obj->date_creation);
145  $block_static->date_modification = $db->jdate($obj->tms);
146  $block_static->action = $obj->action;
147  $block_static->fk_object = $obj->fk_object;
148  $block_static->element = $obj->element;
149  $block_static->amounts = (double) $obj->amounts;
150  $block_static->ref_object = $obj->ref_object;
151  $block_static->date_object = $db->jdate($obj->date_object);
152  $block_static->user_fullname = $obj->user_fullname;
153  $block_static->fk_user = $obj->fk_user;
154  $block_static->signature = $obj->signature;
155  $block_static->object_data = unserialize($obj->object_data);
156 
157  $checksignature = $block_static->checkSignature($previoushash); // If $previoushash is not defined, checkSignature will search it
158 
159  if ($checksignature)
160  {
161  if ($loweridinerror > 0) $statusofrecord = 'ValidButFoundAPreviousKO';
162  else $statusofrecord = 'Valid';
163  }
164  else
165  {
166  $statusofrecord = 'KO';
167  $loweridinerror = $obj->rowid;
168  }
169 
170  print $obj->rowid
171  .';'.$obj->date_creation
172  .';"'.$obj->user_fullname.'"'
173  .';'.$obj->action
174  .';'.$obj->element
175  .';'.$obj->amounts
176  .';'.$obj->fk_object
177  .';'.$obj->date_object
178  .';"'.$obj->ref_object.'"'
179  .';'.$obj->signature
180  .';'.$statusofrecord
181  .';"'.str_replace('"','""',$obj->object_data).'"'
182  ."\n";
183 
184  // Set new previous hash for next fetch
185  $previoushash = $obj->signature;
186  }
187 
188  exit;
189  }
190  else
191  {
192  setEventMessage($db->lasterror, 'errors');
193  }
194 }
195 
196 
197 /*
198  * View
199  */
200 
201 $form=new Form($db);
202 
203 if (GETPOST('withtab','alpha'))
204 {
205  $title=$langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog');
206 }
207 else
208 {
209  $title=$langs->trans("BrowseBlockedLog");
210 }
211 
212 llxHeader('',$langs->trans("BrowseBlockedLog"));
213 
214 $MAXLINES = 10000;
215 
216 $blocks = $block_static->getLog('all', 0, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
217 if (! is_array($blocks))
218 {
219  if ($blocks == -2)
220  {
221  setEventMessages($langs->trans("TooManyRecordToScanRestrictFilters", $MAXLINES), null, 'errors');
222  }
223  else
224  {
225  dol_print_error($block_static->db, $block_static->error, $block_static->errors);
226  exit;
227  }
228 }
229 
230 $linkback='';
231 if (GETPOST('withtab','alpha'))
232 {
233  $linkback='<a href="'.($backtopage?$backtopage:DOL_URL_ROOT.'/admin/modules.php').'">'.$langs->trans("BackToModuleList").'</a>';
234 }
235 
236 print load_fiche_titre($title, $linkback);
237 
238 if (GETPOST('withtab','alpha'))
239 {
241  dol_fiche_head($head, 'fingerprints', '', -1);
242 }
243 
244 print '<span class="opacitymedium">'.$langs->trans("FingerprintsDesc")."</span><br>\n";
245 
246 print '<br>';
247 
248 $param='';
249 if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
250 if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
251 if ($search_fk_user > 0) $param.='&search_fk_user='.urlencode($search_fk_user);
252 if ($search_startyear > 0) $param.='&search_startyear='.urlencode(GETPOST('search_startyear','int'));
253 if ($search_startmonth > 0) $param.='&search_startmonth='.urlencode(GETPOST('search_startmonth','int'));
254 if ($search_startday > 0) $param.='&search_startday='.urlencode(GETPOST('search_startday','int'));
255 if ($search_endyear > 0) $param.='&search_endyear='.urlencode(GETPOST('search_endyear','int'));
256 if ($search_endmonth > 0) $param.='&search_endmonth='.urlencode(GETPOST('search_endmonth','int'));
257 if ($search_endday > 0) $param.='&search_endday='.urlencode(GETPOST('search_endday','int'));
258 if ($search_showonlyerrors > 0) $param.='&search_showonlyerrors='.urlencode($search_showonlyerrors);
259 if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
260 if (GETPOST('withtab','alpha')) $param.='&withtab='.urlencode(GETPOST('withtab','alpha'));
261 
262 // Add $param from extra fields
263 //include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
264 
265 
266 print '<div align="right">';
267 //print ' <a href="?all=1'.(GETPOST('withtab','alpha')?'&withtab='.GETPOST('withtab','alpha'):'').'">'.$langs->trans('ShowAllFingerPrintsMightBeTooLong').'</a>';
268 //print ' | <a href="?all=1&search_showonlyerrors=1'.(GETPOST('withtab','alpha')?'&withtab='.GETPOST('withtab','alpha'):'').'">'.$langs->trans('ShowAllFingerPrintsErrorsMightBeTooLong').'</a>';
269 print ' <a href="?action=downloadcsv'.(GETPOST('withtab','alpha')?'&withtab='.GETPOST('withtab','alpha'):'').'">'.$langs->trans('DownloadLogCSV').'</a>';
270 if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) print ' | <a href="?action=downloadblockchain'.(GETPOST('withtab','alpha')?'&withtab='.GETPOST('withtab','alpha'):'').'">'.$langs->trans('DownloadBlockChain').'</a>';
271 print ' </div>';
272 
273 
274 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
275 
276 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
277 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
278 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
279 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
280 print '<input type="hidden" name="action" value="list">';
281 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
282 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
283 print '<input type="hidden" name="page" value="'.$page.'">';
284 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
285 print '<input type="hidden" name="withtab" value="'.GETPOST('withtab','alpha').'">';
286 
287 print '<table class="noborder" width="100%">';
288 
289 // Line of filters
290 print '<tr class="liste_titre_filter">';
291 
292 print '<td class="liste_titre">&nbsp;</td>';
293 
294 print '<td class="liste_titre">';
295 //print $langs->trans("from").': ';
296 $form->select_date($search_start,'search_start');
297 //print '<br>';
298 //print $langs->trans("to").': ';
299 $form->select_date($search_end,'search_end');
300 print '</td>';
301 
302 // User
303 print '<td class="liste_titre">';
304 print $form->select_dolusers($search_fk_user, 'search_fk_user', 1);
305 print '</td>';
306 
307 // Actions code
308 $langs->load("blockedlog");
309 print '<td class="liste_titre">';
310 print $form->selectarray('search_code', $block_static->trackedevents, $search_code, 1, 0, 0, '', 1, 0, 0, 'ASC', 'maxwidth200', 1);
311 print '</td>';
312 
313 // Ref
314 print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
315 
316 print '<td class="liste_titre"></td>';
317 
318 // Amount
319 print '<td class="liste_titre right"><input type="text" class="maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
320 
321 // Full data
322 print '<td class="liste_titre"></td>';
323 
324 // Fingerprint
325 print '<td class="liste_titre"></td>';
326 
327 // Status
328 print '<td class="liste_titre">';
329 $array=array("1"=>$langs->trans("OnlyNonValid"));
330 print $form->selectarray('search_showonlyerrors', $array, $search_showonlyerrors, 1);
331 print '</td>';
332 
333 // Action column
334 print '<td class="liste_titre" align="middle">';
335 $searchpicto=$form->showFilterButtons();
336 print $searchpicto;
337 print '</td>';
338 
339 print '</tr>';
340 
341 print '<tr class="liste_titre">';
342 print getTitleFieldOfList($langs->trans('#'), 0, $_SERVER["PHP_SELF"],'rowid','',$param,'',$sortfield,$sortorder,'minwidth50 ')."\n";
343 print getTitleFieldOfList($langs->trans('Date'), 0, $_SERVER["PHP_SELF"],'date_creation','',$param,'',$sortfield,$sortorder,'')."\n";
344 print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"],'user_fullname','',$param,'',$sortfield,$sortorder,'')."\n";
345 print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
346 print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"],'ref_object','',$param,'',$sortfield,$sortorder,'')."\n";
347 print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
348 print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder,'')."\n";
349 print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n";
350 print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
351 print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n";
352 print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n";
353 print '</tr>';
354 
355 if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR))
356 {
357  // This is version that is faster but require more memory and report errors that are outside the filter range
358 
359  // TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests
360  // to find the $loweridinerror.
361 
362 }
363 else
364 {
365  // This is version that optimize the memory (but will not report errors that are outside the filter range)
366  $loweridinerror=0;
367  $checkresult=array();
368  if (is_array($blocks))
369  {
370  foreach($blocks as &$block)
371  {
372  $checksignature = $block->checkSignature(); // Note: this make a sql request at each call, we can't avoid this as the sorting order is various
373  $checkresult[$block->id]=$checksignature; // false if error
374  if (! $checksignature)
375  {
376  if (empty($loweridinerror)) $loweridinerror=$block->id;
377  else $loweridinerror = min($loweridinerror, $block->id);
378  }
379  }
380  }
381 }
382 
383 if (is_array($blocks))
384 {
385  foreach($blocks as &$block)
386  {
387  $object_link = $block->getObjectLink();
388 
389  if (empty($search_showonlyerrors) || ! $checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror))
390  {
391  print '<tr class="oddeven">';
392  // ID
393  print '<td>'.$block->id.'</td>';
394  // Date
395  print '<td>'.dol_print_date($block->date_creation,'dayhour').'</td>';
396  // User
397  print '<td>';
398  //print $block->getUser()
399  print $block->user_fullname;
400  print '</td>';
401  // Action
402  print '<td>'.$langs->trans('log'.$block->action).'</td>';
403  // Ref
404  print '<td class="nowrap">'.$block->ref_object.'</td>';
405  // Link to source object
406  print '<td>'.$object_link.'</td>';
407  print '<td align="right">'.price($block->amounts).'</td>';
408  print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
409 
410  print '<td>';
411  print $form->textwithpicto(dol_trunc($block->signature, '12'), $block->signature);
412  print '</td>';
413 
414  print '<td class="center">';
415  if (! $checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) // If error
416  {
417  if ($checkresult[$block->id]) print img_picto($langs->trans('OkCheckFingerprintValidityButChainIsKo'), 'statut1');
418  else print img_picto($langs->trans('KoCheckFingerprintValidity'), 'statut8');
419  }
420  else
421  {
422  print img_picto($langs->trans('OkCheckFingerprintValidity'), 'statut4');
423  }
424 
425  if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
426  print ' '.($block->certified ? img_picto($langs->trans('AddedByAuthority'), 'info') : img_picto($langs->trans('NotAddedByAuthorityYet'), 'info_black') );
427  }
428  print '</td>';
429 
430  print '<td></td>';
431 
432  print '</tr>';
433 
434  }
435  }
436 }
437 
438 print '</table>';
439 
440 print '</form>';
441 
442 print '</div>';
443 
444 
445 
446 print '<script type="text/javascript">
447 
448 jQuery(document).ready(function () {
449  jQuery("#dialogforpopup").dialog(
450  { closeOnEscape: true, classes: { "ui-dialog": "highlight" },
451  maxHeight: window.innerHeight-60, height: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).',
452  modal: true,
453  autoOpen: false }).css("z-index: 5000");
454 
455  $("a[rel=show-info]").click(function() {
456 
457  console.log("We click on tooltip");
458 
459  jQuery("#dialogforpopup").html(\'<div id="pop-info"><table width="100%" height="80%" class="border"><thead><th width="50%">'.$langs->trans('Field').'</th><th>'.$langs->trans('Value').'</th></thead><tbody></tbody></table></div>\');
460 
461  var fk_block = $(this).attr("data-blockid");
462 
463  $.ajax({
464  url:"../ajax/block-info.php?id="+fk_block
465  ,dataType:"json"
466  }).done(function(data) {
467  drawData(data,"");
468  });
469 
470  jQuery("#dialogforpopup").dialog("open");
471  });
472 
473 
474  function drawData(data, prefix) {
475  for(x in data) {
476  value = data[x];
477 
478  if (typeof value != "object") {
479  $("#pop-info table tbody").append("<tr><td>"+prefix+x+"</td><td class=\"wordwrap\">"+value+"</td></tr>");
480  }
481  if ((typeof value === "object") && (value !== null)) {
482  drawData(value, prefix+x+" &gt;&gt; ");
483  }
484  }
485  }
486 
487 })
488 </script>'."\n";
489 
490 
491 if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL))
492 {
493 ?>
494  <script type="text/javascript">
495 
496  $.ajax({
497  url : "<?php echo dol_buildpath('/blockedlog/ajax/check_signature.php',1) ?>"
498  ,dataType:"html"
499  }).done(function(data) {
500 
501  if(data == 'hashisok') {
502  $('#blockchainstatus').html('<?php echo $langs->trans('AuthorityReconizeFingerprintConformity'). ' '. img_picto($langs->trans('SignatureOK'), 'on') ?>');
503  }
504  else{
505  $('#blockchainstatus').html('<?php echo $langs->trans('AuthorityDidntReconizeFingerprintConformity'). ' '.img_picto($langs->trans('SignatureKO'), 'off') ?>');
506  }
507 
508  });
509 
510  </script>
511 <?php
512 }
513 
514 if (GETPOST('withtab','alpha'))
515 {
516  dol_fiche_end();
517 }
518 
519 print '<br><br>';
520 
521 llxFooter();
522 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
Class to manage certif authority.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
blockedlogadmin_prepare_head()
Define head array for tabs of blockedlog tools setup pages.
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting a parameter.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='')
Get title line of an array.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
dol_fiche_end($notab=0)
Show tab footer of a card.
Class to manage Blocked Log.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
dol_now($mode='gmt')
Return date for now.
print
Draft customers invoices.
Definition: index.php:91
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
img_info($titlealt= 'default')
Show info logo.
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.
Definition: date.lib.php:116
type
Definition: viewcat.php:283
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.