diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 733c42255..dcf8c8abf 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -805,16 +805,16 @@ HTML if (!$this->IsNew()) { // Look for any trigger that considers this object as "In Scope" // If any trigger has been found then display a tab with notifications - // + // If all triggers on an object have been deleted, we consider that we no longer need the event notification information $aTriggers = $this->GetRelatedTriggersIDs(); if (count($aTriggers) > 0) { $iId = $this->GetKey(); - $aParams = array('triggers' => $aTriggers, 'id' => $iId); + $aParams = array('class' => get_class($this), 'id' => $iId); $aNotifSearches = array(); $iNotifsCount = 0; $aNotificationClasses = MetaModel::EnumChildClasses('EventNotification'); foreach ($aNotificationClasses as $sNotifClass) { - $aNotifSearches[$sNotifClass] = DBObjectSearch::FromOQL("SELECT $sNotifClass AS Ev JOIN Trigger AS T ON Ev.trigger_id = T.id WHERE T.id IN (:triggers) AND Ev.object_id = :id"); + $aNotifSearches[$sNotifClass] = DBObjectSearch::FromOQL("SELECT $sNotifClass AS Ev WHERE Ev.object_id = :id AND Ev.object_class = :class"); $aNotifSearches[$sNotifClass]->SetInternalParams($aParams); $oNotifSet = new DBObjectSet($aNotifSearches[$sNotifClass], array()); $iNotifsCount += $oNotifSet->Count(); diff --git a/core/action.class.inc.php b/core/action.class.inc.php index 524d6a59f..9bf37241e 100644 --- a/core/action.class.inc.php +++ b/core/action.class.inc.php @@ -566,6 +566,7 @@ class ActionEmail extends ActionNotification $oLog->Set('trigger_id', $oTrigger->GetKey()); $oLog->Set('action_id', $this->GetKey()); $oLog->Set('object_id', $aContextArgs['this->object()']->GetKey()); + $oLog->Set('object_class', get_class($aContextArgs['this->object()'])); // Must be inserted now so that it gets a valid id that will make the link // between an eventual asynchronous task (queued) and the log $oLog->DBInsertNoReload(); diff --git a/core/event.class.inc.php b/core/event.class.inc.php index 90d900257..41c626a7e 100644 --- a/core/event.class.inc.php +++ b/core/event.class.inc.php @@ -131,7 +131,7 @@ class EventNotification extends Event "db_finalclass_field" => "", "order_by_default" => array('date' => false), 'indexes' => array( - array('object_id'), + array( 'object_class', 'object_id'), ) ); MetaModel::Init_Params($aParams); @@ -139,9 +139,11 @@ class EventNotification extends Event MetaModel::Init_AddAttribute(new AttributeExternalKey("trigger_id", array("targetclass"=>"Trigger", "jointype"=> "", "allowed_values"=>null, "sql"=>"trigger_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array()))); MetaModel::Init_AddAttribute(new AttributeExternalKey("action_id", array("targetclass" => "Action", "jointype" => "", "allowed_values" => null, "sql" => "action_id", "is_null_allowed" => false, "on_target_delete" => DEL_AUTO, "depends_on" => array()))); MetaModel::Init_AddAttribute(new AttributeInteger("object_id", array("allowed_values" => null, "sql" => "object_id", "default_value" => 0, "is_null_allowed" => false, "depends_on" => array()))); + //@since 3.2.0 + MetaModel::Init_AddAttribute(new AttributeClass("object_class", array("class_category"=>"", "more_values"=>"", "sql"=>"object_class", "default_value"=>null, "is_null_allowed"=>true /*to avoid setting AbstractResource as default in database*/, "depends_on"=>array()))); // Display lists - MetaModel::Init_SetZListItems('details', array('date', 'message', 'userinfo', 'trigger_id', 'action_id', 'object_id')); // Attributes to be displayed for the complete details + MetaModel::Init_SetZListItems('details', array('date', 'message', 'userinfo', 'trigger_id', 'action_id', 'object_class', 'object_id')); // Attributes to be displayed for the complete details MetaModel::Init_SetZListItems('list', array('date', 'message')); // Attributes to be displayed for a list // Search criteria // MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form @@ -176,7 +178,7 @@ class EventNotificationEmail extends EventNotification MetaModel::Init_AddAttribute(new AttributeTable("attachments", array("allowed_values"=>null, "sql"=>"attachments", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); // Display lists - MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body', 'attachments')); // Attributes to be displayed for the complete details + MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_class', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body', 'attachments')); // Attributes to be displayed for the complete details MetaModel::Init_SetZListItems('list', array('date', 'message', 'to', 'subject', 'attachments')); // Attributes to be displayed for a list // Search criteria diff --git a/datamodels/2.x/itop-structure/module.itop-structure.php b/datamodels/2.x/itop-structure/module.itop-structure.php index f2d72272e..8c6363e1c 100644 --- a/datamodels/2.x/itop-structure/module.itop-structure.php +++ b/datamodels/2.x/itop-structure/module.itop-structure.php @@ -401,6 +401,54 @@ if (!class_exists('StructureInstaller')) $oAction->Set('message', $aData['message']); $oAction->DBWrite(); } + + //N°824 - Fill object_class in EventNotification from the Triggers target_class + if (version_compare($sPreviousVersion, '3.2.0', '<')) { + SetupLog::Info("Filling object_class in EventNotification from the Triggers target_class"); + $iNbProcessed = 0; + + $sTableToSet = MetaModel::DBGetTable('EventNotification', 'object_class'); + $oAttDefToSet = MetaModel::GetAttributeDef('EventNotification', 'object_class'); + $oAttDefObjectId = MetaModel::GetAttributeDef('EventNotification', 'object_id'); + $oAttDefTriggerId = MetaModel::GetAttributeDef('EventNotification', 'trigger_id'); + + $aColumnsToSets = array_keys($oAttDefToSet->GetSQLColumns()); + $sColumnToSet = $aColumnsToSets[0]; // We know that a string has only one column + $aColumnsTriggerId = array_keys($oAttDefTriggerId->GetSQLColumns()); + $sColumnTriggerId = $aColumnsTriggerId[0]; // We know that a string has only one column + $aColumnsObjectd = array_keys($oAttDefObjectId->GetSQLColumns()); + $sColumnObjectId = $aColumnsObjectd[0]; // We know that a string has only one column + + + $oSearch = DBObjectSearch::FromOQL('SELECT TriggerOnObject'); + $oSet = new DBObjectSet($oSearch); + $aTriggerIdToTargetClass = []; + while ($oTrigger = $oSet->Fetch()) { + $aTriggerIdToTargetClass[$oTrigger->GetKey()] = $oTrigger->Get('target_class'); + } + + foreach ($aTriggerIdToTargetClass as $sKey => $sTargetClass) { + + if (MetaModel::HasChildrenClasses($sTargetClass)) { + //in this case, we have toget the name of the final class + $sTableToRead = MetaModel::DBGetTable($sTargetClass, 'finalclass'); + $oAttDefToRead = MetaModel::GetAttributeDef($sTargetClass, 'finalclass'); + $aColumnsToReads = array_keys($oAttDefToRead->GetSQLColumns()); + $sColumnToRead = $aColumnsToReads[0]; // We know that a string has only one column + $sObjectPrimaryKey = MetaModel::DBGetKey($sTargetClass); + + $sRepair = "UPDATE `$sTableToSet` JOIN `$sTableToRead` ON `$sTableToSet`.`$sColumnObjectId` = `$sTableToRead`.`$sObjectPrimaryKey` SET `$sTableToSet`.`$sColumnToSet` = `$sTableToRead`.`$sColumnToRead` WHERE `$sTableToSet`.`$sColumnTriggerId` = '".$sKey."' AND `$sTableToSet`.`$sColumnToSet` = ''"; + } else { + + $sRepair = "UPDATE `$sTableToSet` SET `$sTableToSet`.`$sColumnToSet` = '".$sTargetClass."' WHERE `$sTableToSet`.`$sColumnTriggerId` = '".$sKey."' AND `$sTableToSet`.`$sColumnToSet` = ''"; + } + + SetupLog::Info(" | | Query: ".$sRepair); + CMDBSource::Query($sRepair); + $iNbProcessed += CMDBSource::AffectedRows(); + } + SetupLog::Info("| | ".$iNbProcessed." EventNotification processed."); + } } } } diff --git a/dictionaries/cs.dictionary.itop.core.php b/dictionaries/cs.dictionary.itop.core.php index 8dc22ed2f..3e95c1cc4 100755 --- a/dictionaries/cs.dictionary.itop.core.php +++ b/dictionaries/cs.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @author Lukáš Dvořák @@ -312,6 +312,8 @@ If omitted the From (label) is used.', 'Class:EventNotification/Attribute:object_id+' => '', 'Class:EventNotification/Attribute:trigger_id' => 'Triger', 'Class:EventNotification/Attribute:trigger_id+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Odeslání emailu', 'Class:EventNotificationEmail+' => '', 'Class:EventNotificationEmail/Attribute:attachments' => 'Přílohy', diff --git a/dictionaries/da.dictionary.itop.core.php b/dictionaries/da.dictionary.itop.core.php index 9ffb117da..dc26d990f 100644 --- a/dictionaries/da.dictionary.itop.core.php +++ b/dictionaries/da.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @author Erik Bøg @@ -311,6 +311,8 @@ If omitted the From (label) is used.~~', 'Class:EventNotification/Attribute:object_id+' => '', 'Class:EventNotification/Attribute:trigger_id' => 'Trigger', 'Class:EventNotification/Attribute:trigger_id+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Email emission hændelse', 'Class:EventNotificationEmail+' => '', 'Class:EventNotificationEmail/Attribute:attachments' => 'Vedhæftning(er)', diff --git a/dictionaries/de.dictionary.itop.core.php b/dictionaries/de.dictionary.itop.core.php index cf6aee56c..fa214dfd3 100644 --- a/dictionaries/de.dictionary.itop.core.php +++ b/dictionaries/de.dictionary.itop.core.php @@ -7,7 +7,7 @@ * @author Stephan Rosenke * @author Martin Raenker * @author Attila Baroti - * + * */ Dict::Add('DE DE', 'German', 'Deutsch', [ @@ -317,6 +317,12 @@ Dict::Add('DE DE', 'German', 'Deutsch', [ 'Class:EventNotificationEmail/Attribute:bcc+' => '', 'Class:EventNotificationEmail/Attribute:body' => 'Inhalt der Nachricht', 'Class:EventNotificationEmail/Attribute:body+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', + 'Class:EventNotificationEmail' => 'E-Mail Emission Event', + 'Class:EventNotificationEmail+' => 'Verfolgung einer E-Mail, die gesendet wurde', + 'Class:EventNotificationEmail/Attribute:to' => 'An', + 'Class:EventNotificationEmail/Attribute:to+' => '', 'Class:EventNotificationEmail/Attribute:cc' => 'Kopie an', 'Class:EventNotificationEmail/Attribute:cc+' => '', 'Class:EventNotificationEmail/Attribute:from' => 'Von', diff --git a/dictionaries/en.dictionary.itop.core.php b/dictionaries/en.dictionary.itop.core.php index e00d02366..8bca06e4a 100644 --- a/dictionaries/en.dictionary.itop.core.php +++ b/dictionaries/en.dictionary.itop.core.php @@ -377,7 +377,9 @@ Dict::Add('EN US', 'English', 'English', array( 'Class:EventNotification/Attribute:action_id' => 'Action', 'Class:EventNotification/Attribute:action_id+' => '', 'Class:EventNotification/Attribute:object_id' => 'Object id', - 'Class:EventNotification/Attribute:object_id+' => 'object id (class defined by the trigger ?)', + 'Class:EventNotification/Attribute:object_id+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)', )); // diff --git a/dictionaries/es_cr.dictionary.itop.core.php b/dictionaries/es_cr.dictionary.itop.core.php index 71a1a394d..2cb9932b9 100644 --- a/dictionaries/es_cr.dictionary.itop.core.php +++ b/dictionaries/es_cr.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @author Miguel Turrubiates @@ -307,6 +307,8 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [ 'Class:EventNotification/Attribute:object_id+' => 'Id de objeto (¿clase definida por el disparador?)', 'Class:EventNotification/Attribute:trigger_id' => 'Disparador', 'Class:EventNotification/Attribute:trigger_id+' => 'Disparador', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Correo Electrónico de Notificación de Evento', 'Class:EventNotificationEmail+' => 'Correo Electrónico de Notificación de Evento', 'Class:EventNotificationEmail/Attribute:attachments' => 'Anexos', diff --git a/dictionaries/fr.dictionary.itop.core.php b/dictionaries/fr.dictionary.itop.core.php index 79e02080b..c36784bc4 100644 --- a/dictionaries/fr.dictionary.itop.core.php +++ b/dictionaries/fr.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -322,11 +322,14 @@ Les mots-clés sous la forme :this->attcode spécifiant un champ de l\'objet aya 'Class:EventNotification+' => '', 'Class:EventNotification/Attribute:action_id' => 'Action', 'Class:EventNotification/Attribute:action_id+' => '', - 'Class:EventNotification/Attribute:object_id' => 'Objet', + 'Class:EventNotification/Attribute:object_id' => 'Identifiant de l\'objet', 'Class:EventNotification/Attribute:object_id+' => '', 'Class:EventNotification/Attribute:trigger_id' => 'Déclencheur', 'Class:EventNotification/Attribute:trigger_id+' => '', 'Class:EventNotificationEmail' => 'Mél envoyé', + 'Class:EventNotification/Attribute:object_class' => 'Classe de l\'objet', + 'Class:EventNotification/Attribute:object_class+' => 'Classe de l\'objet (la même que celle du déclencheur)', + 'Class:EventNotificationEmail' => 'Envoi d\'Email', 'Class:EventNotificationEmail+' => '', 'Class:EventNotificationEmail/Attribute:attachments' => 'Pièces jointes', 'Class:EventNotificationEmail/Attribute:attachments+' => '', diff --git a/dictionaries/hu.dictionary.itop.core.php b/dictionaries/hu.dictionary.itop.core.php index f7ba2e343..0f13da3f2 100755 --- a/dictionaries/hu.dictionary.itop.core.php +++ b/dictionaries/hu.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -306,6 +306,8 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [ 'Class:EventNotification/Attribute:object_id+' => 'Objektum azonosítója (eseményindító határozza meg az osztályt ?)', 'Class:EventNotification/Attribute:trigger_id' => 'Eseményindító', 'Class:EventNotification/Attribute:trigger_id+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Email küldés esemény', 'Class:EventNotificationEmail+' => 'A kiküldött email-ek nyomonkövetése', 'Class:EventNotificationEmail/Attribute:attachments' => 'Mellékletek', diff --git a/dictionaries/it.dictionary.itop.core.php b/dictionaries/it.dictionary.itop.core.php index 8ba24a9dc..a8c358f3d 100644 --- a/dictionaries/it.dictionary.itop.core.php +++ b/dictionaries/it.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -306,6 +306,8 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [ 'Class:EventNotification/Attribute:object_id+' => 'Id oggetto (classe definita dal trigger ?)', 'Class:EventNotification/Attribute:trigger_id' => 'Trigger', 'Class:EventNotification/Attribute:trigger_id+' => 'account utente', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Emissione evento Email', 'Class:EventNotificationEmail+' => 'Traccia di una e-mail che è stato inviata', 'Class:EventNotificationEmail/Attribute:attachments' => 'Allegati', diff --git a/dictionaries/ja.dictionary.itop.core.php b/dictionaries/ja.dictionary.itop.core.php index 481fafe19..82e19a181 100644 --- a/dictionaries/ja.dictionary.itop.core.php +++ b/dictionaries/ja.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -310,6 +310,8 @@ If omitted the From (label) is used.~~', 'Class:EventNotification/Attribute:object_id+' => 'オブジェクトID(トリガーでクラスが定義済み?)', 'Class:EventNotification/Attribute:trigger_id' => 'トリガー', 'Class:EventNotification/Attribute:trigger_id+' => 'ユーザアカウント', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'メール送出イベント', 'Class:EventNotificationEmail+' => '送出されたメールのトレース', 'Class:EventNotificationEmail/Attribute:attachments' => '添付', diff --git a/dictionaries/nl.dictionary.itop.core.php b/dictionaries/nl.dictionary.itop.core.php index 45610cb48..7c4e514bb 100644 --- a/dictionaries/nl.dictionary.itop.core.php +++ b/dictionaries/nl.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** @@ -309,6 +309,8 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', [ 'Class:EventNotification/Attribute:object_id+' => 'ID object (klasse gedefineerd door de trigger)', 'Class:EventNotification/Attribute:trigger_id' => 'Trigger', 'Class:EventNotification/Attribute:trigger_id+' => 'De trigger die de melding veroorzaakte', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Gebeurtenis - versturen van e-mail', 'Class:EventNotificationEmail+' => 'Historiek van de e-mail die verstuurd is', 'Class:EventNotificationEmail/Attribute:attachments' => 'Bijlagen', diff --git a/dictionaries/pl.dictionary.itop.core.php b/dictionaries/pl.dictionary.itop.core.php index 6bd00f443..afac1a3cf 100644 --- a/dictionaries/pl.dictionary.itop.core.php +++ b/dictionaries/pl.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -308,6 +308,8 @@ Dict::Add('PL PL', 'Polish', 'Polski', [ 'Class:EventNotification/Attribute:object_id+' => 'id obiektu (klasa zdefiniowana przez wyzwalacz?)', 'Class:EventNotification/Attribute:trigger_id' => 'Wyzwalacz', 'Class:EventNotification/Attribute:trigger_id+' => 'konto użytkownika', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Zdarzenie wysyłki wiadomości e-mail', 'Class:EventNotificationEmail+' => 'Ślad e-maila, który został wysłany', 'Class:EventNotificationEmail/Attribute:attachments' => 'Załączniki', diff --git a/dictionaries/pt_br.dictionary.itop.core.php b/dictionaries/pt_br.dictionary.itop.core.php index 57b1100a5..340b8a643 100644 --- a/dictionaries/pt_br.dictionary.itop.core.php +++ b/dictionaries/pt_br.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -306,6 +306,8 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ 'Class:EventNotification/Attribute:object_id+' => 'ID do objeto (classe definida pelo gatilho?)', 'Class:EventNotification/Attribute:trigger_id' => 'Gatilho', 'Class:EventNotification/Attribute:trigger_id+' => 'Conta de usuário', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Evento de envio de e-mail', 'Class:EventNotificationEmail+' => 'Controle de e-mails que foram enviados', 'Class:EventNotificationEmail/Attribute:attachments' => 'Anexos', diff --git a/dictionaries/ru.dictionary.itop.core.php b/dictionaries/ru.dictionary.itop.core.php index 6a7993c47..816c20f50 100644 --- a/dictionaries/ru.dictionary.itop.core.php +++ b/dictionaries/ru.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @author Vladimir Kunin @@ -311,6 +311,8 @@ If omitted the From (label) is used.~~', 'Class:EventNotification/Attribute:object_id+' => 'Идентификатор объекта целевого класса триггера', 'Class:EventNotification/Attribute:trigger_id' => 'Триггер', 'Class:EventNotification/Attribute:trigger_id+' => 'Сработавший триггер', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Уведомление по email', 'Class:EventNotificationEmail+' => 'Отслеживание уведомлений по email', 'Class:EventNotificationEmail/Attribute:attachments' => 'Вложения', diff --git a/dictionaries/sk.dictionary.itop.core.php b/dictionaries/sk.dictionary.itop.core.php index 20091586d..784039d88 100644 --- a/dictionaries/sk.dictionary.itop.core.php +++ b/dictionaries/sk.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -324,6 +324,9 @@ You can use in the OQL :this->attribute_code with an attribute code of the objec 'Class:EventNotification/Attribute:object_id+' => 'object id (class defined by the trigger ?)~~', 'Class:EventNotification/Attribute:trigger_id' => 'Spúštač', 'Class:EventNotification/Attribute:trigger_id+' => '~~', + 'Class:EventNotification/Attribute:object_id+' => '', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'Udalosť emitovania emailu', 'Class:EventNotificationEmail+' => 'Trace of an email that has been sent~~', 'Class:EventNotificationEmail/Attribute:attachments' => 'Prílohy', diff --git a/dictionaries/tr.dictionary.itop.core.php b/dictionaries/tr.dictionary.itop.core.php index 783272f13..9df114c0b 100644 --- a/dictionaries/tr.dictionary.itop.core.php +++ b/dictionaries/tr.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @author Izzet Sirin @@ -311,6 +311,8 @@ If omitted the From (label) is used.~~', 'Class:EventNotification/Attribute:object_id+' => 'nesne belirleyicisi (olayı tetikleyen nesne ?)', 'Class:EventNotification/Attribute:trigger_id' => 'Uyarı tetikçisi', 'Class:EventNotification/Attribute:trigger_id+' => 'kullanıcı hesabı', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => 'E-posta gönderim işlemi', 'Class:EventNotificationEmail+' => 'Gönderilen E-posta tarihçesi', 'Class:EventNotificationEmail/Attribute:attachments' => 'Eklentiler', diff --git a/dictionaries/zh_cn.dictionary.itop.core.php b/dictionaries/zh_cn.dictionary.itop.core.php index a39d511fa..a6406d76d 100644 --- a/dictionaries/zh_cn.dictionary.itop.core.php +++ b/dictionaries/zh_cn.dictionary.itop.core.php @@ -4,7 +4,7 @@ * * @copyright Copyright (C) 2010-2024 Combodo SAS * @license https://opensource.org/licenses/AGPL-3.0 - * + * */ /** * @@ -322,6 +322,8 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [ 'Class:EventNotification/Attribute:object_id+' => '对象编号 (类型由触发器定义?)', 'Class:EventNotification/Attribute:trigger_id' => '触发器', 'Class:EventNotification/Attribute:trigger_id+' => '用户账号', + 'Class:EventNotification/Attribute:object_class' => 'Object class~~', + 'Class:EventNotification/Attribute:object_class+' => 'Object class (Same as trigger)~~', 'Class:EventNotificationEmail' => '邮件发送事件', 'Class:EventNotificationEmail+' => '跟踪每封已发送的邮件', 'Class:EventNotificationEmail/Attribute:attachments' => '附件', diff --git a/sources/Service/Notification/Event/EventNotificationNewsroomService.php b/sources/Service/Notification/Event/EventNotificationNewsroomService.php index f3386e6da..eb09e909d 100644 --- a/sources/Service/Notification/Event/EventNotificationNewsroomService.php +++ b/sources/Service/Notification/Event/EventNotificationNewsroomService.php @@ -60,6 +60,7 @@ class EventNotificationNewsroomService { $oEvent->Set('trigger_id', $iTriggerId); $oEvent->Set('action_id', $oAction->GetKey()); $oEvent->Set('object_id', $iObjectId); + $oEvent->Set('object_class', $sObjectClass); $oEvent->Set('url', $sUrl); if ($sDate !== null) { $oEvent->Set('date', $sDate);