summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-06 08:07:12 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-06 08:07:12 +0000
commitad1a369bf8eea09ea538004977728308ecdbea01 (patch)
tree4f8793f1351fece538593818e2ebd39a912f8a95 /frontends/php/include
parent944f390978cb23baf6db90f5809d8ad18d37ecb5 (diff)
downloadzabbix-ad1a369bf8eea09ea538004977728308ecdbea01.tar.gz
zabbix-ad1a369bf8eea09ea538004977728308ecdbea01.tar.xz
zabbix-ad1a369bf8eea09ea538004977728308ecdbea01.zip
- [DEV-137] fixes in screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5878 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/blocks.inc.php3
-rw-r--r--frontends/php/include/db.inc.php2
-rw-r--r--frontends/php/include/screens.inc.php4
3 files changed, 7 insertions, 2 deletions
diff --git a/frontends/php/include/blocks.inc.php b/frontends/php/include/blocks.inc.php
index fcd127d5..c8826467 100644
--- a/frontends/php/include/blocks.inc.php
+++ b/frontends/php/include/blocks.inc.php
@@ -449,7 +449,7 @@ return $table;
function make_latest_issues(){
global $USER_DETAILS;
- $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_IDS_ARRAY);
+// $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_IDS_ARRAY);
$available_triggers = get_accessible_triggers(PERM_READ_ONLY,PERM_RES_IDS_ARRAY);
$scripts_by_hosts = get_accessible_scripts_by_hosts($available_hosts);
@@ -479,6 +479,7 @@ function make_latest_issues(){
' AND h.status='.HOST_STATUS_MONITORED.
' AND t.value='.TRIGGER_VALUE_TRUE.
' ORDER BY t.lastchange DESC';
+//SDI($sql);
$result = DBselect($sql);
while($row=DBfetch($result)){
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index 2dcec73f..15a12348 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -730,6 +730,8 @@ else {
function DBcondition($fieldname, &$array, $notin=false){
global $DB;
$condition = '';
+
+//if(!is_array($array)) SDI('OPA: '.$fieldname.' : '.$array);
$in = $notin?' NOT IN ':' IN ';
$concat = $notin?' AND ':' OR ';
diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php
index 2fb7b9ce..18bacbf9 100644
--- a/frontends/php/include/screens.inc.php
+++ b/frontends/php/include/screens.inc.php
@@ -30,7 +30,7 @@
if(DBfetch(DBselect('SELECT screenid FROM screens WHERE screenid='.$screenid.' AND '.DBin_node('screenid', get_current_nodeid($perm))))){
$result = true;
- $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_RES_IDS_ARRAY);
+ $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,$perm,PERM_RES_IDS_ARRAY);
$db_result = DBselect('SELECT * FROM screens_items WHERE screenid='.$screenid);
while(($ac_data = DBfetch($db_result)) && $result){
@@ -51,6 +51,8 @@
case SCREEN_RESOURCE_PLAIN_TEXT:
if(!isset($itemid))
$itemid = array($ac_data['resourceid']);
+ else if(!is_array($itemid))
+ $itemid = array($itemid);
if(DBfetch(DBselect('SELECT itemid '.
' FROM items '.