From 275170f9d57b64a2af8b384f1e3bdd2acea488cc Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 16 Jun 2026 11:44:02 -0500 Subject: [PATCH] fix: show all signature fields in print, canvas only once - All firma/firma_profesional positions render with shared signature image - Canvas widget for nurse appears only once (no duplicate inputs) - Signed image replicates to every position of the same type Co-Authored-By: Claude Haiku 4.5 --- ver_formulario_enviado.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ver_formulario_enviado.php b/ver_formulario_enviado.php index 16b0946..f15138d 100644 --- a/ver_formulario_enviado.php +++ b/ver_formulario_enviado.php @@ -455,14 +455,13 @@ function esc2(mixed $v): string { $fColor = $isPro ? '#198754' : '#1565c0'; $fLabel = htmlspecialchars($campo['label'] ?? ($isPro ? 'Firma profesional' : 'Firma paciente')); - // Si ya renderizamos la firma de este tipo, omitir duplicado - if (!$isPro && $_renderedFirmaPaciente) { continue; } - if ($isPro && $_renderedFirmaProfesional) { continue; } + // Firma sin contenido: omitir (no hay nada que mostrar) + if (!$fSvg && !$fFoto && !$isPro) continue; + + // Rastrear si este tipo ya tiene canvas activo (para no duplicar el widget de dibujo) + $yaHayCanvasPro = $isPro && $_renderedFirmaProfesional; if (!$isPro) $_renderedFirmaPaciente = true; if ($isPro) $_renderedFirmaProfesional = true; - - // Firma paciente sin contenido y sin widget turnero: omitir - if (!$isPro && !$fSvg && !$fFoto) continue; ?>
@@ -476,8 +475,8 @@ function esc2(mixed $v): string { Foto - <?= $fLabel ?>
- - + +

Dibuje su firma en el recuadro:

@@ -488,12 +487,10 @@ function esc2(mixed $v): string {
- - +
Pendiente de firma del profesional. - Esta sección será completada por el profesional de salud.