|
@@ -23,7 +23,7 @@ class Trigger extends cmdbAbstractObject
|
|
"description" => "Custom event handler",
|
|
"description" => "Custom event handler",
|
|
"key_type" => "autoincrement",
|
|
"key_type" => "autoincrement",
|
|
"key_label" => "",
|
|
"key_label" => "",
|
|
- "name_attcode" => "",
|
|
|
|
|
|
+ "name_attcode" => "description",
|
|
"state_attcode" => "",
|
|
"state_attcode" => "",
|
|
"reconc_keys" => array(),
|
|
"reconc_keys" => array(),
|
|
"db_table" => "priv_trigger",
|
|
"db_table" => "priv_trigger",
|
|
@@ -61,7 +61,42 @@ class Trigger extends cmdbAbstractObject
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-class TriggerOnStateChange extends Trigger
|
|
|
|
|
|
+class TriggerOnObject extends Trigger
|
|
|
|
+{
|
|
|
|
+ public static function Init()
|
|
|
|
+ {
|
|
|
|
+ $aParams = array
|
|
|
|
+ (
|
|
|
|
+ "category" => "core/cmdb",
|
|
|
|
+ "name" => "Trigger on a class of objects",
|
|
|
|
+ "description" => "Trigger on a given class of objects",
|
|
|
|
+ "key_type" => "autoincrement",
|
|
|
|
+ "key_label" => "",
|
|
|
|
+ "name_attcode" => "",
|
|
|
|
+ "state_attcode" => "",
|
|
|
|
+ "reconc_keys" => array(),
|
|
|
|
+ "db_table" => "priv_trigger_onobject",
|
|
|
|
+ "db_key_field" => "id",
|
|
|
|
+ "db_finalclass_field" => "",
|
|
|
|
+ "display_template" => "",
|
|
|
|
+ );
|
|
|
|
+ MetaModel::Init_Params($aParams);
|
|
|
|
+ MetaModel::Init_InheritAttributes();
|
|
|
|
+ MetaModel::Init_AddAttribute(new AttributeClass("target_class", array("label"=>"Target class", "description"=>"label", "class_category"=>"bizmodel", "more_values"=>null, "sql"=>"target_class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
|
|
|
+
|
|
|
|
+ MetaModel::Init_InheritFilters();
|
|
|
|
+ MetaModel::Init_AddFilterFromAttribute("target_class");
|
|
|
|
+
|
|
|
|
+ // Display lists
|
|
|
|
+ MetaModel::Init_SetZListItems('details', array('description', 'target_class')); // Attributes to be displayed for the complete details
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class', 'description')); // Attributes to be displayed for a list
|
|
|
|
+ // Search criteria
|
|
|
|
+// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
|
|
+// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+class TriggerOnStateChange extends TriggerOnObject
|
|
{
|
|
{
|
|
public static function Init()
|
|
public static function Init()
|
|
{
|
|
{
|
|
@@ -82,16 +117,14 @@ class TriggerOnStateChange extends Trigger
|
|
);
|
|
);
|
|
MetaModel::Init_Params($aParams);
|
|
MetaModel::Init_Params($aParams);
|
|
MetaModel::Init_InheritAttributes();
|
|
MetaModel::Init_InheritAttributes();
|
|
- MetaModel::Init_AddAttribute(new AttributeClass("target_class", array("label"=>"Target class", "description"=>"label", "class_category"=>"bizmodel", "more_values"=>null, "sql"=>"target_class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
|
|
|
MetaModel::Init_AddAttribute(new AttributeString("state", array("label"=>"State", "description"=>"label", "allowed_values"=>null, "sql"=>"state", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
|
MetaModel::Init_AddAttribute(new AttributeString("state", array("label"=>"State", "description"=>"label", "allowed_values"=>null, "sql"=>"state", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
|
|
|
|
|
MetaModel::Init_InheritFilters();
|
|
MetaModel::Init_InheritFilters();
|
|
- MetaModel::Init_AddFilterFromAttribute("target_class");
|
|
|
|
MetaModel::Init_AddFilterFromAttribute("state");
|
|
MetaModel::Init_AddFilterFromAttribute("state");
|
|
|
|
|
|
// Display lists
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
- MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class', 'state')); // Attributes to be displayed for a list
|
|
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class', 'state', 'description')); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
// Search criteria
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
@@ -124,7 +157,7 @@ class TriggerOnStateEnter extends TriggerOnStateChange
|
|
|
|
|
|
// Display lists
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
- MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
|
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('target_class', 'state', 'description')); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
// Search criteria
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
@@ -157,14 +190,14 @@ class TriggerOnStateLeave extends TriggerOnStateChange
|
|
|
|
|
|
// Display lists
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class', 'state')); // Attributes to be displayed for the complete details
|
|
- MetaModel::Init_SetZListItems('list', array('target_class', 'state')); // Attributes to be displayed for a list
|
|
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('target_class', 'state', 'description')); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
// Search criteria
|
|
// MetaModel::Init_SetZListItems('standard_search', array('')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('standard_search', array('')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('')); // Criteria of the advanced search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('')); // Criteria of the advanced search form
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-class TriggerOnObjectCreate extends Trigger
|
|
|
|
|
|
+class TriggerOnObjectCreate extends TriggerOnObject
|
|
{
|
|
{
|
|
public static function Init()
|
|
public static function Init()
|
|
{
|
|
{
|
|
@@ -185,14 +218,12 @@ class TriggerOnObjectCreate extends Trigger
|
|
);
|
|
);
|
|
MetaModel::Init_Params($aParams);
|
|
MetaModel::Init_Params($aParams);
|
|
MetaModel::Init_InheritAttributes();
|
|
MetaModel::Init_InheritAttributes();
|
|
- MetaModel::Init_AddAttribute(new AttributeClass("target_class", array("label"=>"Target class", "description"=>"label", "class_category"=>"bizmodel", "more_values"=>null, "sql"=>"target_class", "default_value"=>null, "is_null_allowed"=>false, "depends_on"=>array())));
|
|
|
|
|
|
|
|
MetaModel::Init_InheritFilters();
|
|
MetaModel::Init_InheritFilters();
|
|
- MetaModel::Init_AddFilterFromAttribute("target_class");
|
|
|
|
|
|
|
|
// Display lists
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', array('description', 'target_class')); // Attributes to be displayed for the complete details
|
|
MetaModel::Init_SetZListItems('details', array('description', '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
|
|
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('finalclass', 'target_class', 'description')); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
// Search criteria
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
// MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form
|
|
@@ -222,14 +253,16 @@ class lnkTriggerAction extends cmdbAbstractObject
|
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("action_id", array("targetclass"=>"Action", "jointype"=> '', "label"=>"Action", "description"=>"The action to be executed", "allowed_values"=>null, "sql"=>"action_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("action_id", array("targetclass"=>"Action", "jointype"=> '', "label"=>"Action", "description"=>"The action to be executed", "allowed_values"=>null, "sql"=>"action_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
|
MetaModel::Init_AddAttribute(new AttributeExternalField("action_name", array("label"=>"Action Name", "description"=>"Name of the action", "allowed_values"=>null, "extkey_attcode"=> 'action_id', "target_attcode"=>"name")));
|
|
MetaModel::Init_AddAttribute(new AttributeExternalField("action_name", array("label"=>"Action Name", "description"=>"Name of the action", "allowed_values"=>null, "extkey_attcode"=> 'action_id', "target_attcode"=>"name")));
|
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("trigger_id", array("targetclass"=>"Trigger", "jointype"=> '', "label"=>"Trigger", "description"=>"Trigger", "allowed_values"=>null, "sql"=>"trigger_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
|
MetaModel::Init_AddAttribute(new AttributeExternalKey("trigger_id", array("targetclass"=>"Trigger", "jointype"=> '', "label"=>"Trigger", "description"=>"Trigger", "allowed_values"=>null, "sql"=>"trigger_id", "is_null_allowed"=>false, "on_target_delete"=>DEL_AUTO, "depends_on"=>array())));
|
|
|
|
+ MetaModel::Init_AddAttribute(new AttributeExternalField("trigger_name", array("label"=>"Trigger Name", "description"=>"Name of the trigger", "allowed_values"=>null, "extkey_attcode"=> 'trigger_id', "target_attcode"=>"description")));
|
|
MetaModel::Init_AddAttribute(new AttributeInteger("order", array("label"=>"Order", "description"=>"Actions execution order", "allowed_values"=>null, "sql"=>"order", "default_value"=>0, "is_null_allowed"=>true, "depends_on"=>array())));
|
|
MetaModel::Init_AddAttribute(new AttributeInteger("order", array("label"=>"Order", "description"=>"Actions execution order", "allowed_values"=>null, "sql"=>"order", "default_value"=>0, "is_null_allowed"=>true, "depends_on"=>array())));
|
|
|
|
|
|
MetaModel::Init_AddFilterFromAttribute("action_id");
|
|
MetaModel::Init_AddFilterFromAttribute("action_id");
|
|
MetaModel::Init_AddFilterFromAttribute("trigger_id");
|
|
MetaModel::Init_AddFilterFromAttribute("trigger_id");
|
|
|
|
+ MetaModel::Init_AddFilterFromAttribute("order");
|
|
|
|
|
|
// Display lists
|
|
// Display lists
|
|
MetaModel::Init_SetZListItems('details', array('action_id', 'trigger_id', 'order')); // Attributes to be displayed for a list
|
|
MetaModel::Init_SetZListItems('details', array('action_id', 'trigger_id', 'order')); // Attributes to be displayed for a list
|
|
- MetaModel::Init_SetZListItems('list', array('action_id', 'trigger_id', 'order')); // Attributes to be displayed for a list
|
|
|
|
|
|
+ MetaModel::Init_SetZListItems('list', array('action_name', 'trigger_name', 'order')); // Attributes to be displayed for a list
|
|
// Search criteria
|
|
// Search criteria
|
|
MetaModel::Init_SetZListItems('standard_search', array('action_id', 'trigger_id', 'order')); // Criteria of the std search form
|
|
MetaModel::Init_SetZListItems('standard_search', array('action_id', 'trigger_id', 'order')); // Criteria of the std search form
|
|
MetaModel::Init_SetZListItems('advanced_search', array('action_id', 'trigger_id', 'order')); // Criteria of the advanced search form
|
|
MetaModel::Init_SetZListItems('advanced_search', array('action_id', 'trigger_id', 'order')); // Criteria of the advanced search form
|