diff --git a/entity/Member_entity/Member_entity.aod b/entity/Member_entity/Member_entity.aod index c09945506ed4ee53942870e33b703b6789d50a48..6d9d859eb35666d48c7ac7dbec54f63e7143af87 100644 --- a/entity/Member_entity/Member_entity.aod +++ b/entity/Member_entity/Member_entity.aod @@ -88,6 +88,10 @@ <name>ExcludedContactIds_param</name> <valueProcess>%aditoprj%/entity/Member_entity/entityfields/contacts/children/excludedcontactids_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>OnlyActive_param</name> + <valueProcess>%aditoprj%/entity/Member_entity/entityfields/contacts/children/onlyactive_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityConsumer> diff --git a/entity/Member_entity/entityfields/contacts/children/excludedcontactids_param/valueProcess.js b/entity/Member_entity/entityfields/contacts/children/excludedcontactids_param/valueProcess.js index 22f69f2e8ce31389ce105f9aac485d8faaf3649f..bf1af554438715f36236f48ed6ab5900da1061da 100644 --- a/entity/Member_entity/entityfields/contacts/children/excludedcontactids_param/valueProcess.js +++ b/entity/Member_entity/entityfields/contacts/children/excludedcontactids_param/valueProcess.js @@ -3,8 +3,10 @@ import("system.vars"); import("system.db"); import("Sql_lib"); -result.object(newSelect("CONTACT_ID") - .from("OBJECTMEMBER") - .where("OBJECTMEMBER.OBJECT_ROWID", "$field.OBJECT_ROWID") - .and("OBJECTMEMBER.OBJECT_TYPE", "$field.OBJECT_TYPE") - .arrayColumn()); \ No newline at end of file +var excludeContacts = newSelect("OBJECTMEMBER.CONTACT_ID") + .from("OBJECTMEMBER") + .where("OBJECTMEMBER.OBJECT_ROWID", "$field.OBJECT_ROWID") + .and("OBJECTMEMBER.OBJECT_TYPE", "$field.OBJECT_TYPE") + .arrayColumn(); + +result.object(excludeContacts); diff --git a/entity/Member_entity/entityfields/contacts/children/onlyactive_param/valueProcess.js b/entity/Member_entity/entityfields/contacts/children/onlyactive_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b79bed7d644e36b82da688b0125065c3a1b66904 --- /dev/null +++ b/entity/Member_entity/entityfields/contacts/children/onlyactive_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(true); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 57cc63a297567e754eecef19f9d82d36ad04c50c..420af63d8d351a6150b7ad3efa37b77ffb9e53fe 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -788,6 +788,11 @@ <valueProcess>%aditoprj%/entity/Person_entity/entityfields/avatartext_param/valueProcess.js</valueProcess> <description>PARAMETER</description> </entityParameter> + <entityParameter> + <name>OnlyActive_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/avatartext_param/valueProcess.js</valueProcess> + <description>PARAMETER</description> + </entityParameter> <entityConsumer> <name>CommRestrictions</name> <dependency> diff --git a/entity/Person_entity/entityfields/onlyactive_param/valueProcess.js b/entity/Person_entity/entityfields/onlyactive_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c95b5dd1b4fc9b39fda3524b5ac7702157952322 --- /dev/null +++ b/entity/Person_entity/entityfields/onlyactive_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(false); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/conditionProcess.js b/entity/Person_entity/recordcontainers/db/conditionProcess.js index a856eee0c297f691d292222ffb1b94f55df14c55..96a93d2ddef53d2c42ac1e41124aeeb5987e0531 100644 --- a/entity/Person_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Person_entity/recordcontainers/db/conditionProcess.js @@ -1,5 +1,6 @@ import("Context_lib"); import("AttributeRegistry_basic"); +import("KeywordRegistry_basic"); import("Employee_lib"); import("AttributeFilter_lib"); import("Attribute_lib"); @@ -9,14 +10,20 @@ import("system.result"); import("Sql_lib"); var cond = newWhereIfSet("CONTACT.ORGANISATION_ID", "$param.OrgId_param") - .andIfSet("CONTACT.CONTACTID", "$param.ContactId_param"); + .andIfSet("CONTACT.CONTACTID", "$param.ContactId_param"); + + +if(vars.getString("$param.OnlyActive_param") == "true") + cond.and("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL()); if (vars.exists("$param.ExcludedContactIds_param") && vars.get("$param.ExcludedContactIds_param")) { var excludedContacts = JSON.parse(vars.getString("$param.ExcludedContactIds_param")); cond.andIfSet("CONTACT.CONTACTID", excludedContacts, SqlBuilder.NOT_IN()); } + var onlyShowContactIds = JSON.parse(vars.get("$param.OnlyShowContactIds_param")); + if(onlyShowContactIds != null && onlyShowContactIds.length > 0) { let additionalCondition = newWhere(); diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index 0c9917ccc6aa44d68deb149a6a5e1ff0c6d878d4..b6552d0b4074339935d62ea9312915e0cb8e07b7 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -34,6 +34,7 @@ $KeywordRegistry.activityDirection$internal = function(){return "x";}; $KeywordRegistry.contactStatus = function(){return "ContactStatus";}; $KeywordRegistry.contactStatus$active = function(){return "CONTACTSTATACTIVE";}; +$KeywordRegistry.contactStatus$inactive = function(){return "CONTACTSTATINACTIVE";}; $KeywordRegistry.currency = function(){return "Currency";}; $KeywordRegistry.currency$eur = function(){return "EUR";};