fix: Corregir orden de ayudantes en PDFs y bot de Telegram

- Cambiar getAyudantesActivos() por getAyudantesPorOrden() en todos los PDFs y bot
- Añadir tabla 'Turnos de Ayudantes' en ambos PDFs (ayudante y admin)
- Mostrar 4 próximas fechas para cada ayudante en orden correcto
- En PDF de ayudante: resaltar fila del usuario con badge 'Tu'
- Corregir sendPDF() y sendPDFGeneral() en bot de Telegram
- Asegurar consistencia: Ana → Esperanza → Mary → Bety → Mariela
- Sincronizar completamente web, PDFs y bot con nuevo orden de rotación
This commit is contained in:
nickpons666
2026-01-30 22:52:32 -06:00
parent 6823a5d6d3
commit ffda892859
3 changed files with 81 additions and 7 deletions

View File

@@ -20,14 +20,16 @@ class TelegramBot {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// --- MEJORAS ---
// 1. Forzar el uso de IPv4. Un problema común en entornos Docker
// es un timeout al intentar resolver AAAA (IPv6) antes de usar A (IPv4).
// 1. Forzar el uso de IPv4.
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
// 2. Añadir timeouts para evitar que el script se cuelgue indefinidamente.
// 2. Añadir timeouts de seguridad.
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); // 5 segundos para conectar
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // 10 segundos para la transferencia total
// 3. (ÚLTIMO INTENTO) Forzar versión de TLS.
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
if ($httpMethod === 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
@@ -269,7 +271,7 @@ class TelegramBot {
$db = \Database::getInstance()->getConnection();
$horarios = $horariosModel->getActivos();
$ayudantes = $userModel->getAyudantesActivos();
$ayudantes = $asignacionModel->getAyudantesPorOrden();
$semanasFuturas = [];
$hoy = new DateTime();
@@ -398,7 +400,7 @@ class TelegramBot {
$db = \Database::getInstance()->getConnection();
$horarios = $horariosModel->getActivos();
$ayudantes = $userModel->getAyudantesActivos();
$ayudantes = $asignacionModel->getAyudantesPorOrden();
$semanasFuturas = [];
$hoy = new DateTime();