diff --git a/modules/turnero/views/lugar.php b/modules/turnero/views/lugar.php index 7f532c0..a2f055e 100644 --- a/modules/turnero/views/lugar.php +++ b/modules/turnero/views/lugar.php @@ -871,7 +871,7 @@ async function cargarFormEmbebido(turnoId) { const res = await fetch(`${API}get_consent_token.php?turno_id=${turnoId}&lugar_id=${lugarId}`); const json = await res.json(); if (json.ok && json.token) { - iframe.src = `${BASE_WA}ver_formulario_enviado.php?token=${encodeURIComponent(json.token)}`; + iframe.src = `${BASE_WA}ver_formulario_enviado.php?token=${encodeURIComponent(json.token)}&embed=1`; } else { load.innerHTML = '' + (json.error || 'No hay formulario configurado') + ''; } diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index c6c206e..f86cb06 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -188,6 +188,7 @@ $datosCliente = json_decode($envio['datos_cliente'] ?? '{}', true) ?? []; $datosPrefilled = json_decode($envio['datos_prefilled'] ?? '{}', true) ?? []; $todos = array_merge($datosPrefilled, $datosCliente); $modoEditar = $modoTurnero && $envio['estado'] !== 'firmado'; +$embebido = isset($_GET['embed']) && $_GET['embed'] === '1'; // Mapa id → label $labelMap = []; @@ -298,6 +299,31 @@ function esc2(mixed $v): string { .hash-seal-header { background: #000 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; } } + + /* ── Modo embebido (iframe) ── */ + body { background: #fff; font-size: 12px; } + .action-bar { display: none !important; } + .doc-wrap { margin: 0; border-radius: 0; box-shadow: none; max-width: 100%; } + .doc-header { padding: 10px 14px 8px; } + .doc-header-text h3 { font-size: 14px; } + .doc-header-text h4 { font-size: 12px; } + .doc-body { padding: 12px 14px; } + .doc-footer { display: none; } + .section-title { font-size: 10px; margin: 14px 0 8px; } + .campo-label { font-size: 11px; } + .campo-valor { font-size: 12px; } + .campo-edit { margin-bottom: 8px; } + .campo-edit label { font-size: 11px; margin-bottom: 2px; } + .campo-edit .form-control, + .campo-edit .form-select { font-size: 12px; padding: 3px 7px; } + .campo-edit .form-check-label { font-size: 12px; } + .campo-row { padding: 3px 0; } + .turnero-cv { height: 110px !important; } + .btn { font-size: 12px; padding: 3px 10px; } + .hash-seal { display: none; } + .alert { font-size: 12px; padding: 6px 10px; } + + /* ── Canvas firma profesional ───────────────────── */ .firma-pro-widget { max-width: 520px; margin-top: 8px; } .fpw-canvas { border: 2px solid #198754; border-radius: 8px; background: #f8fff9; @@ -470,6 +496,11 @@ function esc2(mixed $v): string { if (!$cid) continue; $isPro = ($tipo === 'firma_profesional'); + // Marcar siempre que el esquema tiene campo firma paciente + if (!$isPro) { + $_esquemaTieneFirmaPaciente = true; + } + // La firma profesional global solo se muestra en el PRIMER campo firma_profesional. // Campos posteriores (ej. desistimiento) solo muestran su propia firma por campo. $fSvg = $isPro @@ -481,12 +512,10 @@ function esc2(mixed $v): string { $fLabel = htmlspecialchars($campo['label'] ?? ($isPro ? 'Firma profesional' : 'Firma paciente')); // Campo paciente sin firma: - // - En turnero pendiente: todos los campos firma muestran canvas (consentimiento + desistimiento). + // - En turnero pendiente: todos los campos firma muestran canvas. // - En vista normal: omitir campos sin firma. if (!$fSvg && !$fFoto && !$isPro) { - if ($modoTurnero && $modoEditar) { - $_esquemaTieneFirmaPaciente = true; - } else { + if (!($modoTurnero && $modoEditar)) { continue; // no-turnero: omitir campos sin firma } } @@ -598,7 +627,7 @@ function esc2(mixed $v): string {