29require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
49$langs->loadLangs(array(
'admin',
'banks',
'bills',
'blockedlog',
'cashdesk',
'compta',
'other'));
52$action =
GETPOST(
'action',
'aZ09');
53$confirm =
GETPOST(
'confirm',
'aZ09');
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
58$withtab = GETPOSTISSET(
'withtab') ?
GETPOSTINT(
'withtab') : 1;
60$search_showonlyerrors =
GETPOSTINT(
'search_showonlyerrors');
61if ($search_showonlyerrors < 0) {
62 $search_showonlyerrors = 0;
65$search_startyear =
GETPOSTINT(
'search_startyear');
66$search_startmonth =
GETPOSTINT(
'search_startmonth');
67$search_startday =
GETPOSTINT(
'search_startday');
69$search_endmonth =
GETPOSTINT(
'search_endmonth');
71$search_id =
GETPOST(
'search_id',
'alpha');
72$search_fk_user =
GETPOST(
'search_fk_user',
'intcomma');
74if (
GETPOST(
'search_startyear') !=
'') {
75 $search_start =
dol_mktime(0, 0, 0, $search_startmonth, $search_startday, $search_startyear);
78if (
GETPOST(
'search_endyear') !=
'') {
79 $search_end =
dol_mktime(23, 59, 59, $search_endmonth, $search_endday, $search_endyear);
81$search_code =
GETPOST(
'search_code',
'array:alpha');
82$search_ref =
GETPOST(
'search_ref',
'alpha');
83$search_amount =
GETPOST(
'search_amount',
'alpha');
84$search_signature =
GETPOST(
'search_signature',
'alpha');
86if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET(
'search_startmonth') && !GETPOSTISSET(
'begin')) {
89 $search_startday = $tmparray[
'mday'];
90 $search_startmonth = $tmparray[
'mon'];
91 $search_startyear = $tmparray[
'year'];
96$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
97$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
99if (empty($page) || $page == -1) {
102$offset = $limit * $page;
103$pageprev = $page - 1;
104$pagenext = $page + 1;
106if (empty($sortfield)) {
107 $sortfield =
'rowid';
109if (empty($sortorder)) {
114$block_static->loadTrackedEvents();
122$user->rights->blockedlog->create = 1;
127$max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
128$max_time = @ini_get(
"max_execution_time");
129if ($max_time && $max_time < $max_execution_time_for_importexport) {
130 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.");
131 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
135$MAXFORSHOWNLINKS =
getDolGlobalInt(
'BLOCKEDLOG_MAX_FOR_SHOWN_LINKS', 100);
137$permission = $user->hasRight(
'blockedlog',
'read');
138$permissiontoadd = $user->hasRight(
'blockedlog',
'read');
139$permtoedit = $permissiontoadd;
153if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
155 $search_fk_user =
'';
158 $search_code = array();
161 $search_signature =
'';
162 $search_showonlyerrors = 0;
163 $search_startyear =
'';
164 $search_startmonth =
'';
165 $search_startday =
'';
166 $search_endyear =
'';
167 $search_endmonth =
'';
170 $search_array_options = array();
173include DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
175if ($action ==
'export' && $user->hasRight(
'blockedlog',
'read')) {
180 $periodnotcomplete = 0;
183 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Year")),
null,
"errors");
197 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
198 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/securitycore.lib.php';
201 if ($isqualified && (defined(
'CERTIF_LNE') && (
int) constant(
'CERTIF_LNE') == 1) && !
isHTTPS() && !in_array($action, array(
'DOC_PREVIEW',
'DOC_DOWNLOAD'))) {
202 $errmsg =
'Error: You are using Dolibarr with the module to be compliant with the French Law Finance certification. In this version, the HTTPS is mandatory to be allowed to record any event (Your hosting does not match the install requirements).';
214 $periodnotcomplete = 1;
217 $suffixperiod = ($periodnotcomplete ?
'INCOMPLETE' :
'DONOTMODIFY');
221 $sql =
"SELECT rowid";
222 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
223 $sql .=
" WHERE entity = ".((int)
$conf->entity);
226 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates,
'gmt').
"' AND '".
$db->idate($datee,
'gmt').
"'";
227 $sql .=
" ORDER BY date_creation ASC, rowid ASC";
228 $sql .=
$db->plimit(1);
230 $res =
$db->query($sql);
233 $obj =
$db->fetch_object($res);
235 $firstid = $obj->rowid;
236 $tmparray = $block_static->getPreviousHash(0, $firstid);
237 $previoushash = $tmparray[
'previoushash'];
240 $previoushash =
'nodata';
250 $secretkey = $registrationnumber;
256 $nameofdownoadedfile =
"unalterable-log-archive-".$dolibarr_main_db_name.
"-".str_replace(
'-',
'', $yearmonthtoexport).
'-'.$yearmonthdateofexportstandard.
'UTC-'.$suffixperiod.
'.csv';
259 $tmpfileshort =
'blockedlog/archives/'.$nameofdownoadedfile;
260 $tmpfile =
getMultidirOutput($block_static,
'blockedlog').
'/archives/'.$nameofdownoadedfile;
262 $formatexport =
'VE2';
265 $fh = fopen($tmpfile,
'w');
268 setEventMessages(
'Failed to open file '.$tmpfileshort.
' for writing.',
null,
'errors');
272 if (!$error && $fh) {
273 $refinvoicefound = array();
274 $totalhtamount = array();
275 $totalvatamount = array();
276 $totalamount = array();
279 $remoteobfuscationkey =
'';
282 $remoteobfuscationkey = $block_static->getObfuscationKey();
288 setEventMessages(
'<a class="" href="'.$_SERVER[
"PHP_SELF"].
'?clearcache=1">'.$langs->trans(
"Retry").
'</a>',
null,
'errors');
293 $sql =
"SELECT rowid, entity, date_creation, tms, user_fullname, action, module_source, pos_source, amounts_taxexcl, amounts, element, fk_object, date_object, ref_object,";
294 $sql .=
" linktoref, linktype, signature, fk_user, object_data, object_version, object_format, debuginfo, note";
295 $sql .=
" FROM ".MAIN_DB_PREFIX.
"blockedlog";
296 $sql .=
" WHERE entity = ".((int)
$conf->entity);
299 $sql .=
" AND date_creation BETWEEN '".$db->idate($dates,
'gmt').
"' AND '".
$db->idate($datee,
'gmt').
"'";
300 $sql .=
" ORDER BY date_creation ASC, rowid ASC";
302 $resql =
$db->query($sql);
305 fwrite($fh,
"BEGIN - regnumber=".
dol_trunc($registrationnumber, 10).
" - date=".$yearmonthdateofexport.
" - period=".$yearmonthtoexport.($periodnotcomplete ?
'-'.$suffixperiod :
'').
" - entity=".((int)
$conf->entity).
" - formatexport=".$formatexport.
" - user=".$user->
getFullName($langs)
306 .
';'.$langs->transnoentities(
'Id')
307 .
';'.$langs->transnoentities(
'DateCreation')
308 .
';'.$langs->transnoentities(
'Action')
309 .
';'.$langs->transnoentities(
'Origin')
310 .
';'.$langs->transnoentities(
'Terminal')
311 .
';'.$langs->transnoentities(
'AmountHT')
312 .
';'.$langs->transnoentities(
'AmountTTC')
313 .
';'.$langs->transnoentities(
'Ref')
314 .
';'.$langs->transnoentities(
'Date')
315 .
';'.$langs->transnoentities(
'User')
316 .
';'.$langs->transnoentities(
'LinkTo')
317 .
';'.$langs->transnoentities(
'LinkType')
318 .
';'.$langs->transnoentities(
'FullData')
319 .
';'.$langs->transnoentities(
'Version')
320 .
';'.$langs->transnoentities(
'VersionSignature')
321 .
';'.$langs->transnoentities(
'FingerprintDatabase')
322 .
';'.$langs->transnoentities(
'Status')
330 while ($obj =
$db->fetch_object($resql)) {
336 $block_static->id = $obj->rowid;
337 $block_static->entity = $obj->entity;
340 $tmparray = $block_static->getPreviousHash(0, $block_static->id);
341 $previoushash = $tmparray[
'previoushash'];
343 fwrite($fh,
";NOTE - previoushash=".$previoushash.
"\n");
347 if (empty($obj->object_format) || $obj->object_format ==
'V1') {
351 $block_static->date_creation =
$db->jdate($obj->date_creation, $tz);
353 $block_static->date_modification =
$db->jdate($obj->tms, $tz);
355 $block_static->action = $obj->action;
356 $block_static->module_source = $obj->module_source;
357 $block_static->pos_source = $obj->pos_source;
359 $block_static->amounts_taxexcl = is_null($obj->amounts_taxexcl) ? null : (float) $obj->amounts_taxexcl;
360 $block_static->amounts = (float) $obj->amounts;
362 $block_static->fk_object = $obj->fk_object;
363 $block_static->date_object =
$db->jdate($obj->date_object, $tz);
364 $block_static->ref_object = $obj->ref_object;
366 $block_static->linktoref = $obj->linktoref;
367 $block_static->linktype = $obj->linktype;
369 $block_static->fk_user = $obj->fk_user;
370 $block_static->user_fullname = $obj->user_fullname;
372 $block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data);
374 $block_static->note = $obj->note;
377 $block_static->signature = $obj->signature;
379 $block_static->element = $obj->element;
381 $block_static->object_version = $obj->object_version;
382 $block_static->object_format = $obj->object_format;
384 $block_static->certified = ($obj->certified == 1);
390 $checksignature = $block_static->checkSignature($previoushash);
403 if ($checksignature) {
404 if (!empty($block_static->note)) {
405 $statusofrecord =
'KO';
406 $statusofrecordnote = $block_static->note;
408 $statusofrecord = $langs->transnoentitiesnoconv(
'StatusValid');
410 if ($loweridinerror > 0) {
411 $statusofrecordnote =
'ValidButFoundAPreviousKO';
413 $statusofrecordnote =
'';
416 $statusofrecord =
'KO';
417 $statusofrecordnote =
'LineCorruptedOrNotMatchingPreviousOne';
418 $loweridinerror = $obj->rowid;
422 $statusofrecordnote = $langs->trans(
"PreviousFingerprint").
': '.$previoushash.($statusofrecordnote ?
' - '.$statusofrecordnote :
'');
427 $lastrowid = $block_static->id;
430 $total_ht = $total_vat = $total_ttc = 0;
431 sumAmountsForUnalterableEvent($block_static, $refinvoicefound, $totalhtamount, $totalvatamount, $totalamount, $total_ht, $total_vat, $total_ttc);
435 .csvClean(
dol_print_date($block_static->date_creation,
'standard',
'gmt')).
';'
436 .csvClean($block_static->action).
';'
437 .csvClean($block_static->module_source).
';'
438 .csvClean($block_static->pos_source).
';'
439 .csvClean($block_static->amounts_taxexcl).
';'
440 .csvClean($block_static->amounts).
';'
441 .csvClean($block_static->ref_object).
';'
442 .csvClean(
dol_print_date($block_static->date_object,
'standard',
'gmt')).
';'
443 .csvClean($block_static->user_fullname).
';'
444 .csvClean($block_static->linktoref).
';'
445 .csvClean($block_static->linktype).
';'
446 .csvClean($obj->object_data).
';'
447 .csvClean($block_static->object_version).
';'
448 .csvClean($block_static->object_format).
';'
449 .csvClean($block_static->signature).
';'
450 .csvClean($statusofrecord).
';'
451 .csvClean($block_static->note).
';'
455 $previoushash = $obj->signature;
465 $lastrecord = $block_static->getLastRecord();
468 $isLastRecord =
false;
469 if ($lastrecord[
'id'] == $lastrowid) {
470 $isLastRecord =
true;
473 if (!$periodnotcomplete) {
474 if (!$isLastRecord) {
477 $nextrecord = $block_static_after->getNextRecord($lastrowid);
478 $nextrecordid = $nextrecord[
'id'];
480 $block_static_after->fetch($nextrecordid);
482 $checksignature = $block_static_after->checkSignature();
484 if (!$checksignature) {
485 fwrite($fh,
'ERROR '.$langs->trans(
"ErrorEndOfChainRecordWasRemoved", str_replace(array(
'T',
'Z'),
' ',
dol_print_date($block_static->date_creation,
'dayhourrfc',
'gmt')), str_replace(array(
'T',
'Z'),
' ',
dol_print_date($block_static_after->date_creation,
'dayhourrfc',
'gmt'))).
"\n");
488 $lockfile = $block_static->getEndOfChainFlagFile();
492 if (defined(
'BLOCKEDLOG_END_FLAG_IN_A_FILE')) {
493 if (!file_exists($lockfile)) {
496 if (
$mysoc->country_code ==
'FR') {
497 fwrite($fh,
'ERROR '.$langs->trans(
"ErrorEndOfChainFlagWasRemoved").
"\n");
499 fwrite($fh,
'WARNING '.$langs->trans(
"WarningNoProtectionOnEndOfChain").
"\n");
502 $lockline = trim(file_get_contents($lockfile));
505 $sql =
"SELECT value from ".MAIN_DB_PREFIX.
"const";
506 $sql .=
" WHERE name = '".$db->escape(basename($lockfile)).
"' AND entity = ".((int)
$conf->entity);
507 $resql =
$db->query($sql);
509 $obj =
$db->fetch_object($resql);
511 $lockline = $obj->value;
515 if (
$mysoc->country_code ==
'FR') {
516 fwrite($fh,
'ERROR '.$langs->trans(
"ErrorEndOfChainFlagWasRemoved").
"\n");
518 fwrite($fh,
'WARNING '.$langs->trans(
"WarningNoProtectionOnEndOfChain").
"\n");
526 if (preg_match(
'/^dolcrypt/', $lockline)) {
527 $headstring =
dolDecrypt($lockline,
'',
'BLOCKEDLOGHEAD');
528 } elseif (preg_match(
'/^dolobfuscation/', $lockline)) {
530 $remoteobfuscationkey = $block_static->getObfuscationKey();
531 if (empty($remoteobfuscationkey)) {
532 throw new Exception(
'Remote obfuscation key is empty');
537 $url_for_ping =
getDolGlobalString(
'MAIN_URL_FOR_PING',
"https://ping.dolibarr.org/");
538 setEventMessages($langs->trans(
"FailedToGetRemoteObfuscationKeyReTryLater", $url_for_ping),
null,
'errors');
541 $headstring =
dolDecrypt($lockline, $remoteobfuscationkey,
'BLOCKEDLOGHEAD');
545 if (preg_match(
'/^BLOCKEDLOGHEAD (\d+) ([^\s]+) ([a-zA-Z0-9\-]+)/', (
string) $headstring, $reg)) {
547 $lastrecordid = $lastrecord[
'id'];
548 $lastrecorddate = $lastrecord[
'date'];
549 $lastrecordsignature = $lastrecord[
'signature'];
551 if ($reg[1] > $lastrecordid || $reg[3] != $lastrecordsignature) {
555 fwrite($fh, $langs->trans(
"ErrorEndOfChainRecordWasRemoved", str_replace(array(
'T',
'Z'),
' ',
dol_print_date($lastrecorddate,
'dayhourrfc',
'gmt')), str_replace(array(
'T',
'Z'),
' ', $reg[2])).
"\n");
560 fwrite($fh, $langs->trans(
"FailedToDecodeTheHeadFlagEndOfChainIsNotReliable").
"\n");
572 $showtotalfor = array(
'' => 1);
573 $sql =
"SELECT DISTINCT module_source FROM ".MAIN_DB_PREFIX.
"blockedlog WHERE entity = ".((int)
$conf->entity);
574 $resql =
$db->query($sql);
576 while ($obj =
$db->fetch_object($resql)) {
577 $showtotalfor[$obj->module_source] = 1;
581 $showtotalfor[
'takepos'] = 1;
585 krsort($showtotalfor);
588 foreach ($totalamount as $key => $totalamountofcodepersource) {
589 foreach ($totalamountofcodepersource as $source => $tmpval) {
590 $totalhtamountalllines = array(
'BILL_VALIDATE' => array(),
'PAYMENT_CUSTOMER' => array());
591 $totalvatamountalllines = array(
'BILL_VALIDATE' => array(),
'PAYMENT_CUSTOMER' => array());
592 $totalamountalllines = array(
'BILL_VALIDATE' => array(),
'PAYMENT_CUSTOMER' => array());
598 foreach ($showtotalfor as $source => $tmpval) {
602 if ($countsource == 1) {
605 fwrite($fh,
'----- ');
606 fwrite($fh, $langs->transnoentitiesnoconv(
"TotalForThePeriod"));
607 fwrite($fh,
' - '.($source ? $langs->transnoentitiesnoconv(
"PointOfSale").
' '.ucfirst($source) : $langs->transnoentitiesnoconv(
"BackOffice")));
608 fwrite($fh,
' ('.$yearmonthtoexport.($periodnotcomplete ?
'-'.$suffixperiod :
'').
')');
609 fwrite($fh,
' -----');
612 foreach ($totalamount as $actioncode => $totalamountofcodepersource) {
615 if ($actioncode ==
'BILL_VALIDATE') {
616 $s =
'BILLED = '.$langs->transnoentitiesnoconv(
"Turnover");
617 $amountstoshow = (float) $totalhtamount[
'BILL_VALIDATE'][$source].
' '.$langs->transnoentitiesnoconv(
"HT").
' - '.(float) $totalvatamount[
'BILL_VALIDATE'][$source].
' '.$langs->transnoentitiesnoconv(
"VAT").
' - '.(float) $totalamount[
'BILL_VALIDATE'][$source].
' '.$langs->transnoentitiesnoconv(
"TTC");
618 } elseif ($actioncode ==
'PAYMENT_CUSTOMER') {
619 $s =
'PAID = '.$langs->transnoentitiesnoconv(
"TurnoverCollected");
620 $amountstoshow = (float) $totalamount[
'PAYMENT_CUSTOMER'][$source];
623 fwrite($fh,
'SUMMARY PERIOD '.$s.
' = '.$amountstoshow.
"\n");
631 $totalamountlifetime = array(
'BILL_VALIDATE' => array(),
'PAYMENT_CUSTOMER_CREATE' => array(),
'PAYMENT_CUSTOMER_DELETE' => array());
632 $totalhtamountlifetime = array(
'BILL_VALIDATE' => array(),
'PAYMENT_CUSTOMER_CREATE' => array(),
'PAYMENT_CUSTOMER_DELETE' => array());
635 $firstrecorddate = 0;
636 global $foundoldformat, $firstrecorddate;
637 include DOL_DOCUMENT_ROOT.
'/blockedlog/admin/lifetimeamount.inc.php';
638 '@phan-var-force array<string,array<string,float>> $totalamountlifetime';
639 '@phan-var-force array<string,array<string,float>> $totalhtamountlifetime';
642 foreach ($showtotalfor as $source => $tmpval) {
646 if ($countsource == 1) {
649 fwrite($fh,
'----- ');
650 fwrite($fh, $langs->transnoentitiesnoconv(
"TotalForLifetime"));
651 fwrite($fh,
' - '.($source ? $langs->transnoentitiesnoconv(
"PointOfSale").
' '.ucfirst($source) : $langs->transnoentitiesnoconv(
"BackOffice")));
652 fwrite($fh,
' (>='.
dol_print_date($firstrecorddate,
'standard').
')');
655 foreach ($totalamount as $actioncode => $totalamountofcodepersource) {
658 if ($actioncode ==
'BILL_VALIDATE') {
659 $s =
'BILLED = '.$langs->transnoentitiesnoconv(
"Turnover");
660 $amountstoshow = $totalhtamountlifetime[
'BILL_VALIDATE'][$source].
' '.$langs->transnoentitiesnoconv(
"HT").
" - ".($foundoldformat ?
'' : ((float) $totalamountlifetime[
'BILL_VALIDATE'][$source] - (
float) $totalhtamountlifetime[
'BILL_VALIDATE'][$source]).
' '.$langs->transnoentitiesnoconv(
"VAT")).
' - '.$totalamountlifetime[
'BILL_VALIDATE'][$source].
' '.$langs->transnoentitiesnoconv(
"TTC");
661 } elseif ($actioncode ==
'PAYMENT_CUSTOMER') {
662 $s =
'PAID = '.$langs->transnoentitiesnoconv(
"TurnoverCollected");
663 $amountstoshow = ((float) $totalamountlifetime[
'PAYMENT_CUSTOMER_CREATE'][$source] + (
float) $totalamountlifetime[
'PAYMENT_CUSTOMER_DELETE'][$source]);
667 fwrite($fh,
'SUMMARY LIFETIME '.$s.
' = '.$amountstoshow.
"\n");
678 $sha256 = hash_file($algo, $tmpfile);
679 $hmacsha256 = hash_hmac_file($algo, $tmpfile, $secretkey);
682 file_put_contents($tmpfile,
'END - sha256='.$sha256.
' - hmac_sha256='.$hmacsha256, FILE_APPEND);
687 if ($periodnotcomplete) {
688 setEventMessages($langs->trans(
"ErrorPeriodMustBePastToAllowExport"),
null,
"warnings");
691 require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
700 $object->fullname = $user->getFullName($langs);
702 $object->label =
'Export unalterable logs';
713 $object->period =
'year='.GETPOSTINT(
'yeartoexport').(GETPOSTINT(
'monthtoexport') ?
' month='.GETPOSTINT(
'monthtoexport') :
'');
717 $action =
'BLOCKEDLOG_EXPORT';
719 $result = $b->setObjectData(
$object, $action, 0, $user, 0);
722 setEventMessages(
'Failed to insert the export into the unalterable log. Export canceled: '.$b->error,
null,
'errors');
727 $res = $b->create($user);
730 setEventMessages(
'Failed to insert the export into the unalterable log. Export canceled: '.$b->error,
null,
'errors');
740 if (!$error && $fh) {
756 $title = $langs->trans(
"ModuleSetup").
' '.$langs->trans(
'BlockedLog');
758 $title = $langs->trans(
"BrowseBlockedLog");
760$help_url =
"EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
762llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-blockedlog page-admin_blockedlog_list');
764$blocks = $block_static->getLog(
'all', (
int) $search_id, $MAXLINES, $sortfield, $sortorder, (
int) $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code, $search_signature);
765if (!is_array($blocks)) {
767 setEventMessages($langs->trans(
"TooManyRecordToScanRestrictFilters", $MAXLINES),
null,
'errors');
769 dol_print_error($block_static->db, $block_static->error, $block_static->errors);
776 $linkback =
'<a href="'.dolBuildUrl($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
784 $texttop =
'<small class="opacitymedium">'.$langs->trans(
"RegistrationNumber").
':</small> <small>'.
dol_trunc($registrationnumber, 10).
'</small>';
790print
load_fiche_titre($title.
'<br>'.$texttop, $linkback,
'blockedlog', 0,
'',
'', $morehtmlcenter);
799print
'<div class="opacitymedium hideonsmartphone justify">';
801 print $langs->trans(
"ArchivesDesc").
"<br>";
803 print $langs->trans(
"ArchivesAuditorDesc").
"<br>";
808if ($action ==
'check' || $action ==
'checkconfirmed') {
811 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
812 print
'<input type="hidden" name="urlfile" value="'.GETPOST(
'urlfile').
'">';
813 print
'<input type="hidden" name="action" value="checkconfirmed">';
814 print
'<input type="hidden" name="token" value="'.newToken().
'">';
816 print
'<div class="neutral">';
818 print
'<b>'.$langs->trans(
"File").
'</b> : '.
GETPOST(
'urlfile').
'<br>';
820 $fullpath = $upload_dir.
'/'.
GETPOST(
'urlfile');
822 $handle = fopen($fullpath,
"r");
823 $line = fgets($handle);
831 if (preg_match(
'/\speriod=([^\s]+)/', $line, $reg)) {
834 if (preg_match(
'/\sregnumber=([^\s]+)/', $line, $reg)) {
835 $regnumber = str_replace(array(
'.',
'…'),
'', $reg[1]);
837 if (preg_match(
'/\sformatexport=([^\s]+)/', $line, $reg)) {
838 $formatexport = $reg[1];
840 if (preg_match(
'/\sentity=([^\s]+)/', $line, $reg)) {
841 $fileentity = $reg[1];
843 print
'<b>'.$langs->trans(
"Period").
'</b> : '.$period.
'<br>';
849 $secretkey = $registrationnumber;
850 $inputregistrationnumber =
'';
853 $fullpathtmp = $upload_dir.
'/temp/'.
GETPOST(
'urlfile').
'.tmp';
856 $result =
dol_copy($fullpath, $fullpathtmp);
861 print $langs->trans(
"FileHasBeenEncodedWithASecretKeyStartingWith").
' : '.$regnumber.
'...<br>';
863 print
'As this matches the 10 first characters of the full registration number of this instance, we will use the full registration number to control the archive file...';
867 if (
GETPOST(
'inputregistrationnumber')) {
868 $inputregistrationnumber =
GETPOST(
'inputregistrationnumber');
869 print $langs->trans(
"WeWillUseThisValueAsNumber");
870 print
'<input type="text" name="inputregistrationnumber" class="width300" placeholder="'.$langs->trans(
"FullRegistrationNumber").
'" value="'.$inputregistrationnumber.
'" spellcheck="false">';
872 $secretkey = $inputregistrationnumber;
875 print
'This archive file was not generated by this instance.';
876 print
'The control of authenticity is possible only if you know the full registration number. ';
877 $inputregistrationnumber =
'';
879 print $langs->trans(
"PleaseEnterFullRegistrationNumber").
' ';
882 $sql =
"SELECT registerid from ".MAIN_DB_PREFIX.
"captureserver_captureserver";
883 $sql .=
" WHERE registerid LIKE '".$db->escape($regnumber).
"%'";
884 $sql .=
" AND type = 'dolibarrregistration'";
887 $resql =
$db->query($sql);
889 $obj =
$db->fetch_object($resql);
891 $inputregistrationnumber = $obj->registerid;
895 if ($inputregistrationnumber) {
896 print $langs->trans(
"WeFoundThisFullRegistrationNumberForThisKey").
' ';
898 print $langs->trans(
"WeDidNotFindThisFullRegistrationNumberForThisKey").
'.<br>';
899 print $langs->trans(
"PleaseEnterFullRegistrationNumber").
' ';
902 print
'<input type="text" name="inputregistrationnumber" class="width300" placeholder="'.$langs->trans(
"FullRegistrationNumber").
'" value="'.$inputregistrationnumber.
'" spellcheck="false">';
908 print
'<input type="submit" class="button small" name="submit" value="'.$langs->trans(
"ControlFile").
'">';
916 if ($action ==
'checkconfirmed') {
917 $totalhtamountforaction = $totalvatamountforaction = $totalamountforaction = array(
918 'BILL_VALIDATE' => 0,
919 'PAYMENT_CUSTOMER' => 0
922 $refinvoicefound = array();
923 $recalculatedhashsign =
'';
924 $recalculatedhashauth =
'';
930 $nbLinesModifiedInExportButKo = 0;
931 $nbLinesModifiedBeforeExport = 0;
933 $amounthtlifetime = array();
934 $amountvatlifetime = array();
935 $amountttclifetime = array();
936 $amounthtlifetime[
'BILL_VALIDATE'] = $amounthtlifetime[
'PAYMENT_CUSTOMER'] =
null;
937 $amountvatlifetime[
'BILL_VALIDATE'] = $amountvatlifetime[
'PAYMENT_CUSTOMER'] =
null;
938 $amountttclifetime[
'BILL_VALIDATE'] = $amountttclifetime[
'PAYMENT_CUSTOMER'] =
null;
943 $handle = fopen($fullpath,
"r");
949 while ($line = fgetcsv($handle, 100000,
';',
'"',
'')) {
953 $linetech = $lineactioncode =
'';
954 $lineamountht = $lineamountttc = 0;
963 $block_static->id = 0;
966 if (trim((
string) $line[0]) ==
'' && trim((
string) $line[1]) ==
'') {
971 if (preg_match(
'/^-----/', (
string) $line[0])) {
976 if (preg_match(
'/^ERROR/', (
string) $line[0])) {
980 if (empty($lineanalyzed) && $formatexport ==
'VE1' && !empty($line[1])) {
982 $linetech = $line[0];
984 $block_static->id = (int) $line[1];
985 $block_static->entity = (int) $fileentity;
986 $block_static->date_creation = (
string) $line[2];
987 $block_static->action = $lineactioncode = (
string) $line[3];
988 $block_static->module_source = (
string) $line[4];
989 $block_static->pos_source =
'';
990 $block_static->amounts_taxexcl = $lineamountht = ($line[5] ===
'' ? null : (float) $line[5]);
991 $block_static->amounts = $lineamountttc = (float) $line[6];
992 $block_static->ref_object = $lineref = (
string) $line[7];
993 $block_static->date_object = (int) $line[8];
994 $block_static->user_fullname = (
string) $line[9];
995 $block_static->linktoref = (
string) $line[10];
996 $block_static->linktype = (
string) $line[11];
997 $block_static->object_data = json_decode((
string) $line[12]);
998 $block_static->object_version = (
string) $line[13];
999 $block_static->object_format = (
string) $line[14];
1000 $block_static->signature = (
string) $line[15];
1003 $statusline = (
string) $line[16];
1006 if (empty($lineanalyzed) && $formatexport ==
'VE2' && !empty($line[1])) {
1008 $linetech = $line[0];
1010 $block_static->id = (int) $line[1];
1011 $block_static->entity = (int) $fileentity;
1012 $block_static->date_creation = (
string) $line[2];
1013 $block_static->action = $lineactioncode = (
string) $line[3];
1014 $block_static->module_source = (
string) $line[4];
1015 $block_static->pos_source = (
string) $line[5];
1016 $block_static->amounts_taxexcl = $lineamountht = ($line[6] ===
'' ? null : (float) $line[6]);
1017 $block_static->amounts = $lineamountttc = (float) $line[7];
1018 $block_static->ref_object = $lineref = (
string) $line[8];
1019 $block_static->date_object = (int) $line[9];
1020 $block_static->user_fullname = (
string) $line[10];
1021 $block_static->linktoref = (
string) $line[11];
1022 $block_static->linktype = (
string) $line[12];
1023 $block_static->object_data = json_decode((
string) $line[13]);
1024 $block_static->object_version = (
string) $line[14];
1025 $block_static->object_format = (
string) $line[15];
1026 $block_static->signature = (
string) $line[16];
1029 $statusline = (
string) $line[17];
1032 if ($block_static->id > 0) {
1035 $tmp = $block_static->checkSignature($previoushash, 2);
1049 $signature = $tmp[
'calculatedsignature'];
1050 $previoushash = $block_static->signature;
1053 if ($statusline ==
'Valid') {
1055 if ($signature != $block_static->signature) {
1056 $nbLinesModifiedInExportButKo++;
1060 if ($statusline ==
'KO') {
1061 $nbLinesModifiedBeforeExport++;
1078 if ($lineanalyzed == 1 && ($lineactioncode ==
'BILL_VALIDATE' || $lineactioncode ==
'PAYMENT_CUSTOMER_CREATE' || $lineactioncode ==
'PAYMENT_CUSTOMER_DELETE')) {
1081 if ($lineactioncode !=
'BILL_VALIDATE' || empty($refinvoicefound[$lineref])) {
1082 if ($lineactioncode ==
'PAYMENT_CUSTOMER_CREATE' || $lineactioncode ==
'PAYMENT_CUSTOMER_DELETE') {
1083 $lineactioncode =
'PAYMENT_CUSTOMER';
1086 $totalhtamountforaction[$lineactioncode] += $lineamountht;
1087 $totalvatamountforaction[$lineactioncode] += ($lineamountttc - $lineamountht);
1088 $totalamountforaction[$lineactioncode] += $lineamountttc;
1090 if ($lineactioncode ==
'BILL_VALIDATE') {
1091 $refinvoicefound[$lineref] = 1;
1096 if (preg_match(
'/^SUMMARY /', (
string) $line[0])) {
1101 if ($lineanalyzed == 2) {
1103 $footer .= (
string) str_replace(array(
';',
'*'),
'', implode(
' ', $line)).
"\n";
1106 if ($lineanalyzed == 3) {
1108 $errorlines .= (
string) $line[0].
"\n";
1111 if (preg_match(
'/END - ([a-z0-9_]+)=([a-z0-9]+) - ([a-z0-9_]+)=([a-z0-9]+)$/', (
string) $line[0], $reg)) {
1118 if ($algosign ==
'sha256') {
1120 $recalculatedhashsign = hash_file($algo, $fullpathtmp);
1122 if ($algoauth ==
'hmac_sha256') {
1124 $recalculatedhashauth = hash_hmac_file($algo, $fullpathtmp, $secretkey);
1128 if (!$lineanalyzed) {
1129 print
'Line '.$numline.
' has format '.$formatexport.
' that is not supported';
1139 if ($recalculatedhashsign && hash_equals($recalculatedhashsign, $hashsign)) {
1140 print
img_picto(
'',
'tick',
'class="valignmiddle pictofixedwidth"');
1141 print
'<b>'.$langs->trans(
"FileIntegrity").
'</b> ';
1142 print
' '.$form->textwithpicto(
'', $langs->trans(
"FileContentMatchSignature").
'<br><br>'.$algosign.
' = '.$recalculatedhashsign);
1144 print
img_picto(
'',
'cross',
'class="error valignmiddle pictofixedwidth"');
1145 print
'<b>'.$langs->trans(
"FileIntegrity").
'</b> ';
1146 print
' '.$form->textwithpicto(
'', $langs->trans(
"FileHasBeenCorrupted").
'<br><br>Recalculated '.$recalculatedhashsign.
' != Found in file '.$hashsign);
1151 if ($recalculatedhashauth && hash_equals($recalculatedhashauth, $hashauth)) {
1152 print
img_picto(
'',
'tick',
'class="valignmiddle pictofixedwidth"');
1153 print
'<b>'.$langs->trans(
"FileAuthenticity").
'</b> ';
1155 print
' - <span class="opacitymedium">'.$langs->trans(
"FileWasGeneratedByThisInstance").
'</span>';
1157 print
' - <span class="opacitymedium">'.$langs->trans(
"FileWasGeneratedByTheInstanceWithRegistrationId").
'</span>';
1159 print
' '.$form->textwithpicto(
'', $langs->trans(
"FileContentMatchSignature").
'<br><br>'.$algoauth.
' = '.$recalculatedhashauth);
1160 } elseif ($recalculatedhashsign && hash_equals($recalculatedhashsign, $hashsign)) {
1161 print
img_picto(
'',
'cross',
'class="error valignmiddle pictofixedwidth"');
1162 print
'<b>'.$langs->trans(
"FileAuthenticity").
'</b> ';
1163 print
' '.$form->textwithpicto(
'', $langs->trans(
"FileNotFromInstance").
'<br><br>Recalculated '.$recalculatedhashauth.
' != Found in file '.$hashauth);
1165 print
img_picto(
'',
'cross',
'class="error valignmiddle pictofixedwidth"');
1166 print
'<b>'.$langs->trans(
"FileAuthenticity").
'</b> ';
1167 print
' '.$form->textwithpicto(
'', $langs->trans(
"FileHasBeenCorruptedOrNotFromInstance").
'<br><br>Recalculated '.$recalculatedhashauth.
' != Found in file '.$hashauth);
1170 print
img_picto(
'',
'cross',
'class="valignmiddle pictofixedwidth"');
1171 print
'<b>'.$langs->trans(
"FileAuthenticity").
'</b> ';
1172 print
' '.$form->textwithpicto(
'', $langs->trans(
"AuthenticityCantBeVerifiedIfFullRegistrationNumberNotProvided"));
1176 if ($nbLinesModifiedBeforeExport) {
1177 print
img_picto(
'',
'warning',
'class="error valignmiddle pictofixedwidth"');
1178 print
'<b>'.$langs->trans(
"nbLinesModifiedBeforeExport").
'</b>';
1184 print
img_picto(
'',
'warning',
'class="error valignmiddle center pictofixedwidth"').
'<b>'.$errorlines.
'</b><br>';
1190 print
img_picto(
'',
'tick',
'class="valignmiddle center pictofixedwidth"');
1191 print
'<b>'.$langs->trans(
"Summary").
'</b>';
1192 print
'<textarea class="centpercent" rows="14" spellcheck="false">';
1194 print
'</textarea>';
1198 $text = $langs->trans(
"IfIntegrityAuthenticityIsOkYouCanGetdetailByOpeningTheFile");
1200 $text .= $langs->trans(
"IfIntegrityAuthenticityIsOkYouCanGetdetailByOpeningTheFile2");
1207 print
'<center><a href="'.$_SERVER[
"PHP_SELF"].
'">'.$langs->trans(
"BackToList").
'</a></center>';
1210if ($action !=
'check' && $action !=
'checkconfirmed') {
1214 $nbrecorddone = $block_static->countRecord();
1216 $maxtranspermonth = 10000;
1217 $nbrecordallowed = $mindisksize * 1024 * 1024 / 40 - $nbrecorddone;
1218 $nbmonthallowed = $nbrecordallowed / $maxtranspermonth;
1221 $htmltext .= $langs->trans(
"UnalterableLogTool2", $langs->transnoentitiesnoconv(
"Archives")).
"<br>";
1222 $htmltext .=
'<span class="small">'.$langs->trans(
"UnalterableLogTool2MaxUsage", $nbrecorddone, $mindisksize, $nbrecordallowed).
"</span><br>";
1224 if (
$mysoc->country_code ==
'FR') {
1225 $htmltext .=
'<br><span class="small">'.$langs->trans(
"UnalterableLogTool1FR", $langs->transnoentitiesnoconv(
"Archives")).
'</span><br>';
1227 $htmltext .=
'<span class="small">'.$langs->trans(
"UnalterableLogTool2b", $langs->transnoentitiesnoconv(
"Archives")).
"</span><br>";
1232 print
info_admin($htmltext, 0, 0,
'warning');
1241 $param .=
'&contextpage='.urlencode($contextpage);
1243 if ($limit > 0 && $limit !=
$conf->liste_limit) {
1244 $param .=
'&limit='.((int) $limit);
1246 if ($search_id !=
'') {
1247 $param .=
'&search_id='.urlencode($search_id);
1249 if ($search_fk_user > 0) {
1250 $param .=
'&search_fk_user='.urlencode($search_fk_user);
1252 if ($search_startyear > 0) {
1253 $param .=
'&search_startyear='.((int) $search_startyear);
1255 if ($search_startmonth > 0) {
1256 $param .=
'&search_startmonth='.((int) $search_startmonth);
1258 if ($search_startday > 0) {
1259 $param .=
'&search_startday='.((int) $search_startday);
1261 if ($search_endyear > 0) {
1262 $param .=
'&search_endyear='.((int) $search_endyear);
1264 if ($search_endmonth > 0) {
1265 $param .=
'&search_endmonth='.((int) $search_endmonth);
1267 if ($search_endday > 0) {
1268 $param .=
'&search_endday='.((int) $search_endday);
1270 if ($search_amount) {
1271 $param .=
'&search_amount='.urlencode($search_amount);
1273 if ($search_signature) {
1274 $param .=
'&search_signature='.urlencode($search_signature);
1276 if ($search_showonlyerrors > 0) {
1277 $param .=
'&search_showonlyerrors='.((int) $search_showonlyerrors);
1279 if ($optioncss !=
'') {
1280 $param .=
'&optioncss='.urlencode($optioncss);
1282 if (
GETPOST(
'withtab',
'alpha')) {
1283 $param .=
'&withtab='.urlencode(
GETPOST(
'withtab',
'alpha'));
1289 if ($action ==
'deletefile') {
1290 $langs->load(
"companies");
1291 print $form->formconfirm(
1292 $_SERVER[
"PHP_SELF"].
'?urlfile='.urlencode(
GETPOST(
"urlfile")).
'&linkid='.
GETPOSTINT(
'linkid').(empty($param) ?
'' : $param),
1293 $langs->trans(
'DeleteFile'),
1294 $langs->trans(
'ConfirmDeleteFile'),
1295 'confirm_deletefile',
1304 print
'<form method="POST" id="exportArchives" action="'.$_SERVER[
"PHP_SELF"].
'?output=file">';
1305 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1306 print
'<input type="hidden" name="action" value="export">';
1308 print
'<div class="right">';
1310 print
'<span class="hideonsmartphone">'.$langs->trans(
"RestrictYearToExport").
': </span>';
1312 print $formother->select_month((
string)
GETPOSTINT(
'monthtoexport'),
'monthtoexport', $langs->trans(
"Month"), 0,
'minwidth50 maxwidth75imp valignmiddle',
true);
1313 print
'<input type="text" name="yeartoexport" class="valignmiddle maxwidth75imp" value="'.GETPOST(
'yeartoexport').
'" placeholder="'.$langs->trans(
"Year").
'">';
1322 print
'<input type="hidden" name="withtab" value="'.GETPOST(
'withtab',
'alpha').
'">';
1323 print
'<input type="submit" name="downloadcsv" class="button" value="'.$langs->trans(
'DownloadLogCSV').
'">';
1327 print
' </div><br>';
1350 $filearray =
dol_dir_list($upload_dir,
'files', 0,
'',
null,
'name', SORT_ASC, 1);
1352 $modulepart =
'blockedlog';
1353 $relativepathwithnofile =
'archives/';
1360 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
1363 $savingdocmask =
'';
1368 $tmparray = $formfile->form_attach_new_file(
1369 $_SERVER[
"PHP_SELF"],
1374 $conf->browser->layout ==
'phone' ? 40 : 60,
1389 $formToUploadAFile =
'';
1391 if (is_array($tmparray) && !empty($tmparray)) {
1392 $formToUploadAFile = $tmparray[
'formToUploadAFile'];
1396 $formfile->list_of_documents(
1402 $relativepathwithnofile,
1407 $langs->transnoentitiesnoconv(
'Archives'),
1418 array(
'afteruploadtitle' => $formToUploadAFile,
'showhideaddbutton' => 1,
'hideshared' => 1,
'buttons' => array(0 => array(
'picto' =>
img_picto($langs->trans(
"ControlFile"),
'question'),
'url' => $_SERVER[
"PHP_SELF"].
'?action=check&token=notrequired'.$param)))
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
sumAmountsForUnalterableEvent($block, &$refinvoicefound, &$totalhtamount, &$totalvatamount, &$totalamount, &$total_ht, &$total_vat, &$total_ttc)
sumAmountsForUnalterableEvent
userIsTaxAuditor()
Call remote API service to push the last counter and signature.
blockedlogadmin_prepare_head($withtabsetup)
Define head array for tabs of blockedlog tools setup pages.
isRegistrationDataSavedAndPushed()
Return if the KYC mandatory parameters are set AND pushed/registered centralized server.
getHashUniqueIdOfRegistration($algo='sha256')
Return a hash unique identifier of the registration (used to identify the registration of instance wi...
isALNERunningVersion($blockedlogtestalreadydone=0, $blockedlogmodulealreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage Blocked Log.
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name (civility+' '+name+' '+lastname)
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_copy($srcfile, $destfile, $newmask='0', $overwriteifexists=1, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
removeLastLine($fullpath)
Remove the last line of a text file.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
csvClean($newvalue, $charset='', $separator='')
Clean a cell to respect rules of CSV file cells.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getMultidirOutput($object, $module='', $forobject=0, $mode='output')
Return the full path of the directory where a module (or an object of a module) stores its files.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
getDolDefaultContextPage($s)
Return the default context page string.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.
dolDecrypt($chain, $key='', $patterntotest='')
Decode a string with a symmetric encryption.
isHTTPS()
Return if we are using a HTTPS connection Check HTTPS (no way to be modified by user but may be empty...