mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-11 12:04:12 +01:00
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<?php
|
|
|
|
/*
|
|
* @copyright Copyright (C) 2010-2023 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
/**
|
|
* Class TriggerOnAttachmentCreate
|
|
*
|
|
* @since 3.3.0
|
|
*/
|
|
class TriggerOnAttachmentCreate extends TriggerOnObject
|
|
{
|
|
/**
|
|
* @inheritDoc
|
|
* @throws \CoreException
|
|
* @throws \Exception
|
|
*/
|
|
public static function Init()
|
|
{
|
|
$aParams =
|
|
[
|
|
"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_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", ["sql" => 'file_in_email', "is_null_allowed" => false, "default_value" => 'true', "allowed_values" => null, "depends_on" => [], "always_load_in_tables" => false]));
|
|
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', ['description', 'context', 'filter', 'action_list', 'target_class', 'file_in_email']); // Attributes to be displayed for the complete details
|
|
MetaModel::Init_SetZListItems('list', ['finalclass', 'target_class']); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
MetaModel::Init_SetZListItems('standard_search', ['description', 'target_class']); // Criteria of the std search form
|
|
}
|
|
|
|
}
|