diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-23 07:44:31 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-23 07:44:31 +0000 |
commit | 79dd200e7a1b6802794be3be46099bb2a1083537 (patch) | |
tree | d40942ce01d2a1f3ca0368e733b29bac693adeb0 /frontends/php/scripts.php | |
parent | 92bf3020da3e671315d21b93ca998b6ab3305136 (diff) | |
download | zabbix-79dd200e7a1b6802794be3be46099bb2a1083537.tar.gz zabbix-79dd200e7a1b6802794be3be46099bb2a1083537.tar.xz zabbix-79dd200e7a1b6802794be3be46099bb2a1083537.zip |
- [DEV-48] merged rev. 4896:4898 of branches/1.4.j/ (Artem) [fixes for script form save]
git-svn-id: svn://svn.zabbix.com/trunk@4899 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/scripts.php')
-rw-r--r-- | frontends/php/scripts.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/frontends/php/scripts.php b/frontends/php/scripts.php index 27caeac5..531e371e 100644 --- a/frontends/php/scripts.php +++ b/frontends/php/scripts.php @@ -51,7 +51,6 @@ include_once "include/page_header.php"; 'form_refresh'=> array(T_ZBX_INT, O_OPT, NULL, NULL, null), ); - check_fields($fields); if(isset($_REQUEST['action'])){ @@ -59,9 +58,8 @@ if(isset($_REQUEST['action'])){ if(isset($_REQUEST['save'])){ $cond = (isset($_REQUEST['scriptid']))?(' AND scriptid<>'.$_REQUEST['scriptid']):(''); - $scripts = DBfetch(DBselect('SELECT count(scriptid) as cnt FROM scripts WHERE name='.zbx_dbstr($_REQUEST['name']).$cond,1)); - + if($scripts && $scripts['cnt']>0){ error(S_SCRIPT.SPACE.'['.htmlspecialchars($_REQUEST['name']).']'.SPACE.S_ALREADY_EXISTS_SMALL); show_messages(null,S_ERROR,S_CANNOT_ADD_SCRIPT); @@ -121,6 +119,7 @@ if(isset($_REQUEST['action'])){ if(isset($_REQUEST['form'])){ $frmScr = new CFormTable(S_SCRIPT,'scripts.php','POST',null,'form'); + $frmScr->AddOption('id','scripts'); if(isset($_REQUEST['scriptid'])) $frmScr->AddVar('scriptid',$_REQUEST['scriptid']); @@ -147,7 +146,7 @@ if(isset($_REQUEST['form'])){ $frmScr->AddRow(S_REQUIRED_HOST.SPACE.S_PERMISSIONS_SMALL,$select_acc); - $frmScr->AddItemToBottomRow(new CButton('save',S_SAVE,'javascript: document.forms[0].action += \'?action=1\';')); + $frmScr->AddItemToBottomRow(new CButton('save',S_SAVE,"javascript: document.getElementById('scripts').action+='?action=1'; ")); $frmScr->AddItemToBottomRow(SPACE); $frmScr->AddItemToBottomRow(new CButtonCancel()); |