mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6210 - Avoid n:n duplicates on User-Profile and Trigger-Actions - uniqueness rules
This commit is contained in:
@@ -228,6 +228,17 @@ class URP_UserProfile extends UserRightsBaseClassGUI
|
|||||||
"db_table" => "priv_urp_userprofile",
|
"db_table" => "priv_urp_userprofile",
|
||||||
"db_key_field" => "id",
|
"db_key_field" => "id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
|
'uniqueness_rules' => array(
|
||||||
|
'no_duplicate' => array(
|
||||||
|
'attributes' => array(
|
||||||
|
0 => 'userid',
|
||||||
|
1 => 'profileid',
|
||||||
|
),
|
||||||
|
'filter' => '',
|
||||||
|
'disabled' => false,
|
||||||
|
'is_blocking' => true,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
//MetaModel::Init_InheritAttributes();
|
//MetaModel::Init_InheritAttributes();
|
||||||
|
|||||||
@@ -710,15 +710,26 @@ class lnkTriggerAction extends cmdbAbstractObject
|
|||||||
{
|
{
|
||||||
$aParams = array
|
$aParams = array
|
||||||
(
|
(
|
||||||
"category" => "grant_by_profile,core/cmdb,application",
|
"category" => "grant_by_profile,core/cmdb,application",
|
||||||
"key_type" => "autoincrement",
|
"key_type" => "autoincrement",
|
||||||
"name_attcode" => "",
|
"name_attcode" => "",
|
||||||
"state_attcode" => "",
|
"state_attcode" => "",
|
||||||
"reconc_keys" => array('action_id', 'trigger_id'),
|
"reconc_keys" => array('action_id', 'trigger_id'),
|
||||||
"db_table" => "priv_link_action_trigger",
|
"db_table" => "priv_link_action_trigger",
|
||||||
"db_key_field" => "link_id",
|
"db_key_field" => "link_id",
|
||||||
"db_finalclass_field" => "",
|
"db_finalclass_field" => "",
|
||||||
"is_link" => true,
|
"is_link" => true,
|
||||||
|
'uniqueness_rules' => array(
|
||||||
|
'no_duplicate' => array(
|
||||||
|
'attributes' => array(
|
||||||
|
0 => 'action_id',
|
||||||
|
1 => 'trigger_id',
|
||||||
|
),
|
||||||
|
'filter' => '',
|
||||||
|
'disabled' => false,
|
||||||
|
'is_blocking' => true,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
MetaModel::Init_Params($aParams);
|
MetaModel::Init_Params($aParams);
|
||||||
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 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())));
|
||||||
|
|||||||
Reference in New Issue
Block a user