N°6384 - Flag LinkedSet to specify that it has CheckToWrite constraint (more specific parameter name)

This commit is contained in:
Eric Espie
2023-06-09 10:21:47 +02:00
parent 191742c2a9
commit 1b7529fcb9
5 changed files with 13 additions and 13 deletions

View File

@@ -1727,12 +1727,13 @@ class AttributeLinkedSet extends AttributeDefinition
}
/**
* @return bool true if host object has constraints
* Indicates if the current Attribute has constraints (php constraints or datamodel constraints)
* @return bool true if Attribute has constraints
* @since 3.1.0 N°6228
*/
public function GetHasConstraint()
{
return $this->GetOptional('with_constraint', false);
return $this->GetOptional('with_php_constraint', false);
}
/**

View File

@@ -482,8 +482,8 @@
<type>boolean</type>
<default>true</default>
</property>
<property id="with_constraint">
<php_param>with_constraint</php_param>
<property id="with_php_constraint">
<php_param>with_php_constraint</php_param>
<mandatory>false</mandatory>
<type>boolean</type>
<default>false</default>

View File

@@ -248,8 +248,8 @@ abstract class User extends cmdbAbstractObject
"depends_on" => array(),
)));
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("profile_list",array("linked_class" => "URP_UserProfile", "ext_key_to_me" => "userid", "ext_key_to_remote" => "profileid", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), "display_style" => 'property', "with_constraint" => true)));
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("allowed_org_list", array("linked_class" => "URP_UserOrg", "ext_key_to_me" => "userid", "ext_key_to_remote" => "allowed_org_id", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), 'with_constraint' => true)));
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("profile_list",array("linked_class" => "URP_UserProfile", "ext_key_to_me" => "userid", "ext_key_to_remote" => "profileid", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), "display_style" => 'property', "with_php_constraint" => true)));
MetaModel::Init_AddAttribute(new AttributeLinkedSetIndirect("allowed_org_list", array("linked_class" => "URP_UserOrg", "ext_key_to_me" => "userid", "ext_key_to_remote" => "allowed_org_id", "allowed_values" => null, "count_min" => 1, "count_max" => 0, "depends_on" => array(), 'with_php_constraint' => true)));
MetaModel::Init_AddAttribute(new AttributeCaseLog("log", array("sql" => 'log', "is_null_allowed" => true, "default_value" => '', "allowed_values" => null, "depends_on" => array(), "always_load_in_tables" => false)));
// Display lists

View File

@@ -1132,11 +1132,6 @@ class iTopDesignFormat
$this->RemoveNodeFromXPath("/itop_design/classes//class/fields/field[@xsi:type='AttributeLinkedSet']/display_style");
$this->RemoveNodeFromXPath("/itop_design/classes//class/fields/field[@xsi:type='AttributeLinkedSetIndirect']/display_style");
// N°6228 - Remove last Profil of a User / Exceed SaaS User quota without control
// - Remove with_constraint
$this->RemoveNodeFromXPath("/itop_design/classes//class/fields/field[@xsi:type='AttributeLinkedSet']/with_constraint");
$this->RemoveNodeFromXPath("/itop_design/classes//class/fields/field[@xsi:type='AttributeLinkedSetIndirect']/with_constraint");
// N°2783 - Custom zlists
$this->RemoveNodeFromXPath("/itop_design/classes//class/presentation/custom_presentations");
$this->RemoveNodeFromXPath("/itop_design/meta/presentation/custom_presentations");

View File

@@ -63,12 +63,16 @@
</class>
<class id="ClassWithAttributeLinkedSetWithConstraint">
<fields>
<field id="status" xsi:type="AttributeLinkedSet"/>
<field id="status" xsi:type="AttributeLinkedSet">
<with_php_constraint>true</with_php_constraint>
</field>
</fields>
</class>
<class id="ClassWithAttributeLinkedSetIndirectWithConstraint">
<fields>
<field id="status" xsi:type="AttributeLinkedSetIndirect"/>
<field id="status" xsi:type="AttributeLinkedSetIndirect">
<with_php_constraint>true</with_php_constraint>
</field>
</fields>
</class>
<class id="ClassWithAttributeEnumSorted">