summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
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;