diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index fdb6fb795564c093ceb8b381a8792986cb822700..d94015b2c511c97d6615b82a80d53ffb28ca3df0 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -531,6 +531,12 @@ </entityParameter> </children> </entityConsumer> + <entityField> + <name>ENTRYYEAR</name> + <title>Entrydate (Year)</title> + <groupable v="true" /> + <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/entryyear/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Activity_entity/entityfields/entryyear/valueProcess.js b/entity/Activity_entity/entityfields/entryyear/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d0a0b4c3271e345217e289de3c0514efe3a6889a --- /dev/null +++ b/entity/Activity_entity/entityfields/entryyear/valueProcess.js @@ -0,0 +1,6 @@ +import("system.datetime"); +import("system.result"); +import("system.vars"); + +var entryDate = vars.get("$field.ENTRYDATE"); +result.string(datetime.toDate(entryDate, "yyyy")); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index 62f9bbabc73bf2f542a760fe0eda65c59019d8a3..c215f745c25cf6bf3daee3d3990e3a51539adfee 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -212,6 +212,16 @@ </entityParameter> </children> </entityConsumer> + <entityField> + <name>STANDARD_EMAIL_COMMUNICATION</name> + <title>E-Mail</title> + <state>READONLY</state> + </entityField> + <entityField> + <name>STANDARD_PHONE_COMMUNICATION</name> + <title>Phone</title> + <state>READONLY</state> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -269,6 +279,14 @@ <name>ADVERTISINGBAN.value</name> <expression>%aditoprj%/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/advertisingban.value/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STANDARD_PHONE_COMMUNICATION.displayValue</name> + <expression>%aditoprj%/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_phone_communication.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STANDARD_EMAIL_COMMUNICATION.displayValue</name> + <expression>%aditoprj%/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_email_communication.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_email_communication.displayvalue/expression.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_email_communication.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..28967142d41b09fd97aa7991b40e836c1248ec95 --- /dev/null +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_email_communication.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("Sql_lib"); +import("system.result"); +import("Communication_lib"); + +var res = CommUtil.getStandardSubSqlMail(SqlCondition.begin().and("COMMUNICATION.CONTACT_ID = CAMPAIGNPARTICIPANT.CONTACT_ID")); +result.string(res); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_phone_communication.displayvalue/expression.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_phone_communication.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..1b654090c3c0fffd96c2eb836be6cbb10cdb4661 --- /dev/null +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/recordfieldmappings/standard_phone_communication.displayvalue/expression.js @@ -0,0 +1,5 @@ +import("system.result"); +import("Communication_lib"); + +var res = CommUtil.getStandardSubSqlPhone(SqlCondition.begin().and("COMMUNICATION.CONTACT_ID = CAMPAIGNPARTICIPANT.CONTACT_ID")); +result.string(res); \ No newline at end of file diff --git a/entity/PermissionDetail_entity/contentTitleProcess.js b/entity/PermissionDetail_entity/contentTitleProcess.js index 7e35ace3e3ce47d5f46b1b494dff2c1ad9887f09..937f96a1d91d81edeced428071f1acce83dcc344 100644 --- a/entity/PermissionDetail_entity/contentTitleProcess.js +++ b/entity/PermissionDetail_entity/contentTitleProcess.js @@ -27,10 +27,12 @@ switch (vars.get("$field.ACCESSTYPE")) { break; } -if (vars.get("$field.CONDITION") != noCond && vars.get("$field.CONDITION") != "") { - res += " - conditional"; -} else { - res += " - default"; +if (vars.get("$field.ACCESSTYPE") != "E") { + if (vars.get("$field.CONDITION") != noCond && vars.get("$field.CONDITION") != "") { + res += " - conditional"; + } else { + res += " - default"; + } } result.string(res); \ No newline at end of file diff --git a/entity/PermissionDetail_entity/entityfields/permissionactions/onValidation.js b/entity/PermissionDetail_entity/entityfields/permissionactions/onValidation.js index 9822dae140770b8d12ccf03a616e765b431026ca..94a26646c0e8b70614c4433d98e617464b23e857 100644 --- a/entity/PermissionDetail_entity/entityfields/permissionactions/onValidation.js +++ b/entity/PermissionDetail_entity/entityfields/permissionactions/onValidation.js @@ -1,3 +1,4 @@ +import("system.logging"); import("Sql_lib"); import("system.db"); import("system.vars"); @@ -15,9 +16,10 @@ var fieldTitle = vars.get("$field.FIELD"); var accesstype = vars.get("$field.ACCESSTYPE"); var permCondInput = vars.get("$field.CONDITION"); var permCondType = vars.get("$field.CONDTYPE"); -var permissionId = PermissionUtil.getPermission(roleTitle, entityTitle, fieldTitle, accesstype, permCondInput, permCondType); -var actionsInDb = PermissionUtil.getActions([permissionId]); +var permId = PermissionUtil.getPermission(roleTitle, entityTitle, fieldTitle, accesstype, permCondInput, permCondType); +var actionsInDb = PermissionUtil.getActions([permId]); var actionsAsStringArray = vars.get("$field.ACTION").split(","); // only useful while working with already existing permissions +var noCond = "{\"entity\":\"" + entityTitle + "\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; var deletedRows = vars.get("$field.PermissionActions.deletedRows"); var changedRows = vars.get("$field.PermissionActions.changedRows"); @@ -27,12 +29,13 @@ if (deletedRows.length == actionsAsStringArray.length && changedRows.length == 0 result.string(translate.text("Permissions without actions are not allowed!")); } -if (PermissionUtil.permissionExists(permissionId)) { +if (PermissionUtil.permissionExists(permId)) { // old permission // insert only possible, if the same action is not already linked to the permission + logging.log("test"); for each (let row in insertedRows) { var actionGotJustDelted = false; - if (PermissionUtil.actionExists(row.ACTION, permissionId)) { + if (PermissionUtil.actionExists(row.ACTION, permId)) { for each (let delRow in deletedRows) { if (row.ACTION == delRow.ACTION) { actionGotJustDelted = true; @@ -45,13 +48,25 @@ if (PermissionUtil.permissionExists(permissionId)) { } for each (let row in changedRows) { - if (PermissionUtil.actionExists(row.ACTION, permissionId) && actionsAsStringArray.indexOf(row.ACTION) == -1) { + if (PermissionUtil.actionExists(row.ACTION, permId) && actionsAsStringArray.indexOf(row.ACTION) == -1) { result.string(translate.text("Action '" + row.ACTION + "' already linked to this permission.")); } } } else { // new permission - if (insertedRows.length > 1) { + if (insertedRows.length > 0) { + var defaultPerm = PermissionUtil.getPermission(roleTitle, entityTitle, fieldTitle, accesstype, noCond); + if (PermissionUtil.permissionExists(defaultPerm)) { + var defaultActions = PermissionUtil.getActions([defaultPerm]); + for each (let entry in insertedRows) { + for each (let action in defaultActions) { + if (entry.ACTION == PermissionUtil.resolveActionId(action)) { + result.string(translate.text("Action '" + entry.ACTION + "' is already linked to a permission with this role-entity-field-combination")); + } + } + } + } + for (let i = 0; i < insertedRows.length-1; i++) { for (let j = i + 1; j < insertedRows.length; j++) { if (insertedRows[i].ACTION == insertedRows[j].ACTION) { diff --git a/entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js b/entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js index 7caa94138a350ba29d74d1d8fedb0fb1e47d36e6..b0aa5ab5592d45f36b45bdab7dbe30b66b166293 100644 --- a/entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/PermissionDetail_entity/recordcontainers/jdito/contentProcess.js @@ -106,7 +106,7 @@ if (selectedPermission == null) { } } -result.object(res.sort(sortResultsAfterAccessTypes)); +result.object(res.sort(sortResultsAfterCondition).sort(sortResultsAfterAccessTypes)); function prepareResultArray(pEntry, pRes) { var rootPermission = ""; @@ -183,4 +183,16 @@ function sortResultsAfterAccessTypes(a, b) { return 1; else return 0; +} + +// sorts result array: default permission -> conditional permission +function sortResultsAfterCondition(a, b) { + var noCond = "{\"entity\":\"" + vars.get("$field.ENTITY") + "\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; + if (a[4] == "" || a[4] == noCond) { + return -1; + } else if (b[4] == "" || b[4] == noCond) { + return 1; + } else { + return 0; + } } \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 5f7a544ec344f5de8353d2c96732a976ceb25d78..ed7f9ee2c993036881e49f9fc826279f3fa47908 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -62,6 +62,10 @@ <key>Anonymization</key> <value>Anonymisierung</value> </entry> + <entry> + <key>Theme</key> + <value>Thema</value> + </entry> <entry> <key>Turnover change</key> <value>Entwicklung Umsatz</value> @@ -96,6 +100,11 @@ </entry> <entry> <key>Recipient status</key> + <value>Empfängerstatus</value> + </entry> + <entry> + <key>Download template</key> + <value>Vorlage herunterladen</value> </entry> <entry> <key>LOW</key> @@ -1830,7 +1839,7 @@ </entry> <entry> <key>New receipt version</key> - <value>Neue Belegsversion</value> + <value>Neue Quittungsversion</value> </entry> <entry> <key>Orderitems</key> @@ -2124,6 +2133,10 @@ <key>Montserrat</key> <value>Montserrat</value> </entry> + <entry> + <key>Entrydate (Year)</key> + <value>Eingangsdatum (Jahr)</value> + </entry> <entry> <key>Guadeloupe</key> <value>Guadeloupe</value> @@ -4397,7 +4410,7 @@ <key>Required fields</key> </entry> <entry> - <key>Address addition</key> + <key>Address addition</key> <value>Adresszusatz</value> </entry> <entry> @@ -4827,6 +4840,7 @@ </entry> <entry> <key>Test email</key> + <value>E-Mail testen</value> </entry> <entry> <key>Rating</key> @@ -6200,216 +6214,40 @@ <key>2</key> </entry> <entry> - <key>versendet</key> - </entry> - <entry> - <key>Netto</key> - </entry> - <entry> - <key>Währung</key> - </entry> - <entry> - <key>Transfer to Invoice</key> - <value>In Rechnung übertragen</value> - </entry> - <entry> - <key>Pay due date</key> - <value>Zahlungsziel</value> + <key>Action '</key> </entry> <entry> <key>Invoice</key> - <value>Rechnung</value> - </entry> - <entry> - <key>Payment address</key> - <value>Zahlungsadresse</value> </entry> <entry> <key>Receipt Footer Text</key> - <value>Beleg Fußtext</value> - </entry> - <entry> - <key>Texts</key> - <value>Texte</value> - </entry> - <entry> - <key>keine Standard-E-Mail Büro vorhanden !</key> </entry> <entry> <key>Delivery note</key> - <value>Lieferschein</value> </entry> <entry> - <key>Belegdatum</key> - </entry> - <entry> - <key>Firma</key> - </entry> - <entry> - <key>Choose payment address</key> - <value>Zahlungsadresse auswählen</value> - </entry> - <entry> - <key>Paid</key> - <value>Bezahlt</value> - </entry> - <entry> - <key>Dunning level</key> - <value>Mahnstufe</value> + <key>Permission Action</key> </entry> <entry> <key>Order confirmation</key> - <value>Auftragsbestätigung</value> - </entry> - <entry> - <key>Beleg</key> - </entry> - <entry> - <key>Order Type</key> - <value>Belegtyp</value> - </entry> - <entry> - <key>Notice</key> - <value>Notiz</value> - </entry> - <entry> - <key>Bitte einen Adressat in 'to' eintragen!</key> </entry> <entry> <key>Receipt Header Text</key> - <value>Beleg Kopftext</value> - </entry> - <entry> - <key>Dunning text</key> - <value>Mahnungstext</value> </entry> <entry> - <key>Choose delivery address</key> - <value>Lieferadresse auswählen</value> + <key>Filter</key> </entry> <entry> <key>Cancellation</key> - <value>Storno</value> - </entry> - <entry> - <key>Links</key> - </entry> - <entry> - <key>geprüft</key> - </entry> - <entry> - <key>Set dunning</key> - <value>Mahnstufe setzen</value> - </entry> - <entry> - <key>Beleg-Nr.</key> - </entry> - <entry> - <key>Cancel</key> - <value>Stornieren</value> - </entry> - <entry> - <key>Set to sent</key> - <value>Versendet setzen</value> - </entry> - <entry> - <key>Set paid amount</key> - <value>Bezahlten Betrag setzen</value> - </entry> - <entry> - <key>Belegliste</key> </entry> <entry> - <key>Pay date</key> - <value>Zahlungseingang</value> - </entry> - <entry> - <key>Transfer to delivery note</key> - <value>In Lieferschein übertragen</value> - </entry> - <entry> - <key>Dunning date</key> - <value>Mahndatum</value> - </entry> - <entry> - <key>Credit</key> - <value>Gutschrift</value> - </entry> - <entry> - <key>Print order</key> - <value>Beleg drucken</value> - </entry> - <entry> - <key>Adds the selection to a bulk mail</key> - </entry> - <entry> - <key>Order number</key> - <value>Belegsnummer</value> - </entry> - <entry> - <key>Permission Action</key> - </entry> - <entry> - <key>Filter</key> - </entry> - <entry> - <key>Adds the selection to a serial letter</key> + <key>Bulk mail \"%0\" sent</key> </entry> <entry> <key>Actions</key> </entry> <entry> - <key>Reminder</key> - <value>Mahnung</value> - </entry> - <entry> - <key>Print reminder</key> - <value>Mahnung drucken</value> - </entry> - <entry> - <key>Rech.-Betrag</key> - </entry> - <entry> - <key>Order date</key> - <value>Belegsdatum</value> - </entry> - <entry> - <key>Due date</key> - <value>Mahndatum</value> - </entry> - <entry> - <key>Order amount</key> - </entry> - <entry> - <key>Mahnung</key> - </entry> - <entry> - <key>Due</key> - <value>Fällig</value> - </entry> - <entry> - <key>Only </key> - </entry> - <entry> - <key>Theme</key> - </entry> - <entry> - <key>Action '</key> - </entry> - <entry> - <key>No duplicates allowed: action '</key> - </entry> - <entry> - <key>Empty actions are not allowed!</key> - </entry> - <entry> - <key>Download template</key> - </entry> - <entry> - <key>Bulk mail \"%0\" sent</key> - </entry> - <entry> - <key>This error should never appear - contact administrator.</key> + <key>Credit</key> </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> diff --git a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod index 240d2d812b910bde5bb2e70c29991a2bca51e819..f977448e5c7f7ed98beca7801fba57935cf694e5 100644 --- a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod +++ b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod @@ -30,6 +30,14 @@ <name>1649e2e9-e3b3-4a41-960d-39002cb6b2d8</name> <entityField>CAMPAIGNSTEP_ID</entityField> </neonTableColumn> + <neonTableColumn> + <name>20c9aed5-cf30-484b-a68b-c1f6ca0459db</name> + <entityField>STANDARD_EMAIL_COMMUNICATION</entityField> + </neonTableColumn> + <neonTableColumn> + <name>0071a91d-b716-4ee9-a373-9c8eac9626b8</name> + <entityField>STANDARD_PHONE_COMMUNICATION</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/process/Permission_lib/process.js b/process/Permission_lib/process.js index d06b7295339730b1364fe34b7c1bd63a4d21b787..f59aa345d2aab771f0a5e7f3aa17631fbd3471d0 100644 --- a/process/Permission_lib/process.js +++ b/process/Permission_lib/process.js @@ -296,7 +296,7 @@ function PermissionUtil () {} */ PermissionUtil.setIsEmpty = function(pSetId) { var subSets = PermissionUtil.getChildSetsOfSet(pSetId); - var subPerms = PermissionUtil.getPermissions(pSetId); + var subPerms = PermissionUtil.getPermissions([pSetId]); var subActions = PermissionUtil.getActionsOfSet(pSetId); if (subActions.length == 0 && subPerms == 0 && subSets == 0) @@ -305,31 +305,15 @@ function PermissionUtil () {} } /** - * Returns all permissions of the given permission sets. + * Returns all subordinated permissions of the given permission sets. * - * @param {String[]} pSetIds the ids of the permission sets + * @param {String[]} pSetIds ids of the permission sets * * @result {String[]} array with ids of all subordinated permissions. The result can never be null. */ PermissionUtil.getPermissions = function(pSetIds) { return db.table("select ASYS_PERMISSIONID from ASYS_PERMISSION where ASYS_PERMISSION.ASYS_PERMISSIONSET_ID in ('" + pSetIds.join("','") + "')", alias); } - - /** - * Returns all subordinated permissions of a given permission set. - * - * @param {String} pSetId the id of the parent permission set - * - * @result {String[]} array with ids of all subordinated permission. The result can never be null. - */ - PermissionUtil.getPermissions = function (pSetId) - { - return db.array(db.COLUMN, SqlCondition.begin() - .and("ASYS_PERMISSIONSET.ASYS_PERMISSIONSETID = '" + pSetId + "'") - .buildSql("select ASYS_PERMISSION.ASYS_PERMISSIONID from ASYS_PERMISSION" - + " join ASYS_PERMISSIONSET on ASYS_PERMISSIONSET.ASYS_PERMISSIONSETID = ASYS_PERMISSION.ASYS_PERMISSIONSET_ID") - , alias); - } /** * Returns the condition type of the given permissions.