Pārlūkot izejas kodu

Allow TriggerOnPortalUpdate to work also on derived classes: i.e a trigger defined for the class 'Ticket' will be called when a 'UserRequest' (derived from Ticket) will be updated from the portal.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1509 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 gadi atpakaļ
vecāks
revīzija
b46bf220ed
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      portal/index.php

+ 3 - 1
portal/index.php

@@ -977,7 +977,9 @@ function AddComment($oP, $id)
 		$oP->p("<h1>".Dict::Format('UI:Class_Object_Updated', MetaModel::GetName(get_class($oRequest)), $oRequest->GetName())."</h1>\n");
 		
 		// If there is any trigger for the Portal Update, then activate them
-		$sOQL = "SELECT TriggerOnPortalUpdate WHERE target_class ='UserRequest'";
+		$aClasses = MetaModel::EnumParentClasses(get_class($oRequest), ENUM_PARENT_CLASSES_ALL);
+		$aClasses = CMDBSource::Quote($aClasses);
+		$sOQL = "SELECT TriggerOnPortalUpdate WHERE target_class IN (".implode(',', $aClasses).")";
 		$oSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL));
 		while($oTrigger = $oSet->Fetch())
 		{