diff --git a/entity/Activity_entity/recordcontainers/db/onDBInsert.js b/entity/Activity_entity/recordcontainers/db/onDBInsert.js index 3bd6b8b3b9c844e2632f11a231b283d2a46b461a..c687b6e1624de972c662d31003d3dcdb31628893 100644 --- a/entity/Activity_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Activity_entity/recordcontainers/db/onDBInsert.js @@ -6,5 +6,5 @@ var documents = vars.exists("$param.PresetDocuments_param") && vars.getString("$ if (documents) { documents = JSON.parse(documents); - ActivityUtils.insertDocuments(vars.get("$field.ACTIVITYID"), documents); + ActivityUtils.insertDocuments(vars.get("$local.uid"), documents); } \ No newline at end of file diff --git a/entity/Address_entity/recordcontainers/db/onDBInsert.js b/entity/Address_entity/recordcontainers/db/onDBInsert.js index 14c04e5fc957168514bd24185fa04f2bea97cd79..62ff605c220f8a1d0b6b127ef3e312fac3827af4 100644 --- a/entity/Address_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Address_entity/recordcontainers/db/onDBInsert.js @@ -9,7 +9,8 @@ if (typeParam === "contact") else if (typeParam === "organisation") scopeType = "Organisation" -new StandardObject("Address", vars.get("$field.ADDRESSID"), scopeType, vars.get("$field.CONTACT_ID")) +var rowdata = vars.get("$local.rowdata"); +new StandardObject("Address", vars.get("$local.uid"), scopeType, rowdata["ADDRESS.CONTACT_ID"]) .onObjectInsert() -DataPrivacyUtils.notifyNeedDataPrivacyUpdate(vars.get("$field.CONTACT_ID"), vars.get("$param.ShowDsgvoMessage_param")); \ No newline at end of file +DataPrivacyUtils.notifyNeedDataPrivacyUpdate(rowdata["ADDRESS.CONTACT_ID"], vars.get("$param.ShowDsgvoMessage_param")); \ No newline at end of file diff --git a/entity/BulkMail_entity/recordcontainers/db/onDBInsert.js b/entity/BulkMail_entity/recordcontainers/db/onDBInsert.js index dd2d0ecc46f46ab5786a9679f05a1c8d9ef54fa8..11e9ee3b706e82d03bde432040467efbdbfa56cb 100644 --- a/entity/BulkMail_entity/recordcontainers/db/onDBInsert.js +++ b/entity/BulkMail_entity/recordcontainers/db/onDBInsert.js @@ -1,49 +1,49 @@ -import("DocumentTemplate_lib"); -import("system.result"); -import("system.vars"); -import("system.db"); -import("system.util"); -import("Document_lib"); -import("Bulkmail_lib"); - -//TODO - Function - -var content = vars.get("$field.content"); -var originalBinData = vars.get("$field.BINDATA"); -var filename, type, template; - -if(vars.get("$field.BINDATA")) -{ - filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.BINDATA")); - type = DocumentUtil.getFileExtensionFromUpload(filename); - type = ({ - "txt" : DocumentTemplate.types.TXT, - "html" : DocumentTemplate.types.HTML, - "htm" : DocumentTemplate.types.HTML, - "eml" : DocumentTemplate.types.EML - })[type]; -} -else -{ - template = DocumentTemplate.loadTemplate(vars.get("$field.DOCUMENTTEMPLATE_ID")); - type = template.type; -} - -if (type == DocumentTemplate.types.EML || type == DocumentTemplate.types.HTML) - content = "<html>" + content + "</html>"; - -var bindata = util.encodeBase64String(content); -if (!filename) - filename = vars.get("$field.NAME") + ".txt"; - -if(bindata != "") -{ - db.insertBinary("BULKMAIL", "DOCUMENT", vars.get("$field.BULKMAILID"), - "", bindata, filename, "", "", "_____SYSTEMALIAS"); -} - -var contactIds = JSON.parse(vars.getString("$param.PresetRecipients_param")); -var bulkMailId = vars.get("$field.BULKMAILID"); - -if (contactIds && contactIds.length > 0) +import("DocumentTemplate_lib"); +import("system.result"); +import("system.vars"); +import("system.db"); +import("system.util"); +import("Document_lib"); +import("Bulkmail_lib"); + +//TODO - Function +var rowdata = vars.get("$local.rowdata"); +var content = vars.get("$field.content"); +var originalBinData = vars.get("$field.BINDATA"); +var filename, type, template; + +if(vars.get("$field.BINDATA")) +{ + filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.BINDATA")); + type = DocumentUtil.getFileExtensionFromUpload(filename); + type = ({ + "txt" : DocumentTemplate.types.TXT, + "html" : DocumentTemplate.types.HTML, + "htm" : DocumentTemplate.types.HTML, + "eml" : DocumentTemplate.types.EML + })[type]; +} +else +{ + template = DocumentTemplate.loadTemplate(rowdata["BULKMAIL.DOCUMENTTEMPLATE_ID"]); + type = template.type; +} + +if (type == DocumentTemplate.types.EML || type == DocumentTemplate.types.HTML) + content = "<html>" + content + "</html>"; + +var bindata = util.encodeBase64String(content); +if (!filename) + filename = rowdata["BULKMAIL.NAME"] + ".txt"; + +if(bindata != "") +{ + db.insertBinary("BULKMAIL", "DOCUMENT", vars.get("$local.uid"), + "", bindata, filename, "", "", "_____SYSTEMALIAS"); +} + +var contactIds = JSON.parse(vars.getString("$param.PresetRecipients_param")); +var bulkMailId = vars.get("$field.BULKMAILID"); + +if (contactIds && contactIds.length > 0) BulkMailUtils.addRecipients(bulkMailId, BulkMailUtils.filterNewRecipients(bulkMailId, contactIds)); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index eadee452ce6751f048c9998d1fb110e919c04af2..d6ab3e662ae9e1181893f8d93377221f532fafa5 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -229,10 +229,6 @@ </linkInformation> </linkInformation> <recordFieldMappings> - <dbRecordFieldMapping> - <name>CAMPAIGNPARTICIPANT_ID.value</name> - <recordfield>CAMPAIGNPARTICIPANT.CAMPAIGNPARTICIPANTID</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>CAMPAIGN_ID.value</name> <recordfield>CAMPAIGNPARTICIPANT.CAMPAIGN_ID</recordfield> @@ -265,6 +261,10 @@ <name>USER_NEW.value</name> <recordfield>CAMPAIGNPARTICIPANT.USER_NEW</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CAMPAIGNPARTICIPANTID.displayValue</name> + <recordfield>CAMPAIGNPARTICIPANT.CAMPAIGNPARTICIPANTID</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js index 847118274289be3fc7b39180b3dcbe19e3b35ccb..b0c1baba02ef1be52d2fea57401dc417af85cbcf 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js @@ -1,9 +1,10 @@ -import("system.vars"); -import("Campaign_lib"); - -var campaignId = vars.get("$field.CAMPAIGN_ID"); -var campaignStepId = vars.get("$field.CAMPAIGNSTEP_ID"); -var contactId = vars.get("$field.CONTACT_ID"); -var campaignParticipantId = vars.get("$field.CAMPAIGNPARTICIPANTID"); - +import("system.vars"); +import("Campaign_lib"); + +var rowdata = vars.get("$local.rowdata"); +var campaignId = rowdata["CAMPAIGNPARTICIPANT.CAMPAIGN_ID"]; +var campaignStepId = rowdata["CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID"]; +var contactId = rowdata["CAMPAIGNPARTICIPANT.CONTACT_ID"]; +var campaignParticipantId = vars.get("$local.uid"); + CampaignUtils.createLogEntry(campaignId, campaignStepId, contactId, campaignParticipantId); \ No newline at end of file diff --git a/entity/Campaign_entity/recordcontainers/db/onDBInsert.js b/entity/Campaign_entity/recordcontainers/db/onDBInsert.js index 1c4614ea9ccf8b7adc7d532ea28deab3036f1970..dca739b5798f820a4930592b520a8f9f4ff898cb 100644 --- a/entity/Campaign_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Campaign_entity/recordcontainers/db/onDBInsert.js @@ -6,10 +6,12 @@ import("system.vars"); import("system.db"); import("system.datetime"); +var rowdata = vars.get("$local.rowdata"); + var threeWeeks = datetime.ONE_WEEK * 3; var inThreeWeeks = datetime.date() + threeWeeks; -var campaignId = vars.get("$field.CAMPAIGNID"); +var campaignId = vars.get("$local.uid"); var campaignStepId = util.getNewUUID(); var campaignStepName = translate.text("Added"); @@ -23,7 +25,7 @@ var description = ""; var maxParticipants = 100; var state = $KeywordRegistry.campaignStepState$open(); var sorting = 1; -var employeeContactId = vars.get("$field.EMPLOYEE_CONTACT_ID"); +var employeeContactId = rowdata["CAMPAIGN.EMPLOYEE_CONTACT_ID"]; var columns = ["CAMPAIGN_ID", "CAMPAIGNSTEPID", "NAME", "DATE_NEW", "USER_NEW", diff --git a/entity/Communication_entity/entityfields/addr/onValueChange.js b/entity/Communication_entity/entityfields/addr/onValueChange.js index 162a469de3311f5b17c1cff5994e510c1689ca4f..33c6de3393e742652e3720e90d620e129fdbe703 100644 --- a/entity/Communication_entity/entityfields/addr/onValueChange.js +++ b/entity/Communication_entity/entityfields/addr/onValueChange.js @@ -1,3 +1,4 @@ +import("system.logging"); import("WsValidation_lib"); import("system.neon"); import("KeywordRegistry_basic"); diff --git a/entity/Communication_entity/recordcontainers/db/onDBInsert.js b/entity/Communication_entity/recordcontainers/db/onDBInsert.js index 064879ccf84aa1d2ec5dafc66afc5dda16eed01d..11caf39b805cccf8ccffb87b00fb39b0a67923fc 100644 --- a/entity/Communication_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Communication_entity/recordcontainers/db/onDBInsert.js @@ -2,7 +2,9 @@ import("DataPrivacy_lib"); import("system.vars"); import("StandardObject_lib"); -new StandardObject("Communication", vars.get("$field.COMMUNICATIONID"), "Person", vars.get("$field.CONTACT_ID")) - .onCommunicationInsert(vars.get("$field.MEDIUM_ID")); +var rowdata = vars.get("$local.rowdata"); + +new StandardObject("Communication", vars.get("$local.uid"), "Person", rowdata["COMMUNICATION.CONTACT_ID"]) + .onCommunicationInsert(rowdata["COMMUNICATION.MEDIUM_ID"]); -DataPrivacyUtils.notifyNeedDataPrivacyUpdate(vars.get("$field.CONTACT_ID"), vars.get("$param.ShowDsgvoMessage_param")); \ No newline at end of file +DataPrivacyUtils.notifyNeedDataPrivacyUpdate(rowdata["COMMUNICATION.CONTACT_ID"], vars.get("$param.ShowDsgvoMessage_param")); \ No newline at end of file diff --git a/entity/DSGVOInfo_entity/entityfields/garantee/mandatoryProcess.js b/entity/DSGVOInfo_entity/entityfields/garantee/mandatoryProcess.js index 3d5236a0fbf1f2a9917d615b3cedb3065923acb4..1038e1167f0bc290e7e044ef2dbc5e145dd0c8ff 100644 --- a/entity/DSGVOInfo_entity/entityfields/garantee/mandatoryProcess.js +++ b/entity/DSGVOInfo_entity/entityfields/garantee/mandatoryProcess.js @@ -3,5 +3,5 @@ import("system.vars"); import("system.neon"); import("KeywordRegistry_basic"); -result.object(vars.get("$field.TRANSMISSION") && vars.get("$field.TRANSMISSION") != $KeywordRegistry.dsgvoTransmission$none() +result.object(vars.get("$field.TRANSMISSION") != "" && vars.get("$field.TRANSMISSION") != $KeywordRegistry.dsgvoTransmission$none() && vars.get("$field.TRANSMISSION") != $KeywordRegistry.dsgvoTransmission$inland()); \ No newline at end of file diff --git a/entity/DSGVOInfo_entity/entityfields/recipient/mandatoryProcess.js b/entity/DSGVOInfo_entity/entityfields/recipient/mandatoryProcess.js index de3c08140ff329c4580823e74d7d41e991695ca8..b72d41b28f12a60815129c0ba9c541b31a43f19d 100644 --- a/entity/DSGVOInfo_entity/entityfields/recipient/mandatoryProcess.js +++ b/entity/DSGVOInfo_entity/entityfields/recipient/mandatoryProcess.js @@ -3,4 +3,4 @@ import("system.vars"); import("system.neon"); import("KeywordRegistry_basic"); -result.object(vars.get("$field.TRANSMISSION") && vars.get("$field.TRANSMISSION") != $KeywordRegistry.dsgvoTransmission$none()); \ No newline at end of file +result.object(vars.get("$field.TRANSMISSION") != "" && vars.get("$field.TRANSMISSION") != $KeywordRegistry.dsgvoTransmission$none()); \ No newline at end of file diff --git a/entity/DSGVOInfo_entity/recordcontainers/db/onDBInsert.js b/entity/DSGVOInfo_entity/recordcontainers/db/onDBInsert.js index e8669f4fa41b190b0d2409d52bf653dfa1d2a9b3..ef08b6011add55be5ac2961455eb1d455f16d0c1 100644 --- a/entity/DSGVOInfo_entity/recordcontainers/db/onDBInsert.js +++ b/entity/DSGVOInfo_entity/recordcontainers/db/onDBInsert.js @@ -1,12 +1,14 @@ import("system.vars"); import("DataPrivacy_lib"); +var rowdata = vars.get("$local.rowdata"); + if (vars.get("$param.ReportType_param")) DataPrivacyUtils.openReport(vars.get("$param.ContactId_param"), vars.get("$param.ReportType_param"), { - datasource: vars.get("$field.DATASOURCE"), - transmission: vars.get("$field.TRANSMISSION"), - recipient: vars.get("$field.RECIPIENT"), - garantees: vars.get("$field.GUARANTEE"), + datasource: rowdata["DSGVOINFO.DATASOURCE"], + transmission: rowdata["DSGVOINFO.TRANSMISSION"], + recipient: rowdata["DSGVOINFO.RECIPIENT"], + garantees: rowdata["DSGVOINFO.GUARANTEE"], requestDate: vars.get("$field.dateRequest"), deadline: vars.get("$field.deadline"), deadlineDate: vars.get("$field.dateDeadline") diff --git a/entity/DSGVO_entity/recordcontainers/db/onDBInsert.js b/entity/DSGVO_entity/recordcontainers/db/onDBInsert.js deleted file mode 100644 index db82774a9ad18f9e15e0735707fb6cfe524afd1c..0000000000000000000000000000000000000000 --- a/entity/DSGVO_entity/recordcontainers/db/onDBInsert.js +++ /dev/null @@ -1,47 +0,0 @@ -import("KeywordRegistry_basic"); -import("Keyword_lib"); -import("system.db"); -import("system.neon"); -import("system.vars"); -import("system.util"); - -/* -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) -{ - var cols = ["USER_NEW" , "USER_EDIT" , "DSGVOID" , "ROW_ID" , "DATE_NEW" , - "TABLENAME" , "DATE_EDIT" , "RIGHT" , "VALID_TO" , "CONTACT_ID" , "USE"]; - - var vals = [vars.get("$sys.user"), null, util.getNewUUID(), - vars.get("$field.ROW_ID"), vars.get("$sys.date"), vars.get("$field.TABLENAME"), - null, KeywordUtils. vars.get("$field.RIGHT").valueOf(), vars.get("$field.VALID_TO"), - vars.get("$field.CONTACT_ID"), vars.get("$field.USE").valueOf()]; - // KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.dsgvoUse(), "DSGVO.USE"); - db.insertData("DSGVO", cols, null, vals); -} - - -/* - - // TODO Eintrag in DSGVO Tabelle - - /* - * - var InputMapping = { - "OFFERITEM": { - condition: "OFFER_ID = '" + pSourceOfferId + "' order by ITEMSORT", - ValueMapping: { - "OFFER_ID" : pTargetOfferId - } - } - }; - CopyModuleUtils.copyModule(InputMapping); - - var oiUtils = new OfferItemUtils(pTargetOfferId); - - //update order price - cols = ["NET", "VAT"]; - var vals = oiUtils.getNetAndVat(); - - db.updateData("OFFER", cols, null, vals, SqlCondition.equals("OFFER.OFFERID", pTargetOfferId, "1 = 2")); - * - */ \ No newline at end of file diff --git a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js index 0d8f6fe0d4cb076ba62b68fbb9738d9c2ee77039..ea7cf6a1ea8e1092e46a919e23a9971076d93f50 100644 --- a/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js +++ b/entity/DocumentTemplate_entity/recordcontainers/db/onDBInsert.js @@ -3,8 +3,10 @@ import("system.vars"); import("system.db"); import("system.util"); import("Document_lib"); +import("Sql_lib"); //TODO - Function +var rowdata = vars.get("$local.rowdata"); var bindataUpload = DocumentUtil.getBindataFromUpload(vars.get("$field.BINDATA")); var filename = ""; @@ -15,14 +17,14 @@ if(bindataUpload != "") filename = DocumentUtil.getFilenameFromUpload(vars.get("$field.BINDATA")); bindata = bindataUpload; } -else if(vars.get("$field.TYPE").trim() == "TEX" && vars.get("$field.texText") != "") +else if(rowdata["DOCUMENTTEMPLATE.TYPE"].trim() == "TEX" && vars.get("$field.texText") != "") { - filename = vars.get("$field.NAME") + ".txt"; + filename = rowdata["DOCUMENTTEMPLATE.NAME"] + ".txt"; bindata = util.encodeBase64String(vars.get("$field.texText")); } if(bindata != "" && filename != "") { - db.insertBinary("DOCUMENTTEMPLATE", "DOCUMENT", vars.get("$field.DOCUMENTTEMPLATEID"), - "", bindata, filename, "", "", "_____SYSTEMALIAS"); + db.insertBinary("DOCUMENTTEMPLATE", "DOCUMENT", vars.get("$local.uid"), + "", bindata, filename, "", "", SqlUtils.getSystemAlias()); } \ No newline at end of file diff --git a/entity/Offer_entity/recordcontainers/db/onDBInsert.js b/entity/Offer_entity/recordcontainers/db/onDBInsert.js index c9c487029913a28d6eda69030fccfc6f6f3a3f5f..cf7eb05721dd07df50aec9a891e3bdce9a3cd49b 100644 --- a/entity/Offer_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Offer_entity/recordcontainers/db/onDBInsert.js @@ -3,4 +3,4 @@ import("system.vars"); import("Offer_lib"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferOriginal_Id_param")) - OfferUtils.copyOfferItems(vars.getString("$param.OfferOriginal_Id_param"), vars.get("$field.OFFERID")); + OfferUtils.copyOfferItems(vars.getString("$param.OfferOriginal_Id_param"), vars.get("$local.uid")); diff --git a/entity/Offeritem_entity/recordcontainers/db/onDBInsert.js b/entity/Offeritem_entity/recordcontainers/db/onDBInsert.js index 1e4dc46b09b8d369f24c76194c2eb16774ab8bea..317fce086c92e7e36cb070594c3fb2a756b386d0 100644 --- a/entity/Offeritem_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Offeritem_entity/recordcontainers/db/onDBInsert.js @@ -7,13 +7,15 @@ import("Offer_lib"); import("Product_lib"); import("Sql_lib"); -var oid = vars.get("$field.OFFER_ID"); +var rowdata = vars.get("$local.rowdata"); + +var oid = rowdata["OFFERITEM.OFFER_ID"]; if(oid != "") { var curr = vars.exists("$param.Currency_param") ? vars.get("$param.Currency_param") : ""; var contactid = vars.exists("$param.ContactId_param") ? vars.get("$param.ContactId_param") : ""; - var oiUtils = new OfferItemUtils(vars.get("$field.OFFER_ID")); - oiUtils.insertPartsList(vars.get("$field.PRODUCT_ID"), vars.get("$field.OFFERITEMID"), curr, contactid, vars.get("$param.Language_param")); + var oiUtils = new OfferItemUtils(rowdata["OFFERITEM.OFFER_ID"]); + oiUtils.insertPartsList(rowdata["OFFERITEM.PRODUCT_ID"], vars.get("$local.uid"), curr, contactid, vars.get("$param.Language_param")); oiUtils.reOrgItems(); //update offer price diff --git a/entity/Order_entity/recordcontainers/db/onDBInsert.js b/entity/Order_entity/recordcontainers/db/onDBInsert.js index 940a4ff0f9a833f00b45814bab915e9ed2014fb6..e2760611ed329affdd97f899f00caba0444e0cb0 100644 --- a/entity/Order_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Order_entity/recordcontainers/db/onDBInsert.js @@ -3,6 +3,8 @@ import("system.vars"); import("Sql_lib"); import("Order_lib"); +var rowdata = vars.get("$local.rowdata"); + if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.OfferId_param")) { var orderId = vars.getString("$field.SALESORDERID"); diff --git a/process/DataPrivacy_lib/process.js b/process/DataPrivacy_lib/process.js index 2a90429564990b9c7e179f19ee788fa19c7d5398..24e7ca2099a4403f18162d8b5e065a3736afb556 100644 --- a/process/DataPrivacy_lib/process.js +++ b/process/DataPrivacy_lib/process.js @@ -1,6 +1,5 @@ import("system.project"); import("system.project"); -import("system.logging"); import("Util_lib"); import("PostalAddress_lib"); import("system.text");