diff --git a/lab_formularios.php b/lab_formularios.php index ea93d47..76bd026 100644 --- a/lab_formularios.php +++ b/lab_formularios.php @@ -444,6 +444,11 @@ function renderFormularios() { onclick="envio.abrir(${f.id})"> Enviar + ${f.es_toma_progresiva && PUEDE_ESCRIBIR ? ` + + + ` : ''} ${PUEDE_ESCRIBIR ? ` diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 3a1a9d7..b5663c6 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -664,18 +664,33 @@ function esc2(mixed $v): string { $_gruposConfig[$_gk] = ['title' => $__title, 'secs' => $_gsecs]; } } - $_showCfgPanel = $modoTurnero && $embebido && !empty($_gruposConfig) && $_tomasConfig === null; + = 2 tomas (hay algo que configurar). + // Si todos los grupos tienen 1 sola toma, el JS auto-guarda la config sin preguntar. + $_hasMulTomas = array_reduce($_gruposConfig, fn($c, $g) => $c || count($g['secs']) >= 2, false); + $_showCfgPanel = $modoTurnero && $embebido && !empty($_gruposConfig) && $_tomasConfig === null && $_hasMulTomas; + $_autoSaveCfg = $modoTurnero && $embebido && !empty($_gruposConfig) && $_tomasConfig === null && !$_hasMulTomas; + // Config por defecto (todas las tomas) — usada tanto por auto-save como por "Usar todas" + $_cfgDefault = []; + foreach ($_gruposConfig as $_cgk => $_cg) { + $_cfgDefault[$_cgk] = array_column($_cg['secs'], 'firma'); + } ?>
-
- Configurar protocolo de tomas +
+ Configurar protocolo de tomas +

- Seleccione las tomas a realizar para este paciente. - Puede desmarcar las tomas que no apliquen según la indicación médica. + Seleccione las tomas a realizar. Desmárquelas si el médico indicó un protocolo reducido.

$_cg): ?>
@@ -1207,53 +1222,79 @@ function esc2(mixed $v): string {