fix: ocultar tomas no configuradas en formulario aunque esté en modoEditar
Añade flag $_mpSkipSec para secciones excluidas por _tomas_config; la condición anterior dependía de !$modoEditar y nunca ocultaba nada cuando el consentimiento está en_progreso. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
418485197b
commit
4fdc8e2c13
@@ -878,9 +878,11 @@ function _addExamWizardHtml(string $cid): string {
|
||||
|
||||
if ($compact): ?><div class="campos-grid"><?php endif;
|
||||
$_saltarSeccion = false;
|
||||
$_mpSkipSec = false; // toma excluida por _tomas_config; siempre ocultar sin importar modoEditar
|
||||
foreach ($esquema as $campo):
|
||||
$tipo = $campo['tipo'] ?? '';
|
||||
if ($tipo === 'separador'):
|
||||
$_mpSkipSec = false;
|
||||
$cond = $campo['condicion'] ?? null;
|
||||
if ($cond) {
|
||||
$vCtrl = $todos[$cond['campo_id']] ?? null;
|
||||
@@ -894,12 +896,13 @@ function _addExamWizardHtml(string $cid): string {
|
||||
// Ocultar secciones de tomas excluidas por la configuración de ciclos del paciente
|
||||
if (!$_saltarSeccion && isset($_mpSkippedSepIds[$campo['id'] ?? ''])) {
|
||||
$_saltarSeccion = true;
|
||||
$_mpSkipSec = true;
|
||||
}
|
||||
if ($_saltarSeccion && !$modoEditar) continue; ?>
|
||||
if (($_saltarSeccion && !$modoEditar) || $_mpSkipSec) continue; ?>
|
||||
<div class="esquema-sep<?= $compact ? ' campo-full' : '' ?>" data-campo-id="<?= esc2($campo['id'] ?? '') ?>"
|
||||
<?= ($_saltarSeccion && $modoEditar) ? 'style="max-height:0;opacity:0;overflow:hidden;pointer-events:none"' : '' ?>><?= esc2($campo['label'] ?? '') ?></div>
|
||||
<?php continue; endif;
|
||||
if ($_saltarSeccion && !$modoEditar) continue;
|
||||
if (($_saltarSeccion && !$modoEditar) || $_mpSkipSec) continue;
|
||||
|
||||
// ── Firmas inline: cada campo muestra su propia firma ──
|
||||
if ($tipo === 'firma' || $tipo === 'firma_profesional'):
|
||||
|
||||
Reference in New Issue
Block a user