2026-02-19 21:29:20 +00:00
< ? php
/* Copyright ( C ) 2017 ATM Consulting < contact @ atm - consulting . fr >
* Copyright ( C ) 2017 - 2018 Laurent Destailleur < eldy @ destailleur . fr >
2026-04-12 09:59:56 +00:00
* Copyright ( C ) 2024 - 2026 Frédéric France < frederic . france @ free . fr >
2026-02-19 21:29:20 +00:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < https :// www . gnu . org / licenses />.
*/
/**
* \file htdocs / blockedlog / admin / documentation . php
* \ingroup blockedlog
* \brief Page setup for blockedlog module ( user documentation )
*/
// Load Dolibarr environment
require '../../main.inc.php' ;
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Societe $mysoc
* @ var Translate $langs
* @ var User $user
*/
require_once DOL_DOCUMENT_ROOT . '/blockedlog/lib/blockedlog.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/blockedlog/class/blockedlog.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/modules/modBlockedLog.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formsetup.class.php' ;
// Load translation files required by the page
$langs -> loadLangs ( array ( 'admin' , 'blockedlog' , 'other' ));
// Get Parameters
$action = GETPOST ( 'action' , 'aZ09' );
$backtopage = GETPOST ( 'backtopage' , 'alpha' );
$cancel = GETPOST ( 'cancel' );
$withtab = GETPOSTISSET ( 'withtab' ) ? GETPOSTINT ( 'withtab' ) : 1 ;
$origin = GETPOST ( 'origin' );
$mode = GETPOST ( 'mode' );
// Access Control
2026-03-08 21:27:57 +00:00
if ( ! $user -> admin && ! userIsTaxAuditor ()) {
2026-02-19 21:29:20 +00:00
accessforbidden ();
}
/*
* Actions
*/
// None
/*
* View
*/
$formSetup = new FormSetup ( $db );
$form = new Form ( $db );
$formcompany = new FormCompany ( $db );
$block_static = new BlockedLog ( $db );
$block_static -> loadTrackedEvents ();
2026-06-01 00:49:26 +00:00
if ( $withtab && ! userIsTaxAuditor ()) {
2026-02-19 21:29:20 +00:00
$title = $langs -> trans ( " ModuleSetup " ) . ' ' . $langs -> trans ( 'BlockedLog' );
} else {
$title = $langs -> trans ( " BrowseBlockedLog " );
}
$help_url = " EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable " ;
llxHeader ( '' , $title , $help_url , '' , 0 , 0 , '' , '' , '' , 'mod-blockedlog page-admin_blockedlog' );
2026-06-01 00:49:26 +00:00
if ( $withtab && ! userIsTaxAuditor ()) {
2026-02-19 21:29:20 +00:00
$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>' ;
} else {
$linkback = '' ;
}
$morehtmlcenter = '' ;
2026-03-11 22:29:59 +00:00
$texttop = '' ;
2026-02-19 21:29:20 +00:00
$registrationnumber = getHashUniqueIdOfRegistration ();
2026-03-08 21:27:57 +00:00
if ( ! userIsTaxAuditor ()) {
2026-03-08 20:19:21 +00:00
$texttop = '<small class="opacitymedium">' . $langs -> trans ( " RegistrationNumber " ) . ':</small> <small>' . dol_trunc ( $registrationnumber , 10 ) . '</small>' ;
if (( ! isRegistrationDataSavedAndPushed () || ! isModEnabled ( 'blockedlog' )) && $mode != " forceregistration " ) {
$texttop = '' ;
}
2026-02-19 21:29:20 +00:00
}
print load_fiche_titre ( $title . '<br>' . $texttop , $linkback , 'blockedlog' , 0 , '' , '' , $morehtmlcenter );
if ( $withtab ) {
2026-04-12 09:59:56 +00:00
$head = blockedlogadmin_prepare_head ( $withtab );
2026-02-19 21:29:20 +00:00
print dol_get_fiche_head ( $head , 'documentation' , '' , - 1 );
} else {
print '<br>' ;
}
2026-03-08 21:27:57 +00:00
if ( ! userIsTaxAuditor ()) {
2026-03-08 20:19:21 +00:00
print '<span class="opacitymedium">' . $langs -> trans ( " BlockedLogDesc " ) . " </span><br> \n " ;
}
2026-02-19 21:29:20 +00:00
// Version
$versionbadge = '<span class="badge-text badge-secondary">' . getBlockedLogVersionToShow () . '</span>' ;
// Special additional message for FR only
$infotoshow = '' ;
if ( $mysoc -> country_code == 'FR' ) {
$islne = isALNEQualifiedVersion ( 1 , 1 );
if ( $islne ) {
2026-03-19 14:58:41 +00:00
if ( preg_match ( '/\-/' , getBlockedLogVersionToShow ())) {
2026-02-19 21:29:20 +00:00
// This is an alpha or beta version
$infotoshow = $langs -> trans ( " LNECandidateVersionForCertificationFR " , $versionbadge );
} else {
$infotoshow = $langs -> trans ( " LNECertifiedVersionFR " , $versionbadge );
}
} else {
$infotoshow = $langs -> trans ( " NotCertifiedVersionFR " , $versionbadge );
}
2026-03-19 14:58:41 +00:00
$infotoshow .= ' - <a href="' . DOL_URL_ROOT . '/blockedlog/admin/filecheck.php">' . img_picto ( '' , 'url' , 'class="pictofixedwidth"' ) . $langs -> trans ( " FileCheck " ) . '</a>' ;
2026-02-19 21:29:20 +00:00
}
// Show generic message (for countries that need registration) to explain we need registration to collect data and why
2026-03-08 21:27:57 +00:00
if ( in_array ( $mysoc -> country_code , array ( 'FR' )) && ! userIsTaxAuditor ()) {
2026-02-19 21:29:20 +00:00
$organization_for_ping = getDolGlobalString ( 'MAIN_ORGANIZATION_FOR_PING' , " Association Dolibarr " );
$dataprivacy_url = getDolGlobalString ( 'MAIN_ORGANIZATION_URL_PRIVACY' , " https://www.dolibarr.org/legal-privacy-gdpr.php " );
if ( ! isRegistrationDataSavedAndPushed () || $origin == 'initmodule' ) {
if ( $infotoshow ) {
print info_admin ( $infotoshow , 0 , 0 , 'info' );
}
if (( ! isRegistrationDataSavedAndPushed () || ! isModEnabled ( 'blockedlog' )) && $mode != " forceregistration " ) {
print '<center><span class="error"><br>' . $langs -> trans ( " RegistrationRequired " ) . '<br><br></span></center>' ;
}
$htmltext = " " ;
$htmltext .= $langs -> trans ( " UnalterableLogToolRegistrationFR " ) . '<br>' ;
$htmltext .= $langs -> trans ( " InformationWillBePublishedTo " );
$htmltext .= '<br>' . $langs -> trans ( " InformationWillBePublishedTo2 " , $organization_for_ping , $dataprivacy_url );
if ( ! isRegistrationDataSavedAndPushed () || ! isModEnabled ( 'blockedlog' )) {
$htmltext .= '<br>' . $langs -> trans ( " InformationWillBePublishedTo3 " );
$color = 'warning' ;
} else {
$color = 'info' ;
}
print info_admin ( $htmltext , 0 , 0 , $color );
if ( isRegistrationDataSavedAndPushed () && isModEnabled ( 'blockedlog' ) && $mode != " forceregistration " ) {
print '<center><span class="ok"><br>' . $langs -> trans ( " ApplicationHasBeenRegistered " ) . '<br><br></span></center>' ;
}
} else {
$htmltext = ( $infotoshow ? $infotoshow . '<br>' : '' );
$htmltext .= $langs -> trans ( " ApplicationHasBeenRegistered " );
2026-04-02 14:38:21 +00:00
$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>' ;
2026-02-19 21:29:20 +00:00
$htmltext .= '<br>' ;
$htmltext .= $langs -> trans ( " LastRegistrationDate " ) . ' : ' ;
//$htmltext .= dol_print_date(getDolGlobalString('MAIN_FIRST_REGISTRATION_OK_DATE'), 'dayhour', 'tzuserrel');
$htmltext .= getDolGlobalString ( 'MAIN_FIRST_REGISTRATION_OK_DATE' );
print info_admin ( $htmltext , 0 , 0 , 'info' );
// Show remind on good practices related to archives
2026-06-07 11:55:52 +00:00
$htmltext = $langs -> trans ( " UnalterableLogTool1FR " , $langs -> transnoentitiesnoconv ( " Archives " )) . '<br>' ;
2026-02-19 21:29:20 +00:00
print info_admin ( $htmltext , 0 , 0 , 'warning' );
}
}
print '<br>' ;
print '<center><br>' ;
2026-02-21 10:44:43 +00:00
print $langs -> trans ( " YouMayFindDocumentOn " ) . '<br>' ;
print '<br>' ;
print img_picto ( '' , 'url' ) . ' <a href="https://www.dolibarr.org/certifications-lf" target="_blank">https://www.dolibarr.org/certifications-lf</a>' ;
2026-06-22 11:17:36 +00:00
if ( $mysoc -> country_code == 'FR' ) {
print '<br><br>' . $langs -> trans ( " ApplicationUpdateResponsibilityFR " );
}
2026-02-19 21:29:20 +00:00
print '<center>' ;
if ( $withtab ) {
print dol_get_fiche_end ();
}
print '<br>' ;
// End of page
llxFooter ();
$db -> close ();