From 794db4f0d53fdc2b2e80d208dd992006fe3ce8d1 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:01:33 -0500 Subject: [PATCH] fix: botones Descargar PDF y Cerrar tras firmar consentimiento MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Después de firmar (y en carga cuando ya está firmado) no había ninguna acción disponible — solo texto "Puede cerrar esta ventana" sin botón. Ahora aparecen dos botones: - Descargar PDF → window.print() (permite guardar como PDF) - Cerrar → window.close() (solo cuando no está en iframe) En modo embebido (iframe desde lugar.php) solo aparece Descargar PDF; el cierre lo maneja el postMessage ya existente al padre. Co-Authored-By: Claude Sonnet 4.6 --- ver_formulario_enviado.php | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index d3d0fac..cf01246 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -852,11 +852,19 @@ function esc2(mixed $v): string {
-
- +
+
Consentimiento firmado
- Puede cerrar esta ventana. El personal de salud ha sido notificado. + El personal de salud ha sido notificado. +
+ + +
@@ -1103,8 +1111,17 @@ document.querySelectorAll('.turnero-firma-item').forEach(function(widget) { w.style.display = 'none'; }); var ok = document.createElement('div'); - ok.className = 'alert alert-success mt-4 d-flex align-items-center gap-2 no-print'; - ok.innerHTML = '
Firmado correctamente.
Puede cerrar esta ventana.
'; + ok.className = 'alert alert-success mt-4 d-flex align-items-start gap-3 no-print'; + var _enIframe = (function(){ try { return window.self !== window.top; } catch(e){ return true; } })(); + ok.innerHTML = '' + + '
Firmado correctamente.
' + + 'El personal de salud ha sido notificado.' + + '
' + + '' + + (!_enIframe ? '' : '') + + '
'; widget.parentNode.insertBefore(ok, widget.nextSibling); try { window.parent.postMessage({ type: 'turneroFirmado' }, '*'); } catch(e) {} } else {