diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-11-20 10:13:38 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2004-11-20 10:13:38 +0000 |
| commit | abaab8acc5b75de465ca5e1fb6d77f3c8d02ce4b (patch) | |
| tree | 6705c4e3454abd57dc0d47fddc3749e8173c7454 /frontends/php | |
| parent | f617fb752abb648c642d4a42944e84ba8d97c7ee (diff) | |
| download | zabbix-abaab8acc5b75de465ca5e1fb6d77f3c8d02ce4b.tar.gz zabbix-abaab8acc5b75de465ca5e1fb6d77f3c8d02ce4b.tar.xz zabbix-abaab8acc5b75de465ca5e1fb6d77f3c8d02ce4b.zip | |
Cosmetic changes.
git-svn-id: svn://svn.zabbix.com/trunk@1494 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/graph.php | 15 | ||||
| -rw-r--r-- | frontends/php/hosts.php | 55 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/include/forms.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/local_en.inc.php | 1 | ||||
| -rw-r--r-- | frontends/php/media.php | 49 | ||||
| -rw-r--r-- | 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(); ?> <?php @@ -49,7 +50,7 @@ { $graph=get_graph_by_graphid($_GET["graphid"]); $item=get_item_by_itemid($_GET["itemid"]); - add_audit(AUDIT_ACTION_ADD,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$_GET["graphid"]."] Name [".$graph["name"]."] Added [".$item["name"]."]"); + add_audit(AUDIT_ACTION_ADD,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$_GET["graphid"]."] Name [".$graph["name"]."] Added [".$item["description"]."]"); } show_messages($result,S_ITEM_ADDED, S_CANNOT_ADD_ITEM); } @@ -60,20 +61,20 @@ { $graphitem=get_graphitem_by_gitemid($_GET["gitemid"]); $graph=get_graph_by_graphid($graphitem["graphid"]); - $item=get_item_by_itemid($graphitemid["itemid"]); - add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Updated [".$item["name"]."]"); + $item=get_item_by_itemid($graphitem["itemid"]); + add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Updated [".$item["description"]."]"); } show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM); } if($_GET["register"]=="delete") { $graphitem=get_graphitem_by_gitemid($_GET["gitemid"]); + $graph=get_graph_by_graphid($graphitem["graphid"]); + $item=get_item_by_itemid($graphitem["itemid"]); $result=delete_graphs_item($_GET["gitemid"]); if($result) { - $graph=get_graph_by_graphid($graphitem["graphid"]); - $item=get_item_by_itemid($graph["itemid"]); - add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Deleted [".$item["name"]."]"); + add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Deleted [".$item["description"]."]"); } show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM); unset($_GET["gitemid"]); @@ -228,7 +229,7 @@ if(isset($itemid)) { echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">"; - echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\">"; + echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete graph element?');\">"; } 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<DBnum_rows($result1);$i++) { @@ -354,7 +373,7 @@ show_table2_h_delimiter(); echo "<input class=\"biginput\" name=\"host\" value=\"$host\" size=20>"; - show_table2_v_delimiter($col++); +/* show_table2_v_delimiter($col++); echo S_GROUPS; show_table2_h_delimiter(); echo "<select multiple class=\"biginput\" name=\"groups[]\" size=\"5\">"; @@ -380,6 +399,34 @@ echo "<option value=\"".$row["groupid"]."\">".$row["name"]; } } + echo "</select>";*/ + + 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 "<input type=checkbox name=\"".$row["groupid"]."\">".$row["name"]; + } + else + { + echo "<input type=checkbox name=\"".$row["groupid"]."\" checked>".$row["name"]; + } + } + else + { + echo "<input type=checkbox name=\"".$row["groupid"]."\">".$row["name"]; + } + echo "<br>"; + } echo "</select>"; 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 "<br>"; - show_table2_header_begin(); echo S_ITEM; @@ -745,8 +743,6 @@ $comments=""; $url=""; } - - echo "<br>"; 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 "<form method=\"get\" action=\"media.php\">"; echo "<input name=\"userid\" type=\"hidden\" value=".$_GET["userid"].">"; if(isset($_GET["mediaid"])) @@ -180,13 +196,13 @@ } echo "</SELECT>"; - show_table2_v_delimiter(); + show_table2_v_delimiter($col++); echo nbsp(S_SEND_TO); show_table2_h_delimiter(); echo "<input class=\"biginput\" name=\"sendto\" size=20 value='$sendto'>"; - 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 "<select multiple class=\"biginput\" name=\"severity[]\" size=\"5\">"; $selected=iif( (1&$severity) == 1,"selected",""); @@ -201,9 +217,24 @@ echo "<option value=\"4\" $selected>".S_HIGH; $selected=iif( (32&$severity) ==32,"selected",""); echo "<option value=\"5\" $selected>".S_DISASTER; - echo "</select>"; + echo "</select>";*/ + + echo nbsp(S_USE_IF_SEVERITY); + show_table2_h_delimiter(); + $checked=iif( (1&$severity) == 1,"checked",""); + echo "<input type=checkbox name=\"0\" value=\"0\" $checked>".S_NOT_CLASSIFIED."<br>"; + $checked=iif( (2&$severity) == 2,"checked",""); + echo "<input type=checkbox name=\"1\" value=\"1\" $checked>".S_INFORMATION."<br>"; + $checked=iif( (4&$severity) == 4,"checked",""); + echo "<input type=checkbox name=\"2\" value=\"2\" $checked>".S_WARNING."<br>"; + $checked=iif( (8&$severity) == 8,"checked",""); + echo "<input type=checkbox name=\"3\" value=\"3\" $checked>".S_AVERAGE."<br>"; + $checked=iif( (16&$severity) ==16,"checked",""); + echo "<input type=checkbox name=\"4\" value=\"4\" $checked>".S_HIGH."<br>"; + $checked=iif( (32&$severity) ==32,"checked",""); + echo "<input type=checkbox name=\"5\" value=\"5\" $checked>".S_DISASTER."<br>"; - show_table2_v_delimiter(); + show_table2_v_delimiter($col++); echo "Status"; show_table2_h_delimiter(); echo "<select class=\"biginput\" name=\"active\" size=1>"; @@ -219,7 +250,7 @@ } echo "</select>"; - show_table2_v_delimiter2(); + show_table2_v_delimiter2($col++); echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"add\">"; 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 "<br>"; show_table2_header_begin(); echo "New system map"; |
