diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 12:46:19 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 12:46:19 +0000 |
commit | 9d240eca134c2433ac0a548a2b7fbe1fccc7c66d (patch) | |
tree | cd3d46256d09ca370f385dccf2082d0d33d96e78 | |
parent | 63ce91166a8ecd8550db063ba9d9d914ec270e4c (diff) | |
download | zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.tar.gz zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.tar.xz zabbix-9d240eca134c2433ac0a548a2b7fbe1fccc7c66d.zip |
- [DEV-177] added checkbox range selection (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5800 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | frontends/php/actionconf.php | 2 | ||||
-rw-r--r-- | frontends/php/discoveryconf.php | 2 | ||||
-rw-r--r-- | frontends/php/graphs.php | 2 | ||||
-rw-r--r-- | frontends/php/hosts.php | 8 | ||||
-rw-r--r-- | frontends/php/httpconf.php | 5 | ||||
-rw-r--r-- | frontends/php/include/classes/chart.inc.php | 3 | ||||
-rw-r--r-- | frontends/php/include/page_footer.php | 7 | ||||
-rw-r--r-- | frontends/php/include/page_header.php | 1 | ||||
-rw-r--r-- | frontends/php/items.php | 2 | ||||
-rw-r--r-- | frontends/php/js/common.js | 27 | ||||
-rw-r--r-- | frontends/php/triggers.php | 2 | ||||
-rw-r--r-- | frontends/php/users.php | 2 |
13 files changed, 41 insertions, 23 deletions
@@ -1,5 +1,6 @@ Changes for 1.5.4 + - [DEV-177] added checkbox range selection (Artem) - [DEV-183] added support of applications in action conditions (Sasha) - [DEV-174] added ability to edit user medias (Artem) - [DEV-185] added support of zabbix[uptime] and zabbix[boottime] (Alexei) diff --git a/frontends/php/actionconf.php b/frontends/php/actionconf.php index 01205ca5..90a42be2 100644 --- a/frontends/php/actionconf.php +++ b/frontends/php/actionconf.php @@ -539,7 +539,7 @@ include_once 'include/page_header.php'; $tblActions->AddRow(array( array( new CCheckBox( - 'g_actionid[]', /* name */ + 'g_actionid['.$action_data['actionid'].']', /* name */ null, /* checked */ null, /* action */ $action_data['actionid']), /* value */ diff --git a/frontends/php/discoveryconf.php b/frontends/php/discoveryconf.php index 7ddefc61..1272da40 100644 --- a/frontends/php/discoveryconf.php +++ b/frontends/php/discoveryconf.php @@ -239,7 +239,7 @@ include_once "include/page_header.php"; $drule=new CCol(array( new CCheckBox( - "g_druleid[]", /* name */ + 'g_druleid['.$rule_data["druleid"].']', /* name */ null, /* checked */ null, /* action */ $rule_data["druleid"]), /* value */ diff --git a/frontends/php/graphs.php b/frontends/php/graphs.php index e486817e..8ed58124 100644 --- a/frontends/php/graphs.php +++ b/frontends/php/graphs.php @@ -416,7 +416,7 @@ include_once "include/page_header.php"; } } - $chkBox = new CCheckBox("group_graphid[]",NULL,NULL,$row["graphid"]); + $chkBox = new CCheckBox('group_graphid['.$row["graphid"].']',NULL,NULL,$row["graphid"]); if($row["templateid"] > 0) $chkBox->SetEnabled(false); switch($row["graphtype"]){ diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index e27227f0..6df5e12d 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -967,7 +967,7 @@ include_once 'include/page_header.php'; $templates = get_templates_by_hostid($row["hostid"]); $host=new CCol(array( - new CCheckBox("hosts[]",NULL,NULL,$row["hostid"]), + new CCheckBox('hosts['.$row["hostid"].']',NULL,NULL,$row["hostid"]), SPACE, $description)); @@ -1159,7 +1159,7 @@ include_once 'include/page_header.php'; $table->AddRow(array( array( - new CCheckBox('groups[]',NULL,NULL,$db_group["groupid"]), + new CCheckBox('groups['.$db_group["groupid"].']',NULL,NULL,$db_group["groupid"]), SPACE, new CLink( $db_group["name"], @@ -1325,7 +1325,7 @@ include_once 'include/page_header.php'; $table->AddRow(array( - array(new CCheckBox("applications[]",NULL,NULL,$db_app["applicationid"]),SPACE,$name), + array(new CCheckBox('applications['.$db_app["applicationid"].']',NULL,NULL,$db_app["applicationid"]),SPACE,$name), array(new CLink(S_ITEMS,"items.php?hostid=".$db_app["hostid"],"action"), SPACE."($rows)") )); @@ -1396,7 +1396,7 @@ include_once 'include/page_header.php'; $table->AddRow(array( array( - new CCheckBox("hosts[]", NULL, NULL, $db_proxy["hostid"]), + new CCheckBox('hosts['.$db_proxy["hostid"].']', NULL, NULL, $db_proxy["hostid"]), SPACE, new CLink($db_proxy["host"], "hosts.php?form=update&hostid=".$db_proxy["hostid"].url_param("config"), diff --git a/frontends/php/httpconf.php b/frontends/php/httpconf.php index 52e84b48..a880741f 100644 --- a/frontends/php/httpconf.php +++ b/frontends/php/httpconf.php @@ -447,7 +447,7 @@ include_once "include/page_header.php"; httptest_status2style($httptest_data["status"]))); - $chkBox = new CCheckBox("group_httptestid[]",null,null,$httptest_data["httptestid"]); + $chkBox = new CCheckBox('group_httptestid['.$httptest_data["httptestid"].']',null,null,$httptest_data["httptestid"]); $step_cout = DBfetch(DBselect('select count(*) as cnt from httpstep where httptestid='.$httptest_data["httptestid"])); $step_cout = $step_cout['cnt']; @@ -461,8 +461,7 @@ include_once "include/page_header.php"; $status ))); } - if($httptest_cnt > 0) - { + if($httptest_cnt > 0){ if(uint_in_array($db_app["applicationid"],$_REQUEST["applications"]) || isset($show_all_apps)) $link = new CLink(new CImg("images/general/opened.gif"), "?close=1&applicationid=".$db_app["applicationid"]. diff --git a/frontends/php/include/classes/chart.inc.php b/frontends/php/include/classes/chart.inc.php index d1565831..d1d69b88 100644 --- a/frontends/php/include/classes/chart.inc.php +++ b/frontends/php/include/classes/chart.inc.php @@ -728,8 +728,7 @@ class Chart extends Graph{ ' AND clock<='.$to_time. ' GROUP BY itemid,'.$calc_field ); - -// $this->items[$i]['delay'] = max(($this->items[$i]['delay']*ZBX_GRAPH_MAX_DELAY),ZBX_MAX_TREND_DIFF)/ZBX_GRAPH_MAX_DELAY + 1; + $this->items[$i]['delay'] = max($this->items[$i]['delay'],3600); } //SDI($sql_arr); diff --git a/frontends/php/include/page_footer.php b/frontends/php/include/page_footer.php index 042d0ab3..a7e749d5 100644 --- a/frontends/php/include/page_footer.php +++ b/frontends/php/include/page_footer.php @@ -48,6 +48,13 @@ function zbxCallPostScripts(){ } ?> } + +//try{ + chkbx_range_ext.init(); +//} +//catch(e){ +// throw('Chekbox extension failed!'); +//} --> </script> <?php diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index 87526d15..57372097 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -409,6 +409,7 @@ COpt::profiling_start("page"); <script type="text/javascript" src="js/common.js"></script> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/url.js"></script> + <script type="text/javascript" src="js/chkbxrange.js"></script> <?php if(isset($page['scripts']) && is_array($page['scripts'])){ foreach($page['scripts'] as $id => $script){ diff --git a/frontends/php/items.php b/frontends/php/items.php index 8d23745b..8dd886a2 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -930,7 +930,7 @@ include_once "include/page_header.php"; $applications = $show_applications ? implode(', ', get_applications_by_itemid($db_item["itemid"], 'name')) : null; if(!is_null($applications) && empty($applications)) $applications = ' - '; - $chkBox = new CCheckBox("group_itemid[]",null,null,$db_item["itemid"]); + $chkBox = new CCheckBox('group_itemid['.$db_item["itemid"].']',null,null,$db_item["itemid"]); //if($db_item["templateid"] > 0) $chkBox->SetEnabled(false); $table->AddRow(array( $show_host ? $db_item['host'] : null, diff --git a/frontends/php/js/common.js b/frontends/php/js/common.js index ddb1d6b8..cdc6ce46 100644 --- a/frontends/php/js/common.js +++ b/frontends/php/js/common.js @@ -1,6 +1,6 @@ /* ** ZABBIX -** Copyright (C) 2000-2005 SIA Zabbix +** Copyright (C) 2000-2008 SIA Zabbix ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ function checkBrowser(){ if(SF) SDI('Safari'); if(KQ) SDI('Konqueror'); if(MC) SDI('Mac'); + if(GK) SDI('FireFox'); return 0; } @@ -91,7 +92,6 @@ function SDI(msg){ div_help.appendChild(document.createTextNode(msg)); div_help.appendChild(document.createElement("br")); div_help.appendChild(document.createElement("br")); - div_help.appendChild(document.createElement("br")); } function close_window(){ @@ -344,8 +344,7 @@ function PopUp(url,width,height,form_name){ function CheckAll(form_name, chkMain, shkName){ var frmForm = document.forms[form_name]; var value = frmForm.elements[chkMain].checked; - for (var i=0; i < frmForm.length; i++) - { + for (var i=0; i < frmForm.length; i++){ name = frmForm.elements[i].name.split('[')[0]; if(frmForm.elements[i].type != 'checkbox') continue; if(name == chkMain) continue; @@ -408,6 +407,20 @@ function deselectAll(){ sel.removeAllRanges(); } } + +function eventTarget(e){ + var targ = false; + + if (!e) var e = window.event; + if (e.target) targ = e.target; + else if (e.srcElement) targ = e.srcElement; + +// defeat Safari bug + if (targ.nodeType == 3) targ = targ.parentNode; + +return targ; +} + /************************************************************************************/ /* Pages stuff */ /************************************************************************************/ @@ -489,14 +502,12 @@ function GetSelectedText(obj){ return obj.value; } -function ScaleChartToParenElement(obj_name) -{ +function ScaleChartToParenElement(obj_name){ var obj = document.getElementsByName(obj_name); if(obj.length <= 0) throw "Can't find objects with name [" + obj_name +"]"; - for(i = obj.length-1; i>=0; i--) - { + for(i = obj.length-1; i>=0; i--){ obj[i].src += "&width=" + (obj[i].parentNode.offsetWidth - obj[i].parentNode.offsetLeft - 10); } } diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php index 37ad4df6..764eb4ee 100644 --- a/frontends/php/triggers.php +++ b/frontends/php/triggers.php @@ -421,7 +421,7 @@ include_once "include/page_header.php"; $description = array( new CCheckBox( - "g_triggerid[]", /* name */ + 'g_triggerid['.$row['triggerid'].']', /* name */ NULL, /* checked */ NULL, /* action */ $row["triggerid"]), /* value */ diff --git a/frontends/php/users.php b/frontends/php/users.php index 5643ba57..26dc7c22 100644 --- a/frontends/php/users.php +++ b/frontends/php/users.php @@ -604,7 +604,7 @@ include_once "include/page_header.php"; $table->addRow(array( array( - new CCheckBox("group_groupid[]",NULL,NULL,$row["usrgrpid"]), + new CCheckBox('group_groupid['.$row["usrgrpid"].']',NULL,NULL,$row["usrgrpid"]), $alias = new CLink($row["name"], "users.php?form=update".url_param("config"). "&usrgrpid=".$row["usrgrpid"]."#form", 'action') |