From aed8aa7e8ffc9b4882f27203e842e591376b80d9 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 17 Jun 2026 13:14:51 -0400 Subject: [PATCH] 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. --- php/inc_fonctions.php | 1 + php/inc_fx_doc.php | 28 ++++++++++++++++++++++++---- php/inc_fx_promoteur.php | 15 +++++++++++---- php/inc_settings.php | 2 +- 4 files changed, 37 insertions(+), 9 deletions(-) diff --git a/php/inc_fonctions.php b/php/inc_fonctions.php index 2ccde65..7a2b08e 100644 --- a/php/inc_fonctions.php +++ b/php/inc_fonctions.php @@ -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'; diff --git a/php/inc_fx_doc.php b/php/inc_fx_doc.php index 07b27dd..c0a5264 100644 --- a/php/inc_fx_doc.php +++ b/php/inc_fx_doc.php @@ -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(); } diff --git a/php/inc_fx_promoteur.php b/php/inc_fx_promoteur.php index 5eab56e..e9278ca 100644 --- a/php/inc_fx_promoteur.php +++ b/php/inc_fx_promoteur.php @@ -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 '' . fxBibEsc(fxBibTexte($clef, 0, $strFallback)) . fxBibAideButton($clef) . ''; +/** Titre d'en-tête de bloc (assignation, gestion…) + aide + doc overlay optionnel. */ +function fxBibBlockHeader($clef, $strFallback = '', $docAnchorClef = '') { + $html = '' . fxBibEsc(fxBibTexte($clef, 0, $strFallback)) . fxBibAideButton($clef); + if ($docAnchorClef !== '') { + $html .= fxDocRenderTrigger($docAnchorClef); + $html .= fxAdminDocButton($docAnchorClef); + } + return $html . ''; } /** Cellule d'en-tête de colonne séquence + aide optionnelle (info_texte peut être vide). */ @@ -3082,7 +3087,7 @@ if ($teamMode <= 0) {
-
+
@@ -3115,6 +3120,8 @@ if ($teamMode <= 0) {
+ +