28 require
'../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/authority.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 $langs->loadLangs(array(
'admin',
'bills',
'blockedlog',
'other'));
39 if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
44 $action =
GETPOST(
'action',
'aZ09');
45 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'blockedloglist';
46 $backtopage =
GETPOST(
'backtopage',
'alpha');
47 $optioncss =
GETPOST(
'optioncss',
'aZ');
49 $search_showonlyerrors =
GETPOST(
'search_showonlyerrors',
'int');
50 if ($search_showonlyerrors < 0) {
51 $search_showonlyerrors = 0;
54 $search_startyear =
GETPOST(
'search_startyear',
'int');
55 $search_startmonth =
GETPOST(
'search_startmonth',
'int');
56 $search_startday =
GETPOST(
'search_startday',
'int');
57 $search_endyear =
GETPOST(
'search_endyear',
'int');
58 $search_endmonth =
GETPOST(
'search_endmonth',
'int');
59 $search_endday =
GETPOST(
'search_endday',
'int');
60 $search_id =
GETPOST(
'search_id',
'alpha');
61 $search_fk_user =
GETPOST(
'search_fk_user',
'intcomma');
63 if ($search_startyear !=
'') {
64 $search_start =
dol_mktime(0, 0, 0, $search_startmonth, $search_startday, $search_startyear);
67 if (
GETPOST(
'search_endyear') !=
'') {
70 $search_code =
GETPOST(
'search_code',
'alpha');
71 $search_ref =
GETPOST(
'search_ref',
'alpha');
72 $search_amount =
GETPOST(
'search_amount',
'alpha');
74 if (($search_start == -1 || empty($search_start)) && !
GETPOSTISSET(
'search_startmonth')) {
79 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
80 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
81 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
83 if (empty($page) || $page == -1) {
86 $offset = $limit * $page;
87 $pageprev = $page - 1;
88 $pagenext = $page + 1;
90 if (empty($sortfield)) {
93 if (empty($sortorder)) {
98 $block_static->loadTrackedEvents();
103 $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME);
104 $max_time = @ini_get(
"max_execution_time");
105 if ($max_time && $max_time < $max_execution_time_for_importexport) {
106 dol_syslog(
"max_execution_time=".$max_time.
" is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.
". We try to increase it dynamically.");
107 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
116 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
118 $search_fk_user =
'';
124 $search_showonlyerrors = 0;
126 $search_array_options = array();
129 if ($action ===
'downloadblockchain') {
132 $bc = $auth->getLocalBlockChain();
134 header(
'Content-Type: application/octet-stream');
135 header(
"Content-Transfer-Encoding: Binary");
136 header(
"Content-disposition: attachment; filename=\"".$auth->signature.
".certif\"");
141 } elseif (
GETPOST(
'downloadcsv',
'alpha')) {
149 $sql =
"SELECT rowid,date_creation,tms,user_fullname,action,amounts,element,fk_object,date_object,ref_object,signature,fk_user,object_data";
150 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
151 $sql .=
" WHERE entity = ".$conf->entity;
152 if (
GETPOST(
'monthtoexport',
'int') > 0 ||
GETPOST(
'yeartoexport',
'int') > 0) {
155 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates).
"' AND '".$db->idate($datee).
"'";
157 $sql .=
" ORDER BY rowid ASC";
158 $sql .= $db->plimit(1);
160 $res = $db->query($sql);
163 $obj = $db->fetch_object($res);
165 $previoushash = $block_static->getPreviousHash(0, $obj->rowid);
166 $firstid = $obj->rowid;
168 $previoushash =
'nodata';
179 $sql =
"SELECT rowid, date_creation, tms, user_fullname, action, amounts, element, fk_object, date_object, ref_object, signature, fk_user, object_data, object_version";
180 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
181 $sql .=
" WHERE entity = ".((int) $conf->entity);
182 if (
GETPOST(
'monthtoexport',
'int') > 0 ||
GETPOST(
'yeartoexport',
'int') > 0) {
185 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates).
"' AND '".$db->idate($datee).
"'";
187 $sql .=
" ORDER BY rowid ASC";
189 $res = $db->query($sql);
191 header(
'Content-Type: application/octet-stream');
192 header(
"Content-Transfer-Encoding: Binary");
193 header(
"Content-disposition: attachment; filename=\"unalterable-log-archive-".$dolibarr_main_db_name.
"-".(
GETPOST(
'yeartoexport',
'int') > 0 ?
GETPOST(
'yeartoexport',
'int').(
GETPOST(
'monthtoexport',
'int') > 0 ?sprintf(
"%02d",
GETPOST(
'monthtoexport',
'int')) :
'').
'-' :
'').$previoushash.
".csv\"");
195 print $langs->transnoentities(
'Id')
196 .
';'.$langs->transnoentities(
'Date')
197 .
';'.$langs->transnoentities(
'User')
198 .
';'.$langs->transnoentities(
'Action')
199 .
';'.$langs->transnoentities(
'Element')
200 .
';'.$langs->transnoentities(
'Amounts')
201 .
';'.$langs->transnoentities(
'ObjectId')
202 .
';'.$langs->transnoentities(
'Date')
203 .
';'.$langs->transnoentities(
'Ref')
204 .
';'.$langs->transnoentities(
'Fingerprint')
205 .
';'.$langs->transnoentities(
'Status')
206 .
';'.$langs->transnoentities(
'Note')
207 .
';'.$langs->transnoentities(
'Version')
208 .
';'.$langs->transnoentities(
'FullData')
214 while ($obj = $db->fetch_object($res)) {
217 $block_static->id = $obj->rowid;
218 $block_static->date_creation = $db->jdate($obj->date_creation);
219 $block_static->date_modification = $db->jdate($obj->tms);
220 $block_static->action = $obj->action;
221 $block_static->fk_object = $obj->fk_object;
222 $block_static->element = $obj->element;
223 $block_static->amounts = (double) $obj->amounts;
224 $block_static->ref_object = $obj->ref_object;
225 $block_static->date_object = $db->jdate($obj->date_object);
226 $block_static->user_fullname = $obj->user_fullname;
227 $block_static->fk_user = $obj->fk_user;
228 $block_static->signature = $obj->signature;
229 $block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data);
230 $block_static->object_version = $obj->object_version;
232 $checksignature = $block_static->checkSignature($previoushash);
234 if ($checksignature) {
235 $statusofrecord =
'Valid';
236 if ($loweridinerror > 0) {
237 $statusofrecordnote =
'ValidButFoundAPreviousKO';
239 $statusofrecordnote =
'';
242 $statusofrecord =
'KO';
243 $statusofrecordnote =
'LineCorruptedOrNotMatchingPreviousOne';
244 $loweridinerror = $obj->rowid;
248 $statusofrecordnote = $langs->trans(
"PreviousFingerprint").
': '.$previoushash.($statusofrecordnote ?
' - '.$statusofrecordnote :
'');
251 print
';'.$obj->date_creation;
252 print
';"'.str_replace(
'"',
'""', $obj->user_fullname).
'"';
253 print
';'.$obj->action;
254 print
';'.$obj->element;
255 print
';'.$obj->amounts;
256 print
';'.$obj->fk_object;
257 print
';'.$obj->date_object;
258 print
';"'.str_replace(
'"',
'""', $obj->ref_object).
'"';
259 print
';'.$obj->signature;
260 print
';'.$statusofrecord;
261 print
';'.$statusofrecordnote;
262 print
';'.$obj->object_version;
263 print
';"'.str_replace(
'"',
'""', $obj->object_data).
'"';
267 $previoushash = $obj->signature;
286 if (
GETPOST(
'withtab',
'alpha')) {
287 $title = $langs->trans(
"ModuleSetup").
' '.$langs->trans(
'BlockedLog');
289 $title = $langs->trans(
"BrowseBlockedLog");
291 $help_url=
"EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
297 $blocks = $block_static->getLog(
'all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
298 if (!is_array($blocks)) {
300 setEventMessages($langs->trans(
"TooManyRecordToScanRestrictFilters", $MAXLINES),
null,
'errors');
302 dol_print_error($block_static->db, $block_static->error, $block_static->errors);
308 if (
GETPOST(
'withtab',
'alpha')) {
309 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
314 if (
GETPOST(
'withtab',
'alpha')) {
319 print
'<span class="opacitymedium hideonsmartphone">'.$langs->trans(
"FingerprintsDesc").
"<br></span>\n";
324 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
325 $param .=
'&contextpage='.urlencode($contextpage);
327 if ($limit > 0 && $limit != $conf->liste_limit) {
328 $param .=
'&limit='.urlencode($limit);
330 if ($search_id !=
'') {
331 $param .=
'&search_id='.urlencode($search_id);
333 if ($search_fk_user > 0) {
334 $param .=
'&search_fk_user='.urlencode($search_fk_user);
336 if ($search_startyear > 0) {
337 $param .=
'&search_startyear='.urlencode($search_startyear);
339 if ($search_startmonth > 0) {
340 $param .=
'&search_startmonth='.urlencode($search_startmonth);
342 if ($search_startday > 0) {
343 $param .=
'&search_startday='.urlencode($search_startday);
345 if ($search_endyear > 0) {
346 $param .=
'&search_endyear='.urlencode($search_endyear);
348 if ($search_endmonth > 0) {
349 $param .=
'&search_endmonth='.urlencode($search_endmonth);
351 if ($search_endday > 0) {
352 $param .=
'&search_endday='.urlencode($search_endday);
354 if ($search_showonlyerrors > 0) {
355 $param .=
'&search_showonlyerrors='.urlencode($search_showonlyerrors);
357 if ($optioncss !=
'') {
358 $param .=
'&optioncss='.urlencode($optioncss);
360 if (
GETPOST(
'withtab',
'alpha')) {
361 $param .=
'&withtab='.urlencode(
GETPOST(
'withtab',
'alpha'));
367 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
368 print
'<input type="hidden" name="token" value="'.newToken().
'">';
370 print
'<div class="right">';
371 print $langs->trans(
"RestrictYearToExport").
': ';
372 $smonth =
GETPOST(
'monthtoexport',
'int');
375 $retstring .=
'<select class="flat valignmiddle maxwidth75imp marginrightonly" id="monthtoexport" name="monthtoexport">';
376 $retstring .=
'<option value="0" selected> </option>';
377 for ($month = 1; $month <= 12; $month++) {
378 $retstring .=
'<option value="'.$month.
'"'.($month == $smonth ?
' selected' :
'').
'>';
379 $retstring .=
dol_print_date(mktime(12, 0, 0, $month, 1, 2000),
"%b");
380 $retstring .=
"</option>";
382 $retstring .=
"</select>";
384 print
'<input type="text" name="yeartoexport" class="valignmiddle maxwidth50imp" value="'.GETPOST(
'yeartoexport',
'int').
'">';
385 print
'<input type="hidden" name="withtab" value="'.GETPOST(
'withtab',
'alpha').
'">';
386 print
'<input type="submit" name="downloadcsv" class="button" value="'.$langs->trans(
'DownloadLogCSV').
'">';
387 if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
388 print
' | <a href="?action=downloadblockchain'.(GETPOST(
'withtab',
'alpha') ?
'&withtab='.GETPOST(
'withtab',
'alpha') :
'').
'">'.$langs->trans(
'DownloadBlockChain').
'</a>';
394 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
396 print
'<div class="div-table-responsive">';
398 if ($optioncss !=
'') {
399 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
401 print
'<input type="hidden" name="token" value="'.newToken().
'">';
402 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
403 print
'<input type="hidden" name="action" value="list">';
404 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
405 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
406 print
'<input type="hidden" name="page" value="'.$page.
'">';
407 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
408 print
'<input type="hidden" name="withtab" value="'.GETPOST(
'withtab',
'alpha').
'">';
410 print
'<table class="noborder centpercent">';
413 print
'<tr class="liste_titre_filter">';
415 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.dol_escape_htmltag($search_id).
'"></td>';
417 print
'<td class="liste_titre">';
419 print
$form->selectDate($search_start,
'search_start');
422 print
$form->selectDate($search_end,
'search_end');
426 print
'<td class="liste_titre">';
427 print
$form->select_dolusers($search_fk_user,
'search_fk_user', 1,
null, 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
432 $langs->load(
"blockedlog");
433 print
'<td class="liste_titre">';
434 print
$form->selectarray(
'search_code', $block_static->trackedevents, $search_code, 1, 0, 0,
'', 1, 0, 0,
'ASC',
'maxwidth200', 1);
438 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'"></td>';
441 print
'<td class="liste_titre"></td>';
444 print
'<td class="liste_titre right"><input type="text" class="maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'"></td>';
447 print
'<td class="liste_titre"></td>';
450 print
'<td class="liste_titre"></td>';
453 print
'<td class="liste_titre">';
454 $array = array(
"1" =>
"OnlyNonValid");
455 print
$form->selectarray(
'search_showonlyerrors', $array, $search_showonlyerrors, 1, 0, 0,
'', 1, 0, 0,
'ASC',
'search_status maxwidth200 onrightofpage', 1);
459 print
'<td class="liste_titre"></td>';
462 print
'<td class="liste_titre" align="middle">';
463 $searchpicto =
$form->showFilterButtons();
469 print
'<tr class="liste_titre">';
470 print
getTitleFieldOfList($langs->trans(
'#'), 0, $_SERVER[
"PHP_SELF"],
'rowid',
'', $param,
'', $sortfield, $sortorder,
'minwidth50 ').
"\n";
471 print
getTitleFieldOfList($langs->trans(
'Date'), 0, $_SERVER[
"PHP_SELF"],
'date_creation',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
472 print
getTitleFieldOfList($langs->trans(
'Author'), 0, $_SERVER[
"PHP_SELF"],
'user_fullname',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
473 print
getTitleFieldOfList($langs->trans(
'Action'), 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
474 print
getTitleFieldOfList($langs->trans(
'Ref'), 0, $_SERVER[
"PHP_SELF"],
'ref_object',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
475 print
getTitleFieldOfList(
'', 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
476 print
getTitleFieldOfList($langs->trans(
'Amount'), 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'class="right"', $sortfield, $sortorder,
'').
"\n";
477 print
getTitleFieldOfList($langs->trans(
'DataOfArchivedEvent'), 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'align="center"', $sortfield, $sortorder,
'').
"\n";
478 print
getTitleFieldOfList($langs->trans(
'Fingerprint'), 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'').
"\n";
479 print
getTitleFieldOfList($langs->trans(
'Status'), 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'align="center"', $sortfield, $sortorder,
'').
"\n";
480 print
getTitleFieldOfList(
'', 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'align="center"', $sortfield, $sortorder,
'').
"\n";
481 print
getTitleFieldOfList(
'<span id="blockchainstatus"></span>', 0, $_SERVER[
"PHP_SELF"],
'',
'', $param,
'align="center"', $sortfield, $sortorder,
'').
"\n";
484 if (!empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
492 $checkresult = array();
493 $checkdetail = array();
494 if (is_array($blocks)) {
495 foreach ($blocks as &$block) {
496 $tmpcheckresult = $block->checkSignature(
'', 1);
498 $checksignature = $tmpcheckresult[
'checkresult'];
500 $checkresult[$block->id] = $checksignature;
501 $checkdetail[$block->id] = $tmpcheckresult;
503 if (!$checksignature) {
504 if (empty($loweridinerror)) {
505 $loweridinerror = $block->id;
507 $loweridinerror = min($loweridinerror, $block->id);
514 if (is_array($blocks)) {
516 $MAXFORSHOWLINK = 100;
519 foreach ($blocks as &$block) {
521 if (empty($search_showonlyerrors) || !$checkresult[$block->id]) {
524 if ($nbshown < $MAXFORSHOWLINK) {
525 $object_link = $block->getObjectLink();
527 $object_link = $block->element.
'/'.$block->fk_object;
530 print
'<tr class="oddeven">';
533 print
'<td>'.dol_escape_htmltag($block->id).
'</td>';
536 print
'<td class="nowraponall">'.dol_print_date($block->date_creation,
'dayhour').
'</td>';
545 print
'<td class="tdoverflowmax250" title="'.dol_escape_htmltag($langs->trans(
'log'.$block->action)).
'">'.$langs->trans(
'log'.$block->action).
'</td>';
548 print
'<td class="nowraponall">';
549 print $block->ref_object;
553 print
'<td'.(preg_match(
'/<a/', $object_link) ?
' class="nowrap"' :
'').
'><!-- object_link -->'.$object_link.
'</td>';
556 print
'<td class="right nowraponall">'.price($block->amounts).
'</td>';
559 print
'<td align="center"><a href="#" data-blockid="'.$block->id.
'" rel="show-info">'.
img_info($langs->trans(
'ShowDetails')).
'</a></td>';
562 print
'<td class="nowrap">';
563 $texttoshow = $langs->trans(
"Fingerprint").
' - '.$langs->trans(
"Saved").
':<br>'.$block->signature;
564 $texttoshow .=
'<br><br>'.$langs->trans(
"Fingerprint").
' - Recalculated sha256(previoushash * data):<br>'.$checkdetail[$block->id][
'calculatedsignature'];
565 $texttoshow .=
'<br><span class="opacitymedium">'.$langs->trans(
"PreviousHash").
'='.$checkdetail[$block->id][
'previoushash'].
'</span>';
567 print
$form->textwithpicto(
dol_trunc($block->signature,
'8'), $texttoshow, 1,
'help',
'', 0, 2,
'fingerprint'.$block->id);
571 print
'<td class="center">';
572 if (!$checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) {
573 if ($checkresult[$block->id]) {
574 print
'<span class="badge badge-status4 badge-status" title="'.$langs->trans(
'OkCheckFingerprintValidityButChainIsKo').
'">OK</span>';
576 print
'<span class="badge badge-status8 badge-status" title="'.$langs->trans(
'KoCheckFingerprintValidity').
'">KO</span>';
579 print
'<span class="badge badge-status4 badge-status" title="'.$langs->trans(
'OkCheckFingerprintValidity').
'">OK</span>';
584 print
'<td class="center">';
585 if (!$checkresult[$block->id] || ($loweridinerror && $block->id >= $loweridinerror)) {
586 if ($checkresult[$block->id]) {
587 print
$form->textwithpicto(
'', $langs->trans(
'OkCheckFingerprintValidityButChainIsKo'));
591 if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
592 print
' '.($block->certified ?
img_picto($langs->trans(
'AddedByAuthority'),
'info') :
img_picto($langs->trans(
'NotAddedByAuthorityYet'),
'info_black'));
603 print
'<tr><td colspan="12"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
614 print
'<script type="text/javascript">
616 jQuery(document).ready(function () {
617 jQuery("#dialogforpopup").dialog(
618 { closeOnEscape: true, classes: { "ui-dialog": "highlight" },
619 maxHeight: window.innerHeight-60, height: window.innerHeight-60, width: '.($conf->browser->layout ==
'phone' ? 400 : 700).
',
621 autoOpen: false }).css("z-index: 5000");
623 $("a[rel=show-info]").click(function() {
625 console.log("We click on tooltip, we open popup and get content using an ajax call");
627 var fk_block = $(this).attr("data-blockid");
632 url:
"'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block,
634 }).done(
function(data) {
635 jQuery(
"#dialogforpopup").html(data);
638 jQuery(
"#dialogforpopup").dialog(
"open");
644 if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
646 <script type="text/javascript">
651 url: '<?php echo DOL_URL_ROOT.
'/blockedlog/ajax/check_signature.php' ?>
',
653 }).done(function(data) {
654 if(data == 'hashisok
') {
655 $('#blockchainstatus
').html('<?php echo $langs->trans(
'AuthorityReconizeFingerprintConformity').
' '.
img_picto($langs->trans(
'SignatureOK'),
'on') ?>
');
658 $('#blockchainstatus
').html('<?php echo $langs->trans(
'AuthorityDidntReconizeFingerprintConformity').
' '.
img_picto($langs->trans(
'SignatureKO'),
'off') ?>
');
667 if (GETPOST('withtab
', 'alpha
')) {
668 print dol_get_fiche_end();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
blockedlogadmin_prepare_head()
Define head array for tabs of blockedlog tools setup pages.
Class to manage certif authority.
Class to manage Blocked Log.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
currentToken()
Return the value of token currently saved into session with name 'token'.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_info($titlealt='default')
Show info logo.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.