summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-05-25 07:40:51 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-05-25 07:40:51 +0000
commit231faf1162a0aac6feb4e30b18da7bd14bb8de11 (patch)
tree5c9266d54cb8b65d5014629871ff730547268bdb /frontends/php
parentd3efc4c51bb20d6122b9b45964017a9d1eae7c3a (diff)
downloadzabbix-231faf1162a0aac6feb4e30b18da7bd14bb8de11.tar.gz
zabbix-231faf1162a0aac6feb4e30b18da7bd14bb8de11.tar.xz
zabbix-231faf1162a0aac6feb4e30b18da7bd14bb8de11.zip
- added support for real delta. item.delta=2. (Alexei)
- new selection for triggers.php (Alexei) - new selection for items.php (Alexei) - removed helpdesk.php (Alexei) - fixed check of permissions for screenedit.php (Alexei) - new selection for graphs in charts.php (Alexei) - new selection of maps in maps.php (Alexei) - new selection of group and host for latest.php (Alexei) - added support for macro {IPADDRESS} (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@1348 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/alarms.php20
-rw-r--r--frontends/php/charts.php31
-rw-r--r--frontends/php/helpdesk.php170
-rw-r--r--frontends/php/hosts.php9
-rw-r--r--frontends/php/include/config.inc.php76
-rw-r--r--frontends/php/include/forms.inc.php9
-rw-r--r--frontends/php/include/local_en.inc.php168
-rw-r--r--frontends/php/items.php158
-rw-r--r--frontends/php/latest.php232
-rw-r--r--frontends/php/maps.php73
-rw-r--r--frontends/php/queue.php34
-rw-r--r--frontends/php/report1.php36
-rw-r--r--frontends/php/report2.php18
-rw-r--r--frontends/php/screenconf.php34
-rw-r--r--frontends/php/screenedit.php34
-rw-r--r--frontends/php/screens.php6
-rw-r--r--frontends/php/services.php104
-rw-r--r--frontends/php/srv_status.php18
-rw-r--r--frontends/php/tr_comments.php12
-rw-r--r--frontends/php/tr_status.php96
-rw-r--r--frontends/php/triggers.php152
-rw-r--r--frontends/php/users.php18
22 files changed, 700 insertions, 808 deletions
diff --git a/frontends/php/alarms.php b/frontends/php/alarms.php
index b8c1843a..c623c474 100644
--- a/frontends/php/alarms.php
+++ b/frontends/php/alarms.php
@@ -94,11 +94,11 @@
echo "<TABLE WIDTH=100% align=center BORDER=0 BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR>";
- echo "<TD><B>".S_TIME."</B></TD>";
- echo "<TD><B>".S_STATUS."</B></TD>";
- echo "<TD><B>".S_DURATION."</B></TD>";
- echo "<TD><B>".S_SUM."</B></TD>";
- echo "<TD><B>%</B></TD>";
+ table_td("<B>".S_TIME."</B>","");
+ table_td("<B>".S_STATUS."</B>","");
+ table_td("<B>".S_DURATION."</B>","");
+ table_td("<B>".S_SUM."</B>","");
+ table_td("<B>%</B>","");
echo "</TR>";
$truesum=0;
$falsesum=0;
@@ -114,7 +114,7 @@
elseif($row["value"]==2) { echo "<TR BGCOLOR=#EEEEEE>"; }
else { echo "<TR BGCOLOR=#FFDDDD>"; }
- echo "<TD>",date("Y.M.d H:i:s",$row["clock"]),"</TD>";
+ table_td(date("Y.M.d H:i:s",$row["clock"]),"");
if($row["value"]==1)
{
$istrue=S_TRUE_BIG;
@@ -144,7 +144,7 @@
$proc=round($proc*100)/100;
$proc="$proc%";
- echo "<TD><B>",$istrue,"</B></TD>";
+ table_td("<B>$istrue</B>","");
if($leng>60*60*24)
{
$leng= round(($leng/(60*60*24))*10)/10;
@@ -185,9 +185,9 @@
$sum="$sum secs";
}
- echo "<TD>$leng</TD>";
- echo "<TD>$sum</TD>";
- echo "<TD>$proc</TD>";
+ table_td($leng,"");
+ table_td($sum,"");
+ table_td($proc,"");
echo "</TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/charts.php b/frontends/php/charts.php
index 6eb7a033..74bcb64c 100644
--- a/frontends/php/charts.php
+++ b/frontends/php/charts.php
@@ -53,8 +53,33 @@
echo S_GRAPHS_BIG;
show_table_v_delimiter();
+// Start of new code
+ echo "<form name=\"form2\" method=\"get\" action=\"charts.php\">";
- echo "<font size=2>";
+ if(isset($HTTP_GET_VARS["graphid"])&&($HTTP_GET_VARS["graphid"]==0))
+ {
+ unset($HTTP_GET_VARS["graphid"]);
+ }
+
+ echo S_GRAPH."&nbsp;";
+ echo "<input name=\"keep\" type=\"hidden\" value=".$HTTP_GET_VARS["keep"].">";
+ echo "<select class=\"biginput\" name=\"graphid\" onChange=\"submit()\">";
+ echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["graphid"]),"selected","").">".S_SELECT_GRAPH_DOT_DOT_DOT;
+
+ $result=DBselect("select graphid,name from graphs order by name");
+ while($row=DBfetch($result))
+ {
+ if(!check_right("Graph","R",$row["graphid"]))
+ {
+ continue;
+ }
+ echo "<option value=\"".$row["graphid"]."\" ".iif(isset($HTTP_GET_VARS["graphid"])&&($HTTP_GET_VARS["graphid"]==$row["graphid"]),"selected","").">".$row["name"];
+ }
+ echo "</select>";
+ echo "</form>";
+// End of new code
+
+/* echo "<font size=2>";
$result=DBselect("select graphid,name from graphs order by name");
while($row=DBfetch($result))
@@ -67,7 +92,6 @@
{
echo "<b>[";
}
-// BEGIN - IGMI - keep support
$str="";
if(isset($HTTP_GET_VARS["keep"]))
{
@@ -85,8 +109,6 @@
$str=$str."&keep=".$HTTP_GET_VARS["keep"];
}
echo "<a href='charts.php?graphid=".$row["graphid"].url_param("stime").$str."'>".$row["name"]."</a>";
-// END - IGMI - keep support
-// echo "<a href='charts.php?graphid=".$row["graphid"]."'>".$row["name"]."</a>";
if(isset($HTTP_GET_VARS["graphid"]) && ($HTTP_GET_VARS["graphid"] == $row["graphid"]) )
{
echo "]</b>";
@@ -100,6 +122,7 @@
}
echo "</font>";
+*/
show_table_header_end();
echo "<br>";
}
diff --git a/frontends/php/helpdesk.php b/frontends/php/helpdesk.php
deleted file mode 100644
index 80b93c55..00000000
--- a/frontends/php/helpdesk.php
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/*
-** Zabbix
-** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev
-**
-** 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
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**/
-?>
-<?php
- include "include/config.inc.php";
- $page["title"] = "Helpdesk";
- $page["file"] = "helpdesk.php";
- show_header($page["title"],0,0);
-?>
-
-<?php
- show_table_header_begin();
- echo "IT HELPDESK";
-
- show_table_v_delimiter();
-?>
-
-<?php
- if(isset($start)&&($start<=0))
- {
- unset($start);
- }
- if(isset($start))
- {
- echo "[<A HREF=\"alerts.php?start=".($start-100)."\">";
- echo "Show previous 100</A>] ";
- echo "[<A HREF=\"alerts.php?start=".($start+100)."\">";
- echo "Show next 100</A>]";
- }
- else
- {
- echo "[<A HREF=\"alerts.php?start=100\">";
- echo "Show next 100</A>]";
- }
-
- show_table_header_end();
- echo "<br>";
-
- show_table_header("PROBLEMS");
-?>
-
-
-<FONT COLOR="#000000">
-<?php
- if(!isset($start))
- {
- $sql="select problemid,clock,status,description,priority,userid,triggerid,lastupdate,categoryid from problems where status=0 order by clock,priority limit 1000";
- }
- else
- {
- $sql="select a.alertid,a.clock,a.type,a.sendto,a.subject,a.message,ac.triggerid,a.status,a.retries from alerts a,actions ac where a.actionid=ac.actionid order by a.clock desc limit ".($start+1000);
- }
- $result=DBselect($sql);
-
- echo "<TABLE WIDTH=100% BORDER=0 align=center BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
- echo "<TR>";
- echo "<TD WIDTH=10%><b>Registered at</b></TD>";
- echo "<TD WIDTH=10%><b>Severity</b></TD>";
- echo "<TD WIDTH=10%><b>Category</b></TD>";
- echo "<TD WIDTH=10%><b>Description</b></TD>";
- echo "<TD WIDTH=5%><b>Status</b></TD>";
- echo "<TD><b>History</b></TD>";
- echo "</TR>";
- $col=0;
- $zzz=0;
- while($row=DBfetch($result))
- {
- $zzz++;
- if(isset($start)&&($zzz<$start))
- {
- continue;
- }
-// if(!check_right_on_trigger("R",$row["triggerid"]))
- // {
-// continue;
-// }
-
- if($col++%2==0) { echo "<tr bgcolor=#DDDDDD valign=top>"; }
- else { echo "<tr bgcolor=#EEEEEE valign=top>"; }
-
- if($col>100) break;
-
- echo "<TD><pre>".date("Y.M.d H:i:s",$row["clock"])."</pre></TD>";
- if($row["priority"]==0) echo "<TD ALIGN=CENTER><pre>Not classified</pre></TD>";
- elseif($row["priority"]==1) echo "<TD ALIGN=CENTER><pre>Information</pre></TD>";
- elseif($row["priority"]==2) echo "<TD ALIGN=CENTER><pre>Warning</pre></TD>";
- elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA><pre>Average</pre></TD>";
- elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888><pre>High</pre></TD>";
- elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED><pre>Disaster !!!</pre></TD>";
- else echo "<TD ALIGN=CENTER><pre><B>".$row["priority"]."</B></pre></TD>";
- if(isset($row["categoryid"]))
- {
- echo "<TD align=center><pre>".$row["categoryid"]."</pre></TD>";
- }
- else
- {
- echo "<TD align=center><pre>-</pre></TD>";
- }
- echo "<TD><pre>".$row["description"]."</pre></TD>";
- if($row["status"]==0)
- {
- echo "<TD><pre>Active</pre></TD>";
- }
- else
- {
- echo "<TD><pre>Closed</pre></TD>";
- }
- echo "<TD>";
-
- $sql="select commentid,problemid,clock,status_before,status_after,comment from problems_comments where problemid=".$row["problemid"]." order by clock";
- $result2=DBselect($sql);
- while($row2=DBfetch($result2))
- {
- echo "<table WIDTH=100% BORDER=1 BGCOLOR=\"#EEEEEE\" cellspacing=0 cellpadding=1>";
- echo "<tr>";
- echo "<td><b>Registered at:</b></td>";
- echo "<td>".date("Y.M.d H:i:s",$row2["clock"])."</td>";
- echo "</tr>";
- echo "<tr>";
- echo "<td><b>Commented by:</b></td>";
- if(isset($row2["userid"]))
- {
- $user=get_user_by_userid($row2["userid"]);
- echo "<td>".$user["name"]." ".$user["surname"]."</td>";
- }
- else
- {
- echo "<td>Zabbix</td>";
- }
- echo "</tr>";
- echo "<tr>";
- echo "<td><pre>".$row2["comment"]."</pre></td>";
- echo "<td><pre>".$row2["comment"]."</pre></td>";
- echo "</tr>";
- echo "<tr>";
- echo "</tr>";
- echo "</table>";
- echo "<hr>";
- }
- echo "[<a href=\"helpdesk.php?action=add_comment&problemid=".$row["problemid"]."\">Add comment</a>]";
- echo " [<a href=\"helpdesk.php?action=change_problem&problemid=".$row["problemid"]."\">Change problem</a>]";
- }
- echo "</TABLE>";
-?>
-
-<?php
- echo "<a name=\"form\"></a>";
- insert_problem_form($HTTP_GET_VARS["problemid"]);
-?>
-
-<?php
- show_footer();
-?>
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index b51f634e..404418ef 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -20,6 +20,7 @@
?>
<?php
include "include/config.inc.php";
+ include "include/forms.inc.php";
$page["title"] = S_HOSTS;
$page["file"] = "hosts.php";
show_header($page["title"],0,0);
@@ -131,7 +132,7 @@
if(DBnum_rows($result)==0)
{
echo "<TR BGCOLOR=#EEEEEE>";
- echo "<TD COLSPAN=3 ALIGN=CENTER>".S_NO_HOST_GROUPS_DEFINED."</TD>";
+ echo "<TD COLSPAN=4 ALIGN=CENTER>".S_NO_HOST_GROUPS_DEFINED."</TD>";
echo "<TR>";
}
echo "</TABLE>";
@@ -146,11 +147,11 @@
if(isset($HTTP_GET_VARS["groupid"]))
{
// echo "all ";
- echo "<a href='hosts.php'>".S_ALL."</a> ";
+ echo "<a href='hosts.php'>".S_ALL_SMALL."</a> ";
}
else
{
- echo "<b>[<a href='hosts.php'>".S_ALL."</a>]</b> ";
+ echo "<b>[<a href='hosts.php'>".S_ALL_SMALL."</a>]</b> ";
}
$result=DBselect("select groupid,name from groups order by name");
@@ -281,7 +282,7 @@
if(DBnum_rows($result)==0)
{
echo "<TR BGCOLOR=#EEEEEE>";
- echo "<TD COLSPAN=5 ALIGN=CENTER>".S_NO_HOSTS_DEFINED."</TD>";
+ echo "<TD COLSPAN=6 ALIGN=CENTER>".S_NO_HOSTS_DEFINED."</TD>";
echo "<TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 35750a99..65be722b 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -21,59 +21,39 @@
<?php
include_once "include/defines.inc.php";
include_once "include/db.inc.php";
+ include_once "include/html.inc.php";
include_once "include/local_en.inc.php";
$USER_DETAILS ="";
$ERROR_MSG ="";
- function nbsp($str)
- {
- return str_replace(" ","&nbsp;",$str);;
- }
-
- function url1_param($parameter)
+ function getmicrotime()
{
- global $HTTP_GET_VARS;
-
- if(isset($HTTP_GET_VARS[$parameter]))
- {
- return "$parameter=".$HTTP_GET_VARS[$parameter];
- }
- else
- {
- return "";
- }
- }
+ list($usec, $sec) = explode(" ",microtime());
+ return ((float)$usec + (float)$sec);
+ }
- function url_param($parameter)
+ function iif($bool,$a,$b)
{
- global $HTTP_GET_VARS;
-
- if(isset($HTTP_GET_VARS[$parameter]))
+ if($bool)
{
- return "&$parameter=".$HTTP_GET_VARS[$parameter];
+ return $a;
}
else
{
- return "";
+ return $b;
}
}
- function getmicrotime()
- {
- list($usec, $sec) = explode(" ",microtime());
- return ((float)$usec + (float)$sec);
- }
-
- function iif($bool,$a,$b)
+ function iif_echo($bool,$a,$b)
{
if($bool)
{
- return $a;
+ echo $a;
}
else
{
- return $b;
+ echo $b;
}
}
@@ -3414,6 +3394,19 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
cr();
}
+ function show_table3_h_delimiter()
+ {
+// echo "</font>";
+ cr();
+ echo "</td>";
+ cr();
+ echo "<td width=%10 colspan=1 bgcolor=99AABB align=right valign=\"top\">";
+ cr();
+// echo " <font size=-1>";
+ cr();
+ }
+
+
function show_table_v_delimiter()
{
// echo "</font>";
@@ -3517,6 +3510,25 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
cr();
}
+ function show_table3_header_begin()
+ {
+ echo "<table border=0 align=center cellspacing=0 cellpadding=0 width=100% bgcolor=000000>";
+ cr();
+ echo "<tr>";
+ cr();
+ echo "<td valign=\"top\">";
+ cr();
+ echo "<table width=100% border=0 cellspacing=1 cellpadding=3>";
+ cr();
+ echo "<tr>";
+ cr();
+ echo "<td colspan=1 bgcolor=99AABB align=left valign=\"top\">";
+ cr();
+// echo " <font size=+1>";
+ cr();
+ }
+
+
function show_table2_header_end()
{
// echo " </font>";
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 917eadfa..3e36687e 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -302,12 +302,9 @@
echo nbsp("Store value");
show_table2_h_delimiter();
echo "<SELECT class=\"biginput\" NAME=\"delta\" value=\"$delta\" size=\"1\">";
- echo "<OPTION VALUE=\"0\"";
- if($delta==0) echo "SELECTED";
- echo ">As is";
- echo "<OPTION VALUE=\"1\"";
- if($delta==1) echo "SELECTED";
- echo ">Delta";
+ echo "<OPTION VALUE=\"0\" "; if($delta==0) echo "SELECTED"; echo ">As is";
+ echo "<OPTION VALUE=\"1\" "; if($delta==1) echo "SELECTED"; echo ">Delta (speed per second)";
+ echo "<OPTION VALUE=\"2\" "; if($delta==2) echo "SELECTED"; echo ">Delta (simple change)";
echo "</SELECT>";
if($type==2)
diff --git a/frontends/php/include/local_en.inc.php b/frontends/php/include/local_en.inc.php
index 625fed56..98012021 100644
--- a/frontends/php/include/local_en.inc.php
+++ b/frontends/php/include/local_en.inc.php
@@ -118,6 +118,8 @@
define("S_ON_C", "On");
define("S_OFF_C", "Off");
define("S_MOVE", "Move");
+ define("S_SELECT_GRAPH_DOT_DOT_DOT", "Select graph...");
+
// Colors
define("S_BLACK", "Black");
define("S_BLUE", "Blue");
@@ -159,7 +161,7 @@
define("S_LATEST_VALUES", "Latest values");
define("S_NO_PERMISSIONS", "No permissions !");
define("S_LATEST_DATA", "LATEST DATA");
- define("S_ALL", "all");
+ define("S_ALL_SMALL", "all");
define("S_DESCRIPTION_LARGE", "DESCRIPTION");
define("S_DESCRIPTION_SMALL", "Description");
define("S_GRAPH", "Graph");
@@ -217,6 +219,7 @@
define("S_VALUES_OF_LAST_HOUR", "Values of last hour");
define("S_VALUES_OF_SPECIFIED_PERIOD", "Values of specified period");
define("S_VALUES_IN_PLAIN_TEXT_FORMAT", "Values in plain text format");
+ define("S_CLOCK", "Clock");
// hosts.php
define("S_HOSTS", "Hosts");
@@ -291,6 +294,8 @@
define("S_ACTIVATE_SELECTED_ITEMS_Q", "Activate selected items?");
define("S_DISABLE_SELECTED_ITEMS_Q", "Disable selected items?");
define("S_DELETE_SELECTED_ITEMS_Q", "Delete selected items?");
+ define("S_EMAIL", "Email");
+ define("S_SCRIPT", "Script");
// latestalarms.php
define("S_LATEST_ALARMS", "Latest alarms");
@@ -316,6 +321,7 @@
define("S_NETWORK_MAPS_BIG", "NETWORK MAPS");
define("S_NO_MAPS_TO_DISPLAY", "No maps to display");
define("S_SELECT_MAP_TO_DISPLAY", "Select map to display");
+ define("S_SELECT_MAP_DOT_DOT_DOT", "Select map...");
// media.php
define("S_MEDIA", "Media");
@@ -360,6 +366,166 @@
define("S_MENU_NETWORK_MAPS", "NETWORK MAPS");
define("S_MENU_GRAPHS", "GRAPHS");
+// queue.php
+ define("S_QUEUE_BIG", "QUEUE");
+ define("S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG", "QUEUE OF ITEMS TO BE UPDATED");
+ define("S_NEXT_CHECK", "Next check");
+ define("S_THE_QUEUE_IS_EMPTY", "The queue is empty");
+ define("S_TOTAL", "Total");
+
+// report1.php
+ define("S_STATUS_OF_ZABBIX", "Status of Zabbix");
+ define("S_STATUS_OF_ZABBIX_BIG", "STATUS OF ZABBIX");
+ define("S_PARAMETER", "Parameter");
+ define("S_VALUE", "Value");
+ define("S_ZABBIX_SUCKERD_IS_RUNNING", "zabbix_suckerd is running");
+ define("S_ZABBIX_TRAPPERD_IS_RUNNING", "zabbix_trapperd is running");
+ define("S_NUMBER_OF_VALUES_STORED", "Number of values stored");
+ define("S_NUMBER_OF_TRENDS_STORED", "Number of trends stored");
+ define("S_NUMBER_OF_ALARMS", "Number of alarms");
+ define("S_NUMBER_OF_ALERTS", "Number of alerts");
+ define("S_NUMBER_OF_TRIGGERS_ENABLED_DISABLED", "Number of triggers (enabled/disabled)");
+ define("S_NUMBER_OF_ITEMS_ACTIVE_TRAPPER", "Number of items (active/trapper/not active/not supported)");
+ define("S_NUMBER_OF_USERS", "Number of users");
+ define("S_NUMBER_OF_HOSTS_MONITORED", "Number of hosts (monitored/not monitored/templates)");
+ define("S_YES", "Yes");
+ define("S_NO", "No");
+
+// report2.php
+ define("S_AVAILABILITY_REPORT", "Availability report");
+ define("S_AVAILABILITY_REPORT_BIG", "AVAILABILITY REPORT");
+ define("S_SHOW", "Show");
+ define("S_TRUE", "True");
+ define("S_FALSE", "False");
+
+// screenconf.php
+ define("S_SCREENS", "Screens");
+ define("S_SCREEN", "Screen");
+ define("S_CONFIGURATION_OF_SCREENS_BIG", "CONFIGURATION OF SCREENS");
+ define("S_SCREEN_ADDED", "Screen added");
+ define("S_CANNOT_ADD_SCREEN", "Cannot add screen");
+ define("S_SCREEN_UPDATED", "Screen updated");
+ define("S_CANNOT_UPDATE_SCREEN", "Cannot update screen");
+ define("S_SCREEN_DELETED", "Screen deleted");
+ define("S_CANNOT_DELETE_SCREEN", "Cannot deleted screen");
+ define("S_COLUMNS", "Columns");
+ define("S_ROWS", "Rows");
+ define("S_NO_SCREENS_DEFINED", "No screens defined");
+ define("S_DELETE_SCREEN_Q", "Delete screen?");
+ define("S_CONFIGURATION_OF_SCREEN_BIG", "CONFIGURATION OF SCREEN");
+ define("S_SCREEN_CELL_CONFIGURATION", "Screen cell configuration");
+ define("S_RESOURCE", "Resource");
+ define("S_SIMPLE_GRAPH", "Simple graph");
+ define("S_GRAPH_NAME", "Graph name");
+ define("S_WIDTH", "Width");
+ define("S_HEIGHT", "Height");
+ define("S_EMPTY", "Empty");
+
+// screenedit.php
+ define("S_MAP", "Map");
+
+// screens.php
+ define("S_CUSTOM_SCREENS", "Custom screens");
+ define("S_SCREENS_BIG", "SCREENS");
+ define("S_NO_SCREENS_TO_DISPLAY", "No screens to display");
+ define("S_SELECT_SCREEN_TO_DISPLAY", "Select screen to display");
+
+// services.php
+ define("S_IT_SERVICES", "IT services");
+ define("S_SERVICE_UPDATED", "Service updated");
+ define("S_CANNOT_UPDATE_SERVICE", "Cannot update service");
+ define("S_SERVICE_ADDED", "Service added");
+ define("S_CANNOT_ADD_SERVICE", "Cannot add service");
+ define("S_LINK_ADDED", "Link added");
+ define("S_CANNOT_ADD_LINK", "Cannot add link");
+ define("S_SERVICE_DELETED", "Service deleted");
+ define("S_CANNOT_DELETE_SERVICE", "Cannot delete service");
+ define("S_LINK_DELETED", "Link deleted");
+ define("S_CANNOT_DELETE_LINK", "Cannot delete link");
+ define("S_STATUS_CALCULATION", "Status calculation");
+ define("S_NONE", "None");
+ define("S_MAX_OF_CHILDS", "MAX of childs");
+ define("S_MIN_OF_CHILDS", "MIN of childs");
+ define("S_SERVICE_1", "Service 1");
+ define("S_SERVICE_2", "Service 2");
+ define("S_SOFT_HARD_LINK", "Soft/hard link");
+ define("S_SOFT", "Soft");
+ define("S_HARD", "Hard");
+ define("S_DO_NOT_CALCULATE", "Do not calculate");
+ define("S_MAX_BIG", "MAX");
+ define("S_MIN_BIG", "MIN");
+ define("S_SHOW_SLA", "Show SLA");
+ define("S_ACCEPTABLE_SLA_IN_PERCENT", "Acceptabe SLA (in %)");
+ define("S_LINK_TO_TRIGGER_Q", "Link to trigger?");
+ define("S_SORT_ORDER_0_999", "Sort order (0->999)");
+ define("S_DELETE_SERVICE_Q", "S_DELETE_SERVICE_Q");
+ define("S_LINK_TO", "Link to");
+ define("S_SOFT_LINK_Q", "Soft link?");
+ define("S_ADD_SERVER_DETAILS", "Add server details");
+
+// srv_status.php
+ define("S_IT_SERVICES", "IT services");
+ define("S_IT_SERVICES_BIG", "IT SERVICES");
+ define("S_SERVICE", "Service");
+ define("S_REASON", "Reason");
+ define("S_SLA_LAST_7_DAYS", "SLA (last 7 days)");
+ define("S_PLANNED_CURRENT_SLA", "Planned/current SLA");
+ define("S_TRIGGER_BIG", "TRIGGER");
+
+// triggers.php
+ define("S_CONFIGURATION_OF_TRIGGERS", "Configuration of triggers");
+ define("S_CONFIGURATION_OF_TRIGGERS_BIG", "CONFIGURATION OF TRIGGERS");
+ define("S_DEPENDENCY_ADDED", "Dependency added");
+ define("S_CANNOT_ADD_DEPENDENCY", "Cannot add dependency");
+ define("S_TRIGGERS_UPDATED", "Triggers updated");
+ define("S_CANNOT_UPDATE_TRIGGERS", "Cannot update triggers");
+ define("S_TRIGGERS_DISABLED", "Triggers disabled");
+ define("S_CANNOT_DISABLE_TRIGGERS", "Cannot disable triggers");
+ define("S_TRIGGERS_DELETED", "Triggers deleted");
+ define("S_CANNOT_DELETE_TRIGGERS", "Cannot delete triggers");
+ define("S_TRIGGER_DELETED", "Trigger deleted");
+ define("S_CANNOT_DELETE_TRIGGER", "Cannot delete trigger");
+ define("S_INVALID_TRIGGER_EXPRESSION", "Invalid trigger expression");
+ define("S_TRIGGER_ADDED", "Trigger added");
+ define("S_CANNOT_ADD_TRIGGER", "Cannot add trigger");
+ define("S_SEVERITY", "Severity");
+ define("S_EXPRESSION", "Expression");
+ define("S_DISABLED", "Disabled");
+ define("S_ENABLED", "Enabled");
+ define("S_ENABLE_SELECTED_TRIGGERS_Q", "Enable selected triggers?");
+ define("S_DISABLE_SELECTED_TRIGGERS_Q", "Disable selected triggers?");
+ define("S_CHANGE", "Change");
+ define("S_TRIGGER_UPDATED", "Trigger updated");
+ define("S_CANNOT_UPDATE_TRIGGER", "Cannot update trigger");
+
+// tr_comments.php
+ define("S_TRIGGER_COMMENTS", "Trigger comments");
+ define("S_TRIGGER_COMMENTS_BIG", "TRIGGER COMMENTS");
+ define("S_COMMENT_UPDATED", "Comment updated");
+ define("S_CANNOT_UPDATE_COMMENT", "Cannot update comment");
+ define("S_COMMENTS", "Comments");
+ define("S_ADD", "Add");
+
+// tr_status.php
+ define("S_STATUS_OF_TRIGGERS", "Status of triggers");
+ define("S_STATUS_OF_TRIGGERS_BIG", "STATUS OF TRIGGERS");
+ define("S_SHOW_ONLY_TRUE", "Show only true");
+ define("S_HIDE_ACTIONS", "Hide actions");
+ define("S_SHOW_ACTIONS", "Show actions");
+ define("S_SHOW_ALL_TRIGGERS", "Show all triggers");
+ define("S_HIDE_DETAILS", "Hide details");
+ define("S_SHOW_DETAILS", "Show details");
+ define("S_SELECT", "Select");
+ define("S_HIDE_SELECT", "Hide select");
+ define("S_TRIGGERS_BIG", "TRIGGERS");
+ define("S_DESCRIPTION_BIG", "DESCRIPTION");
+ define("S_SEVERITY_BIG", "SEVERITY");
+ define("S_LAST_CHANGE_BIG", "LAST CHANGE");
+ define("S_LAST_CHANGE", "Last change");
+ define("S_ACTIONS", "Actions");
+ define("S_COMMENTS", "Comments");
+ define("S_SHOW_ACTIONS", "Show actions");
+
// users.php
define("S_USERS", "Users");
define("S_USER_ADDED", "User added");
diff --git a/frontends/php/items.php b/frontends/php/items.php
index fb75794b..c8abe129 100644
--- a/frontends/php/items.php
+++ b/frontends/php/items.php
@@ -132,75 +132,60 @@
echo S_CONFIGURATION_OF_ITEMS_BIG;;
show_table_v_delimiter();
-// echo "<font size=2>";
+// Start of new code
+ echo "<form name=\"form2\" method=\"get\" action=\"items.php\">";
- if(isset($HTTP_GET_VARS["groupid"]))
+ if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0))
{
-// echo "all ";
- echo "<a href='items.php'>".S_ALL."</a> ";
- }
- else
- {
- echo "<b>[<a href='items.php'>".S_ALL."</a>]</b> ";
+ unset($HTTP_GET_VARS["groupid"]);
}
- $result=DBselect("select groupid,name from groups order by name");
+ echo S_GROUP."&nbsp;";
+ echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL;
+ $result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
-// if(!check_right("Host","R",$row["hostid"]))
-// {
-// continue;
-// }
- if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+// Check if at least one host with read permission exists for this group
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $cnt=0;
+ while($row2=DBfetch($result2))
{
- echo "<b>[";
+ if(!check_right("Host","U",$row2["hostid"]))
+ {
+ continue;
+ }
+ $cnt=1; break;
}
- echo "<a href='items.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>";
- if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+ if($cnt!=0)
{
- echo "]</b>";
+ echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
- echo " ";
}
-?>
+ echo "</select>";
+
+ echo "&nbsp;".S_HOST."&nbsp;";
+ echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+
+ $sql=iif(isset($HTTP_GET_VARS["groupid"]),
+ "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host",
+ "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
-<?php
- show_table_v_delimiter();
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- $sql="select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host";
- }
- else
- {
- $sql="select hostid,host from hosts order by host";
- }
$result=DBselect($sql);
-// $result=DBselect("select hostid,host from hosts order by host");
while($row=DBfetch($result))
{
- if(!check_right("Host","U",$row["hostid"]))
- {
- continue;
- }
- if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]))
+ if(!check_right("Host","U",$row["hostid"]))
{
- echo "<b>[";
- }
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- echo "<A HREF=\"items.php?hostid=".$row["hostid"]."&groupid=".$HTTP_GET_VARS["groupid"]."\">".$row["host"]."</A>";
- }
- else
- {
- echo "<A HREF=\"items.php?hostid=".$row["hostid"]."\">".$row["host"]."</A>";
- }
- if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]))
- {
- echo "]</b>";
+ continue;
}
- echo " ";
+ echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
+ echo "</select>";
+
+ echo "</form>";
+// end of new code
+
show_table_header_end();
$lasthost="";
@@ -240,8 +225,9 @@
echo "</TR>";
}
$lasthost=$row["host"];
- if($col++%2 == 1) { echo "<TR BGCOLOR=#DDDDDD>"; }
- else { echo "<TR BGCOLOR=#EEEEEE>"; }
+ iif_echo($col++%2 == 1,
+ "<TR BGCOLOR=#DDDDDD>",
+ "<TR BGCOLOR=#EEEEEE>");
echo "<TD><INPUT TYPE=\"CHECKBOX\" class=\"biginput\" NAME=\"".$row["itemid"]."\"> ".$row["itemid"]."</TD>";
// echo "<TD>".$row["itemid"]."</TD>";
@@ -281,56 +267,28 @@
echo "<td align=center>";
-# if(isset($HTTP_GET_VARS["hostid"]))
-# {
- switch($row["status"])
- {
- case 0:
- echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."&register=changestatus&status=1\"><font color=\"00AA00\">".S_ACTIVE."</font></a>";
- break;
- case 1:
- echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."&register=changestatus&status=0\"><font color=\"AA0000\">".S_NOT_ACTIVE."</font></a>";
- break;
-# case 2:
-# echo "Trapper";
-# break;
- case 3:
- echo "<font color=\"AAAAAA\">".S_NOT_SUPPORTED."</font>";
- break;
- default:
- echo S_UNKNOWN;
- }
-# }
-# else
-# {
-# switch($row["status"])
-# {
-# case 0:
-# echo "<a href=\"items.php?itemid=".$row["itemid"]."&register=changestatus&status=1\">Active</a>";
-# break;
-# case 1:
-# echo "<a href=\"items.php?itemid=".$row["itemid"]."&register=changestatus&status=0\">Not active</a>";
-# break;
-# case 2:
-# echo "Trapper";
-# break;
-# case 3:
-# echo "Not supported";
-# break;
-# default:
-# echo "<B>$status</B> Unknown";
-# }
-# }
- echo "</td>";
-
- if(check_right("Item","U",$row["itemid"]))
- {
- echo "<TD><A HREF=\"items.php?register=change&itemid=".$row["itemid"]."#form\">".S_CHANGE."</A></TD>";
- }
- else
+ switch($row["status"])
{
- echo "<TD>".S_CHANGE."</TD>";
+ case 0:
+ echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."&register=changestatus&status=1\"><font color=\"00AA00\">".S_ACTIVE."</font></a>";
+ break;
+ case 1:
+ echo "<a href=\"items.php?itemid=".$row["itemid"]."&hostid=".$HTTP_GET_VARS["hostid"]."&register=changestatus&status=0\"><font color=\"AA0000\">".S_NOT_ACTIVE."</font></a>";
+ break;
+# case 2:
+# echo "Trapper";
+# break;
+ case 3:
+ echo "<font color=\"AAAAAA\">".S_NOT_SUPPORTED."</font>";
+ break;
+ default:
+ echo S_UNKNOWN;
}
+ echo "</td>";
+
+ iif_echo(check_right("Item","U",$row["itemid"]),
+ "<TD><A HREF=\"items.php?register=change&itemid=".$row["itemid"]."#form\">".S_CHANGE."</A></TD>",
+ "<TD>".S_CHANGE."</TD>");
echo "</TR>";
}
echo "</TABLE>";
diff --git a/frontends/php/latest.php b/frontends/php/latest.php
index 69e1297c..1fab4909 100644
--- a/frontends/php/latest.php
+++ b/frontends/php/latest.php
@@ -32,8 +32,9 @@
show_footer();
exit;
}
- if(isset($HTTP_GET_VARS["select"]))
+ if(isset($HTTP_GET_VARS["select"])&&($HTTP_GET_VARS["select"]!=""))
{
+ unset($HTTP_GET_VARS["groupid"]);
unset($HTTP_GET_VARS["hostid"]);
}
@@ -51,26 +52,22 @@
show_table_v_delimiter();
-// echo "<font size=2>";
+// Start of new code
+ echo "<form name=\"form2\" method=\"get\" action=\"latest.php\">";
- if(isset($HTTP_GET_VARS["groupid"]))
+ if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0))
{
-// echo "all ";
- echo "<a href='latest.php'>".S_ALL."</a> ";
- }
- else
- {
- echo "<b>[<a href='latest.php'>".S_ALL."</a>]</b> ";
+ unset($HTTP_GET_VARS["groupid"]);
}
- $result=DBselect("select groupid,name from groups order by name");
+ echo S_GROUP."&nbsp;";
+ echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL;
+ $result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
-// if(!check_right("Host","R",$row["hostid"]))
-// {
-// continue;
-// }
+// Check if at least one host with read permission exists for this group
$result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
$cnt=0;
while($row2=DBfetch($result2))
@@ -79,81 +76,49 @@
{
continue;
}
- $cnt++;
+ $cnt=1; break;
}
-
- if($cnt>0)
+ if($cnt!=0)
{
- if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
- {
- echo "<b>[";
- }
- echo "<a href='latest.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>";
- if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
- {
- echo "]</b>";
- }
+ echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
- echo " ";
}
+ echo "</select>";
- show_table_v_delimiter();
+ echo "&nbsp;".S_HOST."&nbsp;";
+ echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- $result=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
- }
- else
- {
- $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
- }
+ $sql=iif(isset($HTTP_GET_VARS["groupid"]),
+ "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host",
+ "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
+ $result=DBselect($sql);
while($row=DBfetch($result))
{
if(!check_right("Host","R",$row["hostid"]))
{
continue;
}
- if( isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]) )
- {
- echo "<b>[";
- }
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- echo "<a href='latest.php?groupid=".$HTTP_GET_VARS["groupid"]."&hostid=".$row["hostid"]."'>".$row["host"]."</a>";
- }
- else
- {
- echo "<a href='latest.php?hostid=".$row["hostid"]."'>".$row["host"]."</a>";
- }
- if(isset($HTTP_GET_VARS["hostid"]) && ($HTTP_GET_VARS["hostid"] == $row["hostid"]) )
- {
- echo "]</b>";
- }
- echo " ";
+ echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
+ echo "</select>";
- echo "</font>";
- if(!isset($HTTP_GET_VARS["hostid"])&&isset($HTTP_GET_VARS["select_form"])&&!isset($HTTP_GET_VARS["select"]))
+ echo nbsp(" ");
+
+ if(isset($HTTP_GET_VARS["select"])&&($HTTP_GET_VARS["select"]==""))
{
- show_table_v_delimiter();
- echo "<form name=\"form1\" method=\"get\" action=\"latest.php?select=true\">
- <input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$HTTP_GET_VARS["txt_select"]."\">
- <input class=\"button\" type=\"submit\" name=\"Select\" value=\"Select\">
- </form>";
- }
- else
- {
- show_table_v_delimiter();
- if(isset($HTTP_GET_VARS["select"]))
- {
- echo "<b>[<a href='latest.php?select_form=1'>Select</a>]</b>";
- }
- else
- {
- echo "[<a href='latest.php?select_form=1'>Select</a>]";
- }
+ unset($HTTP_GET_VARS["select"]);
}
+ iif_echo(isset($HTTP_GET_VARS["select"]),
+ "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"".$HTTP_GET_VARS["select"]."\">",
+ "<input class=\"biginput\" type=\"text\" name=\"select\" value=\"\">");
+ echo nbsp(" ");
+ echo "<input class=\"button\" type=\"submit\" name=\"do\" value=\"select\">";
+ echo "</form>";
+
+
+// end of new code
+
show_table_header_end();
if(!isset($HTTP_GET_VARS["sort"]))
@@ -202,14 +167,9 @@
}
else
{
- if(isset($HTTP_GET_VARS["select"]))
- {
- echo "<TD><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>";
- }
- else
- {
- echo "<TD><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>";
- }
+ iif_echo(isset($HTTP_GET_VARS["select"]),
+ "<TD><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>",
+ "<TD><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=description\">".S_DESCRIPTION_SMALL."</B></TD>");
}
if(isset($HTTP_GET_VARS["sort"])&&($HTTP_GET_VARS["sort"]=="lastcheck"))
{
@@ -217,14 +177,9 @@
}
else
{
- if(isset($HTTP_GET_VARS["select"]))
- {
- echo "<TD WIDTH=12%><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=lastcheck\">Last check</B></TD>";
- }
- else
- {
- echo "<TD WIDTH=12%><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=lastcheck\">Last check</B></TD>";
- }
+ iif_echo(isset($HTTP_GET_VARS["select"]),
+ "<TD WIDTH=12%><B><a href=\"latest.php?select=".$HTTP_GET_VARS["select"]."&sort=lastcheck\">Last check</B></TD>",
+ "<TD WIDTH=12%><B><a href=\"latest.php?hostid=".$HTTP_GET_VARS["hostid"]."&sort=lastcheck\">Last check</B></TD>");
}
cr();
echo "<TD WIDTH=10%><B>Last value</B></TD>";
@@ -260,14 +215,10 @@
{
$HTTP_GET_VARS["sort"]="order by i.description";
}
- if(isset($HTTP_GET_VARS["select"]))
- {
- $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$HTTP_GET_VARS["select"]."%' ".$HTTP_GET_VARS["sort"]);
- }
- else
- {
- $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$HTTP_GET_VARS["hostid"]." ".$HTTP_GET_VARS["sort"]);
- }
+ $sql=iif(isset($HTTP_GET_VARS["select"]),
+ "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$HTTP_GET_VARS["select"]."%' ".$HTTP_GET_VARS["sort"],
+ "select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$HTTP_GET_VARS["hostid"]." ".$HTTP_GET_VARS["sort"]);
+ $result=DBselect($sql);
while($row=DBfetch($result))
{
if(!check_right("Item","R",$row["itemid"]))
@@ -278,14 +229,15 @@
{
continue;
}
- if($col++%2 == 1) { echo "<tr bgcolor=#DDDDDD>"; }
- else { echo "<tr bgcolor=#EEEEEE>"; }
+ iif_echo($col++%2 == 1,
+ "<tr bgcolor=#DDDDDD>",
+ "<tr bgcolor=#EEEEEE>");
if(isset($HTTP_GET_VARS["select"]))
{
- echo "<td>".$row["host"]."</td>";
+ table_td($row["host"],"");
}
- echo "<td>".$row["description"]."</td>";
+ table_td($row["description"],"");
echo "<td>";
if($row["status"] == 2)
@@ -293,45 +245,20 @@
echo "<font color=\"#FF6666\">";
}
- if(!isset($row["lastclock"]))
- {
- echo "<div align=center>-</div>";
- }
- else
- {
- echo date("d M H:i:s",$row["lastclock"]);
- }
+ iif_echo(!isset($row["lastclock"]),
+ "<div align=center>-</div>",
+ date("d M H:i:s",$row["lastclock"]));
echo "</font></td>";
if(isset($row["lastvalue"]))
{
- if($row["value_type"] == 0 )
- {
- echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],$row["multiplier"]); echo "</td>";
- }
- else
- {
- echo "<td>"; echo nbsp(htmlspecialchars(substr($row["lastvalue"],0,20)." ...")); echo "</td>";
- }
-/* if(round($row["lastvalue"])==$row["lastvalue"])
- {
- if($row["value_type"] == 0 )
- {
- echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],$row["multiplier"]); echo "</td>";
- }
- else
- {
- echo "<td>"; echo nbsp(htmlspecialchars(substr($row["lastvalue"],0,20)." ...")); echo "</td>";
- }
- }
- else
- {
- echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],$row["multiplier"]); echo "</td>";
- }*/
+ iif_echo($row["value_type"] == 0,
+ "<td>".convert_units($row["lastvalue"],$row["units"],$row["multiplier"])."</td>",
+ "<td>".nbsp(htmlspecialchars(substr($row["lastvalue"],0,20)." ..."))."</td>");
}
else
{
- echo "<td align=center>-</td>";
+ table_td("-","align=center");
}
if( isset($row["lastvalue"]) && isset($row["prevvalue"]) &&
($row["value_type"] == 0) && ($row["lastvalue"]-$row["prevvalue"] != 0) )
@@ -342,14 +269,13 @@
{
$str=convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],$row["multiplier"]);
$str=nbsp($str);
- echo "<td>$str</td>";
-// printf("<td>%0.2f</td>",$row["lastvalue"]-$row["prevvalue"]);
+ table_td($str,"");
}
else
{
$str="+".convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],$row["multiplier"]);
$str=nbsp($str);
- echo "<td>$str</td>";
+ table_td($str,"");
// printf("<td>+%0.2f</td>",$row["lastvalue"]-$row["prevvalue"]);
}
}
@@ -357,30 +283,18 @@
{
echo "<td align=center>-</td>";
}
- if($row["value_type"]==0)
- {
- echo "<td align=center><a href=\"history.php?action=showhistory&itemid=".$row["itemid"]."\">".S_GRAPH."</a></td>";
- }
- else
- {
- echo "<td align=center><a href=\"history.php?action=showvalues&period=3600&itemid=".$row["itemid"]."\">".S_HISTORY."</a></td>";
- }
- if($row["value_type"]==0)
- {
- echo "<td align=center><a href=\"trends.php?itemid=".$row["itemid"]."\">".S_TREND."</a></td>";
- }
- else
- {
- echo "<td align=center>-</td>";
- }
- if($row["value_type"]==0)
- {
- echo "<td align=center><a href=\"compare.php?itemid=".$row["itemid"]."\">".S_COMPARE."</a></td>";
- }
- else
- {
- echo "<td align=center>-</td>";
- }
+ iif_echo($row["value_type"]==0,
+ "<td align=center><a href=\"history.php?action=showhistory&itemid=".$row["itemid"]."\">".S_GRAPH."</a></td>",
+ "<td align=center><a href=\"history.php?action=showvalues&period=3600&itemid=".$row["itemid"]."\">".S_HISTORY."</a></td>");
+
+ iif_echo($row["value_type"]==0,
+ "<td align=center><a href=\"trends.php?itemid=".$row["itemid"]."\">".S_TREND."</a></td>",
+ "<td align=center>-</td>");
+
+ iif_echo($row["value_type"]==0,
+ "<td align=center><a href=\"compare.php?itemid=".$row["itemid"]."\">".S_COMPARE."</a></td>",
+ "<td align=center>-</td>");
+
echo "</tr>";
cr();
}
diff --git a/frontends/php/maps.php b/frontends/php/maps.php
index 2f2cbb20..25bd5051 100644
--- a/frontends/php/maps.php
+++ b/frontends/php/maps.php
@@ -48,57 +48,67 @@
?>
<?php
- if(!isset($HTTP_GET_VARS["fullscreen"]))
+// if(!isset($HTTP_GET_VARS["fullscreen"]))
{
- show_table_header_begin();
- echo S_NETWORK_MAPS_BIG;
+ show_table3_header_begin();
- show_table_v_delimiter();
+ if(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==0))
+ {
+ unset($HTTP_GET_VARS["sysmapid"]);
+ }
- $lasthost="";
- $result=DBselect("select sysmapid,name from sysmaps order by name");
+ if(isset($HTTP_GET_VARS["sysmapid"]))
+ {
+ $result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]);
+ $map=DBget_field($result,0,0);
+ $map=iif(isset($HTTP_GET_VARS["fullscreen"]),
+ "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">".$map."</a>",
+ "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."&fullscreen=1\">".$map."</a>");
+ }
+ else
+ {
+ $map=S_SELECT_MAP_TO_DISPLAY;
+ }
+
+ echo S_NETWORK_MAPS_BIG.nbsp(" / ").$map;
+// Start of new code
+ show_table3_h_delimiter();
+ echo "<form name=\"form2\" method=\"get\" action=\"maps.php\">";
+ if(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==0))
+ {
+ unset($HTTP_GET_VARS["sysmapid"]);
+ }
+
+ echo "<select class=\"biginput\" name=\"sysmapid\" onChange=\"submit()\">";
+ echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_SELECT_MAP_DOT_DOT_DOT;
+
+ $result=DBselect("select sysmapid,name from sysmaps order by name");
while($row=DBfetch($result))
{
if(!check_right("Network map","R",$row["sysmapid"]))
{
continue;
}
- if( isset($HTTP_GET_VARS["sysmapid"]) && ($HTTP_GET_VARS["sysmapid"] == $row["sysmapid"]) )
- {
- echo "<b>[";
- }
- echo "<a href='maps.php?sysmapid=".$row["sysmapid"]."'>".$row["name"]."</a>";
- if(isset($HTTP_GET_VARS["sysmapid"]) && ($HTTP_GET_VARS["sysmapid"] == $row["sysmapid"]) )
- {
- echo "]</b>";
- }
- echo " ";
- }
-
- if(DBnum_rows($result) == 0)
- {
- echo S_NO_MAPS_TO_DISPLAY;
+ echo "<option value=\"".$row["sysmapid"]."\" ".iif(isset($HTTP_GET_VARS["sysmapid"])&&($HTTP_GET_VARS["sysmapid"]==$row["sysmapid"]),"selected","").">".$row["name"];
}
+ echo "</select>";
+ echo "</form>";
+// End of new code
show_table_header_end();
- echo "<br>";
+// echo "<br>";
}
?>
<?php
- if(isset($HTTP_GET_VARS["sysmapid"]))
+/* if(isset($HTTP_GET_VARS["sysmapid"]))
{
$result=DBselect("select name from sysmaps where sysmapid=".$HTTP_GET_VARS["sysmapid"]);
$map=DBget_field($result,0,0);
- if(isset($HTTP_GET_VARS["fullscreen"]))
- {
- $map="<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">".$map."</a>";;
- }
- else
- {
- $map="<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."&fullscreen=1\">".$map."</a>";;
- }
+ $map=iif(isset($HTTP_GET_VARS["fullscreen"]),
+ "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."\">".$map."</a>",
+ "<a href=\"maps.php?sysmapid=".$HTTP_GET_VARS["sysmapid"]."&fullscreen=1\">".$map."</a>");
}
else
{
@@ -106,6 +116,7 @@
}
show_table_header($map);
+*/
echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR BGCOLOR=#EEEEEE>";
diff --git a/frontends/php/queue.php b/frontends/php/queue.php
index cc38bdcd..d98422d5 100644
--- a/frontends/php/queue.php
+++ b/frontends/php/queue.php
@@ -19,31 +19,31 @@
**/
?>
<?php
- $page["title"] = "Information about monitoring server";
- $page["file"] = "queue.php";
-
include "include/config.inc.php";
+
+ $page["title"] = S_QUEUE_BIG;
+ $page["file"] = "queue.php";
show_header($page["title"],10,0);
?>
<?php
if(!check_anyright("Host","R"))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
?>
<?php
- show_table_header("QUEUE OF ITEMS TO BE UPDATED");
+ show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG);
?>
<?php
$now=time();
$result=DBselect("select i.itemid, i.nextcheck, i.description, h.host,h.hostid from items i,hosts h where i.status=0 and i.type not in (2) and h.status=0 and i.hostid=h.hostid and i.nextcheck<$now and i.key_<>'status' order by i.nextcheck");
echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>";
echo "\n";
- echo "<tr><td><b>Next time to check</b></td><td><b>Host</b></td><td><b>Description</b></td></tr>";
+ echo "<tr><td><b>".S_NEXT_CHECK."</b></td><td><b>".S_HOST."</b></td><td><b>".S_DESCRIPTION."</b></td></tr>";
echo "\n";
$col=0;
while($row=DBfetch($result))
@@ -52,24 +52,22 @@
{
continue;
}
- if($col++%2==0) { echo "<tr bgcolor=#EEEEEE>"; }
- else { echo "<tr bgcolor=#DDDDDD>"; }
- echo "<td>".date("m.d.Y H:i:s",$row["nextcheck"])."</td>";
- echo "<td>".$row["host"]."</td>";
- echo "<td>".$row["description"]."</td>";
+ iif_echo($col++%2==0,
+ "<tr bgcolor=#EEEEEE>",
+ "<tr bgcolor=#DDDDDD>");
+ table_td(date("m.d.Y H:i:s",$row["nextcheck"]),"");
+ table_td($row["host"],"");
+ table_td($row["description"],"");
echo "</tr>";
cr();
}
- if(DBnum_rows($result)==0)
- {
- echo "<TR BGCOLOR=#EEEEEE>";
- echo "<TD COLSPAN=3 ALIGN=CENTER>-The queue is empty-</TD>";
- echo "<TR>";
- }
+ iif_echo(DBnum_rows($result)==0,
+ "<TR BGCOLOR=#EEEEEE><TD COLSPAN=3 ALIGN=CENTER>".S_THE_QUEUE_IS_EMPTY."</TD><TR>",
+ "");
echo "</table>";
?>
<?php
- show_table_header("Total:$col");
+ show_table_header(S_TOTAL.":$col");
?>
<?php
diff --git a/frontends/php/report1.php b/frontends/php/report1.php
index d8f4b164..841b48a3 100644
--- a/frontends/php/report1.php
+++ b/frontends/php/report1.php
@@ -20,83 +20,83 @@
?>
<?php
include "include/config.inc.php";
- $page["title"] = "Status of Zabbix";
+ $page["title"] = S_STATUS_OF_ZABBIX;
$page["file"] = "report1.php";
show_header($page["title"],0,0);
?>
<?php
- show_table_header("STATUS OF ZABBIX");
+ show_table_header(S_STATUS_OF_ZABBIX_BIG);
echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
- echo "<TR><TD WIDTH=10%><B>Parameter</B></TD>";
- echo "<TD WIDTH=10% NOSAVE><B>Value</B></TD>";
+ echo "<TR><TD WIDTH=10%><B>".S_PARAMETER."</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>".S_VALUE."</B></TD>";
echo "</TR>";
$stats=get_stats();
?>
<tr bgcolor="#eeeeee">
- <td>Is zabbix_suckerd running ?</td>
+ <td><?php echo S_ZABBIX_SUCKERD_IS_RUNNING; ?></td>
<?php
- $str="<font color=\"AA0000\">No</font>";
+ $str="<font color=\"AA0000\">".S_NO."</font>";
if( (exec("ps -ef|grep zabbix_suckerd|grep -v grep|wc -l")>0) || (exec("ps -ax|grep zabbix_suckerd|grep -v grep|wc -l")>0) )
{
- $str="<font color=\"00AA00\">Yes</font>";
+ $str="<font color=\"00AA00\">".S_YES."</font>";
}
?>
<td><?php echo $str; ?></td>
</tr>
<tr bgcolor="#dddddd">
- <td>Is zabbix_trapperd running ?</td>
+ <td><?php echo S_ZABBIX_TRAPPERD_IS_RUNNING; ?></td>
<?php
- $str="<font color=\"AA0000\">No</font>";
+ $str="<font color=\"AA0000\">".S_NO."</font>";
if( (exec("ps -ef|grep zabbix_trapperd|grep -v grep|wc -l")>0) || (exec("ps -ax|grep zabbix_trapperd|grep -v grep|wc -l")>0) )
{
- $str="<font color=\"00AA00\">Yes</font>";
+ $str="<font color=\"00AA00\">".S_YES."</font>";
}
?>
<td><?php echo $str; ?></td>
</tr>
<tr bgcolor="#eeeeee">
- <td>Number of values stored</td>
+ <td><?php echo S_NUMBER_OF_VALUES_STORED; ?></td>
<td><?php echo $stats["history_count"]; ?></td>
</tr>
<tr bgcolor="#dddddd">
- <td>Number of trends stored</td>
+ <td><?php echo S_NUMBER_OF_TRENDS_STORED; ?></td>
<td><?php echo $stats["trends_count"]; ?></td>
</tr>
<tr bgcolor="#eeeeee">
- <td>Number of alarms</td>
+ <td><?php echo S_NUMBER_OF_ALARMS; ?></td>
<td><?php echo $stats["alarms_count"]; ?></td>
</tr>
<tr bgcolor="#dddddd">
- <td>Number of alerts</td>
+ <td><?php echo S_NUMBER_OF_ALERTS; ?></td>
<td><?php echo $stats["alerts_count"]; ?></td>
</tr>
<tr bgcolor="#eeeeee">
- <td>Number of triggers (enabled/disabled)</td>
+ <td><?php echo S_NUMBER_OF_TRIGGERS_ENABLED_DISABLED; ?></td>
<td><?php echo $stats["triggers_count"],"(",$stats["triggers_count_enabled"],"/",$stats["triggers_count_disabled"],")"; ?></td>
</tr>
<tr bgcolor="#dddddd">
- <td>Number of items (active/trapper/not active/not supported)</td>
+ <td><?php echo S_NUMBER_OF_ITEMS_ACTIVE_TRAPPER; ?></td>
<td><?php echo $stats["items_count"],"(",$stats["items_count_active"],"/",$stats["items_count_trapper"],"/",$stats["items_count_not_active"],"/",$stats["items_count_not_supported"],")"; ?></td>
</tr>
<tr bgcolor="#eeeeee">
- <td>Number of users</td>
+ <td><?php echo S_NUMBER_OF_USERS; ?></td>
<td><?php echo $stats["users_count"]; ?></td>
</tr>
<tr bgcolor="#dddddd">
- <td>Number of hosts (monitored/not monitored/templates)</td>
+ <td><?php echo S_NUMBER_OF_HOSTS_MONITORED; ?></td>
<td><?php echo $stats["hosts_count"],"(",$stats["hosts_count_monitored"],"/",$stats["hosts_count_not_monitored"],"/",$stats["hosts_count_template"],")"; ?></td>
</tr>
diff --git a/frontends/php/report2.php b/frontends/php/report2.php
index 52ff7e8c..353300e0 100644
--- a/frontends/php/report2.php
+++ b/frontends/php/report2.php
@@ -20,7 +20,7 @@
?>
<?php
include "include/config.inc.php";
- $page["title"] = "Availability report";
+ $page["title"] = S_AVAILABILITY_REPORT;
$page["file"] = "report2.php";
show_header($page["title"],0,0);
?>
@@ -28,7 +28,7 @@
<?php
if(!check_anyright("Host","R"))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
@@ -36,7 +36,7 @@
<?php
show_table_header_begin();
- echo "AVAILABILITY REPORT";
+ echo S_AVAILABILITY_REPORT_BIG;
show_table_v_delimiter();
@@ -74,12 +74,12 @@
$result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description");
echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR>";
- echo "<TD><B>Description</B></TD>";
+ echo "<TD><B>".S_DESCRIPTION."</B></TD>";
// echo "<TD><B>Expression</B></TD>";
- echo "<TD WIDTH=5%><B>True</B></TD>";
- echo "<TD WIDTH=5%><B>False</B></TD>";
- echo "<TD WIDTH=5%><B>Unknown</B></TD>";
- echo "<TD WIDTH=5%><B>Graph</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_TRUE."</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_FALSE."</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_UNKNOWN."</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_GRAPH."</B></TD>";
echo "</TR>\n";
$col=0;
while($row=DBfetch($result))
@@ -114,7 +114,7 @@
printf("%.4f%%",$availability["unknown"]);
echo "</TD>";
echo "<TD>";
- echo "<a href=\"report2.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."\">Show</a>";
+ echo "<a href=\"report2.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."\">".S_SHOW."</a>";
echo "</TD>";
echo "</TR>\n";
}
diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php
index 75a7945d..300ce321 100644
--- a/frontends/php/screenconf.php
+++ b/frontends/php/screenconf.php
@@ -20,14 +20,14 @@
?>
<?php
include "include/config.inc.php";
- $page["title"] = "Screens";
+ $page["title"] = S_SCREENS;
$page["file"] = "screenconf.php";
show_header($page["title"],0,0);
insert_confirm_javascript();
?>
<?php
- show_table_header("CONFIGURATION OF SCREENS");
+ show_table_header(S_CONFIGURATION_OF_SCREENS_BIG);
echo "<br>";
?>
@@ -46,17 +46,17 @@
if($HTTP_GET_VARS["register"]=="add")
{
$result=add_screen($HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]);
- show_messages($result,"Screen added","Cannot add screen");
+ show_messages($result,S_SCREEN_ADDED,S_CANNOT_ADD_SCREEN);
}
if($HTTP_GET_VARS["register"]=="update")
{
$result=update_screen($HTTP_GET_VARS["screenid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["cols"],$HTTP_GET_VARS["rows"]);
- show_messages($result,"Screen updated","Cannot update screen");
+ show_messages($result, S_SCREEN_UPDATED, S_CANNOT_UPDATE_SCREEN);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_screen($HTTP_GET_VARS["screenid"]);
- show_messages($result,"Screen deleted","Cannot delete screen");
+ show_messages($result, S_SCREEN_DELETED, S_CANNOT_DELETE_SCREEN);
unset($HTTP_GET_VARS["screenid"]);
}
}
@@ -65,11 +65,11 @@
<?php
show_table_header("SCREENS");
echo "<TABLE BORDER=0 COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
- echo "<TD WIDTH=5% NOSAVE><B>Id</B></TD>";
- echo "<TD><B>Name</B></TD>";
- echo "<TD WIDTH=5% NOSAVE><B>Columns</B></TD>";
- echo "<TD WIDTH=5% NOSAVE><B>Rows</B></TD>";
- echo "<TD WIDTH=10% NOSAVE><B>Actions</B></TD>";
+ echo "<TD WIDTH=5% NOSAVE><B>".S_ID."</B></TD>";
+ echo "<TD><B>".S_NAME."</B></TD>";
+ echo "<TD WIDTH=5% NOSAVE><B>".S_COLUMNS."</B></TD>";
+ echo "<TD WIDTH=5% NOSAVE><B>".S_ROWS."</B></TD>";
+ echo "<TD WIDTH=10% NOSAVE><B>".S_ACTIONS."</B></TD>";
echo "</TR>";
$result=DBselect("select screenid,name,cols,rows from screens order by name");
@@ -87,13 +87,13 @@
echo "<TD><a href=\"screenedit.php?screenid=".$row["screenid"]."\">".$row["name"]."</a></TD>";
echo "<TD>".$row["cols"]."</TD>";
echo "<TD>".$row["rows"]."</TD>";
- echo "<TD><A HREF=\"screenconf.php?screenid=".$row["screenid"]."#form\">Change</A></TD>";
+ echo "<TD><A HREF=\"screenconf.php?screenid=".$row["screenid"]."#form\">".S_CHANGE."</A></TD>";
echo "</TR>";
}
if(DBnum_rows($result)==0)
{
echo "<TR BGCOLOR=#EEEEEE>";
- echo "<TD COLSPAN=5 ALIGN=CENTER>-No screens defined-</TD>";
+ echo "<TD COLSPAN=5 ALIGN=CENTER>".S_NO_SCREENS_DEFINED."</TD>";
echo "<TR>";
}
echo "</TABLE>";
@@ -119,7 +119,7 @@
echo "<br>";
show_table2_header_begin();
- echo "Screen";
+ echo S_SCREEN;
show_table2_v_delimiter();
echo "<form method=\"get\" action=\"screenconf.php\">";
@@ -127,17 +127,17 @@
{
echo "<input class=\"biginput\" name=\"screenid\" type=\"hidden\" value=".$HTTP_GET_VARS["screenid"].">";
}
- echo "Name";
+ echo S_NAME;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"name\" value=\"$name\" size=32>";
show_table2_v_delimiter();
- echo "Columns";
+ echo S_COLUMNS;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"cols\" size=5 value=\"$cols\">";
show_table2_v_delimiter();
- echo "Rows";
+ echo S_ROWS;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"rows\" size=5 value=\"$rows\">";
@@ -146,7 +146,7 @@
if(isset($HTTP_GET_VARS["screenid"]))
{
echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">";
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete screen?');\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_SCREEN_Q."');\">";
}
show_table2_header_end();
diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php
index e0ae1da3..6ad3c07e 100644
--- a/frontends/php/screenedit.php
+++ b/frontends/php/screenedit.php
@@ -26,14 +26,14 @@
?>
<?php
- show_table_header("CONFIGURATION OF SCREEN");
+ show_table_header(S_CONFIGURATION_OF_SCREEN_BIG);
echo "<br>";
?>
<?php
- if(!check_right("Screen","R",$HTTP_GET_VARS["screenid"]))
+ if(!check_right("Screen","U",$HTTP_GET_VARS["screenid"]))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
@@ -51,18 +51,18 @@
// }
$result=add_screen_item($HTTP_GET_VARS["resource"],$HTTP_GET_VARS["screenid"],$HTTP_GET_VARS["x"],$HTTP_GET_VARS["y"],$HTTP_GET_VARS["resourceid"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]);
unset($HTTP_GET_VARS["x"]);
- show_messages($result,"Item added","Cannot add item");
+ show_messages($result, S_ITEM_ADDED, S_CANNOT_ADD_ITEM);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_screen_item($HTTP_GET_VARS["screenitemid"]);
- show_messages($result,"Item deleted","Cannot delete item");
+ show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM);
unset($HTTP_GET_VARS["x"]);
}
if($HTTP_GET_VARS["register"]=="update")
{
$result=update_screen_item($HTTP_GET_VARS["screenitemid"],$HTTP_GET_VARS["resource"],$HTTP_GET_VARS["resourceid"],$HTTP_GET_VARS["width"],$HTTP_GET_VARS["height"]);
- show_messages($result,"Item updated","Cannot update item");
+ show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM);
unset($HTTP_GET_VARS["x"]);
}
unset($HTTP_GET_VARS["register"]);
@@ -114,7 +114,7 @@
$height=@iif(isset($HTTP_GET_VARS["height"]),$HTTP_GET_VARS["height"],$height);
show_table2_header_begin();
- echo "Screen cell configuration";
+ echo S_SCREEN_CELL_CONFIGURATION;
echo "<input name=\"screenid\" type=\"hidden\" value=$screenid>";
echo "<input name=\"screenitemid\" type=\"hidden\" value=$screenitemid>";
@@ -124,18 +124,18 @@
// echo "<input name=\"resource\" type=\"hidden\" value='$resource'>";
show_table2_v_delimiter();
- echo "Resource";
+ echo S_RESOURCE;
show_table2_h_delimiter();
echo "<select name=\"resource\" size=1 onChange=\"submit()\">";
- echo "<OPTION VALUE='0' ".iif($resource==0,"selected","").">Graph";
- echo "<OPTION VALUE='1' ".iif($resource==1,"selected","").">Simple graph";
- echo "<OPTION VALUE='2' ".iif($resource==2,"selected","").">Map";
+ echo "<OPTION VALUE='0' ".iif($resource==0,"selected","").">".S_GRAPH;
+ echo "<OPTION VALUE='1' ".iif($resource==1,"selected","").">".S_SIMPLE_GRAPH;
+ echo "<OPTION VALUE='2' ".iif($resource==2,"selected","").">".S_MAP;
echo "</SELECT>";
if($resource == 1)
{
show_table2_v_delimiter();
- echo nbsp("Graph name");
+ echo nbsp(S_GRAPH_NAME);
show_table2_h_delimiter();
$result=DBselect("select h.host,i.description,i.itemid from hosts h,items i where h.hostid=i.hostid and h.status in (0,2) and i.status=0 order by h.host,i.description");
echo "<select name=\"resourceid\" size=1>";
@@ -152,7 +152,7 @@
else if($resource == 0)
{
show_table2_v_delimiter();
- echo nbsp("Graph name");
+ echo nbsp(S_GRAPH_NAME);
show_table2_h_delimiter();
$result=DBselect("select graphid,name from graphs order by name");
echo "<select name=\"resourceid\" size=1>";
@@ -168,7 +168,7 @@
else if($resource == 2)
{
show_table2_v_delimiter();
- echo "Map";
+ echo S_MAP;
show_table2_h_delimiter();
$result=DBselect("select sysmapid,name from sysmaps order by name");
echo "<select name=\"resourceid\" size=1>";
@@ -189,11 +189,11 @@
if($resource!=2)
{
show_table2_v_delimiter();
- echo "Width";
+ echo S_WIDTH;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"width\" size=5 value=\"$width\">";
show_table2_v_delimiter();
- echo "Height";
+ echo S_HEIGHT;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"height\" size=5 value=\"$height\">";
}
@@ -227,7 +227,7 @@
}
else
{
- echo "<a href=screenedit.php?register=edit&screenid=$screenid&x=$c&y=$r>Empty</a>";
+ echo "<a href=screenedit.php?register=edit&screenid=$screenid&x=$c&y=$r>".S_EMPTY."</a>";
}
echo "</form>\n";
diff --git a/frontends/php/screens.php b/frontends/php/screens.php
index a4c2a82a..836e4f42 100644
--- a/frontends/php/screens.php
+++ b/frontends/php/screens.php
@@ -42,7 +42,7 @@
if(!isset($HTTP_GET_VARS["fullscreen"]))
{
show_table_header_begin();
- echo "SCREENS";
+ echo S_SCREENS_BIG;
show_table_v_delimiter();
@@ -68,7 +68,7 @@
}
if(DBnum_rows($result) == 0)
{
- echo "No screens to display";
+ echo S_NO_SCREENS_TO_DISPLAY;
}
echo "</font>";
@@ -141,7 +141,7 @@
}
else
{
- show_table_header("Select screen to display");
+ show_table_header(S_SELECT_SCREEN_TO_DISPLAY);
echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR BGCOLOR=#DDDDDD>";
echo "<TD ALIGN=CENTER>";
diff --git a/frontends/php/services.php b/frontends/php/services.php
index 5979f131..57167c5a 100644
--- a/frontends/php/services.php
+++ b/frontends/php/services.php
@@ -19,7 +19,7 @@
**/
?>
<?php
- $page["title"] = "High-level representation of monitored data";
+ $page["title"] = S_IT_SERVICES;
$page["file"] = "services.php";
include "include/config.inc.php";
@@ -30,7 +30,7 @@
<?php
if(!check_anyright("Service","U"))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
@@ -42,17 +42,17 @@
if($HTTP_GET_VARS["register"]=="update")
{
$result=@update_service($HTTP_GET_VARS["serviceid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["linktrigger"],$HTTP_GET_VARS["algorithm"],$HTTP_GET_VARS["showsla"],$HTTP_GET_VARS["goodsla"],$HTTP_GET_VARS["sortorder"]);
- show_messages($result,"Service updated","Cannot update service");
+ show_messages($result, S_SERVICE_UPDATED, S_CANNOT_UPDATE_SERVICE);
}
if($HTTP_GET_VARS["register"]=="add")
{
$result=@add_service($HTTP_GET_VARS["serviceid"],$HTTP_GET_VARS["name"],$HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["linktrigger"],$HTTP_GET_VARS["algorithm"],$HTTP_GET_VARS["showsla"],$HTTP_GET_VARS["goodsla"],$HTTP_GET_VARS["goodsla"]);
- show_messages($result,"Service added","Cannot add service");
+ show_messages($result, S_SERVICE_ADDED, S_CANNOT_ADD_SERVICE);
}
if($HTTP_GET_VARS["register"]=="add server")
{
$result=add_host_to_services($HTTP_GET_VARS["hostid"],$HTTP_GET_VARS["serviceid"]);
- show_messages($result,"Host trigger added","Cannot add host triggers");
+ show_messages($result, S_TRIGGER_ADDED, S_CANNOT_ADD_TRIGGER);
}
if($HTTP_GET_VARS["register"]=="add link")
{
@@ -65,31 +65,31 @@
$HTTP_GET_VARS["softlink"]=1;
}
$result=add_service_link($HTTP_GET_VARS["servicedownid"],$HTTP_GET_VARS["serviceupid"],$HTTP_GET_VARS["softlink"]);
- show_messages($result,"Service link added","Cannot add service link");
+ show_messages($result, S_LINK_ADDED, S_CANNOT_ADD_LINK);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_service($HTTP_GET_VARS["serviceid"]);
- show_messages($result,"Service deleted","Cannot delete service");
+ show_messages($result, S_SERVICE_DELETED, S_CANNOT_DELETE_SERVICE);
unset($HTTP_GET_VARS["serviceid"]);
}
if($HTTP_GET_VARS["register"]=="delete_link")
{
$result=delete_service_link($HTTP_GET_VARS["linkid"]);
- show_messages($result,"Link deleted","Cannot delete link");
+ show_messages($result, S_LINK_DELETED, S_CANNOT_DELETE_LINK);
}
}
?>
<?php
- show_table_header("IT SERVICES");
+ show_table_header(S_IT_SERVICES_BIG);
$now=time();
$result=DBselect("select serviceid,name,algorithm from services order by sortorder,name");
echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>";
echo "<tr>";
- echo "<td><b>Service</b></td>";
- echo "<td width=20%><b>Status calculation</b></td>";
+ echo "<td><b>".S_SERVICE."</b></td>";
+ echo "<td width=20%><b>".S_STATUS_CALCULATION."</b></td>";
echo "</tr>";
$col=0;
@@ -100,19 +100,19 @@
echo "<td><b><a href=\"services.php?serviceid=".$service["serviceid"]."#form\">".$service["name"]."</a></b></td>";
if($service["algorithm"] == SERVICE_ALGORITHM_NONE)
{
- echo "<td>none</td>";
+ echo "<td>".S_NONE."</td>";
}
else if($service["algorithm"] == SERVICE_ALGORITHM_MAX)
{
- echo "<td>MAX of childs</td>";
+ echo "<td>".S_MAX_OF_CHILDS."</td>";
}
else if($service["algorithm"] == SERVICE_ALGORITHM_MIN)
{
- echo "<td>MIN of childs</td>";
+ echo "<td>".S_MIN_OF_CHILDS."</td>";
}
else
{
- echo "<td>unknown</td>";
+ echo "<td>".S_UNKNOWN."</td>";
}
echo "</tr>";
$col++;
@@ -147,19 +147,19 @@
}
if($row["algorithm"] == SERVICE_ALGORITHM_NONE)
{
- echo "<td>none</td>";
+ echo "<td>".S_NONE."</td>";
}
else if($row["algorithm"] == SERVICE_ALGORITHM_MAX)
{
- echo "<td>MAX of childs</td>";
+ echo "<td>".S_MAX_OF_CHILDS."</td>";
}
else if($row["algorithm"] == SERVICE_ALGORITHM_MIN)
{
- echo "<td>MIN of childs</td>";
+ echo "<td>".S_MIN_OF_CHILDS."</td>";
}
else
{
- echo "<td>unknown</td>";
+ echo "<td>".S_UNKNOWN."</td>";
}
echo "</tr>";
}
@@ -172,10 +172,10 @@
show_table_header("LINKS");
echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>";
echo "<tr>";
- echo "<td><b>Service 1</b></td>";
- echo "<td><b>Service 2</b></td>";
- echo "<td><b>Soft/hard link</b></td>";
- echo "<td><b>Actions</b></td>";
+ echo "<td><b>".S_SERVICE_1."</b></td>";
+ echo "<td><b>".S_SERVICE_2."</b></td>";
+ echo "<td><b>".S_SOFT_HARD_LINK."</b></td>";
+ echo "<td><b>".S_ACTIONS."</b></td>";
echo "</tr>";
$sql="select linkid,servicedownid,serviceupid,soft from services_links where serviceupid=".$HTTP_GET_VARS["serviceid"]." or servicedownid=".$HTTP_GET_VARS["serviceid"];
$result=DBselect($sql);
@@ -190,13 +190,13 @@
echo "<td>".$service["name"]."</td>";
if($row["soft"] == 0)
{
- echo "<td>Hard</td>";
+ echo "<td>".S_HARD."</td>";
}
else
{
- echo "<td>Soft</td>";
+ echo "<td>".S_SOFT."</td>";
}
- echo "<td><a href=\"services.php?register=delete_link&serviceid=".$HTTP_GET_VARS["serviceid"]."&linkid=".$row["linkid"]."\">Delete</a></td>";
+ echo "<td><a href=\"services.php?register=delete_link&serviceid=".$HTTP_GET_VARS["serviceid"]."&linkid=".$row["linkid"]."\">".S_DELETE."</a></td>";
echo "</tr>";
}
echo "</table>";
@@ -226,7 +226,7 @@
echo "<br>";
echo "<a name=\"form\"></a>";
show_table2_header_begin();
- echo "Service";
+ echo S_SERVICE;
show_table2_v_delimiter();
echo "<form method=\"get\" action=\"services.php\">";
@@ -234,12 +234,12 @@
{
echo "<input class=\"biginput\" name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">";
}
- echo "Name";
+ echo S_NAME;
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"name\" value=\"$name\" size=32>";
show_table2_v_delimiter();
- echo nbsp("Status calculation algorithm");
+ echo nbsp(S_STATUS_CALCULATION_ALGORITHM);
show_table2_h_delimiter();
echo "<select class=\"biginput\" name=\"algorithm\" size=1>";
// if(isset($HTTP_GET_VARS["algorithm"]))
@@ -248,34 +248,34 @@
// if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_NONE)
if($algorithm == SERVICE_ALGORITHM_NONE)
{
- echo "<OPTION VALUE='0' SELECTED>Do not calculate";
- echo "<OPTION VALUE='1'>MAX";
- echo "<OPTION VALUE='2'>MIN";
+ echo "<OPTION VALUE='0' SELECTED>".S_DO_NOT_CALCULATE;
+ echo "<OPTION VALUE='1'>".S_MAX_BIG;
+ echo "<OPTION VALUE='2'>".S_MIN_BIG;
}
// else if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_MAX)
else if($algorithm == SERVICE_ALGORITHM_MAX)
{
- echo "<OPTION VALUE='0'>Do not calculate";
- echo "<OPTION VALUE='1' SELECTED>MAX";
- echo "<OPTION VALUE='2'>MIN";
+ echo "<OPTION VALUE='0'>".S_DO_NOT_CALCULATE;
+ echo "<OPTION VALUE='1' SELECTED>".S_MAX_BIG;
+ echo "<OPTION VALUE='2'>".S_MIN_BIG;
}
else if($HTTP_GET_VARS["algorithm"] == SERVICE_ALGORITHM_MIN)
{
- echo "<OPTION VALUE='0'>Do not calculate";
- echo "<OPTION VALUE='1'>MAX";
- echo "<OPTION VALUE='2' SELECTED>MIN";
+ echo "<OPTION VALUE='0'>".S_DO_NOT_CALCULATE;
+ echo "<OPTION VALUE='1'>".S_MAX_BIG;
+ echo "<OPTION VALUE='2' SELECTED>".S_MIN_BIG;
}
}
else
{
- echo "<OPTION VALUE='0'>Do not calculate";
- echo "<OPTION VALUE='1' SELECTED>MAX";
- echo "<OPTION VALUE='2'>MIN";
+ echo "<OPTION VALUE='0'>".S_DO_NOT_CALCULATE;
+ echo "<OPTION VALUE='1' SELECTED>".S_MAX_BIG;
+ echo "<OPTION VALUE='2'>".S_MIN_BIG;
}
echo "</SELECT>";
show_table2_v_delimiter();
- echo nbsp("Show SLA");
+ echo nbsp(S_SHOW_SLA);
show_table2_h_delimiter();
if($showsla==1)
{
@@ -288,12 +288,12 @@
}
show_table2_v_delimiter();
- echo nbsp("Acceptable SLA (in %)");
+ echo nbsp(S_ACCEPTABLE_SLA_IN_PERCENT);
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"goodsla\" value=\"$goodsla\" size=6>";
show_table2_v_delimiter();
- echo nbsp("Link to trigger ?");
+ echo nbsp(S_LINK_TO_TRIGGER_Q);
show_table2_h_delimiter();
if(isset($triggerid)&&($triggerid!=""))
{
@@ -305,7 +305,7 @@
}
show_table2_v_delimiter();
- echo "Trigger";
+ echo S_TRIGGER;
show_table2_h_delimiter();
$result=DBselect("select triggerid,description from triggers order by description");
echo "<select class=\"biginput\" name=\"triggerid\" size=1>";
@@ -330,7 +330,7 @@
echo "</SELECT>";
show_table2_v_delimiter();
- echo nbsp("Sort order (0->999)");
+ echo nbsp(".S_SORT_ORDER_0_999.");
show_table2_h_delimiter();
echo "<input class=\"biginput\" name=\"sortorder\" value=\"$sortorder\" size=3>";
@@ -343,7 +343,7 @@
if(isset($HTTP_GET_VARS["serviceid"]))
{
echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"update\">";
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('Delete service?');\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete\" onClick=\"return Confirm('".S_DELETE_SERVICE_Q."');\">";
}
show_table2_header_end();
@@ -364,7 +364,7 @@
echo "<br>";
show_table2_header_begin();
- echo nbsp("Link to ...");
+ echo nbsp(S_LINK_TO);
show_table2_v_delimiter();
echo "<form method=\"post\" action=\"services.php\">";
@@ -373,7 +373,7 @@
echo "<input name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">";
echo "<input name=\"serviceupid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">";
}
- echo "Name";
+ echo S_NAME;
show_table2_h_delimiter();
$result=DBselect("select serviceid,triggerid,name from services order by name");
echo "<select class=\"biginput\" name=\"servicedownid\" size=1>";
@@ -397,7 +397,7 @@
echo "</SELECT>";
show_table2_v_delimiter();
- echo nbsp("Soft link ?");
+ echo nbsp(S_SOFT_LINK_Q);
show_table2_h_delimiter();
// if(isset($HTTP_GET_VARS["softlink"])&&($HTTP_GET_VARS["triggerid"]!=""))
// {
@@ -421,7 +421,7 @@
echo "<br>";
show_table2_header_begin();
- echo nbsp("Add server details");
+ echo nbsp(S_ADD_SERVER_DETAILS);
show_table2_v_delimiter();
echo "<form method=\"post\" action=\"services.php\">";
@@ -429,7 +429,7 @@
{
echo "<input name=\"serviceid\" type=\"hidden\" value=".$HTTP_GET_VARS["serviceid"].">";
}
- echo "Server";
+ echo S_SERVER;
show_table2_h_delimiter();
$result=DBselect("select hostid,host from hosts order by host");
echo "<select class=\"biginput\" name=\"hostid\" size=1>";
diff --git a/frontends/php/srv_status.php b/frontends/php/srv_status.php
index e0a08000..05e2273c 100644
--- a/frontends/php/srv_status.php
+++ b/frontends/php/srv_status.php
@@ -19,7 +19,7 @@
**/
?>
<?php
- $page["title"] = "High-level representation of monitored data";
+ $page["title"] = S_IT_SERVICES;
$page["file"] = "srv_status.php";
include "include/config.inc.php";
@@ -27,7 +27,7 @@
?>
<?php
- show_table_header("IT SERVICES");
+ show_table_header(S_IT_SERVICES_BIG);
if(isset($HTTP_GET_VARS["serviceid"])&&isset($HTTP_GET_VARS["showgraph"]))
{
@@ -48,12 +48,12 @@
echo "<table border=0 width=100% bgcolor='#CCCCCC' cellspacing=1 cellpadding=3>";
echo "\n";
echo "<tr>";
- echo "<td width=40%><b>Service</b></td>";
- echo "<td width=10%><b>Status</b></td>";
- echo "<td><b>Reason</b></td>";
- echo "<td width=20%><b>SLA (last 7 days)</b></td>";
- echo "<td width=10% align=center><b>Planned/current&nbsp;SLA</b></td>";
- echo "<td width=5%><b>Graph</b></td>";
+ echo "<td width=40%><b>".S_SERVICE."</b></td>";
+ echo "<td width=10%><b>".S_STATUS."</b></td>";
+ echo "<td><b>".S_REASON."</b></td>";
+ echo "<td width=20%><b>".S_SLA_LAST_7_DAYS."</b></td>";
+ echo "<td width=10% align=center><b>".nbsp(S_PLANNED_CURRENT_SLA)."</b></td>";
+ echo "<td width=5%><b>".S_GRAPH."</b></td>";
echo "</tr>";
echo "\n";
$col=0;
@@ -129,7 +129,7 @@
// {
$description=nbsp(expand_trigger_description($row["triggerid"]));
// }
- $description="[<a href=\"alarms.php?triggerid=".$row["triggerid"]."\">TRIGGER</a>] $description";
+ $description="[<a href=\"alarms.php?triggerid=".$row["triggerid"]."\">".S_TRIGGER_BIG."</a>] $description";
}
else
{
diff --git a/frontends/php/tr_comments.php b/frontends/php/tr_comments.php
index 2c1a1439..fde6d328 100644
--- a/frontends/php/tr_comments.php
+++ b/frontends/php/tr_comments.php
@@ -19,7 +19,7 @@
**/
?>
<?php
- $page["title"] = "Trigger comments";
+ $page["title"] = S_TRIGGER_COMMENTS;
$page["file"] = "tr_comments.php";
include "include/config.inc.php";
@@ -28,14 +28,14 @@
<?php
if(!check_right("Trigger comment","R",$HTTP_GET_VARS["triggerid"]))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
?>
<?php
- show_table_header("TRIGGER COMMENTS");
+ show_table_header(S_TRIGGER_COMMENTS_BIG);
echo "<br>";
?>
@@ -43,7 +43,7 @@
if(isset($HTTP_GET_VARS["register"]) && ($HTTP_GET_VARS["register"]=="update"))
{
$result=update_trigger_comments($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["comments"]);
- show_messages($result,"Trigger comment updated","Cannot update trigger comment");
+ show_messages($result, S_COMMENT_UPDATED, S_CANNO_UPDATE_COMMENT);
}
?>
@@ -54,12 +54,12 @@
<?php
show_table2_header_begin();
- echo "Comments";
+ echo S_COMMENTS;
show_table2_v_delimiter();
echo "<form method=\"get\" action=\"tr_comments.php\">";
echo "<input name=\"triggerid\" type=\"hidden\" value=".$HTTP_GET_VARS["triggerid"].">";
- echo "Comments";
+ echo S_COMMENTS;
show_table2_h_delimiter();
echo "<textarea name=\"comments\" cols=100 ROWS=\"25\" wrap=\"soft\">$comments</TEXTAREA>";
diff --git a/frontends/php/tr_status.php b/frontends/php/tr_status.php
index 275f4653..e28e001b 100644
--- a/frontends/php/tr_status.php
+++ b/frontends/php/tr_status.php
@@ -19,7 +19,7 @@
**/
?>
<?php
- $page["title"] = "Status of triggers";
+ $page["title"] = S_STATUS_OF_TRIGGERS;
$page["file"] = "tr_status.php";
include "include/config.inc.php";
@@ -93,13 +93,13 @@
<?php
if(!check_anyright("Host","R"))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
if(isset($HTTP_GET_VARS["hostid"])&&!check_right("Host","R",$HTTP_GET_VARS["hostid"]))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font>");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
@@ -179,17 +179,17 @@
if(!isset($HTTP_GET_VARS["fullscreen"]))
{
show_table_header_begin();
- echo "STATUS OF TRIGGERS";
+ echo S_STATUS_OF_TRIGGERS_BIG;
show_table_v_delimiter();
$result=DBselect("select hostid,host from hosts where status in (0,2) order by host");
if(isset($HTTP_GET_VARS["hostid"]))
{
- echo "<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">all</A> ";
+ echo "<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".S_ALL_SMALL."</A> ";
}
else
{
- echo "<b>[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">all</A>]</b> ";
+ echo "<b>[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".S_ALL_SMALL."</A>]</b> ";
}
while($row=DBfetch($result))
{
@@ -222,36 +222,36 @@
if($onlytrue!='true')
{
- echo "[<A HREF=\"tr_status.php?onlytrue=true&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">Show only true</a>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=true&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_SHOW_ONLY_TRUE."</a>] ";
}
else
{
- echo "[<A HREF=\"tr_status.php?noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">Show all triggers</A>] ";
+ echo "[<A HREF=\"tr_status.php?noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_SHOW_ALL_TRIGGERS."</A>] ";
}
if($noactions!='true')
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=true&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">Hide Actions</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=true&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_HIDE_ACTIONS."</A>] ";
}
else
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=false&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">Show Actions</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=false&compact=$compact&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_SHOW_ACTIONS."</A>] ";
}
if($compact!='true')
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=true&select=$select&txt_select=$txt_select&sort=$sort$cond\">Hide Details</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=true&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_HIDE_DETAILS."</A>] ";
}
else
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=false&select=$select&txt_select=$txt_select&sort=$sort$cond\">Show Details</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=false&select=$select&txt_select=$txt_select&sort=$sort$cond\">".S_SHOW_DETAILS."</A>] ";
}
if($select!='true')
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=true&txt_select=$txt_select&sort=$sort$cond\">Select</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=true&txt_select=$txt_select&sort=$sort$cond\">".S_SELECT."</A>] ";
}
else
{
- echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=false&sort=$sort$cond\">Hide Select</A>] ";
+ echo "[<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=false&sort=$sort$cond\">".S_HIDE_SELECT."</A>] ";
show_table_v_delimiter();
echo "<form name=\"form1\" method=\"get\" action=\"tr_status.php?select=true\">
<input class=\"biginput\" type=\"text\" name=\"txt_select\" value=\"$txt_select\">
@@ -270,7 +270,7 @@
$time=date("[H:i:s]",time());
if(isset($HTTP_GET_VARS["fullscreen"]))
{
- show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">TRIGGERS $time</A>");
+ show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&sort=$sort\">".S_TRIGGERS_BIG." $time</A>");
$cond="";
if(isset($HTTP_GET_VARS["hostid"]))
@@ -301,18 +301,18 @@
}
echo "\n<TABLE BORDER=0 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=0>";
echo "<TR ALIGN=CENTER>";
- echo "<TD><B>Not classified: $p0</B></TD>";
- echo "<TD><B>Information: $p1</B></TD>";
- echo "<TD><B>Warning: $p2</B></TD>";
- echo "<TD BGCOLOR=#DDAAAA><B>Average: $p3</B></TD>";
- echo "<TD BGCOLOR=#FF8888><B>High: $p4</B></TD>";
- echo "<TD BGCOLOR=RED><B>Disaster: $p5</B></TD>";
+ table_td("<B>".S_NOT_CLASSIFIED.": $p0</B>","");
+ table_td("<B>".S_INFORMATION.": $p1</B>","");
+ table_td("<B>".S_WARNING.": $p2</B>","");
+ table_td("<B>".S_AVERAGE.": $p3</B>","BGCOLOR=#DDAAAA");
+ table_td("<B>".S_HIGH.": $p4</B>","BGCOLOR=#FF8888");
+ table_td("<B>".S_DISASTER.": $p5</B>","BGCOLOR=RED");
echo "</TR>";
echo "</TABLE>";
}
else
{
- show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&fullscreen=1&sort=$sort\">TRIGGERS $time</A>");
+ show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions=$noactions&compact=$compact&fullscreen=1&sort=$sort\">".S_TRIGGERS_BIG." $time</A>");
}
echo "<TABLE BORDER=0 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
@@ -328,37 +328,37 @@
}
if(isset($sort) && $sort=="description")
{
- echo "<TD ALIGN=LEFT><B>DESCRIPTION";
+ echo "<TD ALIGN=LEFT><B>".S_DESCRIPTION_BIG;
}
else
{
if($select=="TRUE")
{
- echo "<TD ALIGN=LEFT><B><A HREF=\"tr_status.php?sort=description&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">Description</a>";
+ echo "<TD ALIGN=LEFT><B><A HREF=\"tr_status.php?sort=description&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">".S_DESCRIPTION."</a>";
}
else
{
- echo "<TD ALIGN=LEFT><B><A HREF=\"tr_status.php?sort=description&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">Description</a>";
+ echo "<TD ALIGN=LEFT><B><A HREF=\"tr_status.php?sort=description&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">".S_DESCRIPTION."</a>";
}
}
- if($compact!='true') {echo "<BR><FONT SIZE=-1>Expression</FONT></B>";}
+ if($compact!='true') {echo "<BR><FONT SIZE=-1>".S_EXPRESSION."</FONT></B>";}
echo "</TD>";
- echo "<TD WIDTH=5%><B>Status</B></TD>";
+ table_td("<B>".S_STATUS."</B>","WIDTH=%5");
if(!isset($sort)||(isset($sort) && $sort=="priority"))
{
- echo "<TD WIDTH=9% ALIGN=CENTER><B>SEVERITY</B></TD>";
+ echo "<TD WIDTH=9% ALIGN=CENTER><B>".S_SEVERITY_BIG."</B></TD>";
}
else
{
if($select=="TRUE")
{
- echo "<TD ALIGN=CENTER><B><A HREF=\"tr_status.php?sort=priority&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">Severity</a>";
+ echo "<TD ALIGN=CENTER><B><A HREF=\"tr_status.php?sort=priority&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">".S_SEVERITY."</a>";
}
else
{
- echo "<TD ALIGN=CENTER><B><A HREF=\"tr_status.php?sort=priority&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">Severity</a>";
+ echo "<TD ALIGN=CENTER><B><A HREF=\"tr_status.php?sort=priority&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">".S_SEVERITY."</a>";
}
}
if($noactions=='true')
@@ -368,26 +368,26 @@
if(isset($sort) && $sort=="lastchange")
{
- echo "<B>LAST CHANGE";
+ echo "<B>".S_LAST_CHANGE_BIG;
}
else
{
if($select=="TRUE")
{
- echo "<B><A HREF=\"tr_status.php?sort=lastchange&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">Last change</a>";
+ echo "<B><A HREF=\"tr_status.php?sort=lastchange&onlytrue=$onlytrue&noactions=$noactions&compact=$compact&select=$select&txt_select=$txt_select$fullscreen$cond\">".S_LAST_CHANGE."</a>";
}
else
{
- echo "<B><A HREF=\"tr_status.php?sort=lastchange&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">Last change</a>";
+ echo "<B><A HREF=\"tr_status.php?sort=lastchange&onlytrue=$onlytrue&noactions=$noactions&compact=$compact$fullscreen$cond\">".S_LAST_CHANGE."</a>";
}
}
echo "</TD>";
if($noactions!='true')
{
- echo "<TD WIDTH=8% NOSAVE><B>Actions</B></TD>";
+ echo "<TD WIDTH=8% NOSAVE><B>".S_ACTIONS."</B></TD>";
}
- echo "<TD WIDTH=9%><B>Comments</B></TD>";
+ echo "<TD WIDTH=9%><B>".S_COMMENTS."</B></TD>";
echo "</TR>\n";
if(isset($HTTP_GET_VARS["hostid"]))
@@ -489,12 +489,12 @@
else
{ echo "<TD ALIGN=CENTER>$blink1<FONT COLOR=\"AA0000\">TRUE</FONT>$blink2</TD>"; }
- if($row["priority"]==0) echo "<TD ALIGN=CENTER>Not classified</TD>";
- elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>Information</TD>";
- elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>Warning</TD>";
- elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>Average</TD>";
- elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>High</TD>";
- elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED>Disaster !!!</TD>";
+ if($row["priority"]==0) echo "<TD ALIGN=CENTER>".S_NOT_CLASSIFIED."</TD>";
+ elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>".S_INFORMATION."</TD>";
+ elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>".S_WARNING."</TD>";
+ elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>".S_AVERAGE."</TD>";
+ elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>".S_HIGH."</TD>";
+ elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED>".S_DISASTER."</TD>";
else echo "<TD ALIGN=CENTER><B>".$row["priority"]."</B></TD>";
echo "<TD ALIGN=CENTER><A HREF=\"alarms.php?triggerid=".$row["triggerid"]."\">".date("d M H:i:s",$row["lastchange"])."</a>";
@@ -503,32 +503,32 @@
if($noactions!='true')
{
echo "<TD>";
- echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">Show actions</A> - ";
- echo "<A HREF=\"alarms.php?triggerid=".$row["triggerid"]."\">History</A> - ";
+ echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">".S_SHOW_ACTIONS."</A> - ";
+ echo "<A HREF=\"alarms.php?triggerid=".$row["triggerid"]."\">".S_HISTORY."</A> - ";
if(isset($HTTP_GET_VARS["hostid"]))
{
- echo "<A HREF=\"triggers.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."#form\">Change</A>";
+ echo "<A HREF=\"triggers.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A>";
}
else
{
- echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">Change</A>";
+ echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A>";
}
echo "</TD>";
}
if($row["comments"] != "")
{
- echo "<TD ALIGN=CENTER><A HREF=\"tr_comments.php?triggerid=".$row["triggerid"]."\">Show</a></TD>";
+ echo "<TD ALIGN=CENTER><A HREF=\"tr_comments.php?triggerid=".$row["triggerid"]."\">".S_SHOW."</a></TD>";
}
else
{
- echo "<TD ALIGN=CENTER><A HREF=\"tr_comments.php?triggerid=".$row["triggerid"]."\">Add</a></TD>";
+ echo "<TD ALIGN=CENTER><A HREF=\"tr_comments.php?triggerid=".$row["triggerid"]."\">".S_ADD."</a></TD>";
}
if($row["value"] == 0) echo "</TR>\n";
cr();
}
echo "</TABLE>";
- show_table_header("Total:$col");
+ show_table_header(S_TOTAL.":$col");
?>
<?php
diff --git a/frontends/php/triggers.php b/frontends/php/triggers.php
index 0d3ee781..6294e385 100644
--- a/frontends/php/triggers.php
+++ b/frontends/php/triggers.php
@@ -19,11 +19,12 @@
**/
?>
<?php
- $page["title"] = "Configuration of triggers";
- $page["file"] = "triggers.php";
-
include "include/config.inc.php";
include "include/forms.inc.php";
+
+ $page["title"] = S_CONFIGURATION_OF_TRIGGERS;
+ $page["file"] = "triggers.php";
+
show_header($page["title"],0,0);
insert_confirm_javascript();
?>
@@ -31,8 +32,7 @@
<?php
if(!check_anyright("Host","U"))
{
- show_table_header("<font color=\"AA0000\">No permissions !</font
->");
+ show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>");
show_footer();
exit;
}
@@ -45,17 +45,17 @@
if($HTTP_GET_VARS["register"]=="add dependency")
{
$result=add_trigger_dependency($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["depid"]);
- show_messages($result,"Dependency added","Cannot add dependency");
+ show_messages($result, S_DEPENDENCY_ADDED, S_CANNOT_ADD_DEPENDENCY);
}
if($HTTP_GET_VARS["register"]=="delete dependency")
{
$result=delete_trigger_dependency($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["dependency"]);
- show_messages($result,"Dependency deleted","Cannot delete dependency");
+ show_messages($result, S_DEPENDENCY_DELETED, S_CANNOT_DELETE_DEPENDENCY);
}
if($HTTP_GET_VARS["register"]=="changestatus")
{
$result=update_trigger_status($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["status"]);
- show_messages($result,"Trigger status updated","Cannot update trigger status");
+ show_messages($result, S_STATUS_UPDATED, S_CANNOT_UPDATE_STATUS);
unset($HTTP_GET_VARS["triggerid"]);
}
if($HTTP_GET_VARS["register"]=="enable selected")
@@ -68,7 +68,7 @@
$result2=update_trigger_status($row["triggerid"],0);
}
}
- show_messages(TRUE,"Triggers enabled","Cannot enable triggers");
+ show_messages(TRUE, S_TRIGGERS_ENABLED, S_CANNOT_UPDATE_TRIGGERS);
}
if($HTTP_GET_VARS["register"]=="disable selected")
{
@@ -80,7 +80,7 @@
$result2=update_trigger_status($row["triggerid"],1);
}
}
- show_messages(TRUE,"Triggers disabled","Cannot disable triggers");
+ show_messages(TRUE, S_TRIGGERS_DISABLED, S_CANNOT_DISABLE_TRIGGERS);
}
if($HTTP_GET_VARS["register"]=="delete selected")
{
@@ -92,7 +92,7 @@
$result2=delete_trigger($row["triggerid"]);
}
}
- show_messages(TRUE,"Triggers deleted","Cannot delete triggers");
+ show_messages(TRUE, S_TRIGGERS_DELETED, S_CANNOT_DELETE_TRIGGERS);
}
if($HTTP_GET_VARS["register"]=="update")
{
@@ -103,11 +103,11 @@
else { $status=0; }
$result=update_trigger($HTTP_GET_VARS["triggerid"],$HTTP_GET_VARS["expression"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["priority"],$status,$HTTP_GET_VARS["comments"],$HTTP_GET_VARS["url"]);
- show_messages($result,"Trigger updated","Cannot update trigger");
+ show_messages($result, S_TRIGGER_UPDATED, S_CANNOT_UPDATE_TRIGGER);
}
else
{
- show_error_message("Invalid trigger expression");
+ show_error_message(S_INVALID_TRIGGER_EXPRESSION);
}
unset($HTTP_GET_VARS["triggerid"]);
}
@@ -119,18 +119,18 @@
else { $status=0; }
$result=add_trigger($HTTP_GET_VARS["expression"],$HTTP_GET_VARS["description"],$HTTP_GET_VARS["priority"],$status,$HTTP_GET_VARS["comments"],$HTTP_GET_VARS["url"]);
- show_messages($result,"Trigger added","Cannot add trigger");
+ show_messages($result, S_TRIGGER_ADDED, S_CANNOT_ADD_TRIGGER);
}
else
{
- show_error_message("Invalid trigger expression");
+ show_error_message(S_INVALID_TRIGGER_EXPRESSION);
}
unset($HTTP_GET_VARS["triggerid"]);
}
if($HTTP_GET_VARS["register"]=="delete")
{
$result=delete_trigger($HTTP_GET_VARS["triggerid"]);
- show_messages($result,"Trigger deleted","Cannot delete trigger");
+ show_messages($result, S_TRIGGER_DELETED, S_CANNOT_DELETE_TRIGGER);
unset($HTTP_GET_VARS["triggerid"]);
}
}
@@ -138,52 +138,50 @@
<?php
show_table_header_begin();
- echo "CONFIGURATION OF TRIGGERS";
+ echo S_CONFIGURATION_OF_TRIGGERS_BIG;
show_table_v_delimiter();
-// echo "<font size=2>";
- if(isset($HTTP_GET_VARS["groupid"]))
- {
-// echo "all ";
- echo "<a href='triggers.php'>all</a> ";
- }
- else
+// Start of new code
+ echo "<form name=\"form2\" method=\"get\" action=\"triggers.php\">";
+
+ if(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==0))
{
- echo "<b>[<a href='triggers.php'>all</a>]</b> ";
+ unset($HTTP_GET_VARS["groupid"]);
}
- $result=DBselect("select groupid,name from groups order by name");
+ echo S_GROUP."&nbsp;";
+ echo "<select class=\"biginput\" name=\"groupid\" onChange=\"submit()\">";
+ echo "<option value=\"0\" ".iif(!isset($HTTP_GET_VARS["groupid"]),"selected","").">".S_ALL_SMALL;
+ $result=DBselect("select groupid,name from groups order by name");
while($row=DBfetch($result))
{
-// if(!check_right("Host","R",$row["hostid"]))
-// {
-// continue;
-// }
- if( isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+// Check if at least one host with read permission exists for this group
+ $result2=DBselect("select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$row["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host");
+ $cnt=0;
+ while($row2=DBfetch($result2))
{
- echo "<b>[";
+ if(!check_right("Host","U",$row2["hostid"]))
+ {
+ continue;
+ }
+ $cnt=1; break;
}
- echo "<a href='triggers.php?groupid=".$row["groupid"]."'>".$row["name"]."</a>";
- if(isset($HTTP_GET_VARS["groupid"]) && ($HTTP_GET_VARS["groupid"] == $row["groupid"]) )
+ if($cnt!=0)
{
- echo "]</b>";
+ echo "<option value=\"".$row["groupid"]."\" ".iif(isset($HTTP_GET_VARS["groupid"])&&($HTTP_GET_VARS["groupid"]==$row["groupid"]),"selected","").">".$row["name"];
}
- echo " ";
}
-?>
+ echo "</select>";
+
+ echo "&nbsp;".S_HOST."&nbsp;";
+ echo "<select class=\"biginput\" name=\"hostid\" onChange=\"submit()\">";
+
+ $sql=iif(isset($HTTP_GET_VARS["groupid"]),
+ "select h.hostid,h.host from hosts h,items i,hosts_groups hg where h.status in (0,2) and h.hostid=i.hostid and hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid group by h.hostid,h.host order by h.host",
+ "select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host");
-<?php
- show_table_v_delimiter();
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- $sql="select h.hostid,h.host from hosts h,hosts_groups hg where hg.groupid=".$HTTP_GET_VARS["groupid"]." and hg.hostid=h.hostid order by h.host";
- }
- else
- {
- $sql="select hostid,host from hosts order by host";
- }
$result=DBselect($sql);
while($row=DBfetch($result))
{
@@ -191,24 +189,12 @@
{
continue;
}
- if(isset($HTTP_GET_VARS["hostid"]) && ($row["hostid"] == $HTTP_GET_VARS["hostid"]))
- {
- echo "<b>[";
- }
- if(isset($HTTP_GET_VARS["groupid"]))
- {
- echo "<A HREF=\"triggers.php?hostid=".$row["hostid"]."&groupid=".$HTTP_GET_VARS["groupid"]."\">".$row["host"]."</A>";
- }
- else
- {
- echo "<A HREF=\"triggers.php?hostid=".$row["hostid"]."\">".$row["host"]."</A>";
- }
- if(isset($HTTP_GET_VARS["hostid"]) && ($row["hostid"] == $HTTP_GET_VARS["hostid"]))
- {
- echo "]</b>";
- }
- echo " ";
+ echo "<option value=\"".$row["hostid"]."\"".iif(isset($HTTP_GET_VARS["hostid"])&&($HTTP_GET_VARS["hostid"]==$row["hostid"]),"selected","").">".$row["host"];
}
+ echo "</select>";
+
+ echo "</form>";
+// end of new code
show_table_header_end();
?>
@@ -240,11 +226,11 @@
echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>";
echo "<TR>";
echo "<TD WIDTH=\"8%\"><B>Id</B></TD>";
- echo "<TD><B>Description</B></TD>";
- echo "<TD><B>Expression</B></TD>";
- echo "<TD WIDTH=5%><B>Severity</B></TD>";
- echo "<TD WIDTH=5%><B>Status</B></TD>";
- echo "<TD WIDTH=15% NOSAVE><B>Actions</B></TD>";
+ echo "<TD><B>".S_DESCRIPTION."</B></TD>";
+ echo "<TD><B>".S_EXPRESSION."</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_SEVERITY."</B></TD>";
+ echo "<TD WIDTH=5%><B>".S_STATUS."</B></TD>";
+ echo "<TD WIDTH=15% NOSAVE><B>".S_ACTIONS."</B></TD>";
echo "</TR>\n";
}
$lasthost=$row["host"];
@@ -263,26 +249,26 @@
echo "<TD>".explode_exp($row["expression"],1)."</TD>";
- if($row["priority"]==0) echo "<TD ALIGN=CENTER>Not classified</TD>";
- elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>Information</TD>";
- elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>Warning</TD>";
- elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>Average</TD>";
- elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>High</TD>";
- elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED>Disaster !!!</TD>";
+ if($row["priority"]==0) echo "<TD ALIGN=CENTER>".S_NOT_CLASSIFIED."</TD>";
+ elseif($row["priority"]==1) echo "<TD ALIGN=CENTER>".S_INFORMATION."</TD>";
+ elseif($row["priority"]==2) echo "<TD ALIGN=CENTER>".S_WARNING."</TD>";
+ elseif($row["priority"]==3) echo "<TD ALIGN=CENTER BGCOLOR=#DDAAAA>".S_AVERAGE."</TD>";
+ elseif($row["priority"]==4) echo "<TD ALIGN=CENTER BGCOLOR=#FF8888>".S_HIGH."</TD>";
+ elseif($row["priority"]==5) echo "<TD ALIGN=CENTER BGCOLOR=RED>".S_DISASTER."</TD>";
else echo "<TD ALIGN=CENTER><B>".$row["priority"]."</B></TD>";
echo "<TD>";
if($row["status"] == 1)
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=0&hostid=".$row["hostid"]."\"><font color=\"AA0000\">Disabled</font></a>";
+ echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=0&hostid=".$row["hostid"]."\"><font color=\"AA0000\">".S_DISABLED."</font></a>";
}
else if($row["status"] == 2)
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"AAAAAA\">Unknown</font></a>";
+ echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"AAAAAA\">".S_UNKNOWN."</font></a>";
}
else
{
- echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"00AA00\">Enabled</font></a>";
+ echo "<a href=\"triggers.php?register=changestatus&triggerid=".$row["triggerid"]."&status=1&hostid=".$row["hostid"]."\"><font color=\"00AA00\">".S_ENABLED."</font></a>";
}
$expression=rawurlencode($row["expression"]);
echo "</TD>";
@@ -290,11 +276,11 @@
echo "<TD>";
if(isset($HTTP_GET_VARS["hostid"]))
{
- echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."&hostid=".$row["hostid"]."#form\">Change</A> ";
+ echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."&hostid=".$row["hostid"]."#form\">".S_CHANGE."</A> ";
}
else
{
- echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">Change</A> ";
+ echo "<A HREF=\"triggers.php?triggerid=".$row["triggerid"]."#form\">".S_CHANGE."</A> ";
}
echo "-";
if(get_action_count_by_triggerid($row["triggerid"])>0)
@@ -303,16 +289,16 @@
}
else
{
- echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">Actions</A>";
+ echo "<A HREF=\"actions.php?triggerid=".$row["triggerid"]."\">".S_ACTIONS."</A>";
}
echo "</TD>";
echo "</TR>";
}
echo "</table>";
show_table2_header_begin();
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"enable selected\" onClick=\"return Confirm('Enable selected triggers?');\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"enable selected\" onClick=\"return Confirm('".S_ENABLE_SELECTED_TRIGGERS_Q."');\">";
echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"disable selected\" onClick=\"return Confirm('Disable selected triggers?');\">";
- echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete selected\" onClick=\"return Confirm('Delete selected triggers?');\">";
+ echo "<input class=\"button\" type=\"submit\" name=\"register\" value=\"delete selected\" onClick=\"return Confirm('".S_DISABLE_SELECTED_TRIGGERS_Q."');\">";
show_table2_header_end();
echo "</form>";
}
diff --git a/frontends/php/users.php b/frontends/php/users.php
index 3448d71d..035b6cc3 100644
--- a/frontends/php/users.php
+++ b/frontends/php/users.php
@@ -19,11 +19,12 @@
**/
?>
<?php
+ include "include/config.inc.php";
+ include "include/forms.inc.php";
+
$page["title"] = S_USERS;
$page["file"] = "users.php";
- include "include/config.inc.php";
- include "include/forms.inc.php";
show_header($page["title"],0,0);
insert_confirm_javascript();
?>
@@ -184,14 +185,9 @@
$sql="select count(*) as count from sessions where userid=".$row["userid"]." and lastaccess-600<".time();
$result2=DBselect($sql);
$row2=DBfetch($result2);
- if($row2["count"]>0)
- {
- echo "<TD><font color=\"00AA00\">".S_YES."</font></TD>";
- }
- else
- {
- echo "<TD><font color=\"AA0000\">".S_NO."</font></TD>";
- }
+ iif_echo($row2["count"]>0,
+ "<TD><font color=\"00AA00\">".S_YES."</font></TD>",
+ "<TD><font color=\"AA0000\">".S_NO."</font></TD>");
echo "<TD>";
if(check_right("User","U",$row["userid"]))
{
@@ -206,7 +202,7 @@
}
else
{
- echo S_CHANGE." - ".S_MEDIA";
+ echo S_CHANGE." - ".S_MEDIA;
}
echo "</TD>";
echo "</TR>";