From 400140ceb21e1f141ebfd62afa145cbc4ee2901d Mon Sep 17 00:00:00 2001 From: artem Date: Mon, 16 Jun 2008 10:42:29 +0000 Subject: - [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 --- frontends/php/include/db.inc.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'frontends/php/include/db.inc.php') 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; } -- cgit