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

dropdown Type

parent ccc77af3
No related branches found
No related tags found
No related merge requests found
Showing with 254 additions and 183 deletions
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<insert tableName="AB_KEYWORD_ENTRY"> <insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="012270f0-b975-489d-883b-b38317390228"/> <column name="AB_KEYWORD_ENTRYID" value="012270f0-b975-489d-883b-b38317390228"/>
<column name="KEYID" value="5fe90cba-c5f1-43f4-a213-895c201d02ea"/> <column name="KEYID" value="5fe90cba-c5f1-43f4-a213-895c201d02ea"/>
<column name="TITLE" value="Attribute"/> <column name="TITLE" value="Eigenschaft"/>
<column name="CONTAINER" value="DSGVOTablename"/> <column name="CONTAINER" value="DSGVOTablename"/>
<column name="SORTING" valueNumeric="2"/> <column name="SORTING" valueNumeric="2"/>
<column name="ISACTIVE" valueNumeric="1"/> <column name="ISACTIVE" valueNumeric="1"/>
......
...@@ -142,12 +142,6 @@ ...@@ -142,12 +142,6 @@
<fieldName>ContactAddresses</fieldName> <fieldName>ContactAddresses</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>87260b21-5c3f-452c-9a0b-d3f5dcf7637d</name>
<entityName>DSGVO_entity</entityName>
<fieldName>ContactAdresses</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
...@@ -242,6 +236,12 @@ ...@@ -242,6 +236,12 @@
<fieldName>PossibleAddresses</fieldName> <fieldName>PossibleAddresses</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>716aac15-99cb-4032-bf97-06101f0718f3</name>
<entityName>DSGVO_entity</entityName>
<fieldName>OrganisationAndContactAdresses</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
<groupable v="true" /> <groupable v="true" />
<linkedContext>KeywordEntry</linkedContext> <linkedContext>KeywordEntry</linkedContext>
<mandatory v="true" /> <mandatory v="true" />
<dropDownProcess>%aditoprj%/entity/DSGVO_entity/entityfields/tablename/dropDownProcess.js</dropDownProcess>
<displayValueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/tablename/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/tablename/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
...@@ -87,12 +88,18 @@ ...@@ -87,12 +88,18 @@
<valueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/contact_id/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/contact_id/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityConsumer> <entityConsumer>
<name>ContactAdresses</name> <name>OrganisationAndContactAdresses</name>
<dependency> <dependency>
<name>dependency</name> <name>dependency</name>
<entityName>Address_entity</entityName> <entityName>Address_entity</entityName>
<fieldName>ContactAddresses</fieldName> <fieldName>OrganisationAndContactAddresses</fieldName>
</dependency> </dependency>
<children>
<entityParameter>
<name>OrganisationId_param</name>
<valueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/contactadresses/children/organisationid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer> </entityConsumer>
<entityConsumer> <entityConsumer>
<name>KeywordPurpose</name> <name>KeywordPurpose</name>
......
import("system.vars");
import("KeywordRegistry_basic");
import("Keyword_lib"); import("Keyword_lib");
import("system.result"); import("system.result");
if(vars.get("$field.TABLENAME"))
result.string(KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.DSGVOTablename(), "DSGVO.TABLENAME")); result.string(KeywordUtils.getViewValue($KeywordRegistry.DSGVOTablename(), vars.get("$field.TABLENAME")));
\ No newline at end of file
import("system.result");
import("Keyword_lib");
import("KeywordRegistry_basic");
result.object(KeywordUtils.getEntryNamesAndIdsByContainer($KeywordRegistry.DSGVOTablename()));
\ No newline at end of file
import("system.db");
import("KeywordRegistry_basic");
import("system.result");
import("Keyword_lib");
import("Keyword_lib");
import("system.vars");
var tablename = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.DSGVOTablename(), "DSGVO.TABLENAME");
var res;
if (tablename == "Adressen")
{
var addrIdent = db.cell(innerCond.andPrepare(vars.get("$field.ROW_ID"), "ADDRESSID")
.buildSql("select ADDRESSIDENTIFIER "
+ "from ADDRESS", "1 = 1"));
if(addrIdent)
res = KeywordUtils.getViewValue($KeywordRegistry.addressType(), vars.get("$field.TYPE")) + " | " + addrIdent;
}else if(tablename == "Kommunikationsdaten")
{
res = KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), vars.get("$field.TYPE"));
}else // Pers. Daten und Attribute
{
res = KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), vars.get("$field.TYPE"));
}
result.string(res);
\ No newline at end of file
import("system.logging"); import("system.logging");
import("DSGVO_lib");
import("system.result");
import("system.vars"); import("system.vars");
import("Keyword_lib") import("Keyword_lib")
import("KeywordRegistry_basic"); import("KeywordRegistry_basic");
var res = getDSGVOTypes(vars.get("$param.currentPerson_param"), vars.get("$field.TABLENAME"));
result.object(res);
\ No newline at end of file
...@@ -15,11 +15,11 @@ if (vars.exists("$param.currentPerson_param") && person) ...@@ -15,11 +15,11 @@ if (vars.exists("$param.currentPerson_param") && person)
recordCond.andPrepareVars("DSGVO.CONTACT_ID", "$param.currentPerson_param"); recordCond.andPrepareVars("DSGVO.CONTACT_ID", "$param.currentPerson_param");
if (vars.exists("$local.idvalues") && vars.get("$local.idvalues") && vars.get("$local.idvalues").length > 0) if (vars.exists("$local.idvalues") && vars.get("$local.idvalues") && vars.get("$local.idvalues").length > 0)
{ {
recordCond.andIn("DSGVO.DSGVOID", vars.get("$local.idvalues")); recordCond.andIn("DSGVO.DSGVOID", vars.get("$local.idvalues"));
// TODO JH fragen // TODO JH fragen
// person = vars.get("$local.idvalues"); // person = vars.get("$local.idvalues");
} }
var data = db.table(recordCond.buildSql("select DSGVOID, ROW_ID, TABLENAME, TYPE, STATUORITYSOURCE, PURPOSE, VALID_TO, CONTACT_ID, DATE_NEW, DATE_EDIT, USER_NEW, USER_EDIT from DSGVO ", "1 = 2")); var data = db.table(recordCond.buildSql("select DSGVOID, ROW_ID, TABLENAME, TYPE, STATUORITYSOURCE, PURPOSE, VALID_TO, CONTACT_ID, DATE_NEW, DATE_EDIT, USER_NEW, USER_EDIT from DSGVO ", "1 = 2"));
...@@ -49,14 +49,14 @@ function _groupData(pData, pPerson) ...@@ -49,14 +49,14 @@ function _groupData(pData, pPerson)
case "Adressen": case "Adressen":
var addrData = db.table(innerCond.andPrepare("ADDRESS.ADDRESSID", pData[i][1]) // RowId var addrData = db.table(innerCond.andPrepare("ADDRESS.ADDRESSID", pData[i][1]) // RowId
.buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, " .buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, "
+ "BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, CONTACT_ID, STATE, ZIP, ADDR_TYPE " + "BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, CONTACT_ID, STATE, ZIP, ADDR_TYPE "
+ "from ADDRESS", "1 = 1")); + "from ADDRESS", "1 = 1"));
if(addrData.length == 1) if(addrData.length == 1)
{ {
// TODO Addresse formatiert // TODO Addresse formatiert
// AddrObject(pContactId, pPerson, pAddressId) // AddrObject(pContactId, pPerson, pAddressId)
//var addrVal = AddrObject(pData[i][7], true); // Person pData[i][7] addr Contact_ID: addrData[9] //var addrVal = AddrObject(pData[i][7]); // Person pData[i][7] addr Contact_ID: addrData[9]
//var addrVal = AddrObject(pData[i][7], true, pData[i][1]); //addrData[0][9], true, addrData[0][0]); //var addrVal = AddrObject(pData[i][7], true, pData[i][1]); //addrData[0][9], true, addrData[0][0]);
var addrVal = ""; var addrVal = "";
addrData[0].forEach(function(entry) addrData[0].forEach(function(entry)
...@@ -104,8 +104,25 @@ function _groupData(pData, pPerson) ...@@ -104,8 +104,25 @@ function _groupData(pData, pPerson)
pData[i][11]]); pData[i][11]]);
} }
break; break;
case "Attribute": case "Eigenschaft":
var attr = AttributeRelationUtils.getAllAttributes(pPerson, pObjectType, pUseAttributeIds, pUseIdValues) var attr = AttributeRelationUtils.getAllAttributes(pPerson, "Person");
// TODO prüfen
var attrVal = attr[0][1];
logging.log(attrVal);
// Zeile: [attributeId|attributeName, value]
res.push([pData[i][0],
pData[i][1],
pData[i][2],
pData[i][3],
attrVal,
pData[i][4],
pData[i][5],
pData[i][6],
pData[i][7],
pData[i][8],
pData[i][9],
pData[i][10],
pData[i][11]]);
break; break;
case "Persönliche Daten": case "Persönliche Daten":
var pers = db.table(SqlCondition.begin() var pers = db.table(SqlCondition.begin()
......
import("Attribute_lib");
import("system.logging"); import("system.logging");
import("Keyword_lib") import("Keyword_lib")
import("KeywordRegistry_basic"); import("KeywordRegistry_basic");
...@@ -8,11 +9,70 @@ import("system.vars"); ...@@ -8,11 +9,70 @@ import("system.vars");
import("system.db"); import("system.db");
import("system.neon"); import("system.neon");
import("system.result"); import("system.result");
import("Report_lib"); import("Report_lib");
function getDSGVOTypes (pPerson, pTablename)
{
// return "combo"
var res = [];
var tablename = KeywordUtils.getViewValue($KeywordRegistry.DSGVOTablename(), pTablename);
if (tablename == "Adressen")
{
var addr = db.table(SqlCondition.begin()
.andPrepare("CONTACT.PERSON_ID", pPerson)
.buildSql("select ADDR_TYPE from ADDRESS join CONTACT on ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID ", "1 = 1", "group by ADDR_TYPE"));
addr.forEach(function (row)
{
res.push([row, KeywordUtils.getViewValue($KeywordRegistry.addressType(), row)]);
});
return res;
}else if(tablename == "Kommunikationsdaten")
{
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"));
comm.forEach(function (row)
{
logging.log(row[0]);
res.push([row, KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), row)]);
});
return res;
}else if(tablename == "Eigenschaft")
{
res.push(["E", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "34c2ddb4-97ce-4683-a067-89a38643ecae")]);
return res;
}else if(tablename == "Persönliche Daten")
{
// TODO beide aus Keyword
res.push(["N", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "dcc34a11-c86b-4acd-9987-e88c98b5b4c5")]);
res.push(["O", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "c626726a-a696-4926-9b0f-c320c410463e")]);
return res;
}
return res;
}
function getDSGVOTable (pPerson, pTablename) function getDSGVOTable (pPerson, pTablename)
{ {
if (tablename == "Adressen")
{
}else if(tablename == "Kommunikationsdaten")
{
}else if(tablename == "Eigenschaft")
{
}else if(tablename == "Persönliche Daten")
{
}
/* /*
var table = vars.get("$field.TABLENAME"); var table = vars.get("$field.TABLENAME");
var container = $KeywordRegistry.DSGVOTablename(); var container = $KeywordRegistry.DSGVOTablename();
...@@ -115,159 +175,159 @@ function getDSGVOTable (pPerson, pTablename) ...@@ -115,159 +175,159 @@ function getDSGVOTable (pPerson, pTablename)
.andPrepare("PERSON.PERSONID", pPerson) .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 data = new Array(); // var data = new Array();
var mediumData = new Array(); var mediumData = new Array();
var valueData = new Array(); var valueData = new Array();
var allData = new Array(); var allData = new Array();
for(i = 0; i < addr.length; i++) for(i = 0; i < addr.length; i++)
{
var addrEntry = null;
if(addr[i][1] != null)
{
mediumData.push(addr[i][0] + " Street");
valueData.push(addr[i][1]);
}
if(addr[i][2] != null)
{ {
mediumData.push(addr[i][0] + " Addressaddition"); var addrEntry = null;
valueData.push(addr[i][2]); if(addr[i][1] != null)
} {
if(addr[i][3] != null) mediumData.push(addr[i][0] + " Street");
{ valueData.push(addr[i][1]);
mediumData.push(addr[i][0] + " Addressident"); }
valueData.push(addr[i][3]); if(addr[i][2] != null)
} {
if(addr[i][4] != null) mediumData.push(addr[i][0] + " Addressaddition");
{ valueData.push(addr[i][2]);
mediumData.push(addr[i][0] + " Buildingno"); }
valueData.push(addr[i][4]); if(addr[i][3] != null)
} {
if(addr[i][5] != null) mediumData.push(addr[i][0] + " Addressident");
{ valueData.push(addr[i][3]);
mediumData.push(addr[i][0] + " City"); }
valueData.push(addr[i][5]); if(addr[i][4] != null)
addrEntry = addr[i][5]; {
} mediumData.push(addr[i][0] + " Buildingno");
if(addr[i][6] != null) valueData.push(addr[i][4]);
{ }
mediumData.push(addr[i][0] + " Country"); if(addr[i][5] != null)
valueData.push(addr[i][6]); {
} mediumData.push(addr[i][0] + " City");
if(addr[i][7] != null) valueData.push(addr[i][5]);
{ addrEntry = addr[i][5];
mediumData.push(addr[i][0] + " District"); }
valueData.push(addr[i][7]); if(addr[i][6] != null)
if(addrEntry == null) {
addrEntry = addr[i][7]; mediumData.push(addr[i][0] + " Country");
} valueData.push(addr[i][6]);
if(addr[i][8] != null) }
{ if(addr[i][7] != null)
mediumData.push(addr[i][0] + " Region"); {
valueData.push(addr[i][8]); mediumData.push(addr[i][0] + " District");
if(addrEntry == null) valueData.push(addr[i][7]);
addrEntry = addr[i][8]; if(addrEntry == null)
} addrEntry = addr[i][7];
if(addr[i][9] != null) }
{ if(addr[i][8] != null)
mediumData.push(addr[i][0] + " State"); {
valueData.push(addr[i][9]); mediumData.push(addr[i][0] + " Region");
} valueData.push(addr[i][8]);
if(addr[i][10] != null) if(addrEntry == null)
{ addrEntry = addr[i][8];
mediumData.push(addr[i][0] + " ZIP"); }
valueData.push(addr[i][10]); if(addr[i][9] != null)
if(addrEntry == null) {
addrEntry = addr[i][10]; mediumData.push(addr[i][0] + " State");
valueData.push(addr[i][9]);
}
if(addr[i][10] != null)
{
mediumData.push(addr[i][0] + " ZIP");
valueData.push(addr[i][10]);
if(addrEntry == null)
addrEntry = addr[i][10];
}
if(addrEntry != null)
allData.push([addr[i][0] + "-address", addrEntry]);
} }
if(addrEntry != null)
allData.push([addr[i][0] + "-address", addrEntry]);
}
for(i = 0; i < comm.length; i++) for(i = 0; i < comm.length; i++)
{
if(comm[i][1] && comm[i][2])
{ {
var medium = KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), comm[i][2]); if(comm[i][1] && comm[i][2])
if(medium != null)
{ {
mediumData.push(medium) var medium = KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), comm[i][2]);
valueData.push(comm[i][1]); if(medium != null)
allData.push([comm[i][0] + "-communication", medium]) {
mediumData.push(medium)
valueData.push(comm[i][1]);
allData.push([comm[i][0] + "-communication", medium])
}
} }
} }
}
for(i = 0; i < pers.length; i++) for(i = 0; i < pers.length; i++)
{
var persEntry = null;
if(pers[i][1] != null)
{ {
mediumData.push(pers[i][0] + " Date of Birth"); var persEntry = null;
valueData.push(pers[i][1]); if(pers[i][1] != null)
} {
if(pers[i][2] != null) mediumData.push(pers[i][0] + " Date of Birth");
{ valueData.push(pers[i][1]);
mediumData.push(pers[i][0] + " Firstname"); }
valueData.push(pers[i][2]); if(pers[i][2] != null)
} {
if(pers[i][3] != null) mediumData.push(pers[i][0] + " Firstname");
{ valueData.push(pers[i][2]);
mediumData.push(pers[i][0] + " Middlename"); }
valueData.push(pers[i][3]); if(pers[i][3] != null)
} {
if(pers[i][4] != null) mediumData.push(pers[i][0] + " Middlename");
{ valueData.push(pers[i][3]);
mediumData.push(pers[i][0] + " Lastname"); }
valueData.push(pers[i][4]); if(pers[i][4] != null)
persEntry = pers[i][4]; {
} mediumData.push(pers[i][0] + " Lastname");
if(pers[i][5] != null) valueData.push(pers[i][4]);
{ persEntry = pers[i][4];
mediumData.push(pers[i][0] + " Gender"); }
valueData.push(pers[i][5]); if(pers[i][5] != null)
{
mediumData.push(pers[i][0] + " Gender");
valueData.push(pers[i][5]);
}
if(pers[i][6] != null)
{
mediumData.push(pers[i][0] + " Salutation");
valueData.push(pers[i][6]);
}
if(pers[i][7] != null)
{
mediumData.push(pers[i][0] + " Title");
valueData.push(pers[i][7]);
}
if(pers[i][8] != null)
{
mediumData.push(pers[i][0] + " Title suffix");
valueData.push(pers[i][8]);
}
if(pers[i][9] != null) {
mediumData.push(pers[i][0] + " Picture");
valueData.push(pers[i][9]);
if(persEntry == null)
persEntry = pers[i][9];
}
if(persEntry != null)
allData.push([pers[i][0] + "-person", persEntry]);
} }
if(pers[i][6] != null)
if(pTablename == "medium")
{ {
mediumData.push(pers[i][0] + " Salutation"); return mediumData;
valueData.push(pers[i][6]);
} }
if(pers[i][7] != null) else if(pTablename == "value")
{ {
mediumData.push(pers[i][0] + " Title"); return valueData;
valueData.push(pers[i][7]);
} }
if(pers[i][8] != null) else if(pTablename == "combo")
{ {
mediumData.push(pers[i][0] + " Title suffix"); return allData;
valueData.push(pers[i][8]);
} }
if(pers[i][9] != null) { else
mediumData.push(pers[i][0] + " Picture"); return null;
valueData.push(pers[i][9]);
if(persEntry == null)
persEntry = pers[i][9];
}
if(persEntry != null)
allData.push([pers[i][0] + "-person", persEntry]);
}
if(pTablename == "medium")
{
return mediumData;
}
else if(pTablename == "value")
{
return valueData;
}
else if(pTablename == "combo")
{
return allData;
}
else
return null;
} }
function openDSGVODisclosureReport(pPerson) function openDSGVODisclosureReport(pPerson)
......
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