summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-02 13:15:05 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-04-02 13:15:05 +0000
commitec55273c758e96dcf8219df76afb2daa0b2b3f61 (patch)
treea3de4d4035c244ab1f37feae6800a326af09d517 /frontends/php/include
parentd2a3e65806eb484b59de7c3d8b7a8612249e70ca (diff)
downloadzabbix-ec55273c758e96dcf8219df76afb2daa0b2b3f61.tar.gz
zabbix-ec55273c758e96dcf8219df76afb2daa0b2b3f61.tar.xz
zabbix-ec55273c758e96dcf8219df76afb2daa0b2b3f61.zip
- fixed remembering of previous charts viewed (Eugene)
- fixed color validation (Eugene) - fixed template graphs editing (Eugene) - fixed trigger overview status (Eugene) [THANKS TO: 'ZP Gu' for detailed bug report] git-svn-id: svn://svn.zabbix.com/trunk@3966 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/defines.inc.php2
-rw-r--r--frontends/php/include/forms.inc.php13
-rw-r--r--frontends/php/include/graphs.inc.php11
-rw-r--r--frontends/php/include/triggers.inc.php1
4 files changed, 19 insertions, 8 deletions
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 5e8e8aa1..9f107a31 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -47,7 +47,7 @@
define('T_ZBX_PERIOD', 3);
define('T_ZBX_IP', 4);
define('T_ZBX_CLR', 5);
- define('T_ZBX_PORTS', 5);
+ define('T_ZBX_PORTS', 6);
define('O_MAND', 0);
define('O_OPT', 1);
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 99d1b47c..3f1ec075 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -181,7 +181,7 @@
$form->AddItemToBottomRow(new CButton("save", isset($sid) ? S_SAVE : S_ADD));
- $form->AddItemToBottomRow(new CButtonCancel('close_window();'));
+ $form->AddItemToBottomRow(new CButtonCancel(null,'close_window();'));
$form->show();
}
@@ -2300,6 +2300,8 @@
}
$only_hostid = null;
+ $monitored_hosts = null;
+
if(count($items))
{
$frmGraph->AddVar('items', $items);
@@ -2313,6 +2315,7 @@
$item = get_item_by_itemid($gitem['itemid']);
if($host['status'] == HOST_STATUS_TEMPLATE) $only_hostid = $host['hostid'];
+ else $monitored_hosts = 1;
if($gitem["type"] == GRAPH_ITEM_AGGREGATED)
$color = "-";
@@ -2329,6 +2332,7 @@
$description->OnClick(
'return PopUp("popup_gitem.php?list_name=items&dstfrm='.$frmGraph->GetName().
url_param($only_hostid, false, 'only_hostid').
+ url_param($monitored_hosts, false, 'monitored_hosts').
url_param($graphtype, false, 'graphtype').
url_param($gitem, false).
url_param($gid,false,'gid').
@@ -2351,13 +2355,13 @@
{
$items_table = $dedlete_button = null;
}
-
$frmGraph->AddRow(S_ITEMS,
array(
$items_table,
new CButton('add_item',S_ADD,
'return PopUp("popup_gitem.php?dstfrm='.$frmGraph->GetName().
url_param($only_hostid, false, 'only_hostid').
+ url_param($monitored_hosts, false, 'monitored_hosts').
url_param($graphtype, false, 'graphtype').
'",550,400,"graph_item_form");'),
$dedlete_button
@@ -2399,6 +2403,7 @@
$type = get_request("type", 0);
$periods_cnt = get_request("periods_cnt", 5);
$only_hostid = get_request("only_hostid", null);
+ $monitored_hosts = get_request('monitored_hosts', null);
$description = '';
if($itemid > 0)
@@ -2420,7 +2425,7 @@
{// graph for template must use only one host
$host_condition = "&only_hostid=".$only_hostid;
}
- else
+ else if(isset($monitored_hosts))
{
$host_condition = "&monitored_hosts=1";
}
@@ -2493,7 +2498,7 @@
$frmGItem->AddItemToBottomRow(new CButton("save", isset($gid) ? S_SAVE : S_ADD));
- $frmGItem->AddItemToBottomRow(new CButtonCancel('close_window();'));
+ $frmGItem->AddItemToBottomRow(new CButtonCancel(null,'close_window();'));
$frmGItem->Show();
}
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index 76855f29..9497af5c 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -204,7 +204,8 @@
{
if($g_graph['graphtype'] != $graphtype && $graphtype == GRAPH_TYPE_STACKED)
{
- $result = DBexecute("update graphs_items set calc_fnc=".CALC_FNC_AVG.",drawtype=1,type=".GRAPH_ITEM_SIMPLE);
+ $result = DBexecute('update graphs_items set calc_fnc='.CALC_FNC_AVG.',drawtype=1,type='.GRAPH_ITEM_SIMPLE.
+ ' where graphid='.$graphid);
}
info("Graph '".$g_graph["name"]."' updated");
@@ -217,10 +218,14 @@
$result = update_graph($graphid,$name,$width,$height,$yaxistype,$yaxismin,$yaxismax,$showworkperiod,
$showtriggers,$graphtype,$templateid);
- if($result) $result = DBexecute("delete from graphs_items where graphid=$graphid");
-
if($result)
{
+ $db_graphs_items = DBselect('select gitemid from graphs_items where graphid='.$graphid);
+ while($gitem_data = DBfetch($db_graphs_items))
+ {
+ delete_graph_item($gitem_data['gitemid']);
+ }
+
foreach($items as $gitem)
{
if(!add_item_to_graph(
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php
index f8cb44ee..22d494a2 100644
--- a/frontends/php/include/triggers.inc.php
+++ b/frontends/php/include/triggers.inc.php
@@ -1169,6 +1169,7 @@
break;
case TRIGGER_VALUE_FALSE:
$css_class = 'normal';
+ break;
default:
$css_class = 'unknown_trigger';
}