fix: formulario de consentimiento turnero mostraba campos editables
En modo turnero el documento debe ser de solo lectura; solo la firma del paciente es interactiva. Los campos editables (inputs, selects, checkboxes) solo aplican para envíos normales sin modo turnero. También inicializa $_renderedFirmaPaciente que se usaba sin definir, evitando que la firma aparezca duplicada al pie del documento. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e80c1d180d
commit
75ead05b14
@@ -452,8 +452,9 @@ function esc2(mixed $v): string {
|
||||
// Firma global del paciente: fallback para cuando no hay datos_cliente por campo
|
||||
$firmaSharedPaciente = $envio['firma_svg'] ?? null;
|
||||
|
||||
// Rastrear campos profesional con canvas ya renderizado (para no duplicar)
|
||||
// Rastrear si ya se renderizó la firma inline (para no duplicarla al pie)
|
||||
$_renderedFirmaProfesional = false;
|
||||
$_renderedFirmaPaciente = false;
|
||||
|
||||
foreach ($esquema as $campo):
|
||||
$tipo = $campo['tipo'] ?? '';
|
||||
@@ -481,7 +482,8 @@ function esc2(mixed $v): string {
|
||||
if (!$fSvg && !$fFoto && !$isPro) continue;
|
||||
|
||||
$yaHayCanvasPro = $isPro && $_renderedFirmaProfesional;
|
||||
if ($isPro) $_renderedFirmaProfesional = true;
|
||||
if ($isPro) $_renderedFirmaProfesional = true;
|
||||
if (!$isPro && $fSvg) $_renderedFirmaPaciente = true;
|
||||
?>
|
||||
<div class="section-title mt-3" style="color:<?= $fColor ?>">
|
||||
<i class="fas <?= $fIcon ?> me-1"></i><?= $fLabel ?>
|
||||
@@ -543,8 +545,9 @@ function esc2(mixed $v): string {
|
||||
$cid = $campo['id'] ?? null;
|
||||
if (!$cid) continue;
|
||||
|
||||
// ── Modo editar (turnero, consentimiento pendiente): campos interactivos ──
|
||||
if ($modoEditar):
|
||||
// ── Modo editar: campos interactivos solo para envíos normales.
|
||||
// En turnero el documento es de solo lectura; solo la firma es interactiva.
|
||||
if ($modoEditar && !$modoTurnero):
|
||||
$prefill = $todos[$cid] ?? '';
|
||||
$label = esc2($campo['label'] ?? $cid);
|
||||
$req = !empty($campo['required']) ? ' required' : '';
|
||||
|
||||
Reference in New Issue
Block a user