Module: nagvis Branch: master Commit: d73f533eeecbbb0f8a027c5a09bb245df6d565b5 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=d73f533eeecbbb0f8a027c5a09bb245df6d565b5
Author: LaMi <[email protected]> Date: Sat Jan 2 13:43:53 2010 +0100 WUI: Fixed invalid redirection due to form validation error messages --- share/frontend/wui/classes/WuiAddModify.php | 3 ++- share/frontend/wui/classes/WuiEditMainCfg.php | 3 ++- share/frontend/wui/js/addmodify.js | 2 ++ share/server/core/classes/GlobalMapCfg.php | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/share/frontend/wui/classes/WuiAddModify.php b/share/frontend/wui/classes/WuiAddModify.php index 6e83b16..c8604a8 100644 --- a/share/frontend/wui/classes/WuiAddModify.php +++ b/share/frontend/wui/classes/WuiAddModify.php @@ -70,7 +70,8 @@ class WuiAddModify extends GlobalPage { $this->FORM = new GlobalForm(Array('name' => 'addmodify', 'id' => 'addmodify', 'method' => '', - 'action' => 'javascript:(validateMapCfgForm()) ? formSubmit(\'addmodify\', \'./ajax_handler.php?action='.$action.'\') : true;', + 'onSubmit' => 'return validateMapCfgForm()', + 'action' => 'javascript:formSubmit(\'addmodify\', \'./ajax_handler.php?action='.$action.'\');', 'cols' => '2')); $code .= $this->getJsIncludes(); diff --git a/share/frontend/wui/classes/WuiEditMainCfg.php b/share/frontend/wui/classes/WuiEditMainCfg.php index dcc414f..c25e282 100644 --- a/share/frontend/wui/classes/WuiEditMainCfg.php +++ b/share/frontend/wui/classes/WuiEditMainCfg.php @@ -57,7 +57,8 @@ class WuiEditMainCfg extends GlobalPage { $this->FORM = new GlobalForm(Array('name' => 'edit_config', 'id' => 'edit_config', - 'action' => 'javascript:(validateMainCfgForm()) ? formSubmit(\'edit_config\', \'./ajax_handler.php?action=updateMainCfg\') : true ;', + 'onSubmit' => 'return validateMainCfgForm()', + 'action' => 'javascript:formSubmit(\'edit_config\', \'./ajax_handler.php?action=updateMainCfg\');', 'method' => '', 'cols' => '3')); diff --git a/share/frontend/wui/js/addmodify.js b/share/frontend/wui/js/addmodify.js index 4472660..f8dc0fa 100644 --- a/share/frontend/wui/js/addmodify.js +++ b/share/frontend/wui/js/addmodify.js @@ -184,6 +184,8 @@ function validateMapCfgForm() { if(document.addmodify.line_type && document.addmodify.line_type.value == '') { alert(printLang(lang["lineTypeNotSet"], '')); + document.addmodify.line_type.focus(); + return false; } } diff --git a/share/server/core/classes/GlobalMapCfg.php b/share/server/core/classes/GlobalMapCfg.php index 82e6e1e..987f8a8 100644 --- a/share/server/core/classes/GlobalMapCfg.php +++ b/share/server/core/classes/GlobalMapCfg.php @@ -1421,7 +1421,10 @@ class GlobalMapCfg { } // Trigger the autorization backend to create new permissions when needed - $this->CORE->getAuthorization()->createPermission($mod, $this->getName()); + $AUTHORIZATION = $this->CORE->getAuthorization(); + if($AUTHORIZATION !== null) { + $this->CORE->getAuthorization()->createPermission($mod, $this->getName()); + } } $this->BACKGROUND = $this->getBackground(); ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
