diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index a48ba1eec23d65e66922c12f14aab572ef4db15e..a1c9dc5748145d7807a8927740c9383fa46d735c 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -1724,12 +1724,12 @@ </dbRecordFieldMapping> <dbRecordFieldMapping> <name>STANDARD_EMAIL_COMMUNICATION.value</name> - <isFilterable v="true" /> + <isFilterable v="false" /> <isLookupFilter v="false" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>STANDARD_PHONE_COMMUNICATION.value</name> - <isFilterable v="true" /> + <isFilterable v="false" /> <isLookupFilter v="false" /> </dbRecordFieldMapping> <consumerMapping> @@ -1880,6 +1880,27 @@ <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/filterextensions/responsibleassignment/filterConditionProcess.js</filterConditionProcess> <filtertype>EXTENDED</filtertype> </filterExtension> + <filterExtension> + <name>Communication_Mail_filter</name> + <title>Communication: Mail</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>Communication_Phone_filter</name> + <title>Communication: Phone</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>Commincation_Link_filter</name> + <title>Communication: Link</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/filterextensions/commincation_link_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> </filterExtensions> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Organisation_entity/recordcontainers/db/filterextensions/commincation_link_filter/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/filterextensions/commincation_link_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d09b906577809b1aef5ce5ececa962849e83bed4 --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/filterextensions/commincation_link_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "LINK"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..36ecbba8f78b1d6a3cc44b791aa188a7b1c028df --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "EMAIL"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a48f7cdf37ab4438d79ae1ddb9349f4cfd91272b --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "TELEPHONE"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 64bb15fc5641035b58595c7c69834e4ac7c989e3..f294673d397ad7e5b12ab7f16821daa5d3c0d75b 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -1671,12 +1671,12 @@ </dbRecordFieldMapping> <dbRecordFieldMapping> <name>STANDARD_EMAIL_COMMUNICATION.value</name> - <isFilterable v="true" /> + <isFilterable v="false" /> <isLookupFilter v="false" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>STANDARD_PHONE_COMMUNICATION.value</name> - <isFilterable v="true" /> + <isFilterable v="false" /> <isLookupFilter v="false" /> </dbRecordFieldMapping> <consumerMapping> @@ -1825,6 +1825,28 @@ <filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/supervisorassignment/filterConditionProcess.js</filterConditionProcess> <filtertype>BASIC</filtertype> </filterExtension> + <filterExtension> + <name>Communication_Mail_filter</name> + <title>Communication: Mail</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>Communication_Phone_filter</name> + <title>Communication: Phone</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + <filterExtension> + <name>Communication_Link_filter</name> + <title>Communication: Link</title> + <contentType>TEXT</contentType> + <filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/communication_link_filter/filterConditionProcess.js</filterConditionProcess> + <isLookupFilter v="false" /> + <filtertype>BASIC</filtertype> + </filterExtension> </filterExtensions> </dbRecordContainer> <indexRecordContainer> diff --git a/entity/Person_entity/recordcontainers/db/filterextensions/communication_link_filter/filterConditionProcess.js b/entity/Person_entity/recordcontainers/db/filterextensions/communication_link_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d09b906577809b1aef5ce5ececa962849e83bed4 --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/filterextensions/communication_link_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "LINK"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js b/entity/Person_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..36ecbba8f78b1d6a3cc44b791aa188a7b1c028df --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/filterextensions/communication_mail_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "EMAIL"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js b/entity/Person_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a48f7cdf37ab4438d79ae1ddb9349f4cfd91272b --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/filterextensions/communication_phone_filter/filterConditionProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var resultSqlCond = ContactUtils.getCommFilter(vars.get("$local.operator"), (vars.get("$local.rawvalue") ? vars.get("$local.rawvalue") : ""), + vars.get("$local.operator2").trim(), vars.get("$local.comparison"), "TELEPHONE"); + +result.string(resultSqlCond); \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 88793e214b2a48ecfbb61c54143d0de37f6c44ff..23e6d296ea90fd1c311faa6dafe33178bbdb0377 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -78,6 +78,10 @@ <key>Restore Team</key> <value>Team wiederherstellen</value> </entry> + <entry> + <key>Communication: Mail</key> + <value>Kommunikation: E-Mail</value> + </entry> <entry> <key>The given Keyword Category Name is already used but needs to be unique</key> <value>Der angegebene Schlüsselwort Kategoriename existiert bereits, muss aber eindeutig sein</value> @@ -102,6 +106,14 @@ <key>Edit Team</key> <value>Team bearbeiten</value> </entry> + <entry> + <key>Communication: Phone</key> + <value>Kommunikation: Telefon</value> + </entry> + <entry> + <key>Communication: Link</key> + <value>Kommunikation: Webseite</value> + </entry> <entry> <key>The start date has to be before the end date.</key> <value>Das Startdatum muss vor dem Enddatum sein.</value> diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index 4a59839543915bbe0c16edfb2c56985efe935f15..9c3d0a46d788de699d66888adde8897756016087 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -582,6 +582,61 @@ ContactUtils.getCommRestrictionCount = function(pMedium, pStartDate) return firstLevel.toString() +") + ("+secondLevel.toString(); } +/** + * returns sql for filtering links, mail addresses or telephone numbers + * + * @param {String} pOperator filter operator + * @param {String} pRawvalue value that is filtered for + * @param {String} pFilterOperatorName name of the filter operator + * @param {String} pComparison comparison operator + * @param {String} pType type of communication + * + * @return {String} the resulting select + */ +ContactUtils.getCommFilter = function(pOperator, pRawvalue, pFilterOperatorName, pComparison, pType) +{ + let resultSqlCond; + let addSqlcond = " in "; + //SqlBuilder not implemented as the statement needs to be finished in the switch case + let commpart = "(select COMMUNICATION.CONTACT_ID from COMMUNICATION " + + " join AB_KEYWORD_ENTRY on AB_KEYWORD_ENTRY.KEYID = COMMUNICATION.MEDIUM_ID " + + " join AB_KEYWORD_ATTRIBUTERELATION on AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID = AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID" + + " where AB_KEYWORD_ATTRIBUTERELATION.CHAR_VALUE = '" + pType + "'"; + + if (pOperator == 2) + { + addSqlcond = " not in "; + } + + resultSqlCond = "CONTACTID " + addSqlcond + commpart + " and COMMUNICATION.ADDR " + pFilterOperatorName; + + switch (pComparison) + { + case "EQUAL": + case "NOT_EQUAL": + resultSqlCond = resultSqlCond + " '" + pRawvalue + "')"; + break; + case "CONTAINS": + case "CONTAINS_NOT": + resultSqlCond = resultSqlCond + " '%" + pRawvalue + "%')"; + break; + case "STARTSWITH": + resultSqlCond = resultSqlCond + " '" + pRawvalue + "%')"; + break; + case "ENDSWITH": + resultSqlCond = resultSqlCond + " '%" + pRawvalue + "')"; + break; + case "ISNULL": + resultSqlCond = "CONTACTID not in " + commpart + ")"; + break; + case "ISNOTNULL": + resultSqlCond = resultSqlCond + ")"; + break; + } + + return resultSqlCond; +} + /** * object for handling of a single contact * provides static- and instance-functions