diff --git a/entity/Member_entity/Member_entity.aod b/entity/Member_entity/Member_entity.aod index 2352659698a9a46d1b461716f2e1ec4289f38284..1db580cf75752e04b8a82ba431f103da3b9ce518 100644 --- a/entity/Member_entity/Member_entity.aod +++ b/entity/Member_entity/Member_entity.aod @@ -321,6 +321,12 @@ <name>ObjectSubType_param</name> <expose v="true" /> </entityParameter> + <entityField> + <name>PERSON_ATTR_LOYALTY</name> + <title>Loyalty</title> + <groupable v="true" /> + <displayValueProcess>%aditoprj%/entity/Member_entity/entityfields/person_attr_loyalty/displayValueProcess.js</displayValueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -420,6 +426,10 @@ <recordfield>OBJECTMEMBER.ONSITE</recordfield> <isFilterable v="true" /> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PERSON_ATTR_LOYALTY.value</name> + <expression>%aditoprj%/entity/Member_entity/recordcontainers/db/recordfieldmappings/person_attr_loyalty.value/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> @@ -533,6 +543,9 @@ <jDitoRecordFieldMapping> <name>MST_MEMBERROLE.value</name> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>PERSON_ATTR_LOYALTY.value</name> + </jDitoRecordFieldMapping> </recordFieldMappings> </jDitoRecordContainer> </recordContainers> diff --git a/entity/Member_entity/entityfields/person_attr_loyalty/displayValueProcess.js b/entity/Member_entity/entityfields/person_attr_loyalty/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b8857b8ffd70bbb62ff1dce0e3eff18072071bc1 --- /dev/null +++ b/entity/Member_entity/entityfields/person_attr_loyalty/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.translate"); +import("system.result"); + +result.string(translate.text(vars.get("$this.value"))); diff --git a/entity/Member_entity/recordcontainers/db/recordfieldmappings/person_attr_loyalty.value/expression.js b/entity/Member_entity/recordcontainers/db/recordfieldmappings/person_attr_loyalty.value/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..16ce5832a5e2bbd32e7488db9bf20bb5611f8211 --- /dev/null +++ b/entity/Member_entity/recordcontainers/db/recordfieldmappings/person_attr_loyalty.value/expression.js @@ -0,0 +1,12 @@ +import("Attribute_lib"); +import("AttributeRegistry_basic"); +import("Sql_lib"); +import("system.result"); + +var attrSql = newSelect("COMBOVAL.ATTRIBUTE_NAME") + .from("AB_ATTRIBUTERELATION") + .join("AB_ATTRIBUTE", "AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID") + .leftJoin("AB_ATTRIBUTE COMBOVAL", AttributeTypes.COMBO.databaseField + " = COMBOVAL.AB_ATTRIBUTEID") + .where("AB_ATTRIBUTERELATION.OBJECT_ROWID = OBJECTMEMBER.CONTACT_ID") + .and("AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID", $AttributeRegistry.loyalty()); +result.string("(" + attrSql.toString() + ")"); diff --git a/entity/Member_entity/recordcontainers/jdito/contentProcess.js b/entity/Member_entity/recordcontainers/jdito/contentProcess.js index 6a0466b6f9cb9866935d6039e83c9f64148033ae..707685adc1efda30c4003bf494fe1876533334a4 100644 --- a/entity/Member_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Member_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("AttributeRegistry_basic"); import("Util_lib"); import("system.translate"); import("system.result"); @@ -17,7 +18,7 @@ var memberLoadingConfig = entities.createConfigForLoadingRows() "MEMBERROLE", "MEMBERROLE.displayValue", "OBJECT_ROWID", "OBJECT_TYPE", "OBJECTMEMBERID", "ORG_ORGID", "ORGANISATION_NAME", "PERSON_FIRSTNAME", "PERSON_FULL_NAME", "PERSON_LASTNAME", "PERSON_PERSID", "PERSON_SALUTATION", "PERSON_TITLE", "POSITION", "TARGETCONTEXT", - "recordType", "MST_MEMBERROLE"]); + "recordType", "MST_MEMBERROLE", "PERSON_ATTR_LOYALTY"]); if (idValues) { @@ -56,7 +57,8 @@ memberRows = memberRows.map(function(row) row["POSITION"], row["TARGETCONTEXT"], row["recordType"], - row["MST_MEMBERROLE"] + row["MST_MEMBERROLE"], + row["PERSON_ATTR_LOYALTY"] ]; }); @@ -150,7 +152,11 @@ if (Utils.isNullOrEmpty(idValues) || memberRows.length === 0) persRows[counter][7], null, "DistrictResponsible", - "" + "", + (new AttributeRelationQuery( + row[3], + $AttributeRegistry.loyalty() + ).includeDisplayValue().getSingleAttribute() || {displayValue: ""}).displayValue ]); }); } diff --git a/neonView/MemberFilter_view/MemberFilter_view.aod b/neonView/MemberFilter_view/MemberFilter_view.aod index 87b04dc9cc12b236f1e3d574fddec941125e0d63..52aed59f96eaef6f02026543abece55c8d686cf1 100644 --- a/neonView/MemberFilter_view/MemberFilter_view.aod +++ b/neonView/MemberFilter_view/MemberFilter_view.aod @@ -45,6 +45,10 @@ <name>c23f4e8b-87a1-4535-b2d1-f6c97d6bfe0b</name> <entityField>POSITION</entityField> </neonTableColumn> + <neonTableColumn> + <name>fe949666-5fe7-42ef-acf1-748ed336682d</name> + <entityField>PERSON_ATTR_LOYALTY</entityField> + </neonTableColumn> <neonTableColumn> <name>bea82980-0639-405a-ab3f-92e45f97090e</name> <entityField>MEMBERROLE</entityField> @@ -87,6 +91,10 @@ <name>87770e60-967b-4411-9eb3-0397fda4663e</name> <entityField>POSITION</entityField> </neonTreeTableColumn> + <neonTreeTableColumn> + <name>6ff9f7d4-e619-4d3b-afa2-279dc0817bfc</name> + <entityField>PERSON_ATTR_LOYALTY</entityField> + </neonTreeTableColumn> <neonTreeTableColumn> <name>2dc17972-2e5a-424a-b069-2b8f04b35f6c</name> <entityField>MEMBERROLE</entityField> diff --git a/process/AttributeRegistry_basic/process.js b/process/AttributeRegistry_basic/process.js index 0d5b68b1c70a1889289312420d1b8902818b0866..4def7134d09a4043376a7d4f4d704d6c946953cd 100644 --- a/process/AttributeRegistry_basic/process.js +++ b/process/AttributeRegistry_basic/process.js @@ -19,6 +19,7 @@ $AttributeRegistry.departments = function(){return "87d4ff5b-0ab6-4534-be26-76c6 $AttributeRegistry.salesprojectType = function(){return "fd3963bc-8e60-411a-9911-b97eb73e5cf7";}; $AttributeRegistry.responsibleADsupervisor = function(){return "c0b26482-c0aa-413d-a9c3-f44c56bd04a9";}; $AttributeRegistry.industry = function(){return "7e9927a4-41e4-426f-bddd-c3e9ee3b093e";}; +$AttributeRegistry.loyalty = function(){return "e73ed929-8631-46de-b28f-eb1423abb808";}; $AttributeRegistry.visitPlanFrequency = function(){return "547b8b9d-88ba-4590-9e01-34d2a58116cc";}; $AttributeRegistry.visitPlanFrequency$monthly = function(){return "8c100817-1d2b-4fc7-8fdd-fd0370e19385";};