From cbb3323a0ad2ae65d0134e01b807faf8df99a2d2 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 11 Aug 2002 16:16:22 +0000 Subject: - added housekeeping procedure for table sessions (Alexei) - changed width=\"X%\" to width=X% in *.php (Alexei) - Status of a trigger will blink if it was changes during last 60 seconds (Alexei) - Zabbix daemons to update triggers.lastchange when triggers.values is changed (Alexei) - added misc/init.d/debian/zabbix-[suckerd|trapperd] (Alexei) - removed misc/init.d/debian/zabbix-server (Alexei) - send_email() will timeout after 10 seconds (Alexei) - DBadd_alarm() renamed to add_alarm() (Alexei) - support for SCO OpenServer (Alexei). Thanks to Alexender Kirhenstein. - ./configure will correctly define socklen_t (Alexei) -
changed to
(Alexei) - reason of problem in screen IT Services (Alexei) - added frontends.php/helpdesk.php (Alexei) - added tables: problems, problems_comments,categories (Alexei) - added "...#form" to button Change in form Configuration of Users (Alexei) - "Just for information" changed to "Information" (Alexei) - fixed ./configure to correctly find zlib (Alexei) - housekeeping to delete no more than HousekeepingFrequency*3600 records from table history and history_str at once (MySQL only) (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@450 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc.php | 197 ++++++++++++++++++++++++++++------- frontends/php/include/db.inc.php | 4 +- 2 files changed, 163 insertions(+), 38 deletions(-) (limited to 'frontends/php/include') diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 8bfc4dad..9588d061 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -5,6 +5,14 @@ $USER_DETAILS =""; $ERROR_MSG =""; + function get_media_count_by_userid($userid) + { + $sql="select count(*) as cnt from media where userid=$userid"; + $result=DBselect($sql); + $row=DBfetch($result); + return $row["cnt"]; + } + function check_right($right,$permission,$id) { global $USER_DETAILS; @@ -586,12 +594,12 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; { ?> - +
- +
- - - - - - - - + + - - - - - - - - - - - - + + + "; + $service=get_service_by_serviceid($serviceid); +# echo "Service status:".$service["status"]."
"; + if($service["status"]==0) + { + return FALSE; + } + if($serviceid==$serviceid2) + { + if($service["status"]>0) + { + return TRUE; + } + + } + + $sql="select serviceupid from services_links where servicedownid=$serviceid2 and soft=0"; +# echo $sql."
"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + if(does_service_depend_on_the_service($serviceid,$row["serviceupid"]) == TRUE) + { + return TRUE; + } + } + return FALSE; + } + function service_has_parent($serviceid) { $sql="select count(*) from services_links where servicedownid=$serviceid"; @@ -1366,7 +1446,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function add_host_to_services($hostid,$serviceid) { - $sql="select t.triggerid,t.description from triggers t,hosts h,items i,functions f where h.hostid=$hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid"; + $sql="select distinct t.triggerid,t.description from triggers t,hosts h,items i,functions f where h.hostid=$hostid and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid"; $result=DBselect($sql); while($row=DBfetch($result)) { @@ -2300,15 +2380,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function show_table2_header_begin() { - echo "
"; - cr(); - echo "
+ + + + + + + + + +"; + } + if($page["file"]=="helpdesk.php") + { + echo "[IT HELPDESK]"; + } + else + { + echo "IT HELPDESK"; + } +?> + +
+ + + +
+ + + + + + + + + +"; + } + if($page["file"]=="helpdesk.php") + { + echo "[IT HELPDESK]"; + } + else + { + echo "IT HELPDESK"; + } +?> + +
"; + echo "
"; cr(); echo ""; cr(); echo "
"; cr(); - echo ""; + echo "
"; cr(); echo ""; cr(); @@ -2320,13 +2398,13 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; function show_table_header_begin() { - echo "
"; + echo "
"; cr(); echo ""; cr(); echo "
"; cr(); - echo ""; + echo "
"; cr(); echo ""; cr(); @@ -2352,8 +2430,6 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; cr(); echo "
"; cr(); - echo ""; - cr(); } function show_table_header_end() @@ -2536,7 +2612,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; } // echo("
"); echo "
"; - echo ""; + echo "
"; echo ""; echo ""; echo "
"; @@ -2922,6 +2998,55 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; show_table2_header_end(); } + # Insert form for Problem + function insert_problem_form($problemid) + { + echo "
"; + + show_table2_header_begin(); + echo "Problem definition"; + show_table2_v_delimiter(); + echo "
"; + echo ""; + echo "Description"; + show_table2_h_delimiter(); + echo ""; + + show_table2_v_delimiter(); + echo "Priority"; + show_table2_h_delimiter(); + echo ""; + + show_table2_v_delimiter(); + echo "Status"; + show_table2_h_delimiter(); + echo ""; + + show_table2_v_delimiter2(); + echo ""; + if(isset($problemid)) + { + echo ""; + echo ""; + } + + show_table2_header_end(); + } + # Insert form for Trigger function insert_trigger_form($hostid,$triggerid) { @@ -2975,7 +3100,7 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; show_table2_h_delimiter(); echo ""; + echo "
"; echo ""; echo "
"; - echo ""; + echo "
"; echo ""; - echo ""; echo ""; diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index e3cc63f3..41a2df96 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -28,7 +28,7 @@ { global $DB,$DB_TYPE; -// echo $query,"
"; +# echo $query,"
"; if($DB_TYPE == "MYSQL") { @@ -46,7 +46,7 @@ { global $DB,$DB_TYPE; -// echo $query,"
"; +# echo $query,"
"; if($DB_TYPE == "MYSQL") { -- cgit
"; echo ""; echo "ZABBIX Copyright 2000,2001,2002 by Alexei Vladishev"; echo ""; echo ""; + echo ""; echo "| Connected as ".$USER_DETAILS["alias"]; echo "