This commit is contained in:
Lizandro Guarnizo
2026-06-18 09:35:17 -05:00
parent c58998599b
commit 8d577947a6
7 changed files with 87 additions and 12 deletions
+3 -3
View File
@@ -135,16 +135,16 @@ try {
if (!str_starts_with($cel, '+')) {
$cel = '+57' . ltrim($cel, '0');
}
$nombrePacWA = $pacienteNombre ?: 'Paciente';
require_once __DIR__ . '/../../../services/WhatsAppService.php';
try {
$wa = new WhatsAppService();
// Enviar solo el código, sin nombre/apellido
$wa->sendTemplateMessage(
$cel,
$waTemplate,
$waLang,
[
htmlspecialchars($nombrePacWA, ENT_QUOTES),
'Paciente',
$codigo,
'',
],
@@ -152,7 +152,7 @@ try {
);
} catch (\Throwable $eTmpl) {
try {
$mensajeTexto = "Hola {$nombrePacWA}, su turno *{$codigo}* ha sido registrado en {$codigo}. Preséntese al laboratorio.";
$mensajeTexto = "Su turno *{$codigo}* ha sido registrado. Preséntese al laboratorio.";
$wa->sendTextMessage($cel, $mensajeTexto);
} catch (\Throwable $eTxt) {
// Silenciar
+4 -2
View File
@@ -14,6 +14,8 @@ $input = inputJson();
$id = (int)($input['id'] ?? 0);
$nombre = trim($input['nombre'] ?? '');
$color = trim($input['color'] ?? '#6b7280');
$icono = trim($input['icono'] ?? null) ?: null;
$descripcion = trim($input['descripcion'] ?? null) ?: null;
$ordenPeso = (int)($input['orden_peso'] ?? 1);
$activo = (int)($input['activo'] ?? 1);
@@ -23,9 +25,9 @@ if ($ordenPeso < 1) jsonError('El orden debe ser mayor a 0');
if (!preg_match('/^#[0-9a-f]{6}$/i', $color)) jsonError('Color hexadecimal inválido (formato: #RRGGBB)');
$stmt = db()->prepare(
'UPDATE turnero_prioridades SET nombre=?, color=?, orden_peso=?, activo=? WHERE id=?'
'UPDATE turnero_prioridades SET nombre=?, color=?, icono=?, descripcion=?, orden_peso=?, activo=? WHERE id=?'
);
$stmt->execute([$nombre, $color, $ordenPeso, $activo, $id]);
$stmt->execute([$nombre, $color, $icono, $descripcion, $ordenPeso, $activo, $id]);
if ($stmt->rowCount() === 0) {
jsonError('Prioridad no encontrada', 404);