diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 6cfced349ddd90fb1a68e6f48fcb5008fa456288..9c5f7d69e6d20cb90389855b9e34f86ec274deca 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -35,13 +35,13 @@ <kind v="10077" /> </entityNode> <entityNode> - <name>QuickEntry</name> + <name>Task</name> <kind v="10077" /> - <title></title> </entityNode> <entityNode> - <name>Task</name> + <name>QuickEntry</name> <kind v="10077" /> + <title></title> </entityNode> </childNodes> </entityNode> diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index 8d6f9bcd16eda817959bcbcf6be1664dab271751..f3d45f150a4fa598d8544a12cde5733edb05fcde 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -558,6 +558,11 @@ <stateProcess>%aditoprj%/entity/Activity_entity/entityfields/bindata/stateProcess.js</stateProcess> <onValueChange>%aditoprj%/entity/Activity_entity/entityfields/bindata/onValueChange.js</onValueChange> </entityField> + <entityParameter> + <name>InsertLinks_param</name> + <expose v="true" /> + <description>Links that will be inserted, required in QuickEntry</description> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Activity_entity/recordcontainers/db/onDBInsert.js b/entity/Activity_entity/recordcontainers/db/onDBInsert.js index 054415bffa780180ce2bd4ed4b91b377a56431b4..abe4a1bcfa74b5a1c23022f980a78b68cb22b29d 100644 --- a/entity/Activity_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Activity_entity/recordcontainers/db/onDBInsert.js @@ -20,3 +20,14 @@ else } if (documents) ActivityUtils.insertDocuments(vars.get("$local.uid"), documents); + +if (vars.exists("$param.InsertLinks_param") && vars.get("$param.InsertLinks_param")) +{ + var activityId = vars.get("$local.uid"); + var insertLinks = vars.get("$param.InsertLinks_param"); + insertLinks = JSON.parse(insertLinks); + insertLinks.forEach(function ([objectType, rowId]) + { + ActivityUtils.insertLink(activityId, objectType, rowId); + }); +} \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/conditionProcess.js b/entity/Person_entity/recordcontainers/db/conditionProcess.js index e96a8aa3f5d7ac33d1daca18c60197e6b683c413..15b9975dc380f240b7055c7e39a0af796217e0f1 100644 --- a/entity/Person_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Person_entity/recordcontainers/db/conditionProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.vars"); import("system.db"); import("system.result"); @@ -13,6 +12,6 @@ if (vars.exists("$param.ExcludedContactIds_param") && vars.get("$param.ExcludedC var excludedContacts = JSON.parse(vars.getString("$param.ExcludedContactIds_param")); cond.andIn("CONTACT.CONTACTID", excludedContacts, undefined, true); } -logging.log(cond.translate("1=1")) + //TODO: use a preparedCondition (.build instead of .translate) when available #1030812 #1034026 result.string(cond.translate("1 = 1")); \ No newline at end of file diff --git a/entity/QuickEntry_entity/QuickEntry_entity.aod b/entity/QuickEntry_entity/QuickEntry_entity.aod index 5312724d1bc72ccc696195f1c7191103382481a0..877e8dd3ce71b2b13aff2acf106d7b028ff2a576 100644 --- a/entity/QuickEntry_entity/QuickEntry_entity.aod +++ b/entity/QuickEntry_entity/QuickEntry_entity.aod @@ -107,16 +107,20 @@ </dependency> <children> <entityParameter> - <name>ObjectId_param</name> - <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js</valueProcess> + <name>Direction_param</name> + <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/direction_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>InsertLinks_param</name> + <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/insertlinks_param/valueProcess.js</valueProcess> </entityParameter> <entityParameter> <name>RowId_param</name> <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/rowid_param/valueProcess.js</valueProcess> </entityParameter> <entityParameter> - <name>Direction_param</name> - <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/direction_param/valueProcess.js</valueProcess> + <name>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js</valueProcess> </entityParameter> </children> </entityConsumer> diff --git a/entity/QuickEntry_entity/entityfields/activities/children/insertlinks_param/valueProcess.js b/entity/QuickEntry_entity/entityfields/activities/children/insertlinks_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..532faa2466b8e7364d222f001f7d979fbcbf92e3 --- /dev/null +++ b/entity/QuickEntry_entity/entityfields/activities/children/insertlinks_param/valueProcess.js @@ -0,0 +1,12 @@ +import("system.vars"); +import("system.result"); + +var links = [ + ["Organisation", vars.get("$field.UID")] +]; +//var contactLinks = vars.get("$field.Contacts.insertedRows").map(function (row) +//{ +// return ["Person", row["#UID"]]; +//}); + +result.string(JSON.stringify(links.concat(contactLinks))); \ No newline at end of file diff --git a/neonContext/QuickEntry/QuickEntry.aod b/neonContext/QuickEntry/QuickEntry.aod index a32708818731d9915ce40bc2534365ecd2da2ee5..32f04704913d0dd85a7a7d7ae0a7a9bc688a4ffa 100644 --- a/neonContext/QuickEntry/QuickEntry.aod +++ b/neonContext/QuickEntry/QuickEntry.aod @@ -3,7 +3,6 @@ <name>QuickEntry</name> <title>Quick entry</title> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterview>QuickEntryFilter_view</filterview> <editview>QuickEntryEdit_view</editview> <entity>QuickEntry_entity</entity> <references> @@ -11,9 +10,5 @@ <name>43a3acbb-82a7-4d86-88f9-0e4265e4898d</name> <view>QuickEntryEdit_view</view> </neonViewReference> - <neonViewReference> - <name>157df225-0a5b-4a54-99bf-29a8c169b8ce</name> - <view>QuickEntryFilter_view</view> - </neonViewReference> </references> </neonContext> diff --git a/neonView/QuickEntryFilter_view/QuickEntryFilter_view.aod b/neonView/QuickEntryFilter_view/QuickEntryFilter_view.aod deleted file mode 100644 index 96008011a34781ac90fd6312f7b7d287cb64e46d..0000000000000000000000000000000000000000 --- a/neonView/QuickEntryFilter_view/QuickEntryFilter_view.aod +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> - <name>QuickEntryFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Table</name> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>6732391d-7299-4e26-bde0-6be3c5a30916</name> - <entityField>UID</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index ff4762bb200271bdcbd865728ef577dfbd810394..1f427eaa2de6c226344ea2dd81108bb4e174e805 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -202,6 +202,30 @@ ActivityUtils.hasActivities = function (pRowId, pObjectType) return true; } +/** + * creates links for an activity + */ +ActivityUtils.insertLink = function (pActivityId, pObjectType, pRowId) +{ + var linkCols = [ + "ACTIVITYLINKID", + "ACTIVITY_ID", + "OBJECT_ROWID", + "OBJECT_TYPE", + "USER_NEW", + "DATE_NEW" + ]; + var linkVals = [ + util.getNewUUID(), + pActivityId, + pRowId, + pObjectType, + vars.get("$sys.user"), + vars.get("$sys.date") + ]; + db.insertData("ACTIVITYLINK", linkCols, null, linkVals); +} + /** * Methods used by for tasks. * Do not create an instance of this!