Skip to content
Snippets Groups Projects
Commit b8c28738 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

#1064546 indexsearch did not work with Organisation and Person

parent 778d579e
No related branches found
No related tags found
No related merge requests found
......@@ -1357,16 +1357,6 @@
</affectedTables>
<affectedIds>%aditoprj%/entity/Organisation_entity/recordcontainers/index/affectedIds.js</affectedIds>
<indexFieldMappings>
<indexRecordFieldMapping>
<name>#LOCATION</name>
<indexFieldType>LOCATION</indexFieldType>
<additionalFieldNameAliases>
<element>location</element>
</additionalFieldNameAliases>
<isGlobalSearchField v="false" />
<isFilterable v="false" />
<isLookupFilter v="false" />
</indexRecordFieldMapping>
<indexRecordFieldMapping>
<name>NAME.value</name>
<indexFieldType>PROPER_NAME</indexFieldType>
......
......@@ -46,9 +46,7 @@ var querySelect = newSelect("CONTACT.CONTACTID "
.leftJoin("COMMUNICATION", "PHONE.CONTACT_ID = CONTACT.CONTACTID and PHONE.MEDIUM_ID in ('" + CommMediumPhoneIds.join("', '") + "')", "PHONE")//TODO: refactor to new SqlBuilder
.where("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL())
if (vars.exists("$local.idvalue") && vars.get("$local.idvalue") && vars.get("$local.idvalue").length > 0)
{
querySelect.where("CONTACT.CONTACTID", vars.get("$local.idvalue"), SqlBuilder.IN());
}
if (vars.exists("$local.idvalue"))
querySelect.whereIfSet("CONTACT.CONTACTID", "$local.idvalue");
result.string(querySelect.toString());
......@@ -42,7 +42,6 @@ var querySelect = newSelect("CONTACT.CONTACTID "
)
.from("PERSON")
.join("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID")
.and("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL())
.join("ORGANISATION", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID")
.leftJoin("ADDRESS", "defaultAddress.ADDRESSID = CONTACT.ADDRESS_ID", "defaultAddress")
.leftJoin("ADDRESS", "ADDRESS.CONTACT_ID = CONTACT.CONTACTID")
......@@ -51,11 +50,7 @@ var querySelect = newSelect("CONTACT.CONTACTID "
.where("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL())
.orderBy("CONTACT.CONTACTID");
if (vars.exists("$local.idvalue"))
{
affectedIds = vars.get("$local.idvalue");
querySelect.whereIfSet("CONTACT.CONTACTID", affectedIds, SqlBuilder.IN());
}
if (vars.exists("$local.idvalue"))
querySelect.whereIfSet("CONTACT.CONTACTID", "$local.idvalue");
result.string(querySelect);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment