diff --git a/process/Organisation_lib/process.js b/process/Organisation_lib/process.js index d173872ccf02570cd9b4298e7795abbe0f64ee48..a5500b246465d5d168849d0303d1da8d6c96e1cc 100644 --- a/process/Organisation_lib/process.js +++ b/process/Organisation_lib/process.js @@ -20,6 +20,30 @@ import("KeywordRegistry_basic"); */ function OrgUtils() {} +/** + * checks if a organisationid is the id of the dummy organisation "private" + * + * @param {String} pOrganisationId the id that shall be checked + * + * @return {boolean} true if passed organisationid is organisationid of the dummy organisation "private" + */ +OrgUtils.isPrivateOrganisationId = function(pOrganisationId) +{ + //TODO: use this function everywhere instead of manual checks + return pOrganisationId.trim() == OrgUtils.getPrivateOrganisationId(); +} + +/** + * returns the image for a organisation + * + * @return {String} hard coded organisationid of the dummy organisation "private" + */ +OrgUtils.getPrivateOrganisationId = function() +{ + //TODO: use this function everywhere instead of hardcoded organisationids "0" + return "0"; +} + /** * returns the image for a organisation * diff --git a/process/StandardObject_lib/process.js b/process/StandardObject_lib/process.js index 772d1e21ee1a13df0cbed76d5b8c837ec682e8ef..5e8a368ff6f34abf5c60fb08ce0b39828d117350 100644 --- a/process/StandardObject_lib/process.js +++ b/process/StandardObject_lib/process.js @@ -1,3 +1,4 @@ +import("Organisation_lib"); import("system.db"); import("Keyword_lib"); import("KeywordRegistry_basic"); @@ -227,6 +228,8 @@ StandardObject.prototype._setContactStandardAddress = function (pAddressID, pCon * @return Standard address of the organisation or null. */ StandardObject.prototype._getCompanyStandardAddress = function (pOrganisationID) { + if (OrgUtils.isPrivateOrganisationId(pOrganisationID)) + return null; var addressIdResult = db.cell("select ADDRESS_ID from CONTACT" + " where ORGANISATION_ID = '" + pOrganisationID + "'" + " and ADDRESS_ID is not null and PERSON_ID is null");