Enhance documentation functionality by adding fxDocSchemaReady function and updating fxBibBlockHeader to support optional documentation overlay. Increment version code to 4.72.646 in inc_settings.php.

This commit is contained in:
2026-06-17 13:14:51 -04:00
parent f3ed7d6ea7
commit aed8aa7e8f
4 changed files with 37 additions and 9 deletions

View File

@ -5,6 +5,7 @@ define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..') . '/');
// initialiser la variable $binEnvironementDev en utiliant le nom de domaine
include_once APPLICATION_PATH . 'php/inc_fonctions_sl.php';
include_once APPLICATION_PATH . 'php/inc_fx_doc.php';
include_once APPLICATION_PATH . 'php/inc_settings.php';
include_once APPLICATION_PATH . 'php/inc_mysql.php';
include_once APPLICATION_PATH . 'php/inc_dates.php';

View File

@ -33,6 +33,26 @@ function fxDocLangue() {
return !empty($strLangue) ? $strLangue : 'fr';
}
/** Tables doc_* présentes en BD (évite erreur si SQL module pas encore exécuté). */
function fxDocSchemaReady() {
global $objDatabase;
static $blnReady = null;
if ($blnReady !== null) {
return $blnReady;
}
if (!isset($objDatabase)) {
$blnReady = false;
return false;
}
$qry = $objDatabase->fxQuery("SHOW TABLES LIKE 'doc_page'");
$blnReady = ($qry && mysqli_num_rows($qry) > 0);
return $blnReady;
}
/**
* Charge en mémoire toutes les pages doc pour une page PHP (comme obtenirTextepage).
* Remplit $vdoc_page[doc_page_clef] = row.
@ -49,7 +69,7 @@ function obtenirDocPage($page = null, $langue = null) {
$vdoc_page = array();
if (!isset($objDatabase)) {
if (!isset($objDatabase) || !fxDocSchemaReady()) {
return $vdoc_page;
}
@ -87,7 +107,7 @@ function fxDocGetAnchorRow($clef, $mem_global = 0) {
return $anchorCache[$cacheKey];
}
if (!isset($objDatabase) || $clef === '') {
if (!isset($objDatabase) || $clef === '' || !fxDocSchemaReady()) {
$anchorCache[$cacheKey] = array();
return $anchorCache[$cacheKey];
}
@ -127,7 +147,7 @@ function fxDocGetModulePages($modClef, $langue = null, $mem_global = 0) {
$strPrg = fxDocPrg($mem_global);
$modClef = fxDocResolveModClef($modClef, $mem_global);
if (!isset($objDatabase) || $modClef === '') {
if (!isset($objDatabase) || $modClef === '' || !fxDocSchemaReady()) {
return array();
}
@ -166,7 +186,7 @@ function fxDocGetPageRow($clef, $mem_global = 0) {
return $vdoc_page[$clef];
}
if (!isset($objDatabase) || $clef === '') {
if (!isset($objDatabase) || $clef === '' || !fxDocSchemaReady()) {
return array();
}

View File

@ -2780,9 +2780,14 @@ function fxBibTexteAide($clef, $mem_echo = 1, $strFallback = '') {
return $html;
}
/** Titre d'en-tête de bloc (assignation, gestion…) + aide. */
function fxBibBlockHeader($clef, $strFallback = '') {
return '<span class="epr-header-label">' . fxBibEsc(fxBibTexte($clef, 0, $strFallback)) . fxBibAideButton($clef) . '</span>';
/** Titre d'en-tête de bloc (assignation, gestion…) + aide + doc overlay optionnel. */
function fxBibBlockHeader($clef, $strFallback = '', $docAnchorClef = '') {
$html = '<span class="epr-header-label">' . fxBibEsc(fxBibTexte($clef, 0, $strFallback)) . fxBibAideButton($clef);
if ($docAnchorClef !== '') {
$html .= fxDocRenderTrigger($docAnchorClef);
$html .= fxAdminDocButton($docAnchorClef);
}
return $html . '</span>';
}
/** Cellule d'en-tête de colonne séquence + aide optionnelle (info_texte peut être vide). */
@ -3082,7 +3087,7 @@ if ($teamMode <= 0) {
<?php /* MSIN-4379 — Assignation de dossard : séquences + actions (ex 3e colonne). */ ?>
<div class="epr-block epr-block-assign">
<div class="epr-header"><?php echo fxBibBlockHeader('bib_v4_assign_title', 'Assignation de dossard'); ?></div>
<div class="epr-header"><?php echo fxBibBlockHeader('bib_v4_assign_title', 'Assignation de dossard', 'bib_v4_assign_doc'); ?></div>
<div class="epr-content">
<?php if (count($tabBibStats) == 0) { ?>
@ -3115,6 +3120,8 @@ if ($teamMode <= 0) {
</div>
<?php echo fxDocRenderModule('bib_v4_assign_doc'); ?>
<?php
}
function fxInfosBibRange($epr_id = 0, $epr_bib_id = 0){

View File

@ -7,7 +7,7 @@
* Constantes *
*
**************/
define('_VERSION_CODE', '4.72.645');
define('_VERSION_CODE', '4.72.646');
define('_DATE_CODE', '2026-06-17');
//MSIN-4290
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');