diff --git a/modules/turnero/api/configurar_tomas.php b/modules/turnero/api/configurar_tomas.php index cc566d7..3e041e4 100644 --- a/modules/turnero/api/configurar_tomas.php +++ b/modules/turnero/api/configurar_tomas.php @@ -11,9 +11,10 @@ require_once __DIR__ . '/_helpers.php'; requireMethod('POST'); -$body = inputJson(); -$token = trim($body['token'] ?? ''); -$cfg = $body['tomas_config'] ?? null; +$body = inputJson(); +$token = trim($body['token'] ?? ''); +$cfg = $body['tomas_config'] ?? null; +$examType = trim($body['exam_type'] ?? ''); if (!$token) jsonError('token requerido.'); if (!is_array($cfg) || empty($cfg)) jsonError('tomas_config requerido.'); @@ -40,6 +41,7 @@ if ($tc['datos_respuestas']) { } $dr['_tomas_config'] = $cfg; +if ($examType !== '') $dr['_c8j2g16'] = $examType; $pdo->prepare("UPDATE turnero_consentimientos SET datos_respuestas = ? WHERE id = ?") ->execute([json_encode($dr, JSON_UNESCAPED_UNICODE), $tc['id']]); diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 15ee527..808ec87 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -685,40 +685,17 @@ function _addExamWizardHtml(string $cid): string { $_gsecs) { - if (empty($_gsecs)) continue; - $__parts = array_values(array_filter(explode('|', $_gk))); - $__isCond = !empty(array_intersect($__parts, $_examOptions)); - $__matchSel = !empty(array_intersect($__parts, $_examSel)); - if (!$__isCond || $__matchSel) { - $__title = implode(' / ', array_intersect($__parts, $_examSel)); - if (!$__title) $__title = $_gsecs[0]['display'] ?? $_gk; - $_gruposConfig[$_gk] = ['title' => $__title, 'secs' => $_gsecs]; - } - } - // Mostrar panel solo si al menos un grupo tiene >= 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
-
@@ -1266,79 +1222,131 @@ function _addExamWizardHtml(string $cid): string {