diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index 6f51538041ffc0b890e44450ea85fd73235b5185..2b98d6bd2c33292ef54ca82d1d5c8f624b353cbf 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -171,11 +171,6 @@ </entityParameter> <entityConsumer> <name>AppointmentLinks</name> - <dependency> - <name>dependency</name> - <entityName>AppointmentLink_entity</entityName> - <fieldName>Links</fieldName> - </dependency> <children> <entityParameter> <name>AppointmentId_param</name> @@ -187,6 +182,11 @@ <expose v="false" /> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>AppointmentLink_entity</entityName> + <fieldName>Links</fieldName> + </dependency> </entityConsumer> <entityActionField> <name>deleteSeries</name> @@ -254,6 +254,11 @@ <name>#PROVIDER_AGGREGATES</name> <useAggregates v="true" /> </entityProvider> + <entityParameter> + <name>ErrorOnPermissionDenied</name> + <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js</valueProcess> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js b/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e5bfa3bbe7f58d2ffaf401248014a6d1a560d2de --- /dev/null +++ b/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("true"); \ No newline at end of file diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 3d5ff22eafe395331b6e6d52bf359b60c6d91098..709bfac8d00e3b805a383dc0c78c0cb8b91a07d1 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("Calendar_lib"); import("Employee_lib"); import("system.tools"); import("system.db"); @@ -28,14 +29,14 @@ if(vars.exists("$param.Entry_param") && vars.get("$param.Entry_param")) //@TODO Icon result.object([ - buildEntry(entry, masterEntry) + CalendarUtil.buildEntry(entry, masterEntry) ]); } else if(vars.get("$sys.recordstate") != neon.OPERATINGSTATE_NEW && vars.get("$local.idvalues") != null && vars.get("$local.idvalues") != "") { var selectedids = vars.get("$local.idvalues"); - result.object([buildEntry(calendars.getEntry(selectedids, null, null), null)]); + result.object([CalendarUtil.buildEntry(calendars.getEntry(selectedids, null, null), null)]); } else if(vars.getString("$param.LinkedAppointmentsFromDashlet_param")) @@ -43,7 +44,7 @@ else if(vars.getString("$param.LinkedAppointmentsFromDashlet_param")) var contactid = EmployeeUtils.getCurrentContactId(); appointmentSelect.whereIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", contactid) - result.object(buildEntriesFromUids(appointmentSelect.table())); + result.object(CalendarUtil.buildEntriesFromUids(appointmentSelect.table())); } /** @@ -52,78 +53,5 @@ else if(vars.getString("$param.LinkedAppointmentsFromDashlet_param")) else if(vars.getString("$param.LinkedObjectId_param") != undefined) { appointmentSelect.whereIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", "$param.LinkedObjectId_param") - result.object(buildEntriesFromUids(appointmentSelect.table())); -} - -function buildEntriesFromUids(appointmentUids) -{ - var entryArray = new Array(appointmentUids.length); - - for(var i = 0; i < appointmentUids.length; i++) - entryArray[i] = buildEntry(calendars.getEntry(appointmentUids[i], null, null), null); - - return entryArray; -} - - -function buildEntry(pEntry, pMasterentry) -{ - var uid = pEntry[calendars.ID]; - var summary = pEntry[calendars.SUMMARY]; - var attendees = pEntry[calendars.AFFECTEDUSERS]; - var startdate = pEntry[calendars.DTSTART]; - var enddate = pEntry[calendars.DTEND]; - var links = pEntry[calendars.LINKS]; - var description = pEntry[calendars.DESCRIPTION]; - if(pEntry[calendars.ORGANIZER2] != undefined) - var organizer = pEntry[calendars.ORGANIZER2]["paramvalue"]; - if(pEntry[calendars.USER2] != undefined) - var owner = JSON.stringify(pEntry[calendars.USER2]); - var status = pEntry[calendars.STATUS]; - var location = pEntry[calendars.LOCATION]; - var reminder = pEntry[calendars.REMINDER_DURATION]; - var remindercheck = pEntry[calendars.HASREMINDER] - var classification = pEntry[calendars.CLASSIFICATION]; - var transparency = pEntry[calendars.TRANSPARENCY]; - var categories = pEntry[calendars.CATEGORIES]; - var isAllDay = pEntry["X-ADITO-ISALLDAYEVENT"] != null ? pEntry["X-ADITO-ISALLDAYEVENT"] : "FALSE"; - - var masterBegin = pMasterentry != null ? pMasterentry[calendars.DTSTART] : null - var masterEnd = pMasterentry != null ? pMasterentry[calendars.DTEND] : null - - // Recurrence - var recurrenceID = pEntry[calendars.RECURRENCEID]; - var rrule = null; - if (pMasterentry != null) { // Entry is a recurrence exception, therefore get rrule from master - rrule = pMasterentry[calendars.RRULE] != null ? pMasterentry[calendars.RRULE][0] : null; - } else { - rrule = pEntry[calendars.RRULE] != null ? pEntry[calendars.RRULE][0] : null; - } - - return [ - uid, - attendees.length, - startdate, - enddate, - summary, - organizer, - owner, - attendees, - status, - description, - location, - '', - isAllDay, - classification, - transparency, - categories, - reminder, - remindercheck, - rrule, - recurrenceID, - null, - masterBegin, - masterEnd, - null - ]; + result.object(CalendarUtil.buildEntriesFromUids(appointmentSelect.table())); } diff --git a/entity/Appointment_entity/recordcontainers/jdito/rowCountProcess.js b/entity/Appointment_entity/recordcontainers/jdito/rowCountProcess.js index afff252f743faff586199e13333a707e5d52c51e..d6495461f9409c2d28cd62951d09cc6797a4eb69 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/rowCountProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/rowCountProcess.js @@ -1,3 +1,4 @@ +import("Calendar_lib"); import("system.db"); import("Employee_lib"); import("Sql_lib"); @@ -5,7 +6,7 @@ import("system.vars"); import("system.result"); var rowCount = "0"; -var cond = newSelect("count(APPOINTMENT_ID)") +var cond = newSelect("APPOINTMENT_ID") .from("AB_APPOINTMENTLINK"); if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) @@ -13,7 +14,7 @@ if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) else if (vars.getString("$param.LinkedAppointmentsFromDashlet_param")) { cond.whereIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", EmployeeUtils.getCurrentContactId()); - rowCount = cond.cell(); + rowCount = CalendarUtil.countEntriesFromUids(cond.table()); } /** @@ -22,7 +23,7 @@ else if (vars.getString("$param.LinkedAppointmentsFromDashlet_param")) else if (vars.getString("$param.LinkedObjectId_param") != undefined) { cond.whereIfSet("AB_APPOINTMENTLINK.OBJECT_ROWID", "$param.LinkedObjectId_param"); - rowCount = cond.cell(); + rowCount = CalendarUtil.countEntriesFromUids(cond.table()); } /** * Will be used, if the user is operating the calendar. diff --git a/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod b/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod index bae83161b6a2b2580cbc7734093346ce3596a028..60d85496e220808f40709d4fd7fc80bbba176c0a 100644 --- a/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod +++ b/entity/BulkMailRecipient_entity/BulkMailRecipient_entity.aod @@ -121,6 +121,13 @@ <iconId>VAADIN:BAN</iconId> <tooltipProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientactions/children/removewithcommrestriction/tooltipProcess.js</tooltipProcess> </entityActionField> + <entityActionField> + <name>startMarketingWorkflows</name> + <title>Start marketing mailing</title> + <onActionProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientactions/children/startmarketingworkflows/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:ENVELOPES</iconId> + </entityActionField> </children> </entityActionGroup> <entityField> diff --git a/entity/BulkMailRecipient_entity/entityfields/recipientactions/children/startmarketingworkflows/onActionProcess.js b/entity/BulkMailRecipient_entity/entityfields/recipientactions/children/startmarketingworkflows/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..cbe91449e5c258643491b9020a7bc6d1b534e7ec --- /dev/null +++ b/entity/BulkMailRecipient_entity/entityfields/recipientactions/children/startmarketingworkflows/onActionProcess.js @@ -0,0 +1,34 @@ +import("Util_lib"); +import("system.entities"); +import("Context_lib"); +import("system.vars"); +import("system.neon"); + +var rows = vars.get("$sys.selectionRows"); +var filter = vars.get("$sys.filter").filter; +var targets = []; + +if (Utils.isNullOrEmpty(rows)) +{ + let loadConfig = entities.createConfigForLoadingRows() + .entity("BulkMailRecipient_entity") + .provider("BulkMailRecipients") + .fields(["CONTACT_ID", "TARGETCONTEXT"]) + .addParameter("BulkMailId_param", vars.get("$param.BulkMailId_param")); + + if (filter) + loadConfig.filter(JSON.stringify(filter)); + + rows = entities.getRows(loadConfig); +} + +rows = rows.map(function (row) +{ + return [row["CONTACT_ID"], row["TARGETCONTEXT"]]; +}); + + +neon.openContext("MarketingWorkflowLauncher", "MarketingWorkflowLauncherEdit_view", null, neon.OPERATINGSTATE_VIEW, { + "ObjectIds_param": JSON.stringify(rows), + "ObjectType_param": ContextUtils.getCurrentContextId() +}); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index 3c8e5a5655f3c8320c4188939e9588988e7b9b44..4d3b86ba02c4c01afcd977df57bbd15e493c3c08 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -177,6 +177,13 @@ <tooltip>Update campaign step</tooltip> <tooltipProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/setsteptoparticipantselection/tooltipProcess.js</tooltipProcess> </entityActionField> + <entityActionField> + <name>startMarketingWorkflows</name> + <title>Start marketing mailing</title> + <onActionProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:ENVELOPES</iconId> + </entityActionField> </children> </entityActionGroup> <entityField> diff --git a/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js b/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..40e60ff20d2ca20af3b447981c2a988959d2de63 --- /dev/null +++ b/entity/CampaignParticipant_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js @@ -0,0 +1,36 @@ +import("Util_lib"); +import("system.entities"); +import("Context_lib"); +import("system.vars"); +import("system.neon"); + +var rows = vars.get("$sys.selectionRows"); +var filter = vars.get("$sys.filter").filter; +var targets = []; + +if (Utils.isNullOrEmpty(rows)) +{ + let loadConfig = entities.createConfigForLoadingRows() + .entity("CampaignParticipant_entity") + .provider("CampaignParticipantsProvider") + .fields(["CONTACT_ID", "CONTACTCONTEXT"]) + .addParameter("CampaignId_param", vars.get("$param.CampaignId_param")) + .addParameter("CampaignStepId_param", vars.get("$param.CampaignStepId_param")) + .addParameter("ContactId_param", vars.get("$param.ContactId_param")); + + if (filter) + loadConfig.filter(JSON.stringify(filter)); + + rows = entities.getRows(loadConfig); +} + +rows = rows.map(function (row) +{ + return [row["CONTACT_ID"], row["CONTACTCONTEXT"]]; +}); + + +neon.openContext("MarketingWorkflowLauncher", "MarketingWorkflowLauncherEdit_view", null, neon.OPERATINGSTATE_VIEW, { + "ObjectIds_param": JSON.stringify(rows), + "ObjectType_param": ContextUtils.getCurrentContextId() +}); \ No newline at end of file diff --git a/entity/Campaign_entity/recordcontainers/db/conditionProcess.js b/entity/Campaign_entity/recordcontainers/db/conditionProcess.js index b56a17e4e112b773aa2b1f6f5339c986b5d205bf..ea77837ea6f8defb3e4e66200740f5b8614adae5 100644 --- a/entity/Campaign_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Campaign_entity/recordcontainers/db/conditionProcess.js @@ -7,19 +7,11 @@ import("Sql_lib"); var recordState = vars.get("$sys.recordstate"); +var condition = newWhere(); if(vars.get("$param.ShowOnlyCurrentUsersCampaigns_param") == 'true') { - //TODO: use a preparedCondition (.build instead of .translate) when available #1030812 #1034026 - result.string(newWhere("CAMPAIGN.EMPLOYEE_CONTACT_ID", EmployeeUtils.getCurrentContactId()).toString()); -} else if (recordState != neon.OPERATINGSTATE_NEW && recordState != neon.OPERATINGSTATE_EDIT) { - var condition = new SqlBuilder() - .whereIfSet("STEPDATESTART_TABLEALIAS.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID") - .andIfSet("STEPDATEEND_TABLEALIAS.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID") - ; + condition.and("CAMPAIGN.EMPLOYEE_CONTACT_ID", EmployeeUtils.getCurrentContactId()); +} - result.string(condition.toString()); -} else { - - result.string(newWhere().toString()); -} \ No newline at end of file +result.string(condition.toString()); \ No newline at end of file diff --git a/entity/Campaign_entity/recordcontainers/db/fromClauseProcess.js b/entity/Campaign_entity/recordcontainers/db/fromClauseProcess.js index 5eec4c678e0303f56f160d22534f7c2fbe2bd302..f1704c63ce08d64a2b42eaa2192c87e929b2c290 100644 --- a/entity/Campaign_entity/recordcontainers/db/fromClauseProcess.js +++ b/entity/Campaign_entity/recordcontainers/db/fromClauseProcess.js @@ -7,10 +7,11 @@ var recordState = vars.get("$sys.recordstate"); var res = "CAMPAIGN"; if (recordState != neon.OPERATINGSTATE_NEW && recordState != neon.OPERATINGSTATE_EDIT) { - var subSelectDateStart = "(select min(DATE_START) as STEPDATESTART_ALIAS, CAMPAIGN_ID from CAMPAIGNSTEP group by CAMPAIGN_ID) as STEPDATESTART_TABLEALIAS"; - var subSelectDateEnd = "(select max(DATE_END) as STEPDATEEND_ALIAS, CAMPAIGN_ID from CAMPAIGNSTEP group by CAMPAIGN_ID) as STEPDATEEND_TABLEALIAS"; - - res += ", " + subSelectDateStart + ", " + subSelectDateEnd; + res += " join (select min(DATE_START) as STEPDATESTART_ALIAS, CAMPAIGN_ID from CAMPAIGNSTEP group by CAMPAIGN_ID) STEPDATESTART_TABLEALIAS" + + " on STEPDATESTART_TABLEALIAS.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID " + + " join (select max(DATE_END) as STEPDATEEND_ALIAS, CAMPAIGN_ID from CAMPAIGNSTEP group by CAMPAIGN_ID) STEPDATEEND_TABLEALIAS" + + " on STEPDATEEND_TABLEALIAS.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID "; + } result.string(res); diff --git a/entity/Competition_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js b/entity/Competition_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js index 33554680cccd2c3d363443686457c41e0c1c5729..fb69d484cfa8fc6aa1c45987d94b793c35efd20a 100644 --- a/entity/Competition_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js +++ b/entity/Competition_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js @@ -1,4 +1,4 @@ import("system.result"); import("Context_lib"); -result.string(ContextUtils.getNameSubselectSql("OBJECT_TYPE", "OBJECT_ROWID")) \ No newline at end of file +result.string(ContextUtils.getNameSubselectSql("COMPETITION.OBJECT_TYPE", "COMPETITION.OBJECT_ROWID")) \ No newline at end of file diff --git a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod index 9cf1d9cca301bb4240acea90684327824bbd201d..dbb9e49a3b635be85e5615422520d9f08d387aac 100644 --- a/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod +++ b/entity/DocumentTemplate_entity/DocumentTemplate_entity.aod @@ -321,6 +321,7 @@ <entityConsumer> <name>DocumentTemplatePlaceOfUse</name> <stateProcess>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/stateProcess.js</stateProcess> + <onValidation>%aditoprj%/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/onValidation.js</onValidation> <dependency> <name>dependency</name> <entityName>DocumentTemplatePlaceOfUse_entity</entityName> diff --git a/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/onValidation.js b/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..a40be7eb7d8e21b088a3cf4683b41849239e35ee --- /dev/null +++ b/entity/DocumentTemplate_entity/entityfields/documenttemplateplaceofuse/onValidation.js @@ -0,0 +1,14 @@ +import("system.translate"); +import("system.result"); +import("system.vars"); +import("Entity_lib"); + +var usages = EntityConsumerRowsHelper.getCurrentConsumerRows("DocumentTemplatePlaceOfUse", ["PLACEOFUSE"]); +var hasMarketingWorkflowUsage = usages.some(function (usage) +{ + return usage["PLACEOFUSE"] == "MarketingWorkflowLauncher"; +}); +if (hasMarketingWorkflowUsage && !vars.get("$field.Content").includes("{@workflowActionLink@}")) +{ + result.string(translate.text("The template must contain the placeholder for the worklow-link to use it with the marketing workflow")); +} diff --git a/entity/Document_entity/Document_entity.aod b/entity/Document_entity/Document_entity.aod index 420157a37135f2b6b3fd1105810584e32ac6935e..cba9173b17cbedf17fc79b500cd69af232cb8c10 100644 --- a/entity/Document_entity/Document_entity.aod +++ b/entity/Document_entity/Document_entity.aod @@ -144,6 +144,26 @@ <entityProvider> <name>Documents</name> <recordContainer>jdito</recordContainer> + <children> + <entityParameter> + <name>AssignmentName_param</name> + <valueProcess>%aditoprj%/entity/Document_entity/entityfields/documents/children/assignmentname_param/valueProcess.js</valueProcess> + <expose v="true" /> + <documentation>%aditoprj%/entity/Document_entity/entityfields/documents/children/assignmentname_param/documentation.adoc</documentation> + </entityParameter> + <entityParameter> + <name>AssignmentRowId_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>AssignmentTable_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>Keyword_param</name> + <expose v="true" /> + </entityParameter> + </children> <dependencies> <entityDependency> <name>1eae1907-53ea-4d6f-bcf1-772052365020</name> @@ -225,7 +245,7 @@ </entityDependency> <entityDependency> <name>2e6fcf27-ee98-4f7d-a99d-7ce02774076b</name> - <entityName>UserhelpResources</entityName> + <entityName>UserhelpResources_entity</entityName> <fieldName>Documents</fieldName> <isConsumer v="false" /> </entityDependency> @@ -242,12 +262,23 @@ <isConsumer v="false" /> </entityDependency> </dependencies> + </entityProvider> + <entityProvider> + <name>MainDocuments</name> + <recordContainer>jdito</recordContainer> <children> + <entityParameter> + <name>Keyword_param</name> + <valueProcess>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/keyword_param/valueProcess.js</valueProcess> + <expose v="true" /> + <mandatory v="true" /> + <description>TODO: expose auf false. aktuell wird der Code nicht ausgeführt, wenn Expose false ist.</description> + </entityParameter> <entityParameter> <name>AssignmentName_param</name> - <valueProcess>%aditoprj%/entity/Document_entity/entityfields/documents/children/assignmentname_param/valueProcess.js</valueProcess> + <valueProcess>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/assignmentname_param/valueProcess.js</valueProcess> <expose v="true" /> - <documentation>%aditoprj%/entity/Document_entity/entityfields/documents/children/assignmentname_param/documentation.adoc</documentation> + <documentation>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/assignmentname_param/documentation.adoc</documentation> </entityParameter> <entityParameter> <name>AssignmentRowId_param</name> @@ -258,14 +289,10 @@ <expose v="true" /> </entityParameter> <entityParameter> - <name>Keyword_param</name> - <expose v="true" /> + <name>DisallowCreate_param</name> + <expose v="false" /> </entityParameter> </children> - </entityProvider> - <entityProvider> - <name>MainDocuments</name> - <recordContainer>jdito</recordContainer> <dependencies> <entityDependency> <name>87d738a5-5d5e-425e-b013-007371475a38</name> @@ -310,33 +337,6 @@ <isConsumer v="false" /> </entityDependency> </dependencies> - <children> - <entityParameter> - <name>Keyword_param</name> - <valueProcess>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/keyword_param/valueProcess.js</valueProcess> - <expose v="true" /> - <mandatory v="true" /> - <description>TODO: expose auf false. aktuell wird der Code nicht ausgeführt, wenn Expose false ist.</description> - </entityParameter> - <entityParameter> - <name>AssignmentName_param</name> - <valueProcess>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/assignmentname_param/valueProcess.js</valueProcess> - <expose v="true" /> - <documentation>%aditoprj%/entity/Document_entity/entityfields/maindocuments/children/assignmentname_param/documentation.adoc</documentation> - </entityParameter> - <entityParameter> - <name>AssignmentRowId_param</name> - <expose v="true" /> - </entityParameter> - <entityParameter> - <name>AssignmentTable_param</name> - <expose v="true" /> - </entityParameter> - <entityParameter> - <name>DisallowCreate_param</name> - <expose v="false" /> - </entityParameter> - </children> </entityProvider> <entityParameter> <name>DisallowCreate_param</name> @@ -346,14 +346,6 @@ <entityProvider> <name>SingleDocument</name> <titlePlural>Document</titlePlural> - <dependencies> - <entityDependency> - <name>91f87622-d0e8-43c6-99a0-5f9cebf79aaf</name> - <entityName>SerialLetter_entity</entityName> - <fieldName>Documents</fieldName> - <isConsumer v="false" /> - </entityDependency> - </dependencies> <children> <entityParameter> <name>AssignmentName_param</name> @@ -365,6 +357,14 @@ <expose v="true" /> </entityParameter> </children> + <dependencies> + <entityDependency> + <name>91f87622-d0e8-43c6-99a0-5f9cebf79aaf</name> + <entityName>SerialLetter_entity</entityName> + <fieldName>Documents</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> </entityProvider> <entityProvider> <name>#PROVIDER_AGGREGATES</name> diff --git a/entity/Forecast_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js b/entity/Forecast_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js index 33554680cccd2c3d363443686457c41e0c1c5729..856c1bb3cfff78abcc06bc817a49a40757e3529f 100644 --- a/entity/Forecast_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js +++ b/entity/Forecast_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js @@ -1,4 +1,4 @@ import("system.result"); import("Context_lib"); -result.string(ContextUtils.getNameSubselectSql("OBJECT_TYPE", "OBJECT_ROWID")) \ No newline at end of file +result.string(ContextUtils.getNameSubselectSql("FORECAST.OBJECT_TYPE", "FORECAST.OBJECT_ROWID")) \ No newline at end of file diff --git a/entity/MarketingWorkflowLauncher_entity/MarketingWorkflowLauncher_entity.aod b/entity/MarketingWorkflowLauncher_entity/MarketingWorkflowLauncher_entity.aod index 40b9b39c8993d2b421f368b11fca27d80abb24f5..791b08d72b2e85a807d11a6c47284056ae16a977 100644 --- a/entity/MarketingWorkflowLauncher_entity/MarketingWorkflowLauncher_entity.aod +++ b/entity/MarketingWorkflowLauncher_entity/MarketingWorkflowLauncher_entity.aod @@ -14,7 +14,7 @@ </entityProvider> <entityField> <name>DOCUMENTTEMPLATE_ID</name> - <title>Document template</title> + <title>Document Template</title> <consumer>EmailTemplates</consumer> <mandatory v="true" /> <state>EDITABLE</state> @@ -80,6 +80,7 @@ <recordContainers> <datalessRecordContainer> <name>dataLess</name> + <alias>Data_alias</alias> </datalessRecordContainer> </recordContainers> </entity> diff --git a/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/processvariables_param/valueProcess.js b/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/processvariables_param/valueProcess.js index b81df3d4fb93fc9608febd7783247052a61d4acd..cea637a710a0e3e0903248241654aec944c88137 100644 --- a/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/processvariables_param/valueProcess.js +++ b/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/processvariables_param/valueProcess.js @@ -2,6 +2,7 @@ import("system.vars"); import("system.result"); var variables = { - documentTemplate: vars.get("$field.DOCUMENTTEMPLATE_ID") + documentTemplateId: vars.get("$field.DOCUMENTTEMPLATE_ID"), + originUrl: vars.get("$sys.origin") }; result.string(JSON.stringify(variables)); \ No newline at end of file diff --git a/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/targets_param/valueProcess.js b/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/targets_param/valueProcess.js index 6a28aafa528aa4130e913b642f80e04cfadc8b19..cca5f0e8d7ce5b6b8bb2ad60f3ffb068c4c6f1a1 100644 --- a/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/targets_param/valueProcess.js +++ b/entity/MarketingWorkflowLauncher_entity/entityfields/workflowlauncherintegration/children/targets_param/valueProcess.js @@ -1,13 +1,17 @@ import("Util_lib"); import("system.vars"); import("system.result"); +import("FilterViewAction_lib"); var context = vars.get("$param.ObjectType_param"); -var targets = Utils.parseJSON(vars.get("$param.ObjectIds_param")) || []; -targets = targets.map(function (targetId) +var targets = Utils.parseJSON(vars.get("$param.ObjectIds_param")); +var filter = Utils.parseJSON(vars.get("$param.ObjectFilter_param")); + +targets = FilterViewActionUtils.getUidsBySelectionOrFilter(context, targets, filter).map(function (targetId) { if (Utils.isString(targetId)) return [targetId, context]; //todo: context dynamic (eg for participants) return targetId; }); + result.string(JSON.stringify(targets)); \ No newline at end of file diff --git a/entity/Member_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js b/entity/Member_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js index 000d055cfacc970e2ca0dc70689b4c793e0bc0cd..a5d62617bee8630b78204e4bc85c851dba3b10df 100644 --- a/entity/Member_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js +++ b/entity/Member_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js @@ -5,6 +5,6 @@ import("Context_lib"); //TODO: refactor: //whenever we want to shrink data for a single object it's not needed to resolve the objects name where we're from if (vars.get("$param.ObjectType_param") == null) - result.string(ContextUtils.getNameSubselectSql("OBJECT_TYPE", "OBJECT_ROWID")); + result.string(ContextUtils.getNameSubselectSql("OBJECTMEMBER.OBJECT_TYPE", "OBJECTMEMBER.OBJECT_ROWID")); else result.string("'OBJECT_ROWID.displayValue not loaded'"); \ No newline at end of file diff --git a/entity/Offer_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js b/entity/Offer_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js index 33554680cccd2c3d363443686457c41e0c1c5729..c0332af5cb599a99d062e3828f354ebfd005273f 100644 --- a/entity/Offer_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js +++ b/entity/Offer_entity/recordcontainers/db/recordfieldmappings/object_rowid.displayvalue/expression.js @@ -1,4 +1,4 @@ import("system.result"); import("Context_lib"); -result.string(ContextUtils.getNameSubselectSql("OBJECT_TYPE", "OBJECT_ROWID")) \ No newline at end of file +result.string(ContextUtils.getNameSubselectSql("OFFER.OBJECT_TYPE", "OFFER.OBJECT_ROWID")) \ No newline at end of file diff --git a/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js b/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js index a86ac585f271d61227c89ec425d97d7c43e2a73d..2aec63a8d1bbd3bd15e9522ccb53fa52f74f7623 100644 --- a/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js +++ b/entity/Order_entity/recordcontainers/db/recordfieldmappings/offer_id.displayvalue/expression.js @@ -1,4 +1,5 @@ import("system.result"); import("Context_lib"); +import("system.db"); -result.string(ContextUtils.getNameSubselectSql("'Offer'", "SALESORDER.OFFER_ID")); \ No newline at end of file +result.string(db.translateStatement(ContextUtils.getNameSql("Offer", "SALESORDER.OFFER_ID"))); \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 4d5db6ed1a8789383791d9793b7c5791ae8f30a6..50afcd2e32295cc01c67e21a154d33520e99a7ce 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -812,6 +812,10 @@ <name>LinkedObjectId_param</name> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/linkedappointments/children/linkedobjectid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ErrorOnPermissionDenied</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/linkedappointments/children/erroronpermissiondenied/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -955,6 +959,13 @@ <tooltip>Export fields of this table</tooltip> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/export/tooltipProcess.js</tooltipProcess> </entityActionField> + <entityActionField> + <name>startMarketingWorkflows</name> + <title>Start marketing mailing</title> + <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:ENVELOPES</iconId> + </entityActionField> </children> </entityActionGroup> <entityActionField> diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2b04867cc90fd72a300747605800b32664d4b5b4 --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js @@ -0,0 +1,9 @@ +import("Context_lib"); +import("system.vars"); +import("system.neon"); + +neon.openContext("MarketingWorkflowLauncher", "MarketingWorkflowLauncherEdit_view", null, neon.OPERATINGSTATE_VIEW, { + "ObjectIds_param": JSON.stringify(vars.get("$sys.selection")), + "ObjectFilter_param": JSON.stringify(vars.get("$sys.filter")), + "ObjectType_param": ContextUtils.getCurrentContextId() +}); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/linkedappointments/children/erroronpermissiondenied/valueProcess.js b/entity/Organisation_entity/entityfields/linkedappointments/children/erroronpermissiondenied/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..15b1f8d0322593145f40d707c61dfdfd9babf0fe --- /dev/null +++ b/entity/Organisation_entity/entityfields/linkedappointments/children/erroronpermissiondenied/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("false"); \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index c66ce949329c5b9e71486cb5802b41b0b2244ddf..42f436e7093dbe2303fabd9df2a098fc792ca049 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -884,6 +884,10 @@ <name>LinkedObjectId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/appointments/children/linkedobjectid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ErrorOnPermissionDenied</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/appointments/children/erroronpermissiondenied/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityField> @@ -1099,9 +1103,10 @@ </entityActionField> <entityActionField> <name>startMarketingWorkflows</name> - <title>Marketing Workflow</title> + <title>Start marketing mailing</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js</onActionProcess> <isObjectAction v="false" /> + <iconId>VAADIN:ENVELOPES</iconId> </entityActionField> </children> </entityActionGroup> diff --git a/entity/Person_entity/entityfields/appointments/children/erroronpermissiondenied/valueProcess.js b/entity/Person_entity/entityfields/appointments/children/erroronpermissiondenied/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..15b1f8d0322593145f40d707c61dfdfd9babf0fe --- /dev/null +++ b/entity/Person_entity/entityfields/appointments/children/erroronpermissiondenied/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("false"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js index 3e462ab4498eb4215bac2daa8457aee59ae8cd2a..2b04867cc90fd72a300747605800b32664d4b5b4 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/startmarketingworkflows/onActionProcess.js @@ -4,5 +4,6 @@ import("system.neon"); neon.openContext("MarketingWorkflowLauncher", "MarketingWorkflowLauncherEdit_view", null, neon.OPERATINGSTATE_VIEW, { "ObjectIds_param": JSON.stringify(vars.get("$sys.selection")), + "ObjectFilter_param": JSON.stringify(vars.get("$sys.filter")), "ObjectType_param": ContextUtils.getCurrentContextId() }); \ No newline at end of file diff --git a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js index bd20eceda69bc4ed288c1090ba77ee4918831b57..fd0e3bd7a6f2c7518d54d02f9351a842f3d25d9b 100644 --- a/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Turnover_entity/recordcontainers/jdito/contentProcess.js @@ -27,8 +27,8 @@ import("system.translate"); */ -var turnoverCategory = translate.text('Turnover'); -var forecastCategory = translate.text('Forecast'); +var turnoverCategory = translate.text("Turnover"); +var forecastCategory = translate.text("Forecast"); var maxYear = parseInt(vars.get("$param.MaxYear_param")); var yearCountToShow = parseInt(vars.get("$param.YearCountToShow_param")); diff --git a/entity/UserhelpResources/UserhelpResources.aod b/entity/UserhelpResources_entity/UserhelpResources_entity.aod similarity index 70% rename from entity/UserhelpResources/UserhelpResources.aod rename to entity/UserhelpResources_entity/UserhelpResources_entity.aod index 7775d3fd5a4ba8d43ec112062c7772b437bd68c9..32f253d41162e3e5c8b4e33f1bcba45bdc803965 100644 --- a/entity/UserhelpResources/UserhelpResources.aod +++ b/entity/UserhelpResources_entity/UserhelpResources_entity.aod @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.17" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.17"> - <name>UserhelpResources</name> + <name>UserhelpResources_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <documentation>%aditoprj%/entity/UserhelpResources/documentation.adoc</documentation> + <documentation>%aditoprj%/entity/UserhelpResources_entity/documentation.adoc</documentation> <entityFields> <entityProvider> <name>#PROVIDER</name> @@ -12,21 +12,21 @@ </entityField> <entityConsumer> <name>Documents</name> - <dependency> - <name>dependency</name> - <entityName>Document_entity</entityName> - <fieldName>Documents</fieldName> - </dependency> <children> <entityParameter> <name>AssignmentTable_param</name> - <valueProcess>%aditoprj%/entity/UserhelpResources/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess> + <valueProcess>%aditoprj%/entity/UserhelpResources_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess> </entityParameter> <entityParameter> <name>AssignmentRowId_param</name> - <valueProcess>%aditoprj%/entity/UserhelpResources/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess> + <valueProcess>%aditoprj%/entity/UserhelpResources_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess> </entityParameter> </children> + <dependency> + <name>dependency</name> + <entityName>Document_entity</entityName> + <fieldName>Documents</fieldName> + </dependency> </entityConsumer> <entityProvider> <name>#PROVIDER_AGGREGATES</name> diff --git a/entity/UserhelpResources/documentation.adoc b/entity/UserhelpResources_entity/documentation.adoc similarity index 100% rename from entity/UserhelpResources/documentation.adoc rename to entity/UserhelpResources_entity/documentation.adoc diff --git a/entity/UserhelpResources/entityfields/documents/children/assignmentrowid_param/valueProcess.js b/entity/UserhelpResources_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js similarity index 100% rename from entity/UserhelpResources/entityfields/documents/children/assignmentrowid_param/valueProcess.js rename to entity/UserhelpResources_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js diff --git a/entity/UserhelpResources/entityfields/documents/children/assignmenttable_param/valueProcess.js b/entity/UserhelpResources_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js similarity index 100% rename from entity/UserhelpResources/entityfields/documents/children/assignmenttable_param/valueProcess.js rename to entity/UserhelpResources_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js diff --git a/entity/WorkflowLauncher_entity/WorkflowLauncher_entity.aod b/entity/WorkflowLauncher_entity/WorkflowLauncher_entity.aod index f1640dc1aacfcbb6ebd9de2ce5afb3d6ca8b92c9..e5749fe5101007e83c45d26c9f24bd15561458b1 100644 --- a/entity/WorkflowLauncher_entity/WorkflowLauncher_entity.aod +++ b/entity/WorkflowLauncher_entity/WorkflowLauncher_entity.aod @@ -88,6 +88,7 @@ <recordContainers> <datalessRecordContainer> <name>dataLess</name> + <alias>Data_alias</alias> </datalessRecordContainer> </recordContainers> </entity> diff --git a/entity/WorkflowTask_entity/afterSave.js b/entity/WorkflowTask_entity/afterSave.js index 68fae8b0d2432769e1c21ae7d594d02fd20cdb87..61b54c53434b45f42ffd7184e88c153966cfac5c 100644 --- a/entity/WorkflowTask_entity/afterSave.js +++ b/entity/WorkflowTask_entity/afterSave.js @@ -30,9 +30,9 @@ if (entityData["FORMRESULT"]) else { var params = { - "TaskTitle_param" : rowData["NAME.value"] + "TaskTitle_param": entityData["NAME"] }; //if you try to open the task now, it will display "Task done" - neon.openContext("WorkflowTask", "WorkflowTaskPreview_view", [rowData["UID.value"]], neon.OPERATINGSTATE_VIEW, params); + neon.openContext("WorkflowTask", "WorkflowTaskPreview_view", [entityData["UID"]], neon.OPERATINGSTATE_VIEW, params); } } \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index b563a3076d29b855c8dfeda7e01fccac5bb6025d..d68c0ad4d7616fed612fdf9039584445f2138e32 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -2795,6 +2795,10 @@ <key>new</key> <value>neu</value> </entry> + <entry> + <key>Start marketing mailing</key> + <value>Marketing Mailing starten</value> + </entry> <entry> <key>Adviser</key> <value>Berater</value> @@ -6568,7 +6572,7 @@ </entry> <entry> <key>Print reminder</key> - <value>Mahnung drucken</value> + <value>Mahnung anzeigen</value> </entry> <entry> <key>Rech.-Betrag</key> @@ -6628,7 +6632,7 @@ </entry> <entry> <key>This error should never appear - contact administrator (PermissionDetail_entity.PermissionAction.onValidation).</key> - <value>Dieser Fehler sollte nie erscheinen - kontaktieren sie einen Administrator (PermissionDetail_entity.PermissionAction.onValidation).</value> + <value>Dieser Fehler sollte nie erscheinen - kontaktieren Sie einen Administrator (PermissionDetail_entity.PermissionAction.onValidation).</value> </entry> <entry> <key>Empty actions are invalid!</key> diff --git a/neonContext/MarketingWorkflowLauncher/MarketingWorkflowLauncher.aod b/neonContext/MarketingWorkflowLauncher/MarketingWorkflowLauncher.aod index bad0c03850983d94a74b3d3af4896308fb1e2086..e200a8a70f878ecb8c691752d3585cf3880e5bef 100644 --- a/neonContext/MarketingWorkflowLauncher/MarketingWorkflowLauncher.aod +++ b/neonContext/MarketingWorkflowLauncher/MarketingWorkflowLauncher.aod @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> <name>MarketingWorkflowLauncher</name> - <title>f</title> + <title>Marketing workflow</title> <majorModelMode>DISTRIBUTED</majorModelMode> <entity>MarketingWorkflowLauncher_entity</entity> <references> diff --git a/neonContext/Userhelp/Userhelp.aod b/neonContext/Userhelp/Userhelp.aod index 435de68c2c1e230ca426a074593bb1004a7ebf6d..057b38dda494f9366cb2e2f617314104f8fd2dd3 100644 --- a/neonContext/Userhelp/Userhelp.aod +++ b/neonContext/Userhelp/Userhelp.aod @@ -3,7 +3,7 @@ <name>Userhelp</name> <majorModelMode>DISTRIBUTED</majorModelMode> <filterView>Userhelp_FilterView</filterView> - <entity>UserhelpResources</entity> + <entity>UserhelpResources_entity</entity> <references> <neonViewReference> <name>2a1dd62b-0f30-442b-aa1d-969b46312d2a</name> diff --git a/process/Calendar_lib/process.js b/process/Calendar_lib/process.js index 0a9a4b99e7c0c1abbe9d41af4f6ca2b2a734cab1..e9f96a4a9089f1ff65bb69dfb21ff41063f90ab8 100644 --- a/process/Calendar_lib/process.js +++ b/process/Calendar_lib/process.js @@ -538,4 +538,113 @@ CalendarUtil.getCalendarSystemType = function(pScope) // Everything is none return calendars.BACKEND_NONE; +} + +CalendarUtil.buildEntriesFromUids = function(appointmentUids) +{ + var entryArray = new Array(appointmentUids.length); + + for(var i = 0; i < appointmentUids.length; i++) + { + var hasPermission = true; + + if(vars.get("$param.ErrorOnPermissionDenied") == "false" || vars.getString("$param.LinkedAppointmentsFromDashlet_param")) + hasPermission = hasUserPermissionForReadingEntry(getEntryOwnerCn(appointmentUids[i])); + + if(hasPermission) + entryArray[i] = CalendarUtil.buildEntry(calendars.getEntry(appointmentUids[i], null, null), null); + } + + //filter out all null + var filteredEntryArray = entryArray.filter(function (el) { + return el != null; + }); + + return filteredEntryArray; +} + + +CalendarUtil.countEntriesFromUids = function(appointmentUids) +{ + return CalendarUtil.buildEntriesFromUids(appointmentUids).length; +} + +CalendarUtil.buildEntry = function (pEntry, pMasterentry) +{ + var uid = pEntry[calendars.ID]; + var summary = pEntry[calendars.SUMMARY]; + var attendees = pEntry[calendars.AFFECTEDUSERS]; + var startdate = pEntry[calendars.DTSTART]; + var enddate = pEntry[calendars.DTEND]; + var links = pEntry[calendars.LINKS]; + var description = pEntry[calendars.DESCRIPTION]; + if(pEntry[calendars.ORGANIZER2] != undefined) + var organizer = pEntry[calendars.ORGANIZER2]["paramvalue"]; + if(pEntry[calendars.USER2] != undefined) + var owner = JSON.stringify(pEntry[calendars.USER2]); + var status = pEntry[calendars.STATUS]; + var location = pEntry[calendars.LOCATION]; + var reminder = pEntry[calendars.REMINDER_DURATION]; + var remindercheck = pEntry[calendars.HASREMINDER] + var classification = pEntry[calendars.CLASSIFICATION]; + var transparency = pEntry[calendars.TRANSPARENCY]; + var categories = pEntry[calendars.CATEGORIES]; + var isAllDay = pEntry["X-ADITO-ISALLDAYEVENT"] != null ? pEntry["X-ADITO-ISALLDAYEVENT"] : "FALSE"; + + var masterBegin = pMasterentry != null ? pMasterentry[calendars.DTSTART] : null + var masterEnd = pMasterentry != null ? pMasterentry[calendars.DTEND] : null + + // Recurrence + var recurrenceID = pEntry[calendars.RECURRENCEID]; + var rrule = null; + if (pMasterentry != null) { // Entry is a recurrence exception, therefore get rrule from master + rrule = pMasterentry[calendars.RRULE] != null ? pMasterentry[calendars.RRULE][0] : null; + } else { + rrule = pEntry[calendars.RRULE] != null ? pEntry[calendars.RRULE][0] : null; + } + + return [ + uid, + attendees.length, + startdate, + enddate, + summary, + organizer, + owner, + attendees, + status, + description, + location, + '', + isAllDay, + classification, + transparency, + categories, + reminder, + remindercheck, + rrule, + recurrenceID, + null, + masterBegin, + masterEnd, + null + ]; +} + + +function hasUserPermissionForReadingEntry(calUserCn) +{ + return calendars.hasPermission(calUserCn, calendars.VEVENT, "READ"); +} + +function getEntryOwnerCn(appointmentUid) +{ + + var owner = newSelect("ASYS_CALENDARBACKEND.OWNER", "_____SYSTEMALIAS") + .from("ASYS_CALENDARBACKEND") + .whereIfSet("ASYS_CALENDARBACKEND.ELEMENTUID", appointmentUid) + .cell(true); + + var ownerArr = text.decodeMS(owner); + return ownerArr[1].split(":")[1]; } \ No newline at end of file diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index 1d8216d36f52ffbed7094c0d7affc3edaf472ad3..4d53dde63a7f80b5e864330f7aec39f0d3f405ee 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -661,7 +661,7 @@ function ContactTitleRenderer(pContact, pOptions) var maskingUtil = new SqlMaskingUtils(); var res = maskingUtil.concat([this.contact.salutation, this.contact.title, this.contact.firstname, this.contact.middlename, this.contact.lastname].filter(function (e){ return e != ""; - }), " "); + }), " ", false); //binary AND check for possibility to check serveral options if (this._options & ContactTitleRenderer.OPTIONS.IncludeOrganisation && this.contact.organisationName) res = maskingUtil.concat([res, this.contact.organisationName], " | "); diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index f0e62195ad82855ae9e18712786350ba500d1772..a9b9eac3121960b68e3d6a4cf4d740fa3aa21457 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -494,6 +494,10 @@ ContextSelector.prototype.setGroupBy = function(pValue) ContextUtils.getSelectMap = function() { var maskingUtils = new SqlMaskingUtils(); + var isOracle = maskingUtils.dbType == db.DBTYPE_ORACLE10_CLUSTER + || maskingUtils.dbType == db.DBTYPE_ORACLE10_OCI + || maskingUtils.dbType == db.DBTYPE_ORACLE10_THIN; + return { "Organisation": ContextSelector.create("ORGANISATION", "CONTACT.CONTACTID", "ORGANISATION.NAME") .setJoinExpression("join CONTACT on ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null") @@ -536,31 +540,31 @@ ContextUtils.getSelectMap = function() .setStateField("STATUS") .setActiveStates([$KeywordRegistry.salesprojectState$open(), $KeywordRegistry.salesprojectState$postponed()]) ,"Contract": ContextSelector.create("CONTRACT", "CONTRACTID") - .setTitleExpression(maskingUtils.concat([ + .setTitleExpression(maskingUtils.cast(maskingUtils.concat([ KeywordUtils.getResolvedTitleSqlPart("ContractType", "CONTRACTTYPE"), maskingUtils.cast("CONTRACTCODE", SQLTYPES.VARCHAR, 10) - ], " ")) + ], " "), isOracle ? SQLTYPES.NVARCHAR : SQLTYPES.VARCHAR, 50)) .setContactIdField("CONTACT_ID") .setCreationDateField("CONTRACTSTART") .setStateField("CONTRACTSTATUS") .setActiveStates([$KeywordRegistry.contractState$validLimited(), $KeywordRegistry.contractState$validUnlimited(), $KeywordRegistry.contractState$notSigned()]) ,"Offer": ContextSelector.create("OFFER", "OFFERID") - .setTitleExpression(maskingUtils.concat([ + .setTitleExpression(maskingUtils.cast(maskingUtils.concat([ "'" + translate.text("Offer") + "'", "' '", maskingUtils.cast("OFFERCODE", SQLTYPES.VARCHAR, 10), "'-'", maskingUtils.cast("VERSNR", SQLTYPES.VARCHAR, 10) - ], "", false)) + ], "", false), isOracle ? SQLTYPES.NVARCHAR : SQLTYPES.VARCHAR, 50)) .setContactIdField("CONTACT_ID") .setCreationDateField("OFFERDATE") .setStateField("STATUS") .setActiveStates([$KeywordRegistry.offerStatus$open(), $KeywordRegistry.offerStatus$checked(), $KeywordRegistry.offerStatus$sent()]) ,"Order": ContextSelector.create("SALESORDER", "SALESORDERID") - .setTitleExpression(maskingUtils.concat([ + .setTitleExpression(maskingUtils.cast(maskingUtils.concat([ KeywordUtils.getResolvedTitleSqlPart("OrderType", "ORDERTYPE"), maskingUtils.cast("SALESORDERCODE", SQLTYPES.VARCHAR, 10) - ], " ")) + ], " "), isOracle ? SQLTYPES.NVARCHAR : SQLTYPES.VARCHAR, 50)) .setContactIdField("CONTACT_ID") .setCreationDateField("SALESORDERDATE") .setStateField("ORDERSTATUS") @@ -607,20 +611,19 @@ ContextUtils.getSelectMap = function() */ ContextUtils.getNameSubselectSql = function(pContextIdDbField, pRowIdDbField) { - // TODO: prepared? - //!SqlBuilder - var select = "(case " + pContextIdDbField + " "; + var select = SqlBuilder.caseStatement() - var selectMap = ContextUtils.getSelectMap () + var selectMap = ContextUtils.getSelectMap(); for (let contextId in selectMap) { - select += "when '" + contextId + "' then (select " + selectMap[contextId].titleExpression + " from " + selectMap[contextId].getFullFromClause() + (pRowIdDbField ? " where " + selectMap[contextId].getFullIdField() + " = " + pRowIdDbField : " ") + ") "; + let titleSelect = newSelect(selectMap[contextId].titleExpression) + .from(selectMap[contextId].getFullFromClause()) + .where(selectMap[contextId].getFullIdField() + " = " + pRowIdDbField); + + select.when(pContextIdDbField, contextId).then(titleSelect); } - select += "else 'Not defined in ContextUtils.getNameSql()!'"; - select += "end)"; - - return select; + return select.toString(); } /** diff --git a/process/FilterViewAction_lib/process.js b/process/FilterViewAction_lib/process.js index b0fa04291d03107498b6eaf03adbe5aa17326186..afd89d4d6d45e7afbd01146356a20eadd053896f 100644 --- a/process/FilterViewAction_lib/process.js +++ b/process/FilterViewAction_lib/process.js @@ -40,7 +40,7 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter) { return new SqlBuilder() .selectDistinct("CONTACT.CONTACTID") - .from("PERSON") + .from("ORGANISATION") .join("CONTACT", newWhere("ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID").and("CONTACT.PERSON_ID is null")) .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") .leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = CONTACT.CONTACTID") @@ -52,7 +52,10 @@ FilterViewActionUtils.getUidsByEntityFilter = function (pContext, pFilter) var loadRowsConfig = entities.createConfigForLoadingRows() .entity(ContextUtils.getEntity(pContext)) .fields(["#UID"]) - .filter(JSON.stringify(pFilter.filter || pFilter)); + if (pFilter.filter) + loadRowsConfig.filter(JSON.stringify(pFilter.filter)); + else if (pFilter) + loadRowsConfig.filter(JSON.stringify(pFilter)); return entities.getRows(loadRowsConfig).map(function (row) { diff --git a/process/Keyword_lib/process.js b/process/Keyword_lib/process.js index ea1736e5c13412a67527ebff0a4ab5d4bdae0293..994fd55c07d07fda603f24db728838663dd844f2 100644 --- a/process/Keyword_lib/process.js +++ b/process/Keyword_lib/process.js @@ -107,6 +107,7 @@ KeywordUtils.getContainerNames = function() //do not cache this list since // a) the list can easly change when a new container is created // b) where this is called it's not relevant in terms of performance + //!SqlBuilder var list = db.array(db.COLUMN, "select distinct AB_KEYWORD_ENTRY.CONTAINER from AB_KEYWORD_ENTRY order by AB_KEYWORD_ENTRY.CONTAINER asc"); return list; }; diff --git a/process/Order_lib/process.js b/process/Order_lib/process.js index d6938458c59687ef679f1d437661ec456e01f2e8..bcb1b8428693ab99e51713ecb61a1b44fc6a4857 100644 --- a/process/Order_lib/process.js +++ b/process/Order_lib/process.js @@ -545,7 +545,8 @@ OrderUtils.buildReminderReport = function (pOrderID) "Ordernumber": translate.text("Order number",language), "Orderdate": translate.text("Order date",language), "Orderamount": translate.text("Order amount",language), - "Dunninglevel": translate.text("Dunning level",language) + "Dunninglevel": translate.text("Dunning level",language), + "OutstandingAmount": translate.text("Outstanding Amount",language) }; diff --git a/process/SendEmail_workflowService/process.js b/process/SendEmail_workflowService/process.js index 6ccbfe3e76006ca51544b503453320d416d35951..14247ad4e4b3dda3ab4be65989fa896e1434a894 100644 --- a/process/SendEmail_workflowService/process.js +++ b/process/SendEmail_workflowService/process.js @@ -10,19 +10,24 @@ import("Workflow_lib"); var processInstanceId = vars.get("$local.uid"); var variables = JSON.parse(vars.get("$local.value")); -var recipientContactId = variables.recipientContactId; +var recipientContactId = variables.recipientContactId || variables.targetId; var documentTemplateId = variables.documentTemplateId; var senderName = variables.senderName; var mailSubject = variables.mailSubject; +var aditoUrl = variables.originUrl; var actionParams = Utils.clone(variables); actionParams.processInstanceId = processInstanceId; -var linkPlaceholder = new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function () +var additionalPlaceholders = []; +if (aditoUrl) { - return WorkflowLinkActions.getActionLink("https://localhost:8443", actionParams.linkActionType, actionParams.redirectLink, actionParams); -}); + additionalPlaceholders.push(linkPlaceholder = new Placeholder("workflowActionLink", Placeholder.types.CALLBACKFUNCTION, function () + { + return WorkflowLinkActions.getActionLink(aditoUrl, actionParams.linkActionType, actionParams.redirectLink, actionParams); + })); +} -var email = Email.fromTemplate(documentTemplateId, recipientContactId, null, [linkPlaceholder]); +var email = Email.fromTemplate(documentTemplateId, recipientContactId, null, additionalPlaceholders); email.subject = mailSubject; email.toRecipients = [CommUtil.getStandardMail(recipientContactId)]; diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 49bcb6bfc966352c346f399240c584b3f1ef2325..75c6923e24957c4f574efec077d73d60d9a52680 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -801,8 +801,6 @@ function SqlBuilder (pAlias) this._where = {}; this._initWhere(); - - SqlBuilder.defineCanBuildSql(this); } /** @@ -823,6 +821,8 @@ SqlBuilder.checkCanBuildSql = function (pObject) return pObject[SqlBuilder.getCanBuildSqlSymbol()]; } +SqlBuilder.defineCanBuildSql(SqlBuilder.prototype); + /** * Deep copies the SqlBuilder object and returns a new one.<br/> * Use this if you want to add for example add additional parameters without modifying the current builder. @@ -830,25 +830,7 @@ SqlBuilder.checkCanBuildSql = function (pObject) */ SqlBuilder.prototype.copy = function() { - var newBuilder = _deepCopyByJson(this, new SqlBuilder()); - return newBuilder; - - // NOTE: this works only with simple data types. - // Here we only use strings, arrays, booleans and null, so this should work - function _deepCopyByJson(pObject, pNewObject) - { - // deep copy by using json - var deepCopied = JSON.parse(JSON.stringify(pObject)); - - // set the props of the new object to the deepCopied ones. - // without this all functions would be lost - for (let prop in deepCopied) - { - pNewObject[prop] = deepCopied[prop] - } - - return pNewObject; - } + return Utils.clone(this); } // errors which are thrown by the SqlBuilder @@ -3100,6 +3082,14 @@ SqlBuilder.caseWhen = function (pFieldOrCond, pValue, pCondition, pFieldType) return new SqlBuilder._CaseStatement().when(pFieldOrCond, pValue, pCondition, pFieldType); } +/** + * @return {SqlBuilder._CaseStatement} + */ +SqlBuilder.caseStatement = function () +{ + return new SqlBuilder._CaseStatement(); +} + /** * Represents a case-when statement */ @@ -3109,9 +3099,10 @@ SqlBuilder._CaseStatement = function () this._whenThens = []; this._elseValue = null; this._afterWhenMask = new SqlBuilder._CaseWhen(this); - SqlBuilder.defineCanBuildSql(this); } +SqlBuilder.defineCanBuildSql(SqlBuilder._CaseStatement.prototype); + /** * @param {String|String[]|SqlBuilder|PreparedSqlArray} [pFieldOrCond] If this is the only parameter, it is used as Subselect <br/> * else it is used as Field. <br/> @@ -3373,6 +3364,8 @@ SqlMaskingUtils.prototype.cast = function (pField, pTargetDatatype, pTargetLengt return "char"; case SQLTYPES.VARCHAR: return "char"; + case SQLTYPES.NVARCHAR: + return "nvarchar"; case SQLTYPES.INTEGER: return "int"; case SQLTYPES.DECIMAL: @@ -3388,6 +3381,7 @@ SqlMaskingUtils.prototype.cast = function (pField, pTargetDatatype, pTargetLengt case db.DBTYPE_DERBY10: switch(pTargetDatatype) { + case SQLTYPES.NVARCHAR: case SQLTYPES.VARCHAR: // Because of a Derby bug, you can't cast INTEGER into VARCHAR // Therefor first cast to char then to varchar @@ -3412,6 +3406,7 @@ SqlMaskingUtils.prototype.cast = function (pField, pTargetDatatype, pTargetLengt case db.DBTYPE_MYSQL4: switch(pTargetDatatype) { + case SQLTYPES.NVARCHAR: case SQLTYPES.VARCHAR: case SQLTYPES.CHAR: case SQLTYPES.INTEGER: @@ -3429,6 +3424,9 @@ SqlMaskingUtils.prototype.cast = function (pField, pTargetDatatype, pTargetLengt case SQLTYPES.VARCHAR: sqlDataType = "varchar2"; break; + case SQLTYPES.NVARCHAR: + sqlDataType = "nvarchar2"; + break; case SQLTYPES.INTEGER: sqlDataType = "number"; pTargetLength = "10" @@ -3448,18 +3446,23 @@ SqlMaskingUtils.prototype.cast = function (pField, pTargetDatatype, pTargetLengt case SQLTYPES.INTEGER: case SQLTYPES.CHAR: case SQLTYPES.VARCHAR: + case SQLTYPES.NVARCHAR: sqlDataType = _mapDefaults(pTargetDatatype); break; } break; case db.DBTYPE_SQLSERVER2000: - case SQLTYPES.DATE: - case SQLTYPES.DECIMAL: - case SQLTYPES.INTEGER: - case SQLTYPES.CHAR: - case SQLTYPES.VARCHAR: - sqlDataType = _mapDefaults(pTargetDatatype); - break; + switch(pTargetDatatype) + { + case SQLTYPES.DATE: + case SQLTYPES.DECIMAL: + case SQLTYPES.INTEGER: + case SQLTYPES.CHAR: + case SQLTYPES.VARCHAR: + case SQLTYPES.NVARCHAR: + sqlDataType = _mapDefaults(pTargetDatatype); + break; + } //TODO: firebird support? } @@ -3589,7 +3592,7 @@ SqlMaskingUtils.prototype.concat = function (pFields, pSeparator, pAutoTrimField if (pSeparator === null || pSeparator === undefined) pSeparator = "' '"; - else if (pSeparator) + else if (pSeparator || pSeparator === "") pSeparator = "'" + db.quote(pSeparator, this.alias) + "'"; var doEmptyStringCheck = true; @@ -4152,7 +4155,7 @@ SqlUtils.getResolvingCaseWhen = function(pKeyValueArray, pDbFieldName, pLocale) else return translate.text(value); }; - + //!SqlBuilder var resSql = "case ", preparedValues = []; var colTypeKeyId = SQLTYPES.CHAR; var colTypeTitle = SQLTYPES.NVARCHAR; diff --git a/process/Turnover_lib/process.js b/process/Turnover_lib/process.js index e8f96a61314fcd72884ff65e5f86641d78adbc19..1e69ad37d5f05c94e3779b5fe5c6edb3fe81cbc5 100644 --- a/process/Turnover_lib/process.js +++ b/process/Turnover_lib/process.js @@ -26,24 +26,45 @@ function TurnoverUtil() {} */ TurnoverUtil.getTurnoverData = function (pMaxYear, pYearCount, pSalesprojectId) { - var turnoverCategory = translate.text('Turnover'); - + var turnoverCategory = translate.text("Turnover"); var minYear = pMaxYear - pYearCount + 1; + var sqlMask = new SqlMaskingUtils(); // load data - return newSelect("'" + turnoverCategory + "', year(SALESORDERDATE) yearNum, month(SALESORDERDATE) monthNum, SALESORDERITEM.DISCOUNT discount, SALESORDERITEM.VAT vat, SALESORDERITEM.PRICE price, sum(SALESORDERITEM.QUANTITY) quantity, SALESORDERITEM.GROUPCODEID prodGroup, (" + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.productGroupcode(), "SALESORDERITEM.GROUPCODEID") + ") prodGroupName") - .from("SALESORDER") - .join("SALESORDERITEM", "SALESORDERITEM.SALESORDER_ID = SALESORDER.SALESORDERID") - .where("SALESORDER.ORDERTYPE", "ORDTYPEINVO") - .and("SALESORDER.ORDERSTATUS = 1") - .and("SALESORDER.CANCELLATION <> 1") - .and("SALESORDERITEM.OPTIONAL <> 1") - .and("SALESORDER.SALESORDERDATE", pMaxYear, "year(#) <= ?", SQLTYPES.INTEGER) - .and("SALESORDER.SALESORDERDATE", minYear, "year(#) >= ?", SQLTYPES.INTEGER) - .andIfSet("SALESORDER.SALESPROJECT_ID", pSalesprojectId) - .groupBy("year(SALESORDERDATE), month(SALESORDERDATE), SALESORDERITEM.GROUPCODEID, SALESORDERITEM.DISCOUNT, SALESORDERITEM.VAT, SALESORDERITEM.PRICE") - .orderBy("yearNum, monthNum") - .table(); + + return newSelect([ + "'" + turnoverCategory + "'", + sqlMask.yearFromDate("SALESORDERDATE"), + sqlMask.monthFromDate("SALESORDERDATE"), + "SALESORDERITEM.DISCOUNT", + "SALESORDERITEM.VAT", + "SALESORDERITEM.PRICE", + "sum(SALESORDERITEM.QUANTITY)", + "SALESORDERITEM.GROUPCODEID", + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.productGroupcode(), "SALESORDERITEM.GROUPCODEID") + ]) + .from("SALESORDER") + .join("SALESORDERITEM", "SALESORDERITEM.SALESORDER_ID = SALESORDER.SALESORDERID") + .where("SALESORDER.ORDERTYPE", "ORDTYPEINVO") + .and("SALESORDER.ORDERSTATUS", "1") + .and("SALESORDER.CANCELLATION", "1", SqlBuilder.NOT_EQUAL()) + .and("SALESORDERITEM.OPTIONAL", "1", SqlBuilder.NOT_EQUAL()) + .and("SALESORDER.SALESORDERDATE", pMaxYear, sqlMask.yearFromDate("#") + " <= ?", SQLTYPES.INTEGER) + .and("SALESORDER.SALESORDERDATE", minYear, sqlMask.yearFromDate("#") + " >= ?", SQLTYPES.INTEGER) + .andIfSet("SALESORDER.SALESPROJECT_ID", pSalesprojectId) + .groupBy([ + sqlMask.yearFromDate("SALESORDERDATE"), + sqlMask.monthFromDate("SALESORDERDATE"), + "SALESORDERITEM.GROUPCODEID", + "SALESORDERITEM.DISCOUNT", + "SALESORDERITEM.VAT", + "SALESORDERITEM.PRICE" + ]) + .orderBy([ + sqlMask.yearFromDate("SALESORDERDATE"), + sqlMask.monthFromDate("SALESORDERDATE") + ]) + .table(); } /** diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index 97545be1730d3020123b1ed5e55dceed59095b83..778e4ae46cb0b4b5a7c5e2887baef1e71b2884a2 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -53,7 +53,7 @@ Utils.isNullOrEmpty = function (pObject) } /** - * Creates a deep copy of the given object. Also works with arrays. + * Creates a deep copy of the given object. Also works with arrays, maps and sets. * * @param {Object} pObject the object to create a copy of * @return {Object} the cloned object @@ -69,7 +69,7 @@ Utils.isNullOrEmpty = function (pObject) * * logging.log(original.name != copy.name); //true * logging.log(copy instanceof MyObject()); //true, prototypes are set correctly - * logging.log(copy.obj1 === copy.obj2); //true, relative object references are kept + * logging.log(copy.obj1 === copy.obj2); //true, relative object references are preserved */ Utils.clone = function (pObject) { @@ -84,20 +84,47 @@ Utils.clone = function (pObject) if (referenceMap.has(pObject)) return referenceMap.get(pObject); - var clonedObject = Array.isArray(pObject) - ? [] - : Object.create(Object.getPrototypeOf(pObject)); //set the prototype of the given object + var clonedObject; + if (Array.isArray(pObject)) + clonedObject = []; + else if (pObject instanceof Map) + clonedObject = new Map(); + else if (pObject instanceof Set) + clonedObject = new Set(); + else + clonedObject = Object.create(Object.getPrototypeOf(pObject)); //set the prototype of the given object /* keeps track of all encountered objects and maps the original to the copy, this makes it possible to: - have the same relative references in the copy as in the original - copy cyclic references without error */ referenceMap.set(pObject, clonedObject); - for (let key in pObject) + if (pObject instanceof Map) + { + pObject.forEach(function (value, key) + { + clonedObject.set(_clone(key), _clone(value)); + }); + } + else if (pObject instanceof Set) { - var value = pObject[key]; - clonedObject[key] = _clone(value); //Recursively (deep) copy for nested objects, including arrays + pObject.forEach(function (value) + { + clonedObject.add(_clone(value)); + }); } + else + { + for (let key in pObject) + { + clonedObject[key] = _clone(pObject[key]); //Recursively (deep) copy for nested objects, including arrays + } + } + + Object.getOwnPropertySymbols(pObject).forEach(function (sym) + { + clonedObject[sym] = _clone(pObject[sym]); + }); return clonedObject; } diff --git a/report/Reminder_report/reportData.jrxml b/report/Reminder_report/reportData.jrxml index ca529152a3fbd0034322ba26a655361e685a1ac9..1347b1ef959b34c58be528e8eecfb4bc139ff51a 100644 --- a/report/Reminder_report/reportData.jrxml +++ b/report/Reminder_report/reportData.jrxml @@ -2,7 +2,7 @@ <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Mahnung" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e7a916c8-3f9a-497d-84bb-3909b15271ea"> <property name="ireport.zoom" value="2.1435888100000016"/> <property name="ireport.x" value="0"/> - <property name="ireport.y" value="57"/> + <property name="ireport.y" value="0"/> <parameter name="myAddr" class="java.lang.String"/> <parameter name="Kontenabstimmung" class="java.lang.String"/> <parameter name="Rech.-Nr" class="java.lang.String"/> @@ -22,6 +22,7 @@ <parameter name="Due" class="java.lang.String"/> <parameter name="DUEDATE" class="java.lang.String"/> <parameter name="Dunninglevel" class="java.lang.String"/> + <parameter name="OutstandingAmount" class="java.lang.String"/> <field name="PAYED" class="java.lang.String"/> <field name="RELATION_ID" class="java.lang.String"/> <field name="CURRENCY" class="java.lang.String"/> @@ -59,13 +60,6 @@ </textElement> <textFieldExpression><![CDATA[$P{DueDate}]]></textFieldExpression> </textField> - <textField> - <reportElement x="408" y="0" width="103" height="15" uuid="62a0909f-ef03-4242-969a-8a9532d1aa9a"/> - <textElement textAlignment="Right"> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$P{Outstanding Amount}]]></textFieldExpression> - </textField> <line> <reportElement x="13" y="33" width="527" height="1" uuid="d5108302-191f-4e27-8920-fcd330d335e8"/> </line> @@ -125,6 +119,13 @@ </textElement> <textFieldExpression><![CDATA[$R{Rechnungsbetrag}]]></textFieldExpression> </textField> + <textField> + <reportElement x="430" y="0" width="81" height="15" uuid="8eee46c0-f3c3-4563-b1b1-746aeb7e73c6"/> + <textElement> + <font size="8"/> + </textElement> + <textFieldExpression><![CDATA[$P{OutstandingAmount}]]></textFieldExpression> + </textField> </band> </groupHeader> </group>