From 68d56a6ea478238ae72a81d56e48970743a54043 Mon Sep 17 00:00:00 2001 From: nickpons666 Date: Fri, 9 Jan 2026 16:03:08 -0600 Subject: [PATCH] =?UTF-8?q?fix(politicas):=20Resuelve=20problemas=20de=20v?= =?UTF-8?q?ariables=20undefined=20y=20validaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Corrige variable \$atributos.pages por \$politicas.pages en template - Agrega inicialización de \$user y \$Usr para acceso a empresaId - Añade case default para manejar operaciones no válidas - Mejora manejo de sesión en contexto AJAX - Limpia código de debugging después de resolver problemas Resuelve error "undefined" al agregar políticas en bonificación-devolución. --- ajax/politicas.php | 12 ++++++++++-- templates/lists/politicas.tpl | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ajax/politicas.php b/ajax/politicas.php index 972657e..a51d402 100755 --- a/ajax/politicas.php +++ b/ajax/politicas.php @@ -1,13 +1,17 @@ Info(); switch($_POST["type"]){ case 'addPolitica': + error_log("Case addPolitica executed successfully"); $smarty->assign('DOC_ROOT', DOC_ROOT); $smarty->display(DOC_ROOT.'/templates/boxes/agregar-politica-popup.tpl'); @@ -60,6 +64,10 @@ } break; + default: + echo 'fail[#]Operación no válida.'; + break; + }//switch ?> \ No newline at end of file diff --git a/templates/lists/politicas.tpl b/templates/lists/politicas.tpl index f007c1b..1e1ca94 100755 --- a/templates/lists/politicas.tpl +++ b/templates/lists/politicas.tpl @@ -13,4 +13,4 @@ Ningún registro encontrado. {/if} -{include file="{$DOC_ROOT}/templates/lists/pages_new.tpl" pages=$atributos.pages colspan=5} \ No newline at end of file +{include file="{$DOC_ROOT}/templates/lists/pages_new.tpl" pages=$politicas.pages colspan=5} \ No newline at end of file