From abaab8acc5b75de465ca5e1fb6d77f3c8d02ce4b Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sat, 20 Nov 2004 10:13:38 +0000 Subject: Cosmetic changes. git-svn-id: svn://svn.zabbix.com/trunk@1494 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/graph.php | 15 +++++----- frontends/php/hosts.php | 55 +++++++++++++++++++++++++++++++--- frontends/php/include/config.inc.php | 2 +- frontends/php/include/forms.inc.php | 4 --- frontends/php/include/local_en.inc.php | 1 + frontends/php/media.php | 49 ++++++++++++++++++++++++------ frontends/php/sysmaps.php | 1 - 7 files changed, 101 insertions(+), 26 deletions(-) diff --git a/frontends/php/graph.php b/frontends/php/graph.php index e27121a6..8f6c6816 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -23,6 +23,7 @@ $page["title"] = S_CONFIGURATION_OF_GRAPH; $page["file"] = "graph.php"; show_header($page["title"],0,0); + insert_confirm_javascript(); ?> "; - echo ""; + echo ""; } show_table2_header_end(); diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 9a21b27d..644790cf 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -41,7 +41,16 @@ { if($_GET["register"]=="add") { - $result=add_host($_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["host_templateid"],$_GET["newgroup"],$_GET["groups"]); + $groups=array(); + $result=DBselect("select groupid from groups"); + while($row=DBfetch($result)) + { + if(isset($_GET[$row["groupid"]])) + { + $groups=array_merge($groups,$row["groupid"]); + } + } + $result=add_host($_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["host_templateid"],$_GET["newgroup"],$groups); show_messages($result, S_HOST_ADDED, S_CANNOT_ADD_HOST); if($result) add_audit(AUDIT_ACTION_ADD,AUDIT_RESOURCE_HOST,"Host [".addslashes($_GET["host"])."] IP [".$_GET["ip"]."] Status [".$_GET["status"]."]"); @@ -55,7 +64,16 @@ } if($_GET["register"]=="update") { - $result=@update_host($_GET["hostid"],$_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["newgroup"],$_GET["groups"]); + $groups=array(); + $result=DBselect("select groupid from groups"); + while($row=DBfetch($result)) + { + if(isset($_GET[$row["groupid"]])) + { + $groups=array_merge($groups,$row["groupid"]); + } + } + $result=@update_host($_GET["hostid"],$_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["newgroup"],$groups); show_messages($result, S_HOST_UPDATED, S_CANNOT_UPDATE_HOST); if($result) add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_HOST,"Host [".addslashes($_GET["host"])."] IP [".$_GET["ip"]."] Status [".$_GET["status"]."]"); @@ -115,7 +133,8 @@ $col=0; while($row=DBfetch($result)) { - $members=array("hide"=>1,"value"=>""); +// $members=array("hide"=>1,"value"=>""); + $members=array("hide"=>0,"value"=>""); $result1=DBselect("select distinct h.host from hosts h, hosts_groups hg where h.hostid=hg.hostid and hg.groupid=".$row["groupid"]." order by host"); for($i=0;$i"; - show_table2_v_delimiter($col++); +/* show_table2_v_delimiter($col++); echo S_GROUPS; show_table2_h_delimiter(); echo "";*/ + + show_table2_v_delimiter($col++); + echo S_GROUPS; + show_table2_h_delimiter(); + $result=DBselect("select distinct groupid,name from groups order by name"); + while($row=DBfetch($result)) + { + if(isset($_GET["hostid"])) + { + $sql="select count(*) as count from hosts_groups where hostid=".$_GET["hostid"]." and groupid=".$row["groupid"]; + $result2=DBselect($sql); + $row2=DBfetch($result2); + if($row2["count"]==0) + { + echo "".$row["name"]; + } + else + { + echo "".$row["name"]; + } + } + else + { + echo "".$row["name"]; + } + echo "
"; + } echo ""; show_table2_v_delimiter($col++); diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 867fc2aa..38bdb536 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2911,7 +2911,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function add_host_to_sysmap($sysmapid,$hostid,$label,$x,$y,$icon,$url,$icon_on) { - $sql="insert into sysmaps_hosts (sysmapid,hostid,label,x,y,icon,url) values ($sysmapid,$hostid,'$label',$x,$y,'$icon','$url','$icon_on')"; + $sql="insert into sysmaps_hosts (sysmapid,hostid,label,x,y,icon,url,icon_on) values ($sysmapid,$hostid,'$label',$x,$y,'$icon','$url','$icon_on')"; return DBexecute($sql); } diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php index c66a2246..c2097121 100644 --- a/frontends/php/include/forms.inc.php +++ b/frontends/php/include/forms.inc.php @@ -159,8 +159,6 @@ $formula=DBget_field($result,0,22); } - echo "
"; - show_table2_header_begin(); echo S_ITEM; @@ -745,8 +743,6 @@ $comments=""; $url=""; } - - echo "
"; show_table2_header_begin(); echo "Trigger configuration"; diff --git a/frontends/php/include/local_en.inc.php b/frontends/php/include/local_en.inc.php index 767b0fd3..03941d21 100644 --- a/frontends/php/include/local_en.inc.php +++ b/frontends/php/include/local_en.inc.php @@ -591,4 +591,5 @@ define("S_LOGGED_IN", "Logged in"); define("S_LOGGED_OUT", "Logged out"); define("S_MEDIA_TYPE", "Media type"); + define("S_GRAPH_ELEMENT", "Graph element"); ?> diff --git a/frontends/php/media.php b/frontends/php/media.php index edcccf64..e215b8d4 100644 --- a/frontends/php/media.php +++ b/frontends/php/media.php @@ -53,12 +53,26 @@ } elseif($_GET["register"]=="add") { - $result=add_media( $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$_GET["severity"],$_GET["active"]); + $severity=array(); + if(isset($_GET["0"])) $severity=array_merge($severity,0); + if(isset($_GET["1"])) $severity=array_merge($severity,1); + if(isset($_GET["2"])) $severity=array_merge($severity,2); + if(isset($_GET["3"])) $severity=array_merge($severity,3); + if(isset($_GET["4"])) $severity=array_merge($severity,4); + if(isset($_GET["5"])) $severity=array_merge($severity,5); + $result=add_media( $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$severity,$_GET["active"]); show_messages($result, S_MEDIA_ADDED, S_CANNOT_ADD_MEDIA); } elseif($_GET["register"]=="update") { - $result=update_media($_GET["mediaid"], $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$_GET["severity"],$_GET["active"]); + $severity=array(); + if(isset($_GET["0"])) $severity=array_merge($severity,0); + if(isset($_GET["1"])) $severity=array_merge($severity,1); + if(isset($_GET["2"])) $severity=array_merge($severity,2); + if(isset($_GET["3"])) $severity=array_merge($severity,3); + if(isset($_GET["4"])) $severity=array_merge($severity,4); + if(isset($_GET["5"])) $severity=array_merge($severity,5); + $result=update_media($_GET["mediaid"], $_GET["userid"], $_GET["mediatypeid"], $_GET["sendto"],$severity,$_GET["active"]); show_messages($result,S_MEDIA_UPDATED,S_CANNOT_UPDATE_MEDIA); } elseif($_GET["register"]=="delete") @@ -154,7 +168,9 @@ show_table2_header_begin(); echo S_NEW_MEDIA; - show_table2_v_delimiter(); + $col=0; + + show_table2_v_delimiter($col++); echo "
"; echo ""; if(isset($_GET["mediaid"])) @@ -180,13 +196,13 @@ } echo ""; - show_table2_v_delimiter(); + show_table2_v_delimiter($col++); echo nbsp(S_SEND_TO); show_table2_h_delimiter(); echo ""; - show_table2_v_delimiter(); - echo nbsp(S_USE_IF_SEVERITY); + show_table2_v_delimiter($col++); +/* echo nbsp(S_USE_IF_SEVERITY); show_table2_h_delimiter(); echo ""; + echo "";*/ + + echo nbsp(S_USE_IF_SEVERITY); + show_table2_h_delimiter(); + $checked=iif( (1&$severity) == 1,"checked",""); + echo "".S_NOT_CLASSIFIED."
"; + $checked=iif( (2&$severity) == 2,"checked",""); + echo "".S_INFORMATION."
"; + $checked=iif( (4&$severity) == 4,"checked",""); + echo "".S_WARNING."
"; + $checked=iif( (8&$severity) == 8,"checked",""); + echo "".S_AVERAGE."
"; + $checked=iif( (16&$severity) ==16,"checked",""); + echo "".S_HIGH."
"; + $checked=iif( (32&$severity) ==32,"checked",""); + echo "".S_DISASTER."
"; - show_table2_v_delimiter(); + show_table2_v_delimiter($col++); echo "Status"; show_table2_h_delimiter(); echo ""; - show_table2_v_delimiter2(); + show_table2_v_delimiter2($col++); echo ""; if(isset($_GET["mediaid"])) { diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index e10a6beb..8103224f 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -112,7 +112,6 @@ $background=""; } - echo "
"; show_table2_header_begin(); echo "New system map"; -- cgit