diff --git a/entity/DSGVO_entity/DSGVO_entity.aod b/entity/DSGVO_entity/DSGVO_entity.aod index 6c7a1b0e72bbee7583cd25e5f2f13649e5e2a917..1a4ea4473eada2868272bae5e8a57fcc2522308a 100644 --- a/entity/DSGVO_entity/DSGVO_entity.aod +++ b/entity/DSGVO_entity/DSGVO_entity.aod @@ -194,7 +194,6 @@ <title>Value</title> <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/DSGVO_entity/entityfields/value/dropDownProcess.js</dropDownProcess> - <valueProcess>%aditoprj%/entity/DSGVO_entity/entityfields/value/valueProcess.js</valueProcess> </entityField> <entityConsumer> <name>KeywordTablename</name> @@ -217,6 +216,7 @@ <jDitoRecordAlias>Data_alias</jDitoRecordAlias> <contentProcess>%aditoprj%/entity/DSGVO_entity/recordcontainers/jdito/contentProcess.js</contentProcess> <onInsert>%aditoprj%/entity/DSGVO_entity/recordcontainers/jdito/onInsert.js</onInsert> + <onUpdate>%aditoprj%/entity/DSGVO_entity/recordcontainers/jdito/onUpdate.js</onUpdate> <recordFieldMappings> <jDitoRecordFieldMapping> <name>UID.value</name> diff --git a/entity/DSGVO_entity/entityfields/row_id/valueProcess.js b/entity/DSGVO_entity/entityfields/row_id/valueProcess.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fd738b471968e12f90bd8ec78bcd494daae5bbf1 100644 --- a/entity/DSGVO_entity/entityfields/row_id/valueProcess.js +++ b/entity/DSGVO_entity/entityfields/row_id/valueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("DSGVO_lib"); + +result.object(getSpecificRowId(vars.get("$param.currentPerson_param"), vars.get("$field.TABLENAME"))); \ No newline at end of file diff --git a/entity/DSGVO_entity/entityfields/value/valueProcess.js b/entity/DSGVO_entity/entityfields/value/valueProcess.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/entity/DSGVO_entity/recordcontainers/jdito/contentProcess.js b/entity/DSGVO_entity/recordcontainers/jdito/contentProcess.js index 7cecf7abe681302d823d6447947ce1de54533347..dbd8410395df7675f0dbcb466768771e5eb07ae3 100644 --- a/entity/DSGVO_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/DSGVO_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("system.datetime"); import("system.vars"); import("system.logging"); import("KeywordRegistry_basic"); @@ -17,19 +18,16 @@ if (vars.exists("$param.currentPerson_param") && person) if (vars.exists("$local.idvalues") && vars.get("$local.idvalues") && vars.get("$local.idvalues").length > 0) { recordCond.andIn("DSGVO.DSGVOID", vars.get("$local.idvalues")); -// TODO JH fragen -// 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")); var res = _groupData(data, person); -//logging.log(JSON.stringify(res, null, "\t")); -result.object(res); -// RESULT muss Form haben: [[DSGVOID, ROW_ID, STATUORITYSOURCE, PURPOSE, TABLENAME, TYPE, VALUE, VALID_TO, CONTACT_ID] -// ,[DSGVOID, ROW_ID, STATUORITYSOURCE, PURPOSE, TABLENAME, TYPE, VALUE, VALID_TO, CONTACT_ID]] +result.object(res); function _groupData(pData, pPerson) @@ -54,7 +52,7 @@ function _groupData(pData, pPerson) if(addrData.length == 1) { - // TODO Addresse formatiert + // TODO Addresse formatieren // AddrObject(pContactId, pPerson, pAddressId) //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]); @@ -63,7 +61,7 @@ function _groupData(pData, pPerson) { addrVal += entry + " "; }); - + logging.log(addrVal); //var addrType = KeywordUtils.getViewValue($KeywordRegistry.addressType(), pData[i][3]); //if(addrData[i][2]) // addrType = addrType + " | " + addrData[i][2]; @@ -86,14 +84,18 @@ function _groupData(pData, pPerson) case "Kommunikationsdaten": 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")); + if(comm.length == 1) { + logging.log(comm[0][1]); res.push([pData[i][0], pData[i][1], pData[i][2], pData[i][3], //comm[2], - comm[1], + comm[0][1], pData[i][4], pData[i][5], pData[i][6], @@ -127,7 +129,8 @@ function _groupData(pData, pPerson) case "Persönliche Daten": var pers = db.table(SqlCondition.begin() .andPrepare("PERSON.PERSONID", pPerson) // 4 8 - .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")); if(pers.length == 1) { var typeContainer = $KeywordRegistry.DSGVOType(); @@ -135,8 +138,8 @@ function _groupData(pData, pPerson) switch (typeViewVal) { case "Namen": - var names = pers[6] + " " + pers[7] + " " + pers[8] + " " + pers[2] + " " + pers[3] + " " + pers[4]; - + var names = pers[0][6] + " " + pers[0][7] + " " + pers[0][8] + " " + pers[0][2] + " " + pers[0][3] + " " + pers[0][4]; + logging.log(names); res.push([pData[i][0], pData[i][1], pData[i][2], @@ -152,8 +155,8 @@ function _groupData(pData, pPerson) pData[i][11]]); break; case "sonstige Persönliche Daten": - var otherPersData = pers[9] + pers[1] + ", " + pers[5]; - + var otherPersData = pers[0][9] + datetime.toDate(pers[0][1], "dd.MM.yyyy") + ", " + pers[0][5]; + logging.log(otherPersData); res.push([pData[i][0], pData[i][1], pData[i][2], diff --git a/entity/DSGVO_entity/recordcontainers/jdito/onUpdate.js b/entity/DSGVO_entity/recordcontainers/jdito/onUpdate.js new file mode 100644 index 0000000000000000000000000000000000000000..87ad3e808da6293f20cad1e66f01ad88c4ce70a1 --- /dev/null +++ b/entity/DSGVO_entity/recordcontainers/jdito/onUpdate.js @@ -0,0 +1,33 @@ +import("system.db"); +import("Sql_lib"); +import("system.vars"); + +var columns = [ + "CONTACT_ID", + "DATE_NEW", + "DATE_EDIT", + "PURPOSE", + "ROW_ID", + "STATUORITYSOURCE", + "TABLENAME", + "TYPE", + "USER_NEW", + "USER_EDIT", + "VALID_TO" +]; +var values = [ + vars.get("$field.CONTACT_ID"), + vars.get("$field.DATE_NEW"), + vars.get("$field.DATE_EDIT"), + vars.get("$field.PURPOSE"), + vars.get("$field.ROW_ID"), + vars.get("$field.STATUORITYSOURCE"), + vars.get("$field.TABLENAME"), + vars.get("$field.TYPE"), + vars.get("$field.USER_NEW"), + vars.get("$field.USER_EDIT"), + vars.get("$field.VALID_TO") +]; + +db.updateData("DSGVO", columns, null, values, + SqlCondition.equals("DSGVO.DSGVOID", vars.get("$field.UID"), "1=2")); \ No newline at end of file diff --git a/neonView/DSGVOFilter_view/DSGVOFilter_view.aod b/neonView/DSGVOFilter_view/DSGVOFilter_view.aod index 3afd005938743c7356906c6dbea7d40555b8f7b5..55199a9557eede7ab76f1e00459e9907f4d1f066 100644 --- a/neonView/DSGVOFilter_view/DSGVOFilter_view.aod +++ b/neonView/DSGVOFilter_view/DSGVOFilter_view.aod @@ -15,12 +15,6 @@ <favoriteActionGroup2>Reports</favoriteActionGroup2> <entityField>#ENTITY</entityField> <columns> - <neonTableColumn> - <name>eb95fb43-28ed-41d0-a9f9-4147697f10e8</name> - <entityField>ROW_ID</entityField> - <width v="10" /> - <expandRatio v="10" /> - </neonTableColumn> <neonTableColumn> <name>a09fc7e3-15d9-4739-84df-71f511f4b758</name> <entityField>TYPE</entityField> diff --git a/process/DSGVO_lib/process.js b/process/DSGVO_lib/process.js index 452c9511d1a597ecd7e4f1ac820ceb936863f198..1d5400cfde1d6fad9c6d58d8fb20cf97c0d0c333 100644 --- a/process/DSGVO_lib/process.js +++ b/process/DSGVO_lib/process.js @@ -22,13 +22,15 @@ function getDSGVOTypes (pPerson, pTablename) if (tablename == "Adressen") { + // TODO liefert aktuell nur eine Privatadresse, wenn mehrere Vorhanden und keine Firmenadresse + // Bsp Birgit Leicht 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)]); + res.push([row[0], KeywordUtils.getViewValue($KeywordRegistry.addressType(), row)]); }); return res; }else if(tablename == "Kommunikationsdaten") @@ -40,18 +42,17 @@ function getDSGVOTypes (pPerson, pTablename) //logging.log(JSON.stringify(comm, null, "\t")); comm.forEach(function (row) { - logging.log(row); res.push([row[0], KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), row)]); }); return res; }else if(tablename == "Eigenschaft") { - res.push(["E", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "34c2ddb4-97ce-4683-a067-89a38643ecae")]); + res.push(["34c2ddb4-97ce-4683-a067-89a38643ecae", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "34c2ddb4-97ce-4683-a067-89a38643ecae")]); return res; }else if(tablename == "Persönliche Daten") { - res.push(["names", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "dcc34a11-c86b-4acd-9987-e88c98b5b4c5")]); - res.push(["other", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "c626726a-a696-4926-9b0f-c320c410463e")]); + res.push(["dcc34a11-c86b-4acd-9987-e88c98b5b4c5", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "dcc34a11-c86b-4acd-9987-e88c98b5b4c5")]); + res.push(["c626726a-a696-4926-9b0f-c320c410463e", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "c626726a-a696-4926-9b0f-c320c410463e")]); return res; } @@ -62,19 +63,19 @@ function getDSGVOValues(pPerson, pTablename, pType) { var res = []; var tablename = KeywordUtils.getViewValue($KeywordRegistry.DSGVOTablename(), pTablename); - // TODO überall Typ abfragen!! - // KeywordUtils.getViewValue($KeywordRegistry.addressType(), pType);, wenn KEYID da drin gespeichert - // dazu, siehe getDSGVOTypes + if (tablename == "Adressen") { var addr = db.table(SqlCondition.begin() .andPrepare("CONTACT.PERSON_ID", pPerson) - .buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, STATE, ZIP " + .buildSql("select ADDRESSID, ADDRESS, ADDRESSADDITION, ADDRIDENTIFIER, BUILDINGNO, CITY, COUNTRY, DISTRICT, REGION, STATE, ZIP, ADDR_TYPE " + "from ADDRESS join CONTACT on ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID", "1 = 1")); var addrVal = ""; + addr.forEach(function (addrRow) { + if(pType == addrRow[11]) addrVal = addrRow[1] + " " + addrRow[2] + " " + addrRow[3] + " "+ addrRow[4] + " " + addrRow[5] + " " + addrRow[6] + " " + addrRow[7] + " " + addrRow[8] + " " + addrRow[9] + " " + addrRow[10]; @@ -87,10 +88,9 @@ function getDSGVOValues(pPerson, pTablename, pType) .andPrepare("CONTACT.PERSON_ID", pPerson) .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[0] + " " + entry[1] + ", " + pType); if(pType == entry[2]) res.push([entry[2], entry[1]]); }); @@ -98,11 +98,14 @@ function getDSGVOValues(pPerson, pTablename, pType) { var attr = AttributeRelationUtils.getAllAttributes(pPerson, "Person"); logging.log(attr); - attr.forEach(function (entry) + /*attr.forEach(function (entry) { - // TODO muss erst mal attr was liefern.... + // TODO muss erst attr was liefern, --> leer res.push(["", ""]); - }) + })*/ + + // Keyword KeyId: ["34c2ddb4-97ce-4683-a067-89a38643ecae", KeywordUtils.getViewValue($KeywordRegistry.DSGVOType(), "34c2ddb4-97ce-4683-a067-89a38643ecae")]); + return res; }else if(tablename == "Persönliche Daten") { @@ -111,15 +114,14 @@ function getDSGVOValues(pPerson, pTablename, pType) .andPrepare("PERSON.PERSONID", pPerson) .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 "names": // names - res.push(["names", (pers[0][6] + " " + pers[0][7] + " " + pers[0][8] + " " + pers[0][2] + " " + pers[0][3] + " " + pers[0][4])]); + case "dcc34a11-c86b-4acd-9987-e88c98b5b4c5": // names + res.push(["dcc34a11-c86b-4acd-9987-e88c98b5b4c5", (pers[0][6] + " " + pers[0][7] + " " + pers[0][8] + " " + pers[0][2] + " " + pers[0][3] + " " + pers[0][4])]); return res; - case "other": // Sonstige Persönliche Daten - res.push(["other", (pers[0][9] + pers[0][1] + ", " + pers[0][5])]); + case "c626726a-a696-4926-9b0f-c320c410463e": // Sonstige Persönliche Daten + res.push(["c626726a-a696-4926-9b0f-c320c410463e", (pers[0][9] + pers[0][1] + ", " + pers[0][5])]); return res; } } @@ -127,9 +129,8 @@ function getDSGVOValues(pPerson, pTablename, pType) } -function getSpecificRowId(pTablename, pPerson) +function getSpecificRowId(pPerson, pTablename) { - var res = []; var tablename = KeywordUtils.getViewValue($KeywordRegistry.DSGVOTablename(), pTablename); if (tablename == "Adressen") @@ -144,12 +145,14 @@ function getSpecificRowId(pTablename, pPerson) .buildSql("select COMMUNICATIONID from COMMUNICATION join CONTACT on COMMUNICATION.CONTACT_ID = CONTACTID", "1 = 1")); }else if(tablename == "Eigenschaft") { - + // TODO attribute + return ""; }else if(tablename == "Persönliche Daten") { return pPerson; } - + else + return null; } function openDSGVOReport(pPerson, pReportName) @@ -189,7 +192,7 @@ function openDSGVOReport(pPerson, pReportName) ])); DSGVOReport.addImage("myLogo", imgData[1]); DSGVOReport.addReportParams(params); - DSGVOReport.openReport(); // pCondition, pVariables + DSGVOReport.openReport(); }