diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-27 10:07:06 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-27 10:07:06 +0000 |
commit | af1943c6cdf9e639e987a63fafa06c200d7f5936 (patch) | |
tree | 896df11f157cd28785d5719abc1d252339d9f5bf /frontends/php | |
parent | 8c219636c506ed1678f653443f8ab863bc5ee51a (diff) | |
download | zabbix-af1943c6cdf9e639e987a63fafa06c200d7f5936.tar.gz zabbix-af1943c6cdf9e639e987a63fafa06c200d7f5936.tar.xz zabbix-af1943c6cdf9e639e987a63fafa06c200d7f5936.zip |
- [DEV-177] fixes in service form for checkbox range selection (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5803 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r-- | frontends/php/include/classes/ctree.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/locales/en_gb.inc.php | 2 | ||||
-rw-r--r-- | frontends/php/include/page_footer.php | 10 | ||||
-rw-r--r-- | frontends/php/js/services.js | 2 | ||||
-rw-r--r-- | frontends/php/js/tree.js | 21 | ||||
-rw-r--r-- | frontends/php/services_form.php | 6 |
6 files changed, 22 insertions, 21 deletions
diff --git a/frontends/php/include/classes/ctree.inc.php b/frontends/php/include/classes/ctree.inc.php index 64c3a8e3..7a423de2 100644 --- a/frontends/php/include/classes/ctree.inc.php +++ b/frontends/php/include/classes/ctree.inc.php @@ -221,7 +221,7 @@ var $maxlevel=0; foreach($this->tree as $id => $rows){ $parentid = $rows['parentid']; - $this->tree[$parentid]['nodelist'].=$id.'.'; + $this->tree[$parentid]['nodelist'].=$id.';'; } foreach($this->tree as $id => $rows){ diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php index 30da6a22..ee92fb57 100644 --- a/frontends/php/include/locales/en_gb.inc.php +++ b/frontends/php/include/locales/en_gb.inc.php @@ -256,7 +256,7 @@ 'S_ADD_HOST'=> 'Add host', 'S_REMOVE_HOST'=> 'Remove host', 'S_LINK_TO_TEMPLATE'=> 'Link to template', - 'S_CANNOT_LINK_TO_TEMPLATE'=> 'CAnnot link to template', + 'S_CANNOT_LINK_TO_TEMPLATE'=> 'Cannot link to template', 'S_UNLINK_FROM_TEMPLATE'=> 'Unlink from template', 'S_CANNOT_UNLINK_FROM_TEMPLATE'=> 'Cannot unlink from template', 'S_HOST_TEMPLATE'=> 'Host template', diff --git a/frontends/php/include/page_footer.php b/frontends/php/include/page_footer.php index a7e749d5..2e67f9e9 100644 --- a/frontends/php/include/page_footer.php +++ b/frontends/php/include/page_footer.php @@ -49,12 +49,12 @@ function zbxCallPostScripts(){ ?> } -//try{ +try{ chkbx_range_ext.init(); -//} -//catch(e){ -// throw('Chekbox extension failed!'); -//} +} +catch(e){ + throw('Checkbox extension failed!'); +} --> </script> <?php diff --git a/frontends/php/js/services.js b/frontends/php/js/services.js index ed6b98b3..4569e441 100644 --- a/frontends/php/js/services.js +++ b/frontends/php/js/services.js @@ -64,7 +64,7 @@ function add_child_service(name,serviceid,trigger,triggerid){ var chkbx = document.createElement('input'); chkbx.type = 'checkbox'; chkbx.value = serviceid; - chkbx.name = 'childs['+serviceid+'][serviceid]'; + chkbx.name = 'childs_to_del['+serviceid+'][serviceid]'; var input = document.createElement('input'); input.setAttribute('type','hidden'); diff --git a/frontends/php/js/tree.js b/frontends/php/js/tree.js index a7d48ccd..f4138bac 100644 --- a/frontends/php/js/tree.js +++ b/frontends/php/js/tree.js @@ -21,9 +21,9 @@ var tree ={ init : function(){ if((tree_init = cookie.read(tree_name)) != null){ - var nodes = tree_init.split('.'); + var nodes = tree_init.split(';'); var c = nodes.length-1; - for(var i=0; i<c;i++){ + for(var i=0; i<c; i++){ this.onStartSetStatus(nodes[i]); } this.onStartOpen(nodes); @@ -53,7 +53,7 @@ ChangeNodeStatus : function(id){ for(var i = 1; i < treenode.length; i++){ if(typeof(treenode[i]) != 'undefined'){ if(treenode[i].status == 'open'){ - cookie_str+=i+'.'; + cookie_str+=i+';'; } } } @@ -66,11 +66,12 @@ ChangeNodeStatus : function(id){ closeSNodeX : function(id,img){ try{ - nodelist = treenode[id].nodelist.split('.'); + nodelist = treenode[id].nodelist.split(';'); if(this.getNodeStatus(id) == 'close'){ this.OpenNode(nodelist); img.src = 'images/general/tree/minus.gif'; - } else { + } + else { this.CloseNode(nodelist); img.src = 'images/general/tree/plus.gif'; } @@ -87,7 +88,7 @@ OpenNode : function(nodelist){ for(var i=0; i<c; i++){ document.getElementById('id_'+nodelist[i]).style.display = (IE)?('block'):('table-row'); if(this.getNodeStatus(nodelist[i]) == 'open'){ - this.OpenNode(treenode[nodelist[i]].nodelist.split('.')); + this.OpenNode(treenode[nodelist[i]].nodelist.split(';')); } } } catch(e){ @@ -101,7 +102,7 @@ CloseNode : function(nodelist){ for(var i=0; i<c; i++){ document.getElementById('id_'+nodelist[i]).style.display = 'none'; if(this.getNodeStatus(nodelist[i]) == 'open'){ - this.CloseNode(treenode[nodelist[i]].nodelist.split('.')); + this.CloseNode(treenode[nodelist[i]].nodelist.split(';')); } } } catch(e){ @@ -110,14 +111,14 @@ CloseNode : function(nodelist){ }, onStartOpen : function(nodes){ - var nodes = tree_init.split('.'); + var nodes = tree_init.split(';'); var c = nodes.length-1; for(var i=0; i<c;i++){ if(typeof(nodes[i]) != 'undefined'){ try{ // alert(nodes[i]+' : '+this.checkParent(nodes[i])); if(this.checkParent(nodes[i])){ - var nodelist = treenode[nodes[i]].nodelist.split('.'); + var nodelist = treenode[nodes[i]].nodelist.split(';'); this.OpenNode(nodelist); } } catch(e){ @@ -137,7 +138,7 @@ onStartSetStatus : function(id){ treenode[id].status = 'open'; } catch(e){ -// alert('OnStartSetStatus: '+e); + alert('OnStartSetStatus: '+e); } }, diff --git a/frontends/php/services_form.php b/frontends/php/services_form.php index 3561700f..4352376d 100644 --- a/frontends/php/services_form.php +++ b/frontends/php/services_form.php @@ -488,7 +488,7 @@ if(isset($_REQUEST['sform'])){ $table->headerClass = 'header'; $table->footerClass = 'footer'; - $table->SetHeader(array(new CCheckBox("all_child_services",null,"check_childs('".$frmService->GetName()."','childs','all_child_services');"),S_SERVICES,S_SOFT_LINK,S_TRIGGER)); + $table->SetHeader(array(new CCheckBox("all_child_services",null,"check_childs('".$frmService->GetName()."','childs','all_child_services');"),S_SERVICES,S_SOFT,S_TRIGGER)); $table->AddOption('id','service_childs'); @@ -504,7 +504,7 @@ if(isset($_REQUEST['sform'])){ $table->AddRow(array( array( - new CCheckBox('childs['.$child['serviceid'].'][serviceid]',null,null,$child['serviceid']), + new CCheckBox('childs_to_del['.$child['serviceid'].'][serviceid]',null,null,$child['serviceid']), new CVar('childs['.$child['serviceid'].'][serviceid]', $child['serviceid']) ), array( @@ -529,7 +529,7 @@ if(isset($_REQUEST['sform'])){ $cb2 = new CButton('del_child_service',S_REMOVE); $cb2->SetType('button'); - $cb2->SetAction("javascript: remove_childs('".$frmService->GetName()."','childs','tr');"); + $cb2->SetAction("javascript: remove_childs('".$frmService->GetName()."','childs_to_del','tr');"); $frmService->AddRow(S_DEPENDS_ON,array($table,BR(),$cb,$cb2)); //---------- |