diff --git a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js index 4f61f041a015261525b89aec9f5af9ccf3ce3577..709b1c0e1937ff93ce1bf32478b6d0e411028554 100644 --- a/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/360Degree_entity/recordcontainers/jdito/contentProcess.js @@ -98,19 +98,39 @@ function _get360Data(pContactId, pContextList) group = row[pContextList[context]["setGroupBy"]] } - if(context == "Salesproject" && !ContactUtils.isOrganisation(pContactId))//add roles to the description + if(context == "Salesproject") { - description = description + " | " + translate.text("Role") + ": " - if(roleObj.hasOwnProperty(salesProjectId)) + if(!ContactUtils.isOrganisation(pContactId))//add roles to the description if person dataset { - var roles = roleObj[salesProjectId]; - for (let i = 0; i < roles.length; i++) + description = description + " | " + translate.text("Role") + ": " + if(roleObj.hasOwnProperty(salesProjectId)) { - if(i != 0) + var roles = roleObj[salesProjectId]; + for (let i = 0; i < roles.length; i++) { - description = description + ", "; + if(i != 0) + { + description = description + ", "; + } + description = description + roles[i]; } - description = description + roles[i]; + } + } + + //add responsible to the description + var responsibleContactId = newSelect("OBJECTMEMBER.CONTACT_ID") + .from("OBJECTMEMBER") + .where("OBJECTMEMBER.OBJECT_TYPE", "Salesproject") + .and("OBJECTMEMBER.OBJECT_ROWID", targetid) + .and("OBJECTMEMBER.RESPONSIBLE", "1") + .cell(); + + if(responsibleContactId) + { + var responsibleName = ContactUtils.getFullTitleByContactId(responsibleContactId, false); + if(!Utils.isNullOrEmpty(responsibleName)) + { + description = description + " | " + translate.text("Responsible") + ": " + responsibleName; } } } diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index b700f6bd1eaee1041a0deb3aee895d25442b8f82..e7436815ba14d9de1ee7b325e7019b2958b96818 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1328,6 +1328,14 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>Salesprojects</name> + <dependency> + <name>dependency</name> + <entityName>Salesproject_entity</entityName> + <fieldName>Salesprojects</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -1809,8 +1817,8 @@ <name>SalesprojectResponsible_filter</name> <title>Salesproject: Responsible</title> <contentType>TEXT</contentType> - <consumer>Salutations</consumer> - <filterValuesProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterValuesProcess.js</filterValuesProcess> + <useConsumer v="true" /> + <consumer>Salesprojects</consumer> <filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtension> diff --git a/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterValuesProcess.js b/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterValuesProcess.js deleted file mode 100644 index 1503f51f280df28f32b5914743bd43070fa3d6d3..0000000000000000000000000000000000000000 --- a/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterValuesProcess.js +++ /dev/null @@ -1,8 +0,0 @@ -import("system.result"); -import("Sql_lib"); - -var salesProjects = newSelect("SALESPROJECT.SALESPROJECTID, SALESPROJECT.PROJECTTITLE") - .from("SALESPROJECT") - .table(); - -result.object(salesProjects); \ No newline at end of file diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index cb8830eabf03ce44753b6cb3e6fe099e044ba2c6..7cc6b6d6e31c43b2a8069cfe485cfc75c2fac65b 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -890,6 +890,14 @@ <name>IgnoreOrderBy_param</name> <expose v="true" /> </entityParameter> + <entityConsumer> + <name>Contacts</name> + <dependency> + <name>dependency</name> + <entityName>Person_entity</entityName> + <fieldName>Contacts</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -1145,15 +1153,15 @@ <filterExtensionSet> <name>Member_filter</name> <filterFieldsProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js</filterFieldsProcess> - <filterValuesProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterValuesProcess.js</filterValuesProcess> <filterConditionProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtensionSet> <filterExtension> <name>Responsible_filter</name> <title>Responsible</title> - <contentType>BOOLEAN</contentType> - <filterValuesProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterValuesProcess.js</filterValuesProcess> + <contentType>TEXT</contentType> + <useConsumer v="true" /> + <consumer>Contacts</consumer> <filterConditionProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtension> diff --git a/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js b/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js index f90041842e710d81d6f7e6b59c2d4edf559d1e51..232efd6c2730953cf806927302dd0c1d1a4b6f76 100644 --- a/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js +++ b/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js @@ -20,7 +20,8 @@ for (var i = 0; i < roles.length; i++) title: translate.text("Role") + ": " + roles[i][1], contentType: "TEXT", hasDropDownValues: true, - isGroupable: false + isGroupable: false, + consumer: "Contacts" }); } diff --git a/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterValuesProcess.js b/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterValuesProcess.js deleted file mode 100644 index 4373a237de9d09be65f68ebc2a214534d65f32c3..0000000000000000000000000000000000000000 --- a/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterValuesProcess.js +++ /dev/null @@ -1,11 +0,0 @@ -import("system.result"); -import("Contact_lib"); -import("Sql_lib"); - - -var values = newSelect(["CONTACT.CONTACTID", ContactUtils.getResolvingDisplaySubSql("CONTACT.CONTACTID", true, true)]) - .from(ContactUtils.getFullContactString()) - .where("CONTACT.PERSON_ID is not null") - .table(); - -result.object(values); \ No newline at end of file diff --git a/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js b/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js index 858d81adb104def5917cb9ef3c162706c9ad04da..475d1ca436a0b54d9ee01032c205d41d9fd1882a 100644 --- a/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js +++ b/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js @@ -9,7 +9,8 @@ var responsibleSql = newSelect("OBJECTMEMBER.CONTACT_ID") .from("OBJECTMEMBER") .where("OBJECTMEMBER.OBJECT_TYPE", "Salesproject") .and("OBJECTMEMBER.OBJECT_ROWID = SALESPROJECT.SALESPROJECTID") - .and("OBJECTMEMBER.RESPONSIBLE", 1); + .and("OBJECTMEMBER.RESPONSIBLE", 1) + .andIfSet("OBJECTMEMBER.CONTACT_ID", rawValue); var condType = SqlBuilder.EXISTS(); diff --git a/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterValuesProcess.js b/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterValuesProcess.js deleted file mode 100644 index 4462144da5638267f7c76cce0c779305ae80c089..0000000000000000000000000000000000000000 --- a/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterValuesProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.translate"); -import("system.result"); - -result.object([["true", translate.text("Yes")], ["false", translate.text("No")]]); \ No newline at end of file