N°3335 - Notifications on threshold don't work when trigger is created on iTop 2.7.1

This commit is contained in:
acognet
2020-09-29 09:12:47 +02:00
parent 794d4f1e0e
commit 80b3212a19

View File

@@ -607,10 +607,11 @@ class CheckStopWatchThresholds implements iBackgroundProcess
// Activate any existing trigger
//
$sClassList = implode("', '", MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL));
$oTriggerSet = new DBObjectSet(
DBObjectSearch::FromOQL("SELECT TriggerOnThresholdReached AS t WHERE t.target_class IN ('$sClassList') AND stop_watch_code=:stop_watch_code AND threshold_index = :threshold_index"),
DBObjectSearch::FromOQL("SELECT TriggerOnThresholdReached AS t WHERE t.target_class IN ('$sClassList') AND stop_watch_code MATCHES '$sAttCode' AND threshold_index = :threshold_index"),
array(), // order by
array('stop_watch_code' => $sAttCode, 'threshold_index' => $iThreshold)
array('threshold_index' => $iThreshold)
);
while ($oTrigger = $oTriggerSet->Fetch())
{