Skip to content
Snippets Groups Projects
Commit 36be8988 authored by Markus Escher's avatar Markus Escher
Browse files

Merge remote-tracking branch 'origin/master'

parents d84b48da 62c6f717
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("system.neon");
import("system.result");
result.string(vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW);
\ No newline at end of file
import("system.project");
import("system.project");
import("system.logging");
import("Util_lib");
import("PostalAddress_lib");
import("system.text");
......@@ -321,8 +324,15 @@ DataPrivacyUtils.collectAll = function(pContactId, pFilterCond)
/**
* Notify the user to update the data privacy informations
*/
DataPrivacyUtils.notifyNeedDataPrivacyUpdate = function(pContactId)
DataPrivacyUtils.notifyNeedDataPrivacyUpdate = function(pContactId, pShowMessage)
{
if (pShowMessage == "false" || pShowMessage === false)
return;
var isActive = JSON.parse(project.getPreferenceValue("custom.dsgvo.active", "true"));
if (!isActive)
return;
if (ContactUtils.getContactTypeByContactId(pContactId) > 1) { // if person
// TODO: jump to DataPrivacy-Tab of contact
question.showMessage(translate.text("Your changes may have an impact on the data privacy information (DSGVO).\n Please update these."), question.INFORMATION, translate.text("Update data privacy information"));
......
......@@ -271,7 +271,6 @@ WsValidationUtils.validate = function(pValue, pType, pCountry, pCity)
*/
WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
{
logging.log(JSON.stringify(vars.getString("$this.value"), null, "\t"))
try
{
var data = JSON.parse(vars.getString("$this.value"));
......@@ -280,11 +279,10 @@ WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
// ignore error
return
}
logging.log(JSON.stringify(typeof data, null, "\t"))
var type = typeof data;
// Only an array can be returned by the ws. V-- this check is slow -> check number and string before
if (type == "number" || type == "string" || Object.prototype.toString.call(data) !== '[object Array]')
// Only an array can be returned by the ws. V-- this check is slow -> check if not object before as its faster
if (type != "object" || Object.prototype.toString.call(data) !== '[object Array]')
return
_setField("$field.ZIP", data[1]);
......
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