dolibarr 24.0.0-beta
documentation.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 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
27// Load Dolibarr environment
28require '../../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/modules/modBlockedLog.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
42require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
43
44// Load translation files required by the page
45$langs->loadLangs(array('admin', 'blockedlog', 'other'));
46
47// Get Parameters
48$action = GETPOST('action', 'aZ09');
49$backtopage = GETPOST('backtopage', 'alpha');
50$cancel = GETPOST('cancel');
51
52$withtab = GETPOSTISSET('withtab') ? GETPOSTINT('withtab') : 1;
53$origin = GETPOST('origin');
54$mode = GETPOST('mode');
55
56// Access Control
57if (!$user->admin && !userIsTaxAuditor()) {
59}
60
61
62/*
63 * Actions
64 */
65
66// None
67
68
69/*
70 * View
71 */
72
73$formSetup = new FormSetup($db);
74$form = new Form($db);
75$formcompany = new FormCompany($db);
76$block_static = new BlockedLog($db);
77$block_static->loadTrackedEvents();
78
79if ($withtab && !userIsTaxAuditor()) {
80 $title = $langs->trans("ModuleSetup").' '.$langs->trans('BlockedLog');
81} else {
82 $title = $langs->trans("BrowseBlockedLog");
83}
84
85$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
86
87llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-blockedlog page-admin_blockedlog');
88
89if ($withtab && !userIsTaxAuditor()) {
90 $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>';
91} else {
92 $linkback='';
93}
94
95$morehtmlcenter = '';
96$texttop = '';
97
98$registrationnumber = getHashUniqueIdOfRegistration();
99if (!userIsTaxAuditor()) {
100 $texttop = '<small class="opacitymedium">'.$langs->trans("RegistrationNumber").':</small> <small>'.dol_trunc($registrationnumber, 10).'</small>';
101 if ((!isRegistrationDataSavedAndPushed() || !isModEnabled('blockedlog')) && $mode != "forceregistration") {
102 $texttop = '';
103 }
104}
105
106print load_fiche_titre($title.'<br>'.$texttop, $linkback, 'blockedlog', 0, '', '', $morehtmlcenter);
107
108if ($withtab) {
109 $head = blockedlogadmin_prepare_head($withtab);
110 print dol_get_fiche_head($head, 'documentation', '', -1);
111} else {
112 print '<br>';
113}
114
115if (!userIsTaxAuditor()) {
116 print '<span class="opacitymedium">'.$langs->trans("BlockedLogDesc")."</span><br>\n";
117}
118
119// Version
120$versionbadge = '<span class="badge-text badge-secondary">'.getBlockedLogVersionToShow().'</span>';
121
122
123// Special additional message for FR only
124$infotoshow = '';
125if ($mysoc->country_code == 'FR') {
126 $islne = isALNEQualifiedVersion(1, 1);
127 if ($islne) {
128 if (preg_match('/\-/', getBlockedLogVersionToShow())) {
129 // This is an alpha or beta version
130 $infotoshow = $langs->trans("LNECandidateVersionForCertificationFR", $versionbadge);
131 } else {
132 $infotoshow = $langs->trans("LNECertifiedVersionFR", $versionbadge);
133 }
134 } else {
135 $infotoshow = $langs->trans("NotCertifiedVersionFR", $versionbadge);
136 }
137
138 $infotoshow .= ' - <a href="'.DOL_URL_ROOT.'/blockedlog/admin/filecheck.php">'.img_picto('', 'url', 'class="pictofixedwidth"').$langs->trans("FileCheck").'</a>';
139}
140
141// Show generic message (for countries that need registration) to explain we need registration to collect data and why
142if (in_array($mysoc->country_code, array('FR')) && !userIsTaxAuditor()) {
143 $organization_for_ping = getDolGlobalString('MAIN_ORGANIZATION_FOR_PING', "Association Dolibarr");
144 $dataprivacy_url = getDolGlobalString('MAIN_ORGANIZATION_URL_PRIVACY', "https://www.dolibarr.org/legal-privacy-gdpr.php");
145
146 if (!isRegistrationDataSavedAndPushed() || $origin == 'initmodule') {
147 if ($infotoshow) {
148 print info_admin($infotoshow, 0, 0, 'info');
149 }
150
151 if ((!isRegistrationDataSavedAndPushed() || !isModEnabled('blockedlog')) && $mode != "forceregistration") {
152 print '<center><span class="error"><br>'.$langs->trans("RegistrationRequired").'<br><br></span></center>';
153 }
154
155 $htmltext = "";
156 $htmltext .= $langs->trans("UnalterableLogToolRegistrationFR").'<br>';
157 $htmltext .= $langs->trans("InformationWillBePublishedTo");
158 $htmltext .= '<br>'.$langs->trans("InformationWillBePublishedTo2", $organization_for_ping, $dataprivacy_url);
159 if (!isRegistrationDataSavedAndPushed() || !isModEnabled('blockedlog')) {
160 $htmltext .= '<br>'.$langs->trans("InformationWillBePublishedTo3");
161 $color = 'warning';
162 } else {
163 $color = 'info';
164 }
165
166 print info_admin($htmltext, 0, 0, $color);
167
168 if (isRegistrationDataSavedAndPushed() && isModEnabled('blockedlog') && $mode != "forceregistration") {
169 print '<center><span class="ok"><br>'.$langs->trans("ApplicationHasBeenRegistered").'<br><br></span></center>';
170 }
171 } else {
172 $htmltext = ($infotoshow ? $infotoshow.'<br>' : '');
173 $htmltext .= $langs->trans("ApplicationHasBeenRegistered");
174 $htmltext .= ' '.$langs->trans("RegistrationNumber").': <span class="badge-text badge-secondary" title="Flag stored into MAIN_FIRST_REGISTRATION_OK_DATE. Registered data saved into BLOCKEDLOG_REGISTRATION_...">'.dol_trunc($registrationnumber, 10).'</span>';
175 $htmltext .= '<br>';
176 $htmltext .= $langs->trans("LastRegistrationDate").' : ';
177 //$htmltext .= dol_print_date(getDolGlobalString('MAIN_FIRST_REGISTRATION_OK_DATE'), 'dayhour', 'tzuserrel');
178 $htmltext .= getDolGlobalString('MAIN_FIRST_REGISTRATION_OK_DATE');
179
180 print info_admin($htmltext, 0, 0, 'info');
181
182 // Show remind on good practices related to archives
183 $htmltext = $langs->trans("UnalterableLogTool1FR", $langs->transnoentitiesnoconv("Archives")).'<br>';
184 print info_admin($htmltext, 0, 0, 'warning');
185 }
186}
187
188
189print '<br>';
190
191print '<center><br>';
192print $langs->trans("YouMayFindDocumentOn").'<br>';
193print '<br>';
194print img_picto('', 'url').' <a href="https://www.dolibarr.org/certifications-lf" target="_blank">https://www.dolibarr.org/certifications-lf</a>';
195if ($mysoc->country_code == 'FR') {
196 print '<br><br>'.$langs->trans("ApplicationUpdateResponsibilityFR");
197}
198print '<center>';
199
200
201if ($withtab) {
202 print dol_get_fiche_end();
203}
204
205print '<br>';
206
207
208// End of page
209llxFooter();
210$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
getBlockedLogVersionToShow()
Define head array for tabs of blockedlog tools setup pages.
isALNEQualifiedVersion($ignoredev=0, $ignoremodule=0)
Return if the version is a candidate version to get the LNE certification and if the prerequisites ar...
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.
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
This class help you create setup render.
global $mysoc
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.