X-Git-Url: https://git.llucax.com/mecon/samurai.git/blobdiff_plain/2ba023cd1e829c20ad139ca6c2c738738b4f15fe..1fce1689d24ee6eed11644946bfa777a06d2ef8e:/sistema/www/sistemas/sistemas-abm.php diff --git a/sistema/www/sistemas/sistemas-abm.php b/sistema/www/sistemas/sistemas-abm.php index 43c144f..0f306ce 100644 --- a/sistema/www/sistemas/sistemas-abm.php +++ b/sistema/www/sistemas/sistemas-abm.php @@ -47,9 +47,9 @@ $FORM->addElement ('mdate' , 'fecha_implementacion', 'Fecha Implementacion'); $FORM->addElement ('textarea', 'contacto' , 'Contacto' , array('rows' => '2','cols'=>'50')); $FORM->addElement ('select' , 'permisos' , 'Permisos' , $PERMISOS, array('size' => '5', 'multiple' => 'multiple')); - $FORM->addElement ('static' , 'responsable' , 'Responsable' , $_SESSION['samurai']['login']); - $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Grabar'); - $group[] = HTML_QuickForm::createElement('submit', 'cancelar', 'Cancelar'); + $FORM->addElement ('hidden' , 'responsable' , $_SESSION['samurai']['login']); + $group[] = HTML_QuickForm::createElement('submit', 'aceptar' , 'Grabar', array ('onClick' => 'javascript:if (confirm(\'¿Esta Seguro?\')) return true;return false;')); + $group[] = HTML_QuickForm::createElement('submit', 'cancelar', 'Cancelar', array ('onClick' => 'javascript:window.location = ->\'sistemas\';return false;')); $FORM->addGroup($group,'botones'); // }}} //AGREGO LAS REGLAS DE VALIDACION DE LOS ELEMENTOS {{{ @@ -178,13 +178,16 @@ } $SISTEMA->setContacto($contacto->getValue()); $SISTEMA->setPermisos($permisos->getSelected()); - $SISTEMA->setResponsable($responsable->_text); //TODO URGENTE Modificar esto. No tiene hay metodo static::getValue() + $SISTEMA->setResponsable($responsable->getValue()); $botones = $FORM->getSubmitValue('botones'); if (@$botones['cancelar']) { header ('Location: sistemas'); } else { $res = $SISTEMA->guardarDatos($aceptar->getValue()); + if ($aceptar->getValue() != 'Eliminar') { + $_SESSION['samurai']['id_sistema'] = $SISTEMA->getId(); + } if (PEAR::isError($res)) { $ERROR = new MECON_HTML_Error($res->getMessage()); }