Skip to content
Snippets Groups Projects
Commit 45ea78a2 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

fix #1042973: ignore private organisations for standard address check

parent b8d391c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
*
......
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");
......
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