Skip to content
Snippets Groups Projects
Commit c4e8f163 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

add validation if all privacy information is filled

parent 0c94d9c9
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.9" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.9">
<name>DSGVOInfo_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<onValidation>%aditoprj%/entity/DSGVOInfo_entity/onValidation.js</onValidation>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
......
import("system.vars");
import("system.translate");
import("system.result");
import("DataPrivacy_lib");
if (!DataPrivacyUtils.checkAllFilled(vars.get("$field.CONTACT_ID")))
{
result.string(translate.text("Not all data privacy fields for all private data is filled. Cannot create report."))
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ import("PostalAddress_lib");
import("system.text");
import("system.question");
import("Attribute_lib");
import("system.logging");
import("Keyword_lib")
import("KeywordRegistry_basic");
import("system.translate");
......@@ -77,7 +76,6 @@ DataPrivacyType.get = function(pKey)
.provider("Contact")
.uid(pContactId)
.fields(fields);
logging.log(entityConfig.toString());
return entities.getRow(entityConfig);
}
......@@ -384,13 +382,23 @@ DataPrivacyUtils.informationReport = function(pContactId, pLocale)
}
////////////////////////////////////////////////////////////////////////
// Deprecated functions:
DataPrivacyUtils.DisclosureReportName = function() {
return "DSGVO_Disclosure_report";
}
/**
* Note: this function requires that all fields in the DSGVO table are updated (via DataPrivacyUtils.collectAll())
* Otherwise there may be fields in DSGVO which do not exist anymore in the person or some are missing.
*/
DataPrivacyUtils.checkAllFilled = function(pContactId)
{
var countNotFilled = db.cell(SqlCondition.begin()
.andPrepare("DSGVO.CONTACT_ID", pContactId)
.and("STATUORITYSOURCE is null or PURPOSE is null or VALID_TO is null")
.buildSql("select count(*) from DSGVO", "1=2"))
return countNotFilled == 0;
}
DataPrivacyUtils.openReport = function(pContactId, pReportName, pDSGVOInfo, pLocale)
{
var DSGVOReport = new Report(pReportName);
......@@ -478,6 +486,9 @@ Muster-Datenschutzberatung";
}
////////////////////////////////////////////////////////////////////////
// Deprecated functions:
/**
* makes selected data from a private contact anonymous
*
......
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