New type of trigger: TriggerOnPortalUpdate, called when the end-user updates a ticket from the portal.

SVN:trunk[1420]
This commit is contained in:
Denis Flaven
2011-08-03 10:36:34 +00:00
parent 3ccbeac996
commit 5d8acbb41a
5 changed files with 58 additions and 8 deletions

View File

@@ -353,6 +353,12 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
}
$oPage->SetCurrentTab('');
foreach (MetaModel::EnumPlugins('iApplicationUIExtension') as $oExtensionInstance)
{
$oExtensionInstance->OnDisplayRelations($this, $oPage, $bEditMode);
}
// Display Notifications after the other tabs since this tab disappears in edition
if (!$bEditMode)
{
// Get the actual class of the current object
@@ -364,19 +370,16 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
$oTriggerSet = new CMDBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnObject AS T WHERE T.target_class IN ('$sClassList')"));
if ($oTriggerSet->Count() > 0)
{
$oPage->SetCurrentTab(Dict::S('UI:NotificationsTab'));
// Display notifications regarding the object
$iId = $this->GetKey();
$oBlock = new DisplayBlock(DBObjectSearch::FromOQL("SELECT EventNotificationEmail AS Ev JOIN TriggerOnObject AS T ON Ev.trigger_id = T.id WHERE T.target_class IN ('$sClassList') AND Ev.object_id = $iId"), 'list', false);
$oNotifSearch = DBObjectSearch::FromOQL("SELECT EventNotificationEmail AS Ev JOIN TriggerOnObject AS T ON Ev.trigger_id = T.id WHERE T.target_class IN ('$sClassList') AND Ev.object_id = $iId");
$oNotifSet = new DBObjectSet($oNotifSearch);
$sCount = ($oNotifSet->Count() > 0) ? ' ('.$oNotifSet->Count().')' : '';
$oPage->SetCurrentTab(Dict::S('UI:NotificationsTab').$sCount);
$oBlock = new DisplayBlock($oNotifSearch, 'list', false);
$oBlock->Display($oPage, 'notifications', array('menu' => false));
}
}
foreach (MetaModel::EnumPlugins('iApplicationUIExtension') as $oExtensionInstance)
{
$oExtensionInstance->OnDisplayRelations($this, $oPage, $bEditMode);
}
}
function GetBareProperties(WebPage $oPage, $bEditMode = false)