diff --git a/entity/Address_entity/recordcontainers/childgroup/query.js b/entity/Address_entity/recordcontainers/childgroup/query.js index 968036a197b0d04ae5aa60f910b75b92aae025a2..4cf4bcc1d9115cf0e3f038deb2444c85fbd28c1e 100644 --- a/entity/Address_entity/recordcontainers/childgroup/query.js +++ b/entity/Address_entity/recordcontainers/childgroup/query.js @@ -10,9 +10,9 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } -sqlQuery = "select ADDRESS.ADDRESSID as uid" +sqlQuery = 'select ADDRESS.ADDRESSID as "_uid_"' + ', ADDRESS.ADDRESSID' - + ', ADDRESS.ZIP as "ZIP.value"' + + ', ADDRESS.ZIP as ZIP' + ', ADDRESS.CITY as CITY' + ', ADDRESS.COUNTRY' + ', ADDRESS.ADDRESS' diff --git a/entity/Communication_entity/recordcontainers/groupextension/query.js b/entity/Communication_entity/recordcontainers/groupextension/query.js index 7faad202b023540b228df7dd410c24573ce8d755..175c25d9aa7ea3eb64603cbec5ff91a1f143ccf6 100644 --- a/entity/Communication_entity/recordcontainers/groupextension/query.js +++ b/entity/Communication_entity/recordcontainers/groupextension/query.js @@ -10,7 +10,9 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } -sqlQuery = "select COMMUNICATION.COMMUNICATIONID, COMMUNICATION.ADDR from COMMUNICATION " +sqlQuery = "select COMMUNICATION.COMMUNICATIONID" + + ", COMMUNICATION.ADDR" + + " from COMMUNICATION" + (queryCondition || "") + " order by COMMUNICATION.COMMUNICATIONID "; diff --git a/entity/Contract_entity/recordcontainers/index/query.js b/entity/Contract_entity/recordcontainers/index/query.js index 3a7783950d4c3e1f8c1222d963e3f468a4dd100d..2c01a5477fbfe24464274ba8a2294bb043cf61b0 100644 --- a/entity/Contract_entity/recordcontainers/index/query.js +++ b/entity/Contract_entity/recordcontainers/index/query.js @@ -15,12 +15,12 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select CONTRACTID as uid, " +sqlQuery = 'select CONTRACTID as "_uid_", ' + sqlHelper.concat(["CONTRACTCODE", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractStatus(), "CONTRACTSTATUS")], " | ") - + " as title, " + + ' as "_title_", ' + sqlHelper.concat(["ORGANISATION.NAME", "'| " + translate.text("Type of contract") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.contractType(), "CONTRACTTYPE")]) - + " as description" + + ' as "_description_"' + ", CONTRACTCODE " + ", CUSTOMERCODE " + ", CONTRACT.CONTACT_ID" diff --git a/entity/Offer_entity/recordcontainers/index/query.js b/entity/Offer_entity/recordcontainers/index/query.js index 7aed701b0b543ac1c93e7a932efec19bac353581..73e6a530c0286b34ea9f1e27bdcb83c52b7c4b47 100644 --- a/entity/Offer_entity/recordcontainers/index/query.js +++ b/entity/Offer_entity/recordcontainers/index/query.js @@ -16,11 +16,11 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select OFFERID as uid, " +sqlQuery = 'select OFFERID as "_uid_", ' + sqlHelper.concat([sqlHelper.cast("OFFERCODE", SQLTYPES.CHAR, 10), KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ") - + " as title, " + + ' as "_title_", ' + sqlHelper.concat(["ORGANISATION.NAME", "'| " + translate.text("Description") + ":'", sqlHelper.castLob("OFFER.INFO", 250)]) - + " as description" + + ' as "_description_"' + ", OFFERCODE" + ", CUSTOMERCODE " + ", OFFER.CONTACT_ID " diff --git a/entity/Order_entity/recordcontainers/index/query.js b/entity/Order_entity/recordcontainers/index/query.js index 57bca0642de68d859f09012c034d5edc33139485..2a452fc682912d0f352095e584df3f3ad05a161a 100644 --- a/entity/Order_entity/recordcontainers/index/query.js +++ b/entity/Order_entity/recordcontainers/index/query.js @@ -15,11 +15,11 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select SALESORDERID as uid, " +sqlQuery = 'select SALESORDERID as "_uid_", ' + sqlHelper.concat([sqlHelper.cast("SALESORDERCODE", SQLTYPES.CHAR, 10), KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesorderState(), "SALESORDER.STATUS")], " | ") - + " as title, " + + ' as "_title_", ' + sqlHelper.concat(["ORGANISATION.NAME"], " | ") - + " as description" + + ' as "_description_" ' + ", SALESORDERCODE" + ", CUSTOMERCODE" + ", SALESORDER.CONTACT_ID" diff --git a/entity/Organisation_entity/recordcontainers/index/affectedConsumerIds.js b/entity/Organisation_entity/recordcontainers/index/affectedConsumerIds.js index e0298d25cc993a3e89df07f184ce16f2316a7ca6..9e9351b3c7af57b042f8d4ead7c452dbcbe126fa 100644 --- a/entity/Organisation_entity/recordcontainers/index/affectedConsumerIds.js +++ b/entity/Organisation_entity/recordcontainers/index/affectedConsumerIds.js @@ -40,7 +40,8 @@ function addIds(pRes, pConsumerName, pIds) function addAddressIds(pRes, pCurrId) { var sql, ids; - sql = "select ADDRESS.ADDRESSID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.ORGANISATION_ID = '" + pCurrId + "'"; +// sql = "select ADDRESS.ADDRESSID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.ORGANISATION_ID = '" + pCurrId + "'"; + sql = "select ADDRESS.ADDRESSID from ADDRESS where ADDRESS.CONTACT_ID = '" + pCurrId + "'"; ids = db.array(db.COLUMN, sql, alias, 0 , 1 * datetime.ONE_MINUTE); addIds(pRes, "Addresses", ids); @@ -49,7 +50,8 @@ function addAddressIds(pRes, pCurrId) function addCommunicationIds(pRes, pCurrId) { var sql, ids; - sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.ORGANISATION_ID = '" + pCurrId + "'"; +// sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.ORGANISATION_ID = '" + pCurrId + "'"; + sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION where COMMUNICATION.CONTACT_ID = '" + pCurrId + "'"; ids = db.array(db.COLUMN, sql, alias, 0 , 1 * datetime.ONE_MINUTE); addIds(pRes, "Communications", ids); diff --git a/entity/Organisation_entity/recordcontainers/index/affectedIds.js b/entity/Organisation_entity/recordcontainers/index/affectedIds.js index 7d50c9deb4813ce649ff34eb5c38d65d0d996280..dc4472218b900a45c68d35b022fc3161a739ec72 100644 --- a/entity/Organisation_entity/recordcontainers/index/affectedIds.js +++ b/entity/Organisation_entity/recordcontainers/index/affectedIds.js @@ -13,24 +13,48 @@ infoContainer = IndexsearchUtils.createAffectedInfoContainer(idValue, null, var ,function (){return vars.get("$local.oldvalues")} ,function (){return vars.get("$local.values")}); +//switch (tableName) +//{ +// case "ORGANISATION": +// res = [idValue]; +// break; +// case "CONTACT": +// res = db.array(db.COLUMN, "select CONTACT.ORGANISATION_ID from CONTACT where CONTACT.PERSON_ID is null and CONTACT.CONTACTID = '" + idValue + "'"); +// break; +// case "ADDRESS": +// res = IndexsearchUtils.getAffectedIdValues("ORGANISATION_ID", infoContainer, function (id){ +// return db.array(db.COLUMN, ["select CONTACT.ORGANISATION_ID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID is null and ADDRESS.ADDRESSID = ?", [ +// [id, SqlUtils.getSingleColumnType("ADDRESS", "ADDRESSID")] +// ]]); +// }); +// break; +// case "COMMUNICATION": +// res = IndexsearchUtils.getAffectedIdValues("ORGANISATION_ID", infoContainer, function (id){ +// return db.array(db.COLUMN, ["select CONTACT.ORGANISATION_ID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID is null and where COMMUNICATIONID = ?", [ +// [id, SqlUtils.getSingleColumnType("COMMUNICATION", "COMMUNICATIONID")] +// ]]); +// }); +// break; +//} + switch (tableName) { - case "ORGANISATION": + case "CONTACT": res = [idValue]; break; - case "CONTACT": - res = db.array(db.COLUMN, "select CONTACT.ORGANISATION_ID from CONTACT where CONTACT.PERSON_ID is null and CONTACT.CONTACTID = '" + idValue + "'"); + case "ORGANISATION": + res = db.array(db.COLUMN, "select CONTACT.CONTACTID from CONTACT where CONTACT.PERSON_ID is null and CONTACT.ORGANISATION_ID = '" + idValue + "'"); break; case "ADDRESS": - res = IndexsearchUtils.getAffectedIdValues("ORGANISATION_ID", infoContainer, function (id){ - return db.array(db.COLUMN, ["select CONTACT.ORGANISATION_ID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID is null and ADDRESS.ADDRESSID = ?", [ + res = IndexsearchUtils.getAffectedIdValues("CONTACT_ID", infoContainer, function (id){ + return db.array(db.COLUMN, ["select ADDRESS.CONTACT_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [ [id, SqlUtils.getSingleColumnType("ADDRESS", "ADDRESSID")] ]]); }); break; case "COMMUNICATION": - res = IndexsearchUtils.getAffectedIdValues("ORGANISATION_ID", infoContainer, function (id){ - return db.array(db.COLUMN, ["select CONTACT.ORGANISATION_ID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID is null and where COMMUNICATIONID = ?", [ + res = IndexsearchUtils.getAffectedIdValues("CONTACT_ID", infoContainer, function (id){ + return db.array(db.COLUMN, ["select COMMUNICATION.CONTACT_ID from COMMUNICATION where COMMUNICATIONID = ?", [ [id, SqlUtils.getSingleColumnType("COMMUNICATION", "COMMUNICATIONID")] ]]); }); diff --git a/entity/Organisation_entity/recordcontainers/index/query.js b/entity/Organisation_entity/recordcontainers/index/query.js index 68a86d5b62dff07b04696c412c3d273ca412ec76..8962918927f06fbbe77111d3bb1f37ef05169179 100644 --- a/entity/Organisation_entity/recordcontainers/index/query.js +++ b/entity/Organisation_entity/recordcontainers/index/query.js @@ -13,22 +13,22 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select ORGANISATION.ORGANISATIONID as uid" +sqlQuery = 'select CONTACT.CONTACTID as "_uid_" ' + ", " + sqlHelper.concat(["ORGANISATION.NAME", "'|'", "ORGANISATION.CUSTOMERCODE"]) - + " as title " + + ' as "_title_" ' + ", " + sqlHelper.concat([ sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO", "'-'" ,"defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) ,sqlHelper.concat(["'" + translate.text("Phone") + ":'", "(" + CommUtil.getStandardSubSqlPhone() + ")"]) ,sqlHelper.concat(["'" + translate.text("Email") + ":'", "(" + CommUtil.getStandardSubSqlMail() + ")"]) - ], " | ") + " as description " + ], " | ") + ' as "_description_"' //additional indexed fields + ", ORGANISATION.ORGANISATIONID" + ", ORGANISATION.NAME" + ", ORGANISATION.CUSTOMERCODE" + ", CONTACT.CONTACTID" - + ", (" + CommUtil.getStandardSubSqlPhone() + ') as "STANDARD_PHONE_COMMUNICATION.value"' - + ", (" + CommUtil.getStandardSubSqlMail() + ') as "STANDARD_EMAIL_COMMUNICATION.value"' + + ", (" + CommUtil.getStandardSubSqlPhone() + ") as STANDARD_PHONE_COMMUNICATION" + + ", (" + CommUtil.getStandardSubSqlMail() + ") as STANDARD_EMAIL_COMMUNICATION" + " from ORGANISATION " + " join CONTACT on CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null " + " left join ADDRESS defaultAddress on defaultAddress.ADDRESSID = CONTACT.ADDRESS_ID " diff --git a/entity/Person_entity/recordcontainers/index/affectedConsumerIds.js b/entity/Person_entity/recordcontainers/index/affectedConsumerIds.js index 679911a6c882e857b87a05a199eea26a08f06d35..ba72575bc776c538553e25abf1ba24c7a02724e8 100644 --- a/entity/Person_entity/recordcontainers/index/affectedConsumerIds.js +++ b/entity/Person_entity/recordcontainers/index/affectedConsumerIds.js @@ -41,7 +41,8 @@ function addIds(pRes, pConsumerName, pIds) function addPersAddressIds(pRes, pCurrId) { var sql, ids; - sql = "select ADDRESS.ADDRESSID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID = '" + pCurrId + "'"; +// sql = "select ADDRESS.ADDRESSID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID = '" + pCurrId + "'"; + sql = "select ADDRESS.ADDRESSID from ADDRESS where ADDRESS.CONTACT_ID = '" + pCurrId + "'"; ids = db.array(db.COLUMN, sql, alias, 0 , 1 * datetime.ONE_MINUTE); addIds(pRes, "PersAddresses", ids); } @@ -49,10 +50,16 @@ function addPersAddressIds(pRes, pCurrId) function addOrgAddressIds(pRes, pCurrId) { var sql, ids; +// sql = "select CONTACT.ADDRESS_ID from ORGANISATION " +// + "join CONTACT on CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null " +// + "where ORGANISATION.ORGANISATIONID = ( " +// + "select c.ORGANISATION_ID FROM CONTACT as c where c.PERSON_ID = '" + pCurrId +// + "')"; +// sql = "select CONTACT.ADDRESS_ID from ORGANISATION " + "join CONTACT on CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null " + "where ORGANISATION.ORGANISATIONID = ( " - + "select c.ORGANISATION_ID FROM CONTACT as c where c.PERSON_ID = '" + pCurrId + + "select c.ORGANISATION_ID FROM CONTACT as c where c.CONTACTID = '" + pCurrId + "')"; ids = db.array(db.COLUMN, sql, alias, 0 , 1 * datetime.ONE_MINUTE); @@ -62,7 +69,8 @@ function addOrgAddressIds(pRes, pCurrId) function addCommunicationIds(pRes, pCurrId) { var sql, ids; - sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID = '" + pCurrId + "'"; +// sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID = '" + pCurrId + "'"; + sql = "select COMMUNICATION.COMMUNICATIONID from COMMUNICATION where COMMUNICATION.CONTACT_ID = '" + pCurrId + "'"; ids = db.array(db.COLUMN, sql, alias, 0 , 1 * datetime.ONE_MINUTE); addIds(pRes, "Communications", ids); } diff --git a/entity/Person_entity/recordcontainers/index/affectedIds.js b/entity/Person_entity/recordcontainers/index/affectedIds.js index b4b39cb6399d759ad6576b68cc46e8fffdb78835..ed25062b17d14fe66f751ac92c620b1928bba166 100644 --- a/entity/Person_entity/recordcontainers/index/affectedIds.js +++ b/entity/Person_entity/recordcontainers/index/affectedIds.js @@ -13,27 +13,55 @@ infoContainer = IndexsearchUtils.createAffectedInfoContainer(idValue, null, var ,function (){return vars.get("$local.oldvalues")} ,function (){return vars.get("$local.values")}); +// +//switch (tableName) +//{ +// case "PERSON": +// res = [idValue]; +// break; +// case "CONTACT": +// res = db.array(db.COLUMN, "select CONTACT.PERSON_ID from CONTACT where CONTACT.CONTACTID = '" + idValue + "'"); +// break; +// case "ORGANISATION": +// res = db.array(db.COLUMN, "select CONTACT.PERSON_ID from CONTACT where CONTACT.PERSON_ID is not null and CONTACT.ORGANISATION_ID = '" + idValue + "'"); +// break; +// case "ADDRESS": +// res = IndexsearchUtils.getAffectedIdValues("PERSON_ID", infoContainer, function (id){ +// return db.array(db.COLUMN, ["select CONTACT.PERSON_ID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID is not null and ADDRESS.ADDRESSID = ?", [ +// [id, SqlUtils.getSingleColumnType("ADDRESS", "ADDRESSID")] +// ]]); +// }); +// break; +// case "COMMUNICATION": +// res = IndexsearchUtils.getAffectedIdValues("PERSON_ID", infoContainer, function (id){ +// return db.array(db.COLUMN, ["select CONTACT.PERSON_ID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID is not null and where COMMUNICATIONID = ?", [ +// [id, SqlUtils.getSingleColumnType("COMMUNICATION", "COMMUNICATIONID")] +// ]]); +// }); +// break; +//} + switch (tableName) { - case "PERSON": + case "CONTACT": res = [idValue]; break; - case "CONTACT": - res = db.array(db.COLUMN, "select CONTACT.PERSON_ID from CONTACT where CONTACT.CONTACTID = '" + idValue + "'"); + case "PERSON": + res = db.array(db.COLUMN, "select CONTACT.CONTACTID from CONTACT where CONTACT.PERSON_ID = '" + idValue + "'"); break; case "ORGANISATION": - res = db.array(db.COLUMN, "select CONTACT.PERSON_ID from CONTACT where CONTACT.PERSON_ID is not null and CONTACT.ORGANISATION_ID = '" + idValue + "'"); + res = db.array(db.COLUMN, "select CONTACT.CONTACTID from CONTACT where CONTACT.PERSON_ID is not null and CONTACT.ORGANISATION_ID = '" + idValue + "'"); break; case "ADDRESS": - res = IndexsearchUtils.getAffectedIdValues("PERSON_ID", infoContainer, function (id){ - return db.array(db.COLUMN, ["select CONTACT.PERSON_ID from ADDRESS left join CONTACT on CONTACT.CONTACTID = ADDRESS.CONTACT_ID where CONTACT.PERSON_ID is not null and ADDRESS.ADDRESSID = ?", [ + res = IndexsearchUtils.getAffectedIdValues("CONTACT_ID", infoContainer, function (id){ + return db.array(db.COLUMN, ["select ADDRESS.CONTACT_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [ [id, SqlUtils.getSingleColumnType("ADDRESS", "ADDRESSID")] ]]); }); break; case "COMMUNICATION": - res = IndexsearchUtils.getAffectedIdValues("PERSON_ID", infoContainer, function (id){ - return db.array(db.COLUMN, ["select CONTACT.PERSON_ID from COMMUNICATION left join CONTACT on CONTACT.CONTACTID = COMMUNICATION.CONTACT_ID where CONTACT.PERSON_ID is not null and where COMMUNICATIONID = ?", [ + res = IndexsearchUtils.getAffectedIdValues("CONTACT_ID", infoContainer, function (id){ + return db.array(db.COLUMN, ["select COMMUNICATION.CONTACT_ID from COMMUNICATION where COMMUNICATIONID = ?", [ [id, SqlUtils.getSingleColumnType("COMMUNICATION", "COMMUNICATIONID")] ]]); }); diff --git a/entity/Person_entity/recordcontainers/index/query.js b/entity/Person_entity/recordcontainers/index/query.js index fdf2d9995a4f18657896e2ab03544e447b011972..ece3dd3e34927fd223128e432ba24be77fdf2e04 100644 --- a/entity/Person_entity/recordcontainers/index/query.js +++ b/entity/Person_entity/recordcontainers/index/query.js @@ -13,7 +13,7 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select PERSON.PERSONID as uid " +sqlQuery = 'select CONTACT.CONTACTID as "_uid_" ' + "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "'|'", "ORGANISATION.NAME"]) + ' as "_title_" ' + "," + sqlHelper.concat([ @@ -21,7 +21,7 @@ sqlQuery = "select PERSON.PERSONID as uid " ,"defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"]) ,sqlHelper.concat(["'" + translate.text("Phone") + ":'", "(" + CommUtil.getStandardSubSqlPhone() + ")"]) ,sqlHelper.concat(["'" + translate.text("Email") + ":'", "(" + CommUtil.getStandardSubSqlMail() + ")"]) - ], " | ") + " as description " + ], " | ") + ' as "_description_" ' //additional indexed fields + ", PERSON.PERSONID " + ", PERSON.FIRSTNAME " @@ -31,8 +31,8 @@ sqlQuery = "select PERSON.PERSONID as uid " + ", CONTACT.CONTACTID " + ", CONTACT.ORGANISATION_ID " + ", ORGANISATION.NAME " - + ", (" + CommUtil.getStandardSubSqlPhone() + ') as "STANDARD_PHONE_COMMUNICATION.value"' - + ", (" + CommUtil.getStandardSubSqlMail() + ') as "STANDARD_EMAIL_COMMUNICATION.value"' + + ", (" + CommUtil.getStandardSubSqlPhone() + ") as STANDARD_PHONE_COMMUNICATION" + + ", (" + CommUtil.getStandardSubSqlMail() + ") as STANDARD_EMAIL_COMMUNICATION" + " from PERSON " + " join CONTACT on CONTACT.PERSON_ID = PERSON.PERSONID " + " join ORGANISATION on CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID " diff --git a/entity/Product_entity/recordcontainers/index/query.js b/entity/Product_entity/recordcontainers/index/query.js index 34a9a7a3beae0a79423a22b105e737b178717dde..0510962887633d9d1b4e3bea26239aae9555a540 100644 --- a/entity/Product_entity/recordcontainers/index/query.js +++ b/entity/Product_entity/recordcontainers/index/query.js @@ -14,11 +14,11 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select PRODUCTID as uid, " +sqlQuery = 'select PRODUCTID as "_uid_", ' + sqlHelper.concat(["PRODUCTCODE", "PRODUCTNAME"], " | ") - + " as title, " + + ' as "_title_", ' + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.productGroupcode(), "GROUPCODEID") - + " as description" + + ' as "_description_" ' + ", PRODUCTCODE " + " from PRODUCT " + queryCondition + " order by PRODUCTCODE "; diff --git a/entity/Salesproject_entity/recordcontainers/index/query.js b/entity/Salesproject_entity/recordcontainers/index/query.js index ae0bd2e48c708ed1828ef89fbaf737d7100c8236..8d94ec07dd8f6fc46b3216f92ca2ea5e794455e6 100644 --- a/entity/Salesproject_entity/recordcontainers/index/query.js +++ b/entity/Salesproject_entity/recordcontainers/index/query.js @@ -15,13 +15,13 @@ if (vars.exists("$local.idvalue")) { //TODO: refactor this for incremental indexer (injections?) } sqlHelper = new SqlMaskingUtils(); -sqlQuery = "select SALESPROJECTID as uid" - + ", PROJECTTITLE as title, " +sqlQuery = 'select SALESPROJECTID as "_uid_"' + + ', PROJECTTITLE as "_title_", ' + sqlHelper.concat([ "'" + translate.text("Status") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectState(), "STATE"), "'| " + translate.text("Phase") + ":'", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectPhase(), "PHASE") ]) - + " as description" + + ' as "_description_" ' + ", PROJECTCODE" + ", PROJECTTITLE" + ", STATE"