summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-19 08:52:05 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-05-19 08:52:05 +0000
commit425b813a558e0dbcca70416a7b440c1590cd3673 (patch)
tree940584c3268c2c87cc8713272d9e37d98512d85f
parent5ea1687a67685fe34875967075bbd422b2d0137a (diff)
downloadzabbix-425b813a558e0dbcca70416a7b440c1590cd3673.tar.gz
zabbix-425b813a558e0dbcca70416a7b440c1590cd3673.tar.xz
zabbix-425b813a558e0dbcca70416a7b440c1590cd3673.zip
-[DEV-137] sql fixes for oracle (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5708 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--create/schema/schema.sql2
-rw-r--r--frontends/php/dashboard.php2
-rw-r--r--frontends/php/include/blocks.inc.php98
-rw-r--r--frontends/php/include/db.inc.php2
-rw-r--r--frontends/php/include/graphs.inc.php2
-rw-r--r--frontends/php/include/items.inc.php2
-rw-r--r--frontends/php/include/maps.inc.php2
-rw-r--r--frontends/php/include/profiles.inc.php54
-rw-r--r--frontends/php/include/screens.inc.php4
9 files changed, 84 insertions, 84 deletions
diff --git a/create/schema/schema.sql b/create/schema/schema.sql
index 70f34a6c..6beb7cea 100644
--- a/create/schema/schema.sql
+++ b/create/schema/schema.sql
@@ -554,7 +554,7 @@ FIELD |userid |t_id |'0' |NOT NULL |ZBX_SYNC
FIELD |idx |t_varchar(64) |'' |NOT NULL |ZBX_SYNC
FIELD |value |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
FIELD |value2 |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
-FIELD |resource |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
+FIELD |source |t_varchar(255) |'' |NOT NULL |ZBX_SYNC
FIELD |valuetype |t_integer |0 |NOT NULL |ZBX_SYNC
INDEX |1 |idx
diff --git a/frontends/php/dashboard.php b/frontends/php/dashboard.php
index 53258258..e73c9ea3 100644
--- a/frontends/php/dashboard.php
+++ b/frontends/php/dashboard.php
@@ -394,7 +394,7 @@ include_once "include/page_header.php";
$fav_form->AddOption('style','display: inline; margin: 0px;');
$fav_form->AddVar('favobj','');
$fav_form->AddVar('favid','');
- $fav_form->AddVar('resource','');
+ $fav_form->AddVar('source','');
$fav_form->Show();
$jsmenu = new CPUMenu(null,170);
diff --git a/frontends/php/include/blocks.inc.php b/frontends/php/include/blocks.inc.php
index fac98a0b..1cced043 100644
--- a/frontends/php/include/blocks.inc.php
+++ b/frontends/php/include/blocks.inc.php
@@ -32,38 +32,38 @@ function make_favorite_graphs(){
foreach($fav_graphs as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if('itemid' == $resource){
- if(!$item = get_item_by_itemid($resourceid)) continue;
+ if('itemid' == $source){
+ if(!$item = get_item_by_itemid($sourceid)) continue;
- $host = get_host_by_itemid($resourceid);
+ $host = get_host_by_itemid($sourceid);
$item["description"] = item_description($item["description"],$item["key_"]);
- $link = new CLink($host['host'].':'.$item['description'],'history.php?action=showgraph&itemid='.$resourceid);
+ $link = new CLink($host['host'].':'.$item['description'],'history.php?action=showgraph&itemid='.$sourceid);
$link->SetTarget('blank');
$capt = new CSpan($link);
$capt->AddOption('style','line-height: 14px; vertical-align: middle;');
- $icon = new CLink(new CImg('images/general/chart.png','chart',18,18,'borderless'),'history.php?action=showgraph&itemid='.$resourceid.'&fullscreen=1');
+ $icon = new CLink(new CImg('images/general/chart.png','chart',18,18,'borderless'),'history.php?action=showgraph&itemid='.$sourceid.'&fullscreen=1');
$icon->SetTarget('blank');
}
else{
- if(!$graph = get_graph_by_graphid($resourceid)) continue;
- if(!graph_accessible($resourceid)) continue;
+ if(!$graph = get_graph_by_graphid($sourceid)) continue;
+ if(!graph_accessible($sourceid)) continue;
- $result = get_hosts_by_graphid($resourceid);
+ $result = get_hosts_by_graphid($sourceid);
$ghost = DBFetch($result);
- $link = new CLink($ghost['host'].':'.$graph['name'],'charts.php?graphid='.$resourceid);
+ $link = new CLink($ghost['host'].':'.$graph['name'],'charts.php?graphid='.$sourceid);
$link->SetTarget('blank');
$capt = new CSpan($link);
$capt->AddOption('style','line-height: 14px; vertical-align: middle;');
- $icon = new CLink(new CImg('images/general/chart.png','chart',18,18,'borderless'),'charts.php?graphid='.$resourceid.'&fullscreen=1');
+ $icon = new CLink(new CImg('images/general/chart.png','chart',18,18,'borderless'),'charts.php?graphid='.$sourceid.'&fullscreen=1');
$icon->SetTarget('blank');
}
@@ -88,33 +88,33 @@ function make_favorite_screens(){
$fav_screens = get_multi_profile('web.favorite.screenids');
foreach($fav_screens as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if('slideshowid' == $resource){
- if(!$slide = get_slideshow_by_slideshowid($resourceid)) continue;
- if(!slideshow_accessible($resourceid, PERM_READ_ONLY)) continue;
+ if('slideshowid' == $source){
+ if(!$slide = get_slideshow_by_slideshowid($sourceid)) continue;
+ if(!slideshow_accessible($sourceid, PERM_READ_ONLY)) continue;
- $link = new CLink($slide['name'],'screens.php?config=1&elementid='.$resourceid);
+ $link = new CLink($slide['name'],'screens.php?config=1&elementid='.$sourceid);
$link->SetTarget('blank');
$capt = new CSpan($link);
$capt->AddOption('style','line-height: 14px; vertical-align: middle;');
- $icon = new CLink(new CImg('images/general/chart.png','screen',18,18,'borderless'),'screens.php?config=1&elementid='.$resourceid.'&fullscreen=1');
+ $icon = new CLink(new CImg('images/general/chart.png','screen',18,18,'borderless'),'screens.php?config=1&elementid='.$sourceid.'&fullscreen=1');
$icon->SetTarget('blank');
}
else{
- if(!$screen = get_screen_by_screenid($resourceid)) continue;
- if(!screen_accessible($resourceid, PERM_READ_ONLY)) continue;
+ if(!$screen = get_screen_by_screenid($sourceid)) continue;
+ if(!screen_accessible($sourceid, PERM_READ_ONLY)) continue;
- $link = new CLink($screen['name'],'screens.php?config=0&elementid='.$resourceid);
+ $link = new CLink($screen['name'],'screens.php?config=0&elementid='.$sourceid);
$link->SetTarget('blank');
$capt = new CSpan($link);
$capt->AddOption('style','line-height: 14px; vertical-align: middle;');
- $icon = new CLink(new CImg('images/general/chart.png','screen',18,18,'borderless'),'screens.php?config=0&elementid='.$resourceid.'&fullscreen=1');
+ $icon = new CLink(new CImg('images/general/chart.png','screen',18,18,'borderless'),'screens.php?config=0&elementid='.$sourceid.'&fullscreen=1');
$icon->SetTarget('blank');
}
@@ -141,19 +141,19 @@ function make_favorite_maps(){
foreach($fav_sysmaps as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if(!$sysmap = get_sysmap_by_sysmapid($resourceid)) continue;
- if(!sysmap_accessible($resourceid,PERM_READ_ONLY)) continue;
+ if(!$sysmap = get_sysmap_by_sysmapid($sourceid)) continue;
+ if(!sysmap_accessible($sourceid,PERM_READ_ONLY)) continue;
- $link = new CLink($sysmap['name'],'maps.php?sysmapid='.$resourceid);
+ $link = new CLink($sysmap['name'],'maps.php?sysmapid='.$sourceid);
$link->SetTarget('blank');
$capt = new CSpan($link);
$capt->AddOption('style','line-height: 14px; vertical-align: middle;');
- $icon = new CLink(new CImg('images/general/chart.png','map',18,18,'borderless'),'maps.php?sysmapid='.$resourceid.'&fullscreen=1');
+ $icon = new CLink(new CImg('images/general/chart.png','map',18,18,'borderless'),'maps.php?sysmapid='.$sourceid.'&fullscreen=1');
$icon->SetTarget('blank');
$table->AddRow(new CCol(array(
@@ -881,36 +881,36 @@ function make_graph_submenu(){
foreach($fav_graphs as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if('itemid' == $resource){
- if(!$item = get_item_by_itemid($resourceid)) continue;
+ if('itemid' == $source){
+ if(!$item = get_item_by_itemid($sourceid)) continue;
$item_added = true;
- $host = get_host_by_itemid($resourceid);
+ $host = get_host_by_itemid($sourceid);
$item["description"] = item_description($item["description"],$item["key_"]);
$graphids[] = array(
'name' => $host['host'].':'.$item['description'],
'favobj'=> 'itemid',
- 'favid' => $resourceid,
+ 'favid' => $sourceid,
'action'=> 'remove'
);
}
else{
- if(!$graph = get_graph_by_graphid($resourceid)) continue;
+ if(!$graph = get_graph_by_graphid($sourceid)) continue;
$graph_added = true;
- $result = get_hosts_by_graphid($resourceid);
+ $result = get_hosts_by_graphid($sourceid);
$ghost = DBFetch($result);
$graphids[] = array(
'name' => $ghost['host'].':'.$graph['name'],
'favobj'=> 'graphid',
- 'favid' => $resourceid,
+ 'favid' => $sourceid,
'action'=> 'remove'
);
}
@@ -964,15 +964,15 @@ function make_sysmap_submenu(){
foreach($fav_sysmaps as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if(!$sysmap = get_sysmap_by_sysmapid($resourceid)) continue;
+ if(!$sysmap = get_sysmap_by_sysmapid($sourceid)) continue;
$sysmapids[] = array(
'name' => $sysmap['name'],
'favobj'=> 'sysmapid',
- 'favid' => $resourceid,
+ 'favid' => $sourceid,
'action'=> 'remove'
);
}
@@ -1030,29 +1030,29 @@ function make_screen_submenu(){
$fav_screens = get_multi_profile('web.favorite.screenids');
foreach($fav_screens as $key => $favorite){
- $resource = $favorite['resource'];
- $resourceid = $favorite['value'];
+ $source = $favorite['source'];
+ $sourceid = $favorite['value'];
- if('slideshowid' == $resource){
- if(!$slide = get_slideshow_by_slideshowid($resourceid)) continue;
+ if('slideshowid' == $source){
+ if(!$slide = get_slideshow_by_slideshowid($sourceid)) continue;
$slide_added = true;
$screenids[] = array(
'name' => $slide['name'],
'favobj'=> 'slideshowid',
- 'favid' => $resourceid,
+ 'favid' => $sourceid,
'action'=> 'remove'
);
}
else{
- if(!$screen = get_screen_by_screenid($resourceid)) continue;
+ if(!$screen = get_screen_by_screenid($sourceid)) continue;
$screen_added = true;
$screenids[] = array(
'name' => $screen['name'],
'favobj'=> 'screenid',
- 'favid' => $resourceid,
+ 'favid' => $sourceid,
'action'=> 'remove'
);
}
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index 9656de35..2a6fbb47 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -74,7 +74,7 @@
break;
case "ORACLE":
$DB['DB']= ociplogon($DB['USER'], $DB['PASSWORD'], $DB['DATABASE']);
-// $DB['DB']= ociplogon($DB['USER'], $DB['PASSWORD'], "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$DB['SERVER'])(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=$DB['DATABASE'])))");
+// $DB['DB']= ociplogon($DB['USER'], $DB['PASSWORD'], '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST='.$DB['SERVER'].')(PORT=1521))(CONNECT_DATA=(SERVICE_NAME='.$DB['DATABASE'].')))');
if(!$DB['DB']){
$error = "Error connecting to database";
$result = false;
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index f4574efe..71a69bd9 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -645,7 +645,7 @@
/* delete graph */
$result &= DBexecute('DELETE FROM graphs_items WHERE graphid='.$graphid);
$result &= DBexecute('DELETE FROM graphs WHERE graphid='.$graphid);
- $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.graphids" AND resource="graphid" AND value='.$graphid);
+ $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.graphids" AND source="graphid" AND value='.$graphid);
if($result){
info('Graph "'.$graph['name'].'" deleted from hosts '.implode(',',$host_list));
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index 60efb68b..4334d7d4 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -809,7 +809,7 @@
$result &= DBexecute('delete from items_applications where itemid='.$itemid);
$result &= DBexecute('delete from items where itemid='.$itemid);
- $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.graphids" AND resource="itemid" AND value='.$itemid);
+ $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.graphids" AND source="itemid" AND value='.$itemid);
if($result){
info("Item '".$host["host"].":".$item["key_"]."' deleted");
diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
index 6cc8999d..27d27737 100644
--- a/frontends/php/include/maps.inc.php
+++ b/frontends/php/include/maps.inc.php
@@ -194,7 +194,7 @@
}
$result = DBexecute('delete FROM sysmaps_elements WHERE sysmapid='.$sysmapid);
- $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.sysmapids" AND resource="sysmapid" AND value='.$sysmapid);
+ $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.sysmapids" AND source="sysmapid" AND value='.$sysmapid);
$result &= DBexecute('DELETE FROM sysmaps WHERE sysmapid='.$sysmapid);
return $result;
diff --git a/frontends/php/include/profiles.inc.php b/frontends/php/include/profiles.inc.php
index e1302641..47f94164 100644
--- a/frontends/php/include/profiles.inc.php
+++ b/frontends/php/include/profiles.inc.php
@@ -22,7 +22,7 @@
/********** USER PROFILE ***********/
//---------- GET USER VALUE -------------
-function get_profile($idx,$default_value=null,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
+function get_profile($idx,$default_value=null,$type=PROFILE_TYPE_UNKNOWN,$source=null){
global $USER_DETAILS;
$result = $default_value;
@@ -32,7 +32,7 @@ function get_profile($idx,$default_value=null,$type=PROFILE_TYPE_UNKNOWN,$resour
' FROM profiles '.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource)).
+ (is_null($source)?'':' AND source='.zbx_dbstr($source)).
' ORDER BY profileid ASC';
$db_profiles = DBselect($sql);
@@ -57,17 +57,17 @@ return $result;
// multi value
-function get_multi_profile($idx,$default_value=array(),$type=PROFILE_TYPE_UNKNOWN,$resource=null){
+function get_multi_profile($idx,$default_value=array(),$type=PROFILE_TYPE_UNKNOWN,$source=null){
global $USER_DETAILS;
$result = $default_value;
if($USER_DETAILS["alias"]!=ZBX_GUEST_USER){
- $sql = 'SELECT value,value2,resource,valuetype '.
+ $sql = 'SELECT value,value2,source,valuetype '.
' FROM profiles '.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource)).
+ (is_null($source)?'':' AND source='.zbx_dbstr($source)).
' ORDER BY profileid ASC';
$db_profiles = DBselect($sql);
@@ -91,7 +91,7 @@ return $result;
}
//----------- ADD/EDIT USERPROFILE -------------
-function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
+function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$source=null){
global $USER_DETAILS;
if($USER_DETAILS["alias"]==ZBX_GUEST_USER){
@@ -111,7 +111,7 @@ function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
DBExecute($sql);
foreach($value as $id => $val){
- insert_profile($idx,$val,$type,$resource);
+ insert_profile($idx,$val,$type,$source);
}
}
else{
@@ -119,18 +119,18 @@ function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
' FROM profiles '.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource));
+ (is_null($source)?'':' AND source='.zbx_dbstr($source));
$row = DBfetch(DBselect($sql));
if(!$row){
- insert_profile($idx,$value,$type,$resource);
+ insert_profile($idx,$value,$type,$source);
}
else{
$sql='UPDATE profiles SET value='.zbx_dbstr($value).',valuetype='.$type.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource));
+ (is_null($source)?'':' AND source='.zbx_dbstr($source));
DBexecute($sql);
}
}
@@ -140,7 +140,7 @@ function update_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
return $result;
}
-function update_multi_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=null){
+function update_multi_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$source=null){
global $USER_DETAILS;
if($USER_DETAILS["alias"]==ZBX_GUEST_USER){
@@ -164,7 +164,7 @@ function update_multi_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=n
DBExecute($sql);
foreach($value as $id => $val){
- insert_profile($idx,$val,$type,$resource);
+ insert_profile($idx,$val,$type,$source);
}
}
else {
@@ -172,26 +172,26 @@ function update_multi_profile($idx,$value,$type=PROFILE_TYPE_UNKNOWN,$resource=n
' FROM profiles '.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource));
+ (is_null($source)?'':' AND source='.zbx_dbstr($source));
$row = DBfetch(DBselect($sql));
if(!$row){
- insert_profile($idx,$value,$type,$resource);
+ insert_profile($idx,$value,$type,$source);
}
else{
$val1 = isset($value['value'])?$value['value']:'';
$val2 = isset($value['value2'])?$value['value2']:'';
- $rsrc = isset($value['resource'])?$value['resource']:(is_null($resource)?'':resource);
+ $rsrc = isset($value['source'])?$value['source']:(is_null($source)?'':source);
$sql='UPDATE profiles '.
' SET value='.zbx_dbstr($val1).
',value2='.zbx_dbstr($val2).
- ',resource='.zbx_dbstr($rsrc).
+ ',source='.zbx_dbstr($rsrc).
',valuetype='.$type.
' WHERE userid='.$USER_DETAILS["userid"].
' AND idx='.zbx_dbstr($idx).
- (is_null($resource)?'':' AND resource='.zbx_dbstr($resource));
+ (is_null($source)?'':' AND source='.zbx_dbstr($source));
DBexecute($sql);
}
}
@@ -203,14 +203,14 @@ return $result;
// Author: Aly
-function insert_profile($idx,$value,$type,$resource=null){
+function insert_profile($idx,$value,$type,$source=null){
global $USER_DETAILS;
$profileid = get_dbid('profiles', 'profileid');
$val1 = $value;
$val2 = '';
- $rsrc = is_null($resource)?'':$resource;
+ $rsrc = is_null($source)?'':$source;
if(($type == PROFILE_TYPE_MULTI_ARRAY) ||
($type == PROFILE_TYPE_MULTI) ||
@@ -218,12 +218,12 @@ function insert_profile($idx,$value,$type,$resource=null){
{
$val1 = isset($value['value'])?$value['value']:'';
$val2 = isset($value['value2'])?$value['value2']:'';
- $rsrc = isset($value['resource'])?$value['resource']:$rsrc;
+ $rsrc = isset($value['source'])?$value['source']:$rsrc;
}
if(is_null($val1)) return false;
- $sql='INSERT INTO profiles (profileid,userid,idx,value,value2,resource,valuetype)'.
+ $sql='INSERT INTO profiles (profileid,userid,idx,value,value2,source,valuetype)'.
' VALUES ('.$profileid.','.
$USER_DETAILS["userid"].','.
zbx_dbstr($idx).','.
@@ -329,24 +329,24 @@ return $result;
/********** USER FAVORITES ***********/
// Author: Aly
-function add2favorites($favobj,$favid,$resource=null){
+function add2favorites($favobj,$favid,$source=null){
$favorites = get_multi_profile($favobj);
$favorites[] = array('value' => $favid);
- $result = update_multi_profile($favobj,$favorites,PROFILE_TYPE_MULTI_ARRAY,$resource);
+ $result = update_multi_profile($favobj,$favorites,PROFILE_TYPE_MULTI_ARRAY,$source);
return $result;
}
// Author: Aly
-function rm4favorites($favobj,$favid,$favcnt=null,$resource=null){
+function rm4favorites($favobj,$favid,$favcnt=null,$source=null){
$favorites = get_multi_profile($favobj);
$favcnt = (is_null($favcnt))?0:$favcnt;
if($favid == 0) $favcnt = ZBX_FAVORITES_ALL;
foreach($favorites as $key => $favorite){
- if(((bccomp($favid,$favorite['value']) == 0) || ($favid == 0)) && ($favorite['resource'] == $resource)){
+ if(((bccomp($favid,$favorite['value']) == 0) || ($favid == 0)) && ($favorite['source'] == $source)){
if($favcnt < 1){
unset($favorites[$key]);
if($favcnt > ZBX_FAVORITES_ALL) break; // foreach
@@ -360,13 +360,13 @@ return $result;
}
// Author: Aly
-function infavorites($favobj,$favid,$resource=null){
+function infavorites($favobj,$favid,$source=null){
$favorites = get_multi_profile($favobj);
if(!empty($favorites)){
foreach($favorites as $id => $favorite){
if(bccomp($favid,$favorite['value']) == 0){
- if(is_null($resource) || ($favorite['resource'] == $resource))
+ if(is_null($source) || ($favorite['source'] == $source))
return true;
}
}
diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php
index 9e2a48eb..5a92c8ec 100644
--- a/frontends/php/include/screens.inc.php
+++ b/frontends/php/include/screens.inc.php
@@ -108,7 +108,7 @@
$result=DBexecute('delete from screens_items where screenid='.$screenid);
$result&=DBexecute('delete from screens_items where resourceid='.$screenid.' and resourcetype='.SCREEN_RESOURCE_SCREEN);
$result&=DBexecute('delete from slides where screenid='.$screenid);
- $result&=DBexecute('DELETE FROM profiles WHERE idx="web.favorite.screenids" AND resource="screenid" AND value='.$screenid);
+ $result&=DBexecute('DELETE FROM profiles WHERE idx="web.favorite.screenids" AND source="screenid" AND value='.$screenid);
$result&=DBexecute('delete from screens where screenid='.$screenid);
return $result;
}
@@ -632,7 +632,7 @@
$result = DBexecute('delete from slideshows where slideshowid='.$slideshowid);
$result &= DBexecute('delete from slides where slideshowid='.$slideshowid);
- $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.screenids" AND resource="slideshowid" AND value='.$slideshowid);
+ $result &= DBexecute('DELETE FROM profiles WHERE idx="web.favorite.screenids" AND source="slideshowid" AND value='.$slideshowid);
return $result;
}