summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-06-16 10:42:29 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-06-16 10:42:29 +0000
commit400140ceb21e1f141ebfd62afa145cbc4ee2901d (patch)
tree28b3a1dd8f334272dc25dcbe7aa3912915d817ae /frontends/php/include
parent5603bd407a6fc337ca523ac7f372588f3c645162 (diff)
downloadzabbix-400140ceb21e1f141ebfd62afa145cbc4ee2901d.tar.gz
zabbix-400140ceb21e1f141ebfd62afa145cbc4ee2901d.tar.xz
zabbix-400140ceb21e1f141ebfd62afa145cbc4ee2901d.zip
- [DEV-181] temp expression on triggers copy changed from {???:???} to 0 (Artem)
- [DEV-137] improvements in user operation result determination in hosts,triggers,items screens (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5769 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/db.inc.php16
-rw-r--r--frontends/php/include/triggers.inc.php6
2 files changed, 14 insertions, 8 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index 69621042..49f52478 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -268,19 +268,25 @@ if(!isset($DB)){
$DB['TRANSACTIONS'] = 0;
- if(empty($result))
- $result = $DB['TRANSACTION_STATE'];
+ if(is_null($result)){
+ $DBresult = $DB['TRANSACTION_STATE'];
+ }
+ else{
+ $DBresult = $result && $DB['TRANSACTION_STATE'];
+ }
//SDI('Result: '.$result);
- if($result){ // OK
- $result = DBcommit();
+ if($DBresult){ // OK
+ $DBresult = DBcommit();
}
- if(!$result){ // FAIL
+ if(!$DBresult){ // FAIL
DBrollback();
}
+ $result = (!is_null($result) && $DBresult)?$result:$DBresult;
+
return $result;
}
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php
index 88d2d07d..3936f408 100644
--- a/frontends/php/include/triggers.inc.php
+++ b/frontends/php/include/triggers.inc.php
@@ -808,9 +808,9 @@
* Comments: !!! Don't forget sync code with C !!! *
* *
******************************************************************************/
- function replace_template_dependencies($deps, $hostid){
+ function replace_template_dependencies($deps, $hostid){
foreach($deps as $id => $val){
- if($db_new_dep = DBfetch(DBselect('SEELCT t.triggerid '.
+ if($db_new_dep = DBfetch(DBselect('SELECT t.triggerid '.
' FROM triggers t,functions f,items i '.
' WHERE t.templateid='.$val.
' AND f.triggerid=t.triggerid '.
@@ -871,7 +871,7 @@
' (triggerid,description,type,priority,status,comments,url,value,expression,templateid)'.
' VALUES ('.$newtriggerid.','.zbx_dbstr($trigger['description']).','.$trigger['type'].','.$trigger['priority'].','.
$trigger["status"].','.zbx_dbstr($trigger["comments"]).','.
- zbx_dbstr($trigger["url"]).",2,'{???:???}',".($copy_mode ? 0 : $triggerid).')');
+ zbx_dbstr($trigger["url"]).",2,'0',".($copy_mode ? 0 : $triggerid).')');
if(!$result)
return $result;