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',
'other'));
52$action =
GETPOST(
'action',
'aZ09');
53$confirm =
GETPOST(
'confirm',
'aZ09');
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$optioncss =
GETPOST(
'optioncss',
'aZ');
57$withtab = GETPOSTISSET(
'withtab') ?
GETPOSTINT(
'withtab') : 1;
60$inputregistrationnumber =
GETPOST(
'inputregistrationnumber');
62$search_showonlyerrors =
GETPOSTINT(
'search_showonlyerrors');
63if ($search_showonlyerrors < 0) {
64 $search_showonlyerrors = 0;
67$search_startyear =
GETPOSTINT(
'search_startyear');
68$search_startmonth =
GETPOSTINT(
'search_startmonth');
69$search_startday =
GETPOSTINT(
'search_startday');
71$search_endmonth =
GETPOSTINT(
'search_endmonth');
73$search_id =
GETPOST(
'search_id',
'alpha');
74$search_fk_user =
GETPOST(
'search_fk_user',
'intcomma');
76if (
GETPOST(
'search_startyear') !=
'') {
77 $search_start =
dol_mktime(0, 0, 0, $search_startmonth, $search_startday, $search_startyear);
80if (
GETPOST(
'search_endyear') !=
'') {
81 $search_end =
dol_mktime(23, 59, 59, $search_endmonth, $search_endday, $search_endyear);
83$search_code =
GETPOST(
'search_code',
'array:alpha');
84$search_ref =
GETPOST(
'search_ref',
'alpha');
85$search_amount =
GETPOST(
'search_amount',
'alpha');
86$search_signature =
GETPOST(
'search_signature',
'alpha');
88if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET(
'search_startmonth') && !GETPOSTISSET(
'begin')) {
91 $search_startday = $tmparray[
'mday'];
92 $search_startmonth = $tmparray[
'mon'];
93 $search_startyear = $tmparray[
'year'];
98$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
99$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
101if (empty($page) || $page == -1) {
104$offset = $limit * $page;
105$pageprev = $page - 1;
106$pagenext = $page + 1;
108if (empty($sortfield)) {
109 $sortfield =
'rowid';
111if (empty($sortorder)) {
116$block_static->loadTrackedEvents();
120 accessforbidden(
'Access to this page is reserved to an allowed tax auditors');
125$permission = $user->hasRight(
'blockedlog',
'read');
126$permissiontoadd = $user->hasRight(
'blockedlog',
'read');
127$permtoedit = $permissiontoadd;
136if ($action ==
'control' && $user->hasRight(
'blockedlog',
'read')) {
148$title = $langs->trans(
"BrowseBlockedLog");
149$help_url =
"EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
151llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-blockedlog page-admin_blockedlog_list');
160 $texttop =
'<small class="opacitymedium">'.$langs->trans(
"RegistrationNumber").
':</small> <small>'.
dol_trunc($registrationnumber, 10).
'</small>';
166print
load_fiche_titre($title.
'<br>'.$texttop, $linkback,
'blockedlog', 0,
'',
'', $morehtmlcenter);
175print
'<div class="opacitymedium hideonsmartphone justify">';
176print $langs->trans(
"ControlDesc").
"<br>";
180print
'<form method="POST" id="exportArchives" action="'.$_SERVER[
"PHP_SELF"].
'?output=file">';
181print
'<input type="hidden" name="token" value="'.newToken().
'">';
182print
'<input type="hidden" name="action" value="export">';
184print
'<div class="neutral">';
186print
'<span class="hideonsmartphone">'.$langs->trans(
"PleaseEnterPartialRegistrationNumber").
': </span>';
188print
'<input type="text" name="inputregistrationnumber" class="width300" placeholder="'.$langs->trans(
"RegistrationNumber").
'" value="'.$inputregistrationnumber.
'" spellcheck="false">';
194print
'<input type="submit" class="button small" name="submit" value="'.$langs->trans(
"ControlSignals").
'">';
205if ($inputregistrationnumber && strlen($inputregistrationnumber) < 8) {
207 print
img_picto(
'',
'cross',
'class="pictofixedwidth"').$langs->trans(
"RegistrationNumberIsTooShort");
208} elseif ($inputregistrationnumber) {
211 print
'The module captureserver to capture the signals from installed instance is not enabled. Is this instance the master instance of the Dolibarr foundation ?';
214 $sql =
"SELECT rowid, registerid, registername, registerprofid, registeremail, date_creation, tms, content, comment,";
215 $sql .=
" versiondolibarr, versionblockedlog, country_code";
216 $sql .=
" FROM ".MAIN_DB_PREFIX.
"captureserver_captureserver";
217 $sql .=
" WHERE registerid LIKE '".$db->escape($inputregistrationnumber).
"%'";
218 $sql .=
" AND type = 'dolibarrregistration'";
219 $sql .=
" LIMIT 100";
221 $resql =
$db->query($sql);
224 while ($obj =
$db->fetch_object($resql)) {
226 print
img_picto(
'',
'tick',
'class="pictofixedwidth"').
' <b>'.
dol_print_date($obj->date_creation,
'dayhour',
'gmt').
'</b> ';
227 print $langs->trans(
"RegistrationDone");
228 print
' - '.$langs->trans(
"BlockedLogInstance").
' '.
dolPrintHTML($obj->registerid);
230 print $langs->trans(
"LastRegistrationUpdate").
' '.
dol_print_date($obj->tms,
'dayhour',
'gmt');
232 print $obj->registername.
' - '.$obj->registerprofid.
' - '.$obj->country_code.
' - '.$obj->registeremail;
234 print $langs->trans(
"Version").
': '.$obj->versiondolibarr.
' - '.$langs->trans(
"VersionOfModule", $langs->transnoentitiesnoconv(
"BlockedLog")).
': '.$obj->versionblockedlog;
244 print
img_picto(
'',
'cross',
'class="pictofixedwidth error"').$langs->trans(
"NoRegistrationFound");
255 $sql =
"SELECT rowid, registerid, date_creation, content, comment from ".MAIN_DB_PREFIX.
"captureserver_captureserver";
256 $sql .=
" WHERE registerid LIKE '".$db->escape($inputregistrationnumber).
"%'";
257 $sql .=
" AND type = 'deletion_or_backup_restoration'";
258 $sql .=
" LIMIT 100";
260 $resql =
$db->query($sql);
263 while ($obj =
$db->fetch_object($resql)) {
265 print
img_picto(
'',
'cross',
'class="pictofixedwidth"').
' <b>'.
dol_print_date($obj->date_creation,
'dayhour').
'</b> ';
266 print $langs->trans(
"BackupRestorationOrLastLineDeletionDetected");
267 print
' - '.$langs->trans(
"BlockedLogInstance").
' '.
dolPrintHTML($obj->registerid);
269 print
'<div class="small">';
270 print $langs->trans(
"Note").
': ';
282 print
img_picto(
'',
'tick',
'class="pictofixedwidth"').$langs->trans(
"NoBackupRestorationOrLastLineDeletionDetected");
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.
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...
Class to manage Blocked Log.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
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...
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
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.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
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.