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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
d7b1aea5a4
commit
275170f9d5
@@ -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;
|
||||
?>
|
||||
<div class="section-title mt-3" style="color:<?= $fColor ?>">
|
||||
<i class="fas <?= $fIcon ?> me-1"></i><?= $fLabel ?>
|
||||
@@ -476,8 +475,8 @@ function esc2(mixed $v): string {
|
||||
<img src="<?= htmlspecialchars($fFoto) ?>" alt="Foto - <?= $fLabel ?>">
|
||||
</div>
|
||||
<?php elseif ($isPro): ?>
|
||||
<?php if (!$modoPublico): ?>
|
||||
<!-- Canvas para que el profesional firme (se replica en todos los campos firma_profesional) -->
|
||||
<?php if (!$modoPublico && !$yaHayCanvasPro): ?>
|
||||
<!-- Canvas del profesional: solo aparece una vez -->
|
||||
<div class="firma-pro-widget no-print" id="fpw-<?= htmlspecialchars($cid) ?>"
|
||||
data-envio="<?= (int)$envio['id'] ?>" data-campo="<?= htmlspecialchars($cid) ?>">
|
||||
<p class="text-muted small mb-2"><i class="fas fa-pen me-1"></i>Dibuje su firma en el recuadro:</p>
|
||||
@@ -488,12 +487,10 @@ function esc2(mixed $v): string {
|
||||
</div>
|
||||
<div class="fpw-msg mt-2 small"></div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<!-- Vista pública: el cliente no puede firmar como profesional -->
|
||||
<?php elseif ($modoPublico): ?>
|
||||
<div class="alert py-2 px-3 no-print" style="background:#fff8e1;border:1.5px dashed #f59e0b;border-radius:8px;color:#92400e;font-size:.85rem">
|
||||
<i class="fas fa-hourglass-half me-2"></i>
|
||||
<strong>Pendiente de firma del profesional.</strong>
|
||||
Esta sección será completada por el profesional de salud.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user