diff --git a/addons/userrights/userrightsprofile.db.class.inc.php b/addons/userrights/userrightsprofile.db.class.inc.php
index 7ae7214b0..16551a4ea 100644
--- a/addons/userrights/userrightsprofile.db.class.inc.php
+++ b/addons/userrights/userrightsprofile.db.class.inc.php
@@ -399,25 +399,25 @@ class URP_ActionGrant extends UserRightsBaseClass
{
$aParams = array
(
- "category" => "addon/userrights",
- "key_type" => "autoincrement",
- "name_attcode" => "profileid",
- "state_attcode" => "",
- "reconc_keys" => array(),
- "db_table" => "priv_urp_grant_actions",
- "db_key_field" => "id",
+ "category" => "addon/userrights",
+ "key_type" => "autoincrement",
+ "name_attcode" => "profileid",
+ "state_attcode" => "",
+ "reconc_keys" => array(),
+ "db_table" => "priv_urp_grant_actions",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
// Common to all grant classes (could be factorized by class inheritence, but this has to be benchmarked)
- MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_SILENT, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
- MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category"=>"", "more_values"=>"", "sql"=>"class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"permission", "default_value"=>"yes", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_SILENT, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
+ MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category" => "", "more_values" => "", "sql" => "class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => null)));
+ MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "permission", "default_value" => "yes", "is_null_allowed" => false, "depends_on" => array())));
- MetaModel::Init_AddAttribute(new AttributeString("action", array("allowed_values"=>null, "sql"=>"action", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeString("action", array("allowed_values" => null, "sql" => "action", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
// Display lists
MetaModel::Init_SetZListItems('details', array('profileid', 'class', 'permission', 'action')); // Attributes to be displayed for the complete details
@@ -435,25 +435,25 @@ class URP_StimulusGrant extends UserRightsBaseClass
{
$aParams = array
(
- "category" => "addon/userrights",
- "key_type" => "autoincrement",
- "name_attcode" => "profileid",
- "state_attcode" => "",
- "reconc_keys" => array(),
- "db_table" => "priv_urp_grant_stimulus",
- "db_key_field" => "id",
+ "category" => "addon/userrights",
+ "key_type" => "autoincrement",
+ "name_attcode" => "profileid",
+ "state_attcode" => "",
+ "reconc_keys" => array(),
+ "db_table" => "priv_urp_grant_stimulus",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
// Common to all grant classes (could be factorized by class inheritence, but this has to be benchmarked)
- MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_SILENT, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
- MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category"=>"", "more_values"=>"", "sql"=>"class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"permission", "default_value"=>"yes", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_SILENT, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
+ MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category" => "", "more_values" => "", "sql" => "class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => null)));
+ MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "permission", "default_value" => "yes", "is_null_allowed" => false, "depends_on" => array())));
- MetaModel::Init_AddAttribute(new AttributeString("stimulus", array("allowed_values"=>null, "sql"=>"action", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeString("stimulus", array("allowed_values" => null, "sql" => "action", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
// Display lists
MetaModel::Init_SetZListItems('details', array('profileid', 'class', 'permission', 'stimulus')); // Attributes to be displayed for the complete details
diff --git a/addons/userrights/userrightsprojection.class.inc.php b/addons/userrights/userrightsprojection.class.inc.php
index 09d4ca3a5..52e90e341 100644
--- a/addons/userrights/userrightsprojection.class.inc.php
+++ b/addons/userrights/userrightsprojection.class.inc.php
@@ -402,7 +402,7 @@ class URP_ClassProjection extends UserRightsBaseClass
MetaModel::Init_AddAttribute(new AttributeExternalKey("dimensionid", array("targetclass"=>"URP_Dimensions", "jointype"=> "", "allowed_values"=>null, "sql"=>"dimensionid", "is_null_allowed"=>false, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeExternalField("dimension", array("allowed_values"=>null, "extkey_attcode"=> 'dimensionid', "target_attcode"=>"name")));
- MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category"=>"", "more_values"=>"", "sql"=>"class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category" => "", "more_values" => "", "sql" => "class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => null)));
MetaModel::Init_AddAttribute(new AttributeString("value", array("allowed_values"=>null, "sql"=>"value", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
MetaModel::Init_AddAttribute(new AttributeString("attribute", array("allowed_values"=>null, "sql"=>"attribute", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
@@ -459,25 +459,25 @@ class URP_ActionGrant extends UserRightsBaseClass
{
$aParams = array
(
- "category" => "addon/userrights",
- "key_type" => "autoincrement",
- "name_attcode" => "profileid",
- "state_attcode" => "",
- "reconc_keys" => array(),
- "db_table" => "priv_urp_grant_actions",
- "db_key_field" => "id",
+ "category" => "addon/userrights",
+ "key_type" => "autoincrement",
+ "name_attcode" => "profileid",
+ "state_attcode" => "",
+ "reconc_keys" => array(),
+ "db_table" => "priv_urp_grant_actions",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
// Common to all grant classes (could be factorized by class inheritence, but this has to be benchmarked)
- MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
- MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category"=>"", "more_values"=>"", "sql"=>"class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"permission", "default_value"=>"yes", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_MANUAL, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
+ MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category" => "", "more_values" => "", "sql" => "class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => null)));
+ MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "permission", "default_value" => "yes", "is_null_allowed" => false, "depends_on" => array())));
- MetaModel::Init_AddAttribute(new AttributeString("action", array("allowed_values"=>null, "sql"=>"action", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeString("action", array("allowed_values" => null, "sql" => "action", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
// Display lists
MetaModel::Init_SetZListItems('details', array('profileid', 'class', 'permission', 'action')); // Attributes to be displayed for the complete details
@@ -495,25 +495,25 @@ class URP_StimulusGrant extends UserRightsBaseClass
{
$aParams = array
(
- "category" => "addon/userrights",
- "key_type" => "autoincrement",
- "name_attcode" => "profileid",
- "state_attcode" => "",
- "reconc_keys" => array(),
- "db_table" => "priv_urp_grant_stimulus",
- "db_key_field" => "id",
+ "category" => "addon/userrights",
+ "key_type" => "autoincrement",
+ "name_attcode" => "profileid",
+ "state_attcode" => "",
+ "reconc_keys" => array(),
+ "db_table" => "priv_urp_grant_stimulus",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
//MetaModel::Init_InheritAttributes();
// Common to all grant classes (could be factorized by class inheritence, but this has to be benchmarked)
- MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass"=>"URP_Profiles", "jointype"=> "", "allowed_values"=>null, "sql"=>"profileid", "is_null_allowed"=>false, "on_target_delete"=>DEL_MANUAL, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values"=>null, "extkey_attcode"=> 'profileid', "target_attcode"=>"name")));
- MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category"=>"", "more_values"=>"", "sql"=>"class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values"=>new ValueSetEnum('yes,no'), "sql"=>"permission", "default_value"=>"yes", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalKey("profileid", array("targetclass" => "URP_Profiles", "jointype" => "", "allowed_values" => null, "sql" => "profileid", "is_null_allowed" => false, "on_target_delete" => DEL_MANUAL, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeExternalField("profile", array("allowed_values" => null, "extkey_attcode" => 'profileid', "target_attcode" => "name")));
+ MetaModel::Init_AddAttribute(new AttributeClass("class", array("class_category" => "", "more_values" => "", "sql" => "class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => null)));
+ MetaModel::Init_AddAttribute(new AttributeEnum("permission", array("allowed_values" => new ValueSetEnum('yes,no'), "sql" => "permission", "default_value" => "yes", "is_null_allowed" => false, "depends_on" => array())));
- MetaModel::Init_AddAttribute(new AttributeString("stimulus", array("allowed_values"=>null, "sql"=>"action", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeString("stimulus", array("allowed_values" => null, "sql" => "action", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
// Display lists
MetaModel::Init_SetZListItems('details', array('profileid', 'class', 'permission', 'stimulus')); // Attributes to be displayed for the complete details
diff --git a/application/iotask.class.inc.php b/application/iotask.class.inc.php
index bdbaad318..f0becff96 100644
--- a/application/iotask.class.inc.php
+++ b/application/iotask.class.inc.php
@@ -36,29 +36,30 @@ class InputOutputTask extends cmdbAbstractObject
{
$aParams = array
(
- "category" => "application",
- "key_type" => "autoincrement",
- "name_attcode" => "name",
- "state_attcode" => "",
- "reconc_keys" => array(),
- "db_table" => "priv_iotask",
- "db_key_field" => "id",
+ "category" => "application",
+ "key_type" => "autoincrement",
+ "name_attcode" => "name",
+ "state_attcode" => "",
+ "reconc_keys" => array(),
+ "db_table" => "priv_iotask",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
- MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values"=>null, "sql"=>"name", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values"=>null, "sql"=>"description", "default_value"=>"", "is_null_allowed"=>true, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("category", array("allowed_values"=>new ValueSetEnum('Input, Ouput'), "sql"=>"category", "default_value"=>"Input", "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("source_type", array("allowed_values"=>new ValueSetEnum('File, Database, Web Service'), "sql"=>"source_type", "default_value"=>"File", "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("source_subtype", array("allowed_values"=>new ValueSetEnum('Oracle, MySQL, Postgress, MSSQL, SOAP, HTTP-Get, HTTP-Post, XML/RPC, CSV, XML, Excel'), "sql"=>"source_subtype", "default_value"=>"CSV", "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeString("source_path", array("allowed_values"=>null, "sql"=>"source_path", "default_value"=>"", "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeClass("objects_class", array("class_category"=>"", "more_values"=>"", "sql"=>"objects_class", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("test_mode", array("allowed_values"=>new ValueSetEnum('Yes,No'), "sql"=>"test_mode", "default_value"=>'No', "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("verbose_mode", array("allowed_values"=>new ValueSetEnum('Yes,No'), "sql"=>"verbose_mode", "default_value" => 'No', "is_null_allowed"=>false, "depends_on"=>array())));
- MetaModel::Init_AddAttribute(new AttributeEnum("options", array("allowed_values"=>new ValueSetEnum('Full, Update Only, Creation Only'), "sql"=>"options", "default_value"=> 'Full', "is_null_allowed"=>true, "depends_on"=>array())));
+ MetaModel::Init_AddAttribute(new AttributeString("name", array("allowed_values" => null, "sql" => "name", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeString("description", array("allowed_values" => null, "sql" => "description", "default_value" => "", "is_null_allowed" => true, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeEnum("category", array("allowed_values" => new ValueSetEnum('Input, Ouput'), "sql" => "category", "default_value" => "Input", "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeEnum("source_type", array("allowed_values" => new ValueSetEnum('File, Database, Web Service'), "sql" => "source_type", "default_value" => "File", "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeEnum("source_subtype",
+ array("allowed_values" => new ValueSetEnum('Oracle, MySQL, Postgress, MSSQL, SOAP, HTTP-Get, HTTP-Post, XML/RPC, CSV, XML, Excel'), "sql" => "source_subtype", "default_value" => "CSV", "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeString("source_path", array("allowed_values" => null, "sql" => "source_path", "default_value" => "", "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeClass("objects_class", array("class_category" => "", "more_values" => "", "sql" => "objects_class", "default_value" => null, "is_null_allowed" => true, "depends_on" => array(), "class_exclusion_list" => null)));
+ MetaModel::Init_AddAttribute(new AttributeEnum("test_mode", array("allowed_values" => new ValueSetEnum('Yes,No'), "sql" => "test_mode", "default_value" => 'No', "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeEnum("verbose_mode", array("allowed_values" => new ValueSetEnum('Yes,No'), "sql" => "verbose_mode", "default_value" => 'No', "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeEnum("options", array("allowed_values" => new ValueSetEnum('Full, Update Only, Creation Only'), "sql" => "options", "default_value" => 'Full', "is_null_allowed" => true, "depends_on" => array())));
// Display lists
- MetaModel::Init_SetZListItems('details', array('name', 'description', 'category', 'objects_class', 'source_type', 'source_subtype', 'source_path' , 'options', 'test_mode', 'verbose_mode')); // Attributes to be displayed for the complete details
+ MetaModel::Init_SetZListItems('details', array('name', 'description', 'category', 'objects_class', 'source_type', 'source_subtype', 'source_path', 'options', 'test_mode', 'verbose_mode')); // Attributes to be displayed for the complete details
MetaModel::Init_SetZListItems('list', array('description', 'category', 'objects_class', 'source_type', 'source_subtype', 'options')); // Attributes to be displayed for a list
// Search criteria
MetaModel::Init_SetZListItems('standard_search', array('name', 'category', 'objects_class', 'source_type', 'source_subtype')); // Criteria of the std search form
diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php
index d94843364..d96f2e965 100644
--- a/core/attributedef.class.inc.php
+++ b/core/attributedef.class.inc.php
@@ -3793,7 +3793,7 @@ class AttributeClass extends AttributeString
public static function ListExpectedParams()
{
- return array_merge(parent::ListExpectedParams(), array("class_category", "more_values"));
+ return array_merge(parent::ListExpectedParams(), array('class_category', 'more_values'));
}
public function __construct($sCode, $aParams)
@@ -3819,10 +3819,35 @@ class AttributeClass extends AttributeString
return $sDefault;
}
+ /**
+ * @param array $aArgs
+ * @param string $sContains
+ *
+ * @return array|null
+ * @throws \CoreException
+ */
+ public function GetAllowedValues($aArgs = array(), $sContains = '')
+ {
+ $oValSetDef = $this->GetValuesDef();
+ if (!$oValSetDef) {
+ return null;
+ }
+
+ $aListClass = $oValSetDef->GetValues($aArgs, $sContains);
+
+ $sClassExclusionList = $this->GetOptional('class_exclusion_list',null);
+ if (!empty($sClassExclusionList)) {
+ foreach (explode(',', $sClassExclusionList) as $sClassName) {
+ unset($aListClass[trim($sClassName)]);
+ }
+ }
+
+ return $aListClass;
+ }
+
public function GetAsHTML($sValue, $oHostObject = null, $bLocalize = true)
{
- if (empty($sValue))
- {
+ if (empty($sValue)) {
return '';
}
diff --git a/core/datamodel.core.xml b/core/datamodel.core.xml
index 0aa85dedc..cdbcaf002 100644
--- a/core/datamodel.core.xml
+++ b/core/datamodel.core.xml
@@ -1024,6 +1024,12 @@
string
+
+ class_exclusion_list
+ false
+ string
+
+
min_up
true
diff --git a/core/trigger.class.inc.php b/core/trigger.class.inc.php
index e458a9959..cd6c56d01 100644
--- a/core/trigger.class.inc.php
+++ b/core/trigger.class.inc.php
@@ -17,6 +17,8 @@
* You should have received a copy of the GNU Affero General Public License
*/
+use Combodo\iTop\Application\UI\Base\Component\Alert\AlertUIBlockFactory;
+
/**
* A user defined trigger, to customize the application
* A trigger will activate an action
@@ -170,19 +172,20 @@ abstract class TriggerOnObject extends Trigger
{
$aParams = array
(
- "category" => "grant_by_profile,core/cmdb",
- "key_type" => "autoincrement",
- "name_attcode" => "description",
+ "category" => "grant_by_profile,core/cmdb",
+ "key_type" => "autoincrement",
+ "name_attcode" => "description",
"complementary_name_attcode" => ['finalclass', 'complement'],
- "state_attcode" => "",
+ "state_attcode" => "",
"reconc_keys" => ['description'],
- "db_table" => "priv_trigger_onobject",
- "db_key_field" => "id",
+ "db_table" => "priv_trigger_onobject",
+ "db_key_field" => "id",
"db_finalclass_field" => "",
);
MetaModel::Init_Params($aParams);
MetaModel::Init_InheritAttributes();
- MetaModel::Init_AddAttribute(new AttributeClass("target_class", array("class_category" => "bizmodel", "more_values" => "User,UserExternal,UserInternal,UserLDAP,UserLocal", "sql" => "target_class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array())));
+ MetaModel::Init_AddAttribute(new AttributeClass("target_class",
+ array("class_category" => "bizmodel", "more_values" => "User,UserExternal,UserInternal,UserLDAP,UserLocal", "sql" => "target_class", "default_value" => null, "is_null_allowed" => false, "depends_on" => array(), "class_exclusion_list" => "Attachment")));
MetaModel::Init_AddAttribute(new AttributeOQL("filter", array("allowed_values" => null, "sql" => "filter", "default_value" => null, "is_null_allowed" => true, "depends_on" => array())));
// Display lists
@@ -270,6 +273,36 @@ abstract class TriggerOnObject extends Trigger
}
}
+ /**
+ * if the target class is Attachment, then the trigger is read-only
+ * @param $sAttCode
+ * @param $aReasons
+ * @param $sTargetState
+ * @return int
+ * @throws ArchivedObjectException
+ * @throws CoreException
+ */
+ public function GetAttributeFlags($sAttCode, &$aReasons = array(), $sTargetState='')
+ {
+ // Force the computed field to be read-only, preventing it to be written
+ if ($this->Get('target_class') == 'Attachment' ) {
+ return OPT_ATT_READONLY;
+ }
+ return parent::GetAttributeFlags($sAttCode, $aReasons, $sTargetState);
+ }
+
+
+ public function DisplayBareHeader(WebPage $oPage, $bEditMode = false)
+ {
+ $aHeaderBlocks = parent::DisplayBareHeader($oPage, $bEditMode);
+ if ($this->Get('target_class') == 'Attachment' ) {
+ $oPage->AddUiBlock(AlertUIBlockFactory::MakeForWarning('', Dict::S('Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage')));
+ $oPage->add_ready_script("$('#UIMenuModify').hide();");
+ }
+
+ return $aHeaderBlocks;
+ }
+
/**
* Activate trigger based on attribute list given instead of changed attributes
*
@@ -529,6 +562,7 @@ class TriggerOnObjectCreate extends TriggerOnObject
MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
}
+
}
/**
diff --git a/datamodels/2.x/itop-attachments/dictionaries/cs.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/cs.dict.itop-attachments.php
index 7ae649aee..74f3a7f6e 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/cs.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/cs.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
* @author Lukáš Dvořák
@@ -58,7 +58,14 @@ nebe se zeptejte'.ITOP_APPLICATION_SHORT.' správce '.ITOP_APPLICATION_SHORT.' z
'Class:Attachment/Attribute:temp_id+' => '~~',
'Class:Attachment/Attribute:user_id' => 'Jméno uživatele',
'Class:Attachment/Attribute:user_id+' => '~~',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/da.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/da.dict.itop-attachments.php
index 0b5a9d2a7..1fefcab61 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/da.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/da.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
* @author Erik Bøg
@@ -57,7 +57,14 @@ or ask your '.ITOP_APPLICATION_SHORT.' administrator if the '.ITOP_APPLICATION_S
'Class:Attachment/Attribute:temp_id+' => '~~',
'Class:Attachment/Attribute:user_id' => 'User id~~',
'Class:Attachment/Attribute:user_id+' => '~~',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/de.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/de.dict.itop-attachments.php
index 97bac3ccf..4ab233328 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/de.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/de.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
* @author ITOMIG GmbH
@@ -57,7 +57,14 @@ oder melden Sie dem '.ITOP_APPLICATION_SHORT.' Administrator diesen Fehler, weil
'Class:Attachment/Attribute:temp_id+' => '',
'Class:Attachment/Attribute:user_id' => 'Benutzer ID',
'Class:Attachment/Attribute:user_id+' => '',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (beim Herunterladen eines Attachment eines Objekts)',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger für das Herunterladen des Attachments der angegebenen Klasse oder einer Unterklasse',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (beim Herunterladen eines Attachment eines Objekts)',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger für das Herunterladen des Attachments der angegebenen Klasse oder einer Unterklasse',
'UI:Attachments:DropYourFileHint' => 'Dateien in diesem Bereich ablegen...',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/en.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/en.dict.itop-attachments.php
index ce049282d..f334994eb 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/en.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/en.dict.itop-attachments.php
@@ -89,6 +89,13 @@ Dict::Add('EN US', 'English', 'English', array(
//
Dict::Add('EN US', 'English', 'English', array(
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger',
));
diff --git a/datamodels/2.x/itop-attachments/dictionaries/es_cr.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/es_cr.dict.itop-attachments.php
index e7dc37e70..2c5abf9b1 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/es_cr.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/es_cr.dict.itop-attachments.php
@@ -5,7 +5,7 @@
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
* @author Miguel Turrubiates
- * @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
+ * @notas Utilizar codificación UTF-8 para mostrar acentos y otros caracteres especiales
*/
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
'Attachment:Max_Go' => '(Tamaño Máximo de Archivo: %1$s Gb)',
@@ -57,4 +57,11 @@ o pregunte al administador de iTop si el servidor que ha quedado sin espacio en
'Class:TriggerOnAttachmentDownload' => 'Disparador (al descargar el archivo adjunto del objeto)',
'Class:TriggerOnAttachmentDownload+' => 'Disparador al descargar el archivo adjunto del objeto de [una clase secundaria de] la clase dada',
'UI:Attachments:DropYourFileHint' => 'Arrastre los archivos en cualquier lugar de esta área',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/fr.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/fr.dict.itop-attachments.php
index 969dc08d8..aaaa773ad 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/fr.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/fr.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -56,7 +56,14 @@ Soit demandez à votre administrateur système s\'il reste de la place disque di
'Class:Attachment/Attribute:temp_id+' => '',
'Class:Attachment/Attribute:user_id' => 'Utilisateur',
'Class:Attachment/Attribute:user_id+' => '',
- 'Class:TriggerOnAttachmentDownload' => 'Déclencheur sur le téléchargement d\'une pièce jointe d\'un objet',
- 'Class:TriggerOnAttachmentDownload+' => '',
+ 'Class:TriggerOnAttachmentDownload' => 'Déclencheur sur le téléchargement d\'une pièce jointe d\'un objet',
+ 'Class:TriggerOnAttachmentDownload+' => '',
'UI:Attachments:DropYourFileHint' => 'Déposez vos fichiers dans cet espace',
+ 'Class:TriggerOnAttachmentCreate' => 'Déclencheur sur la création d\'une pièce jointe',
+ 'Class:TriggerOnAttachmentCreate+' => '',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Ajoute le fichier dans l\'email',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'Si coché, le fichier sera automatiquement attaché à l\'email quand l\'action email est lancée',
+ 'Class:TriggerOnAttachmentDelete' => 'Déclencheur sur la suppression d\'une pièce jointe',
+ 'Class:TriggerOnAttachmentDelete+' => '',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Les Triggers sur les objets ne sont pas autorisés sur la classe Attachement. Veuillez utiliser les triggers spécifiques pour cette classe',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/hu.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/hu.dict.itop-attachments.php
index aebe81aef..d080731bd 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/hu.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/hu.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -54,7 +54,14 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [
'Class:Attachment/Attribute:temp_id+' => '~~',
'Class:Attachment/Attribute:user_id' => 'Felhasználó',
'Class:Attachment/Attribute:user_id+' => '~~',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Húzza a fájlokat erre a területre',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/it.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/it.dict.itop-attachments.php
index de6e5a06a..96a737676 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/it.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/it.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -59,4 +59,11 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [
'Class:TriggerOnAttachmentDownload' => 'Trigger (al download di un allegato dell\'oggetto)',
'Class:TriggerOnAttachmentDownload+' => 'Trigger al download di un allegato di un oggetto di [una sottoclasse di] la classe data',
'UI:Attachments:DropYourFileHint' => 'Rilascia i file ovunque in quest\'area',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/ja.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/ja.dict.itop-attachments.php
index a1c10d576..a149e76d1 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/ja.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/ja.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -56,7 +56,14 @@ or ask your '.ITOP_APPLICATION_SHORT.' administrator if the '.ITOP_APPLICATION_S
'Class:Attachment/Attribute:temp_id+' => '~~',
'Class:Attachment/Attribute:user_id' => 'User id~~',
'Class:Attachment/Attribute:user_id+' => '~~',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/nl.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/nl.dict.itop-attachments.php
index 30132836d..dec62c46e 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/nl.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/nl.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
@@ -62,4 +62,11 @@ of vraag de iTop administrator om de opslagruimte van de iTop-server na te kijke
'Class:TriggerOnAttachmentDownload' => 'Trigger (Bij het downloaden van een bijlage)',
'Class:TriggerOnAttachmentDownload+' => 'Trigger bij het downloaden van een bijlage van een object van de opgegeven klasse (of subklasse ervan)',
'UI:Attachments:DropYourFileHint' => 'Sleep bestanden in dit gebied',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (Bij het toevoegen van een bijlage)',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger bij het toevoegen van een bijlage aan een object van de opgegeven klasse (of subklasse ervan)',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Bestand toevoegen in e-mail',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+'=> 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (Bij het verwijderen van een bijlage)',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger bij het verwijderen van een bijlage van een object van de opgegeven klasse (of subklasse ervan)',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/pl.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/pl.dict.itop-attachments.php
index e5dc69677..24c58562b 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/pl.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/pl.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -59,4 +59,11 @@ lub zapytaj administratora '.ITOP_APPLICATION_SHORT.', czy dysk serwera '.ITOP_A
'Class:TriggerOnAttachmentDownload' => 'Wyzwalacz (po pobraniu załącznika obiektu)',
'Class:TriggerOnAttachmentDownload+' => 'Wyzwalacz po pobraniu załącznika obiektu [klasy podrzędnej] danej klasy',
'UI:Attachments:DropYourFileHint' => 'Upuść pliki w dowolnym miejscu w tym obszarze',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/pt_br.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/pt_br.dict.itop-attachments.php
index 52f2f2746..5f7aa53c0 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/pt_br.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/pt_br.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -56,7 +56,14 @@ ou entre em contato com o seu administrador do '.ITOP_APPLICATION_SHORT.' pois o
'Class:Attachment/Attribute:temp_id+' => '',
'Class:Attachment/Attribute:user_id' => 'Identificador do usuário',
'Class:Attachment/Attribute:user_id+' => '',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Solte arquivos em qualquer lugar nesta área',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/ru.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/ru.dict.itop-attachments.php
index a61917950..95fa2a885 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/ru.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/ru.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
* @author Vladimir Kunin
@@ -57,7 +57,14 @@ or ask your '.ITOP_APPLICATION_SHORT.' administrator if the '.ITOP_APPLICATION_S
'Class:Attachment/Attribute:temp_id+' => '',
'Class:Attachment/Attribute:user_id' => 'Пользователь',
'Class:Attachment/Attribute:user_id+' => '',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/sk.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/sk.dict.itop-attachments.php
index 72bb8e29d..3e0e48545 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/sk.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/sk.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -59,4 +59,11 @@ or ask your '.ITOP_APPLICATION_SHORT.' administrator if the '.ITOP_APPLICATION_S
'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/tr.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/tr.dict.itop-attachments.php
index ccb6ba5c7..6a0584659 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/tr.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/tr.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -56,7 +56,14 @@ or ask your '.ITOP_APPLICATION_SHORT.' administrator if the '.ITOP_APPLICATION_S
'Class:Attachment/Attribute:temp_id+' => '~~',
'Class:Attachment/Attribute:user_id' => 'User id~~',
'Class:Attachment/Attribute:user_id+' => '~~',
- 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
- 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
+ 'Class:TriggerOnAttachmentDownload' => 'Trigger (on object\'s attachment download)~~',
+ 'Class:TriggerOnAttachmentDownload+' => 'Trigger on object\'s attachment download of [a child class of] the given class~~',
'UI:Attachments:DropYourFileHint' => 'Drop files anywhere in this area~~',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php b/datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php
index 3d92900f6..454655430 100644
--- a/datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php
@@ -4,7 +4,7 @@
*
* @copyright Copyright (C) 2010-2024 Combodo SAS
* @license https://opensource.org/licenses/AGPL-3.0
- *
+ *
*/
/**
*
@@ -57,4 +57,11 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [
'Class:TriggerOnAttachmentDownload' => '触发器 (于对象附件下载时)',
'Class:TriggerOnAttachmentDownload+' => '触发器于指定类型 [子类型] 对象附件下载时',
'UI:Attachments:DropYourFileHint' => '将文件拖放到此区域的任意位置',
+ 'Class:TriggerOnAttachmentCreate' => 'Trigger (on object\'s attachment create)~~',
+ 'Class:TriggerOnAttachmentCreate+' => 'Trigger on object\'s attachment create~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email' => 'Add file in email~~',
+ 'Class:TriggerOnAttachmentCreate/Attribute:file_in_email+' => 'If checked, the file will be automatically attached to the email when an email action is triggered~~',
+ 'Class:TriggerOnAttachmentDelete' => 'Trigger (on object\'s attachment delete)~~',
+ 'Class:TriggerOnAttachmentDelete+' => 'Trigger on object\'s attachment delete~~',
+ 'Class:TriggerOnObject:TriggerClassAttachment/ReadOnlyMessage' => 'Trigger on object is not allowed on class Attachment. Please use specific trigger~~',
]);
diff --git a/datamodels/2.x/itop-attachments/main.itop-attachments.php b/datamodels/2.x/itop-attachments/main.itop-attachments.php
index 1fbe5a8b0..fedbcd941 100644
--- a/datamodels/2.x/itop-attachments/main.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/main.itop-attachments.php
@@ -349,9 +349,7 @@ class AttachmentPlugIn implements iApplicationUIExtension, iApplicationObjectExt
{
$oAttachment->DBDelete();
// temporary attachment removed, don't even mention it in the history
- }
- else
- {
+ } else {
$oAttachment->SetItem($oObject);
$oAttachment->Set('temp_id', '');
$oAttachment->DBUpdate();
@@ -771,39 +769,6 @@ class CMDBChangeOpAttachmentRemoved extends CMDBChangeOp
}
}
-/**
- * Class TriggerOnAttachmentDownload
- *
- * @since 3.1.0
- */
-class TriggerOnAttachmentDownload extends TriggerOnAttributeBlobDownload
-{
- /**
- * @inheritDoc
- * @throws \CoreException
- * @throws \Exception
- */
- public static function Init()
- {
- $aParams = array
- (
- "category" => "grant_by_profile,core/cmdb,application",
- "key_type" => "autoincrement",
- "name_attcode" => "description",
- "complementary_name_attcode" => ['finalclass', 'complement'],
- "state_attcode" => "",
- "reconc_keys" => ['description'],
- "db_table" => "priv_trigger_onattdownload",
- "db_key_field" => "id",
- "db_finalclass_field" => "",
- "display_template" => "",
- );
- MetaModel::Init_Params($aParams);
- MetaModel::Init_InheritAttributes();
- }
-}
-
-
class AttachmentsHelper
{
/**
diff --git a/datamodels/2.x/itop-attachments/module.itop-attachments.php b/datamodels/2.x/itop-attachments/module.itop-attachments.php
index 575700f84..06480eab3 100644
--- a/datamodels/2.x/itop-attachments/module.itop-attachments.php
+++ b/datamodels/2.x/itop-attachments/module.itop-attachments.php
@@ -38,6 +38,9 @@ SetupWebPage::AddModule(
'datamodel' => array(
'vendor/autoload.php',
'main.itop-attachments.php',
+ 'src/Trigger/TriggerOnAttachmentCreate.php',
+ 'src/Trigger/TriggerOnAttachmentDelete.php',
+ 'src/Trigger/TriggerOnAttachmentDownload.php',
'renderers.itop-attachments.php',
),
'webservice' => array(
diff --git a/datamodels/2.x/itop-attachments/src/Hook/EventListener.php b/datamodels/2.x/itop-attachments/src/Hook/EventListener.php
index 273f9506e..a3a2973d8 100644
--- a/datamodels/2.x/itop-attachments/src/Hook/EventListener.php
+++ b/datamodels/2.x/itop-attachments/src/Hook/EventListener.php
@@ -10,6 +10,7 @@ namespace Combodo\iTop\Attachments\Hook;
use Combodo\iTop\Service\Events\EventData;
use Combodo\iTop\Service\Events\EventService;
use Combodo\iTop\Service\Events\iEventServiceSetup;
+use DBObject;
use DBObjectSearch;
use DBObjectSet;
use Exception;
@@ -18,6 +19,8 @@ use LogChannels;
use MetaModel;
use ormDocument;
use TriggerOnAttachmentDownload;
+use TriggerOnAttachmentCreate;
+use TriggerOnAttachmentDelete;
/**
* Class EventListener
@@ -37,6 +40,14 @@ class EventListener implements iEventServiceSetup
[$this, 'OnAttachmentDownloadActivateTriggers'],
'Attachment'
);
+ EventService::RegisterListener(
+ EVENT_ADD_ATTACHMENT_TO_OBJECT,
+ [$this, 'OnAttachmentAddedActivateTriggers']
+ );
+ EventService::RegisterListener(
+ EVENT_REMOVE_ATTACHMENT_FROM_OBJECT,
+ [$this, 'OnAttachmentRemovedActivateTriggers']
+ );
}
/**
@@ -59,7 +70,77 @@ class EventListener implements iEventServiceSetup
/** @var \ormDocument $oDocument */
$oDocument = $oEventData->Get('document');
- $sTriggerClass = TriggerOnAttachmentDownload::class;
+ $this->OnAttachmentActivateTriggers(
+ $oHostObj,
+ $oAttachment,
+ $oDocument,
+ TriggerOnAttachmentDownload::class
+ );
+ }
+
+ /**
+ * Callback when an Attachment is added: Activate corresponding triggers
+ *
+ * @param \Combodo\iTop\Service\Events\EventData $oEventData
+ *
+ * @return void
+ * @throws \CoreException
+ */
+ public function OnAttachmentAddedActivateTriggers(EventData $oEventData): void
+ {
+ /** @var DBObject $oAttachment */
+ $oAttachment = $oEventData->Get('attachment');
+ /** @var DBObject $oHostObj */
+ $oHostObj = $oEventData->Get('object');
+ /** @var ormDocument $oDocument */
+ $oDocument = $oAttachment->Get('contents');
+
+ $this->OnAttachmentActivateTriggers(
+ $oHostObj,
+ $oAttachment,
+ $oDocument,
+ \TriggerOnAttachmentCreate::class
+ );
+ }
+
+ /**
+ * Callback when an Attachment is removed: Activate corresponding triggers
+ *
+ * @param \Combodo\iTop\Service\Events\EventData $oEventData
+ *
+ * @return void
+ * @throws \CoreException
+ */
+ public function OnAttachmentRemovedActivateTriggers(EventData $oEventData): void
+ {
+ /** @var DBObject $oAttachment */
+ $oAttachment = $oEventData->Get('attachment');
+ /** @var DBObject $oHostObj */
+ $oHostObj = $oEventData->Get('object');
+ /** @var ormDocument $oDocument */
+ $oDocument = $oAttachment->Get('contents');
+
+ $this->OnAttachmentActivateTriggers(
+ $oHostObj,
+ $oAttachment,
+ $oDocument,
+ \TriggerOnAttachmentDelete::class
+ );
+ }
+
+ /**
+ * Callback when an Attachment downloaded, added or removed: Activate corresponding triggers
+ *
+ * @param DBObject $oHostObj
+ * @param DBObject $oAttachment
+ * @param ormDocument $oDocument
+ * @param string $sTriggerClass
+ *
+ * @return void
+ * @throws \CoreException
+ */
+ protected function OnAttachmentActivateTriggers(DBObject $oHostObj, DBObject $oAttachment, ormDocument $oDocument, string $sTriggerClass): void
+ {
$aTriggerContextArgs = [
'this->object()' => $oHostObj,
'attachment->object()' => $oAttachment,
@@ -75,7 +156,11 @@ class EventListener implements iEventServiceSetup
/** @var \Trigger $oTrigger */
while ($oTrigger = $oTriggerSet->Fetch()) {
try {
- $oTrigger->DoActivate($aTriggerContextArgs);
+ $aContextArgs = $aTriggerContextArgs;
+ if ($oTrigger->Get('file_in_email')) {
+ $aContextArgs['attachments'] = [$oDocument];
+ }
+ $oTrigger->DoActivate($aContextArgs);
} catch (Exception $oException) {
IssueLog::Error('Exception occurred during trigger activation in '.EventListener::class.'::'.__METHOD__, LogChannels::NOTIFICATIONS, [
'trigger_class' => get_class($oTrigger),
diff --git a/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentCreate.php b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentCreate.php
new file mode 100644
index 000000000..236e23012
--- /dev/null
+++ b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentCreate.php
@@ -0,0 +1,48 @@
+ "grant_by_profile,core/cmdb,application",
+ "key_type" => "autoincrement",
+ "name_attcode" => "description",
+ "complementary_name_attcode" => ['finalclass', 'complement'],
+ "state_attcode" => "",
+ "reconc_keys" => ['description'],
+ "db_table" => "priv_trigger_onattcreate",
+ "db_key_field" => "id",
+ "db_finalclass_field" => "",
+ "display_template" => "",
+ );
+ MetaModel::Init_Params($aParams);
+ MetaModel::Init_InheritAttributes();
+ MetaModel::Init_AddAttribute(new AttributeBoolean("file_in_email", array("sql"=>'file_in_email', "is_null_allowed"=>false, "default_value"=>'true', "allowed_values"=>null, "depends_on"=>array(), "always_load_in_tables"=>false)));
+
+
+ // Display lists
+ MetaModel::Init_SetZListItems('details', array('description', 'context', 'filter', 'action_list', 'target_class', 'file_in_email')); // Attributes to be displayed for the complete details
+ MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
+ // Search criteria
+ MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
+ }
+
+}
\ No newline at end of file
diff --git a/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDelete.php b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDelete.php
new file mode 100644
index 000000000..6cbb3f832
--- /dev/null
+++ b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDelete.php
@@ -0,0 +1,47 @@
+ "grant_by_profile,core/cmdb,application",
+ "key_type" => "autoincrement",
+ "name_attcode" => "description",
+ "complementary_name_attcode" => ['finalclass', 'complement'],
+ "state_attcode" => "",
+ "reconc_keys" => ['description'],
+ "db_table" => "priv_trigger_onattdelete",
+ "db_key_field" => "id",
+ "db_finalclass_field" => "",
+ "display_template" => "",
+ );
+ MetaModel::Init_Params($aParams);
+ MetaModel::Init_InheritAttributes();
+
+ // Display lists
+ MetaModel::Init_SetZListItems('details', array('description', 'context', 'filter', 'action_list', 'target_class')); // Attributes to be displayed for the complete details
+ MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class')); // Attributes to be displayed for a list
+ // Search criteria
+ MetaModel::Init_SetZListItems('standard_search', array('description', 'target_class')); // Criteria of the std search form
+
+ }
+
+}
\ No newline at end of file
diff --git a/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDownload.php b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDownload.php
new file mode 100644
index 000000000..8bc8f16bd
--- /dev/null
+++ b/datamodels/2.x/itop-attachments/src/Trigger/TriggerOnAttachmentDownload.php
@@ -0,0 +1,35 @@
+ "grant_by_profile,core/cmdb,application",
+ "key_type" => "autoincrement",
+ "name_attcode" => "description",
+ "complementary_name_attcode" => ['finalclass', 'complement'],
+ "state_attcode" => "",
+ "reconc_keys" => ['description'],
+ "db_table" => "priv_trigger_onattdownload",
+ "db_key_field" => "id",
+ "db_finalclass_field" => "",
+ "display_template" => "",
+ );
+ MetaModel::Init_Params($aParams);
+ MetaModel::Init_InheritAttributes();
+ }
+}
\ No newline at end of file
diff --git a/setup/compiler.class.inc.php b/setup/compiler.class.inc.php
index 1a2208a70..a9394931a 100644
--- a/setup/compiler.class.inc.php
+++ b/setup/compiler.class.inc.php
@@ -2259,10 +2259,12 @@ EOF
$this->CompileCommonProperty('is_null_allowed', $oField, $aParameters, $sModuleRelativeDir, false);
$this->CompileCommonProperty('default_value', $oField, $aParameters, $sModuleRelativeDir, '');
$this->CompileCommonProperty('allowed_values', $oField, $aParameters, $sModuleRelativeDir);
- $aParameters['class_category'] = $this->GetPropString($oField, 'class_category', '');
+ $aParameters['class_category'] = $this->GetPropString($oField, 'class_category', '');
$aParameters['more_values'] = $this->GetPropString($oField, 'more_values', '');
$aParameters['depends_on'] = $sDependencies;
- }else {
+ $aParameters['class_exclusion_list'] = $this->GetPropString($oField, 'class_exclusion_list', null);
+
+ }else {
$this->CompileCommonProperty('sql', $oField, $aParameters, $sModuleRelativeDir);
$this->CompileCommonProperty('is_null_allowed', $oField, $aParameters, $sModuleRelativeDir, false);
$this->CompileCommonProperty('default_value', $oField, $aParameters, $sModuleRelativeDir, '');
diff --git a/synchro/synchrodatasource.class.inc.php b/synchro/synchrodatasource.class.inc.php
index d940fe8a4..2712452c7 100644
--- a/synchro/synchrodatasource.class.inc.php
+++ b/synchro/synchrodatasource.class.inc.php
@@ -66,12 +66,13 @@ class SynchroDataSource extends cmdbAbstractObject
'depends_on' => array(),
)));
MetaModel::Init_AddAttribute(new AttributeClass('scope_class', array(
- 'class_category' => 'bizmodel,addon/authentication,application',
- 'more_values' => '',
- 'sql' => 'scope_class',
- 'default_value' => null,
- 'is_null_allowed' => false,
- 'depends_on' => array(),
+ 'class_category' => 'bizmodel,addon/authentication,application',
+ 'more_values' => '',
+ 'sql' => 'scope_class',
+ 'default_value' => null,
+ 'is_null_allowed' => false,
+ 'depends_on' => array(),
+ "class_exclusion_list" => null,
)));
MetaModel::Init_AddAttribute(new AttributeString('database_table_name', array(
'allowed_values' => null,
@@ -2016,12 +2017,13 @@ class SynchroReplica extends DBObject implements iDisplay
'depends_on' => array(),
)));
MetaModel::Init_AddAttribute(new AttributeClass('dest_class', array(
- 'class_category' => '',
- 'more_values' => '',
- 'sql' => 'dest_class',
+ 'class_category' => '',
+ 'more_values' => '',
+ 'sql' => 'dest_class',
'default_value' => '',
- 'is_null_allowed' => true,
- 'depends_on' => array(),
+ 'is_null_allowed' => true,
+ 'depends_on' => array(),
+ "class_exclusion_list" => null,
)));
MetaModel::Init_AddAttribute(new AttributeDateTime('status_last_seen', array(