diff --git a/ajax_bib_range.php b/ajax_bib_range.php
index 2d86058..74aef47 100644
--- a/ajax_bib_range.php
+++ b/ajax_bib_range.php
@@ -1,9 +1,19 @@
-
+
@@ -2631,9 +2631,84 @@ function fxBibEsc($str) {
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}
+/** Page info pour le module bib v4 — toujours compte.php, jamais le script AJAX. */
+function fxBibInfoPage() {
+ return 'compte.php';
+}
+
+/**
+ * Lit info_texte / info_aide depuis $vtexte_page ou la BD (compte.php / global uniquement).
+ * N'écrit jamais dans info — évite les doublons info_prg=ajax_bib_range.php en AJAX.
+ */
+function fxBibGetInfoRow($clef) {
+ global $vtexte_page, $objDatabase, $strLangue;
+
+ if (!empty($vtexte_page[$clef])) {
+ return $vtexte_page[$clef];
+ }
+
+ static $bibInfoCache = array();
+ if (array_key_exists($clef, $bibInfoCache)) {
+ return $bibInfoCache[$clef];
+ }
+
+ if (!isset($objDatabase)) {
+ $bibInfoCache[$clef] = array();
+ return $bibInfoCache[$clef];
+ }
+
+ $strLang = !empty($strLangue) ? $strLangue : 'fr';
+ $strPage = fxBibInfoPage();
+ $sql = "SELECT info_texte, info_aide FROM info
+ WHERE info_actif = 1
+ AND info_clef = '" . $objDatabase->fxEscape($clef) . "'
+ AND info_langue = '" . $objDatabase->fxEscape($strLang) . "'
+ AND info_prg IN ('" . $strPage . "', 'global')
+ ORDER BY FIELD(info_prg, '" . $strPage . "', 'global')
+ LIMIT 1";
+ $row = $objDatabase->fxGetRow($sql);
+ $bibInfoCache[$clef] = is_array($row) ? $row : array();
+ return $bibInfoCache[$clef];
+}
+
+/** Libellé bib v4 — sur compte.php auto-crée si absent ; en AJAX, lecture seule + repli. */
+function fxBibTexte($clef, $mem_echo = 0, $strFallback = '') {
+ $row = fxBibGetInfoRow($clef);
+ $str = trim($row['info_texte'] ?? '');
+
+ if ($str === '' || $str === $clef || $str === '*' . $clef . '*') {
+ if (!defined('MS1_BIB_AJAX') || !MS1_BIB_AJAX) {
+ $str = trim(afficheTexte($clef, 0));
+ }
+ if ($str === '' || $str === $clef || $str === '*' . $clef . '*') {
+ $str = $strFallback !== '' ? $strFallback : $clef;
+ }
+ }
+
+ if ($mem_echo) {
+ echo fxBibEsc($str);
+ }
+ return $str;
+}
+
+/** Texte d'aide long bib v4 — même règle que fxBibTexte pour l'auto-création. */
+function fxBibAide($clef, $mem_echo = 0) {
+ $row = fxBibGetInfoRow($clef);
+ $str = trim($row['info_aide'] ?? '');
+
+ if ($str === '' && (!defined('MS1_BIB_AJAX') || !MS1_BIB_AJAX)) {
+ $str = trim(afficheAide($clef, 0));
+ }
+
+ if ($mem_echo) {
+ echo fxBibEsc($str);
+ }
+ return $str;
+}
+
/** Attribut data-tippy-content — texte court depuis info_texte (clé bib_v4_tip_*). */
function fxBibTippyAttr($clef) {
- $strTip = trim(afficheTexte($clef, 0));
+ $strTip = trim(fxBibTexte($clef, 0));
if ($strTip === '' || $strTip === '*' . $clef . '*') {
return '';
}
@@ -2642,7 +2717,7 @@ function fxBibTippyAttr($clef) {
/** Bouton (?) — pop-up long depuis info_aide ; absent si info_aide vide. */
function fxBibAideButton($clef) {
- $strAide = trim(afficheAide($clef, 0));
+ $strAide = trim(fxBibAide($clef, 0));
if ($strAide === '') {
return '';
}
@@ -2652,10 +2727,7 @@ function fxBibAideButton($clef) {
/** Libellé info_texte + bouton (?) si info_aide renseigné. */
function fxBibTexteAide($clef, $mem_echo = 1, $strFallback = '') {
- $str = trim(afficheTexte($clef, 0));
- if ($str === '' || $str === '*' . $clef . '*') {
- $str = $strFallback !== '' ? $strFallback : $clef;
- }
+ $str = fxBibTexte($clef, 0, $strFallback);
$html = fxBibEsc($str) . fxBibAideButton($clef);
if ($mem_echo) {
echo $html;
@@ -2665,20 +2737,12 @@ function fxBibTexteAide($clef, $mem_echo = 1, $strFallback = '') {
/** Titre d'en-tête de bloc (assignation, gestion…) + aide. */
function fxBibBlockHeader($clef, $strFallback = '') {
- $str = trim(afficheTexte($clef, 0));
- if ($str === '' || $str === '*' . $clef . '*') {
- $str = $strFallback !== '' ? $strFallback : $clef;
- }
- return '';
+ return '';
}
/** Cellule d'en-tête de colonne séquence + aide optionnelle. */
function fxBibColHeader($clef, $strFallback) {
- $str = trim(afficheTexte($clef, 0));
- if ($str === '' || $str === '*' . $clef . '*') {
- $str = $strFallback;
- }
- return fxBibEsc($str) . fxBibAideButton($clef);
+ return fxBibEsc(fxBibTexte($clef, 0, $strFallback)) . fxBibAideButton($clef);
}
/** Bouton « ajouter séquence » — libellé BD (bib_v4_add) + tip court + aide longue. */
@@ -2689,7 +2753,7 @@ function renderBibAddRangeButton($epr_id, $extraStyle = '') {
@@ -2723,7 +2787,7 @@ function renderBibAssignActions($tabBibAssignments, $strLangue, $infoBib, $blnAu
@@ -2731,41 +2795,41 @@ function renderBibAssignActions($tabBibAssignments, $strLangue, $infoBib, $blnAu
+ style="">
-
+
-
+
-
+
@@ -2777,13 +2841,13 @@ function renderBibAssignActions($tabBibAssignments, $strLangue, $infoBib, $blnAu
@@ -2842,10 +2906,10 @@ function fxShowBibTool4($str_code, $int_eve_id, $strLangue){
+ data-auto-label=""
+ data-auto-label-config=""
+ data-batch-label=""
+ data-batch-label-cancel="">
@@ -2942,9 +3006,9 @@ if ($teamMode <= 0) {
@@ -2955,9 +3019,7 @@ if ($teamMode <= 0) {
-
-
-
+