Skip to content
Snippets Groups Projects
Commit cadee305 authored by Maximilian Hofmann's avatar Maximilian Hofmann
Browse files

fix communication

parent 4b67e545
No related branches found
No related tags found
No related merge requests found
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="m.hofmann" id="e6b32d7d-298c-44a3-901f-88baa77cb6c3">
<update tableName="COMMUNICATION">
<column name="MEDIUM_ID" value="COMMINTERNET"></column>
<where>MEDIUM_ID = ?</where>
<whereParams>
<param value="d9434c95-9abb-4661-a4c0-65d8a9eb676e"></param>
</whereParams>
</update>
</changeSet>
</databaseChangeLog>
......@@ -159,7 +159,6 @@
<include relativeToChangelogFile="true" file="DSGVO/init_purpose_keyword.xml"/>
<include relativeToChangelogFile="true" file="DSGVO/init_dsgvotablename_keyword.xml"/>
<include relativeToChangelogFile="true" file="DSGVO/init_dsgvoType_keyword.xml"/>
<include relativeToChangelogFile="true" file="DSGVO/update_comm_medium.xml"/>
<include relativeToChangelogFile="true" file="AditoBasic/init_UnlinkedMail.xml"/>
......
import("system.db");
import("system.vars");
var columns = [
"CONTACT_ID",
"DATE_NEW",
"PURPOSE",
"ROW_ID",
"STATUORITYSOURCE",
"TABLENAME",
"TYPE",
"DSGVOID",
"USER_NEW",
"VALID_TO"
];
var values = [
vars.get("$field.CONTACT_ID"),
vars.get("$field.DATE_NEW"),
vars.get("$field.PURPOSE"),
vars.get("$field.ROW_ID"),
vars.get("$field.STATUORITYSOURCE"),
vars.get("$field.TABLENAME"),
vars.get("$field.TYPE"),
vars.get("$field.UID"),
vars.get("$field.USER_NEW"),
vars.get("$field.VALID_TO")
];
db.insertData("DSGVO", columns, null, values);
\ No newline at end of file
......@@ -33,15 +33,15 @@ function getDSGVOTypes (pPerson, pTablename)
return res;
}else if(tablename == "Kommunikationsdaten")
{
logging.log("comm");
//logging.log("comm");
var comm = db.table(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select MEDIUM_ID from COMMUNICATION join CONTACT on COMMUNICATION.CONTACT_ID = CONTACTID", "1 = 1", "group by MEDIUM_ID"));
logging.log(JSON.stringify(comm, null, "\t"));
//logging.log(JSON.stringify(comm, null, "\t"));
comm.forEach(function (row)
{
logging.log(row[0]);
res.push([row, KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), row)]);
logging.log(row);
res.push([row[0], KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), row)]);
});
return res;
}else if(tablename == "Eigenschaft")
......@@ -50,8 +50,8 @@ function getDSGVOTypes (pPerson, pTablename)
return res;
}else if(tablename == "Persönliche Daten")
{
res.push(["N", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "dcc34a11-c86b-4acd-9987-e88c98b5b4c5")]);
res.push(["O", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "c626726a-a696-4926-9b0f-c320c410463e")]);
res.push(["names", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "dcc34a11-c86b-4acd-9987-e88c98b5b4c5")]);
res.push(["other", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "c626726a-a696-4926-9b0f-c320c410463e")]);
return res;
}
......@@ -69,7 +69,8 @@ function getDSGVOValues(pPerson, pTablename, pType)
{
var addr = db.table(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, STATE, ZIP from ADDRESS join CONTACT on ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID", "1 = 1"));
.buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, STATE, ZIP "
+ "from ADDRESS join CONTACT on ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID", "1 = 1"));
var addrVal = "";
addr.forEach(function (addrRow)
......@@ -84,12 +85,15 @@ function getDSGVOValues(pPerson, pTablename, pType)
{
var comm = db.table(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select COMMUNICATIONID, ADDR, MEDIUM_ID from COMMUNICATION join CONTACT on COMMUNICATION.CONTACT_ID = CONTACTID", "1 = 1"));
.buildSql("select COMMUNICATIONID, ADDR, MEDIUM_ID "
+ "from COMMUNICATION join CONTACT on COMMUNICATION.CONTACT_ID = CONTACTID", "1 = 1"));
//logging.log(pType);
comm.forEach(function (entry)
{
logging.log("com" + entry);
res.push([entry[0], entry[1]])
})
logging.log("com " + entry[0] + " " + entry[1] + ", " + pType);
if(pType == entry[2])
res.push([entry[2], entry[1]]);
});
}else if(tablename == "Eigenschaft")
{
var attr = AttributeRelationUtils.getAllAttributes(pPerson, "Person");
......@@ -105,15 +109,16 @@ function getDSGVOValues(pPerson, pTablename, pType)
var pers = db.table(SqlCondition.begin()
.andPrepare("PERSON.PERSONID", pPerson)
.buildSql("select PERSONID, DATEOFBIRTH, FIRSTNAME, MIDDLENAME, LASTNAME, GENDER, SALUTATION, TITLE, TITLESUFFIX, PICTURE from PERSON", "1 = 1"));
.buildSql("select PERSONID, DATEOFBIRTH, FIRSTNAME, MIDDLENAME, LASTNAME, GENDER, SALUTATION, TITLE, TITLESUFFIX, PICTURE "
+ "from PERSON", "1 = 1"));
// var typeViewVal = KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), pType);
switch (pType)
{
// TODO Inhalt von other prüfen!!
case "N": // names
case "names": // names
res.push(["names", (pers[0][6] + " " + pers[0][7] + " " + pers[0][8] + " " + pers[0][2] + " " + pers[0][3] + " " + pers[0][4])]);
return res;
case "O": // Sonstige Persönliche Daten
case "other": // Sonstige Persönliche Daten
res.push(["other", (pers[0][9] + pers[0][1] + ", " + pers[0][5])]);
return res;
}
......@@ -122,6 +127,30 @@ function getDSGVOValues(pPerson, pTablename, pType)
}
function getSpecificRowId(pTablename, pPerson)
{
var res = [];
var tablename = KeywordUtils.getViewValue($KeywordRegistry.DSGVOTablename(), pTablename);
if (tablename == "Adressen")
{
return db.cell(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select ADDRESSID from ADDRESS join CONTACT on ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID", "1 = 1"));
}else if(tablename == "Kommunikationsdaten")
{
return db.cell(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select COMMUNICATIONID from COMMUNICATION join CONTACT on COMMUNICATION.CONTACT_ID = CONTACTID", "1 = 1"));
}else if(tablename == "Eigenschaft")
{
}else if(tablename == "Persönliche Daten")
{
return pPerson;
}
}
function openDSGVOReport(pPerson, pReportName)
{
......
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