From c0f45dd47aaf36a05c357812659155eaa28005fc Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:39:26 -0500 Subject: [PATCH] F-LAB-28: panel config muestra solo tomas del examen seleccionado MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _mpGetGroupsForExam ahora solo incluye los grupos genéricos ('Toma') cuando el examen no tiene secciones propias condicionadas. Para Taukit/Heliprobe/etc. aparecen únicamente sus tomas. Co-Authored-By: Claude Sonnet 4.6 --- ver_formulario_enviado.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 52f2d61..9c6bacb 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -1384,12 +1384,23 @@ function _mpShowCfgPanel(examName, groups) { } function _mpGetGroupsForExam(examName) { + // Primero buscar grupos condicionados para este examen var result = {}; + var hasOwn = false; for (var gk in _mpAllGroups) { var parts = gk.split('|').filter(Boolean); var isCond = parts.some(function(p) { return _mpExamOptions.indexOf(p) !== -1; }); - if (!isCond || parts.indexOf(examName) !== -1) { + if (isCond && parts.indexOf(examName) !== -1) { result[gk] = _mpAllGroups[gk]; + hasOwn = true; + } + } + // Solo incluir grupos genéricos (sin condición) si el examen no tiene secciones propias + if (!hasOwn) { + for (var gk in _mpAllGroups) { + var parts = gk.split('|').filter(Boolean); + var isCond = parts.some(function(p) { return _mpExamOptions.indexOf(p) !== -1; }); + if (!isCond) result[gk] = _mpAllGroups[gk]; } } return result;