diff --git a/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/create_Ticket_table.xml b/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/create_Ticket_table.xml new file mode 100644 index 0000000000000000000000000000000000000000..cbc82f51cfe32933d09c0002de2c6735891330ee --- /dev/null +++ b/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/create_Ticket_table.xml @@ -0,0 +1,16 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="j.hoermann" id="15176b40-4b5e-48a9-8dfc-4540b01595c8"> + <createTable tableName="TICKET"> + <column name="TICKETID" type="CHAR(36)"> + <constraints primaryKey="true" primaryKeyName="PK_TICKET_TICKETID"/> + </column> + <column name="TASK_ID" type="CHAR(36)"> + <constraints nullable="false" unique="true"/> + </column> + <column name="CODE" type="INTEGER"/> + </createTable> + + <dropColumn tableName="TASK" columnName="CODE"/> + </changeSet> +</databaseChangeLog> diff --git a/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/insert_TaskType_Task.xml b/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/insert_TaskType_Task.xml index c9bafcf9881e8160ce82b09eb7bd238d3dcc380b..82f7e4d65245e3ecd65676bce24f3c7824eb3bad 100644 --- a/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/insert_TaskType_Task.xml +++ b/.liquibase/Data_alias/basic/2019.1.4/Ticketmanagement/insert_TaskType_Task.xml @@ -60,7 +60,7 @@ <insert tableName="AB_KEYWORD_ENTRY"> <column name="AB_KEYWORD_ENTRYID" value="2ef84e0e-988a-44b4-9d14-3461555d2f18"/> <column name="KEYID" value="f3da0edd-49d9-4061-98c1-8fda8631be7e"/> - <column name="TITLE" value="Complaint"/> + <column name="TITLE" value="Ticket"/> <column name="CONTAINER" value="TaskType"/> <column name="SORTING" valueNumeric="1"/> <column name="ISACTIVE" valueNumeric="1"/> diff --git a/.liquibase/Data_alias/basic/2019.1.4/changelog.xml b/.liquibase/Data_alias/basic/2019.1.4/changelog.xml index a6fcf7a25d934938cbf48a5591c6c1b61ae89b4c..6a95ddfc9bdbb1c3f53cf8cd5abb7a4d67eca0fd 100644 --- a/.liquibase/Data_alias/basic/2019.1.4/changelog.xml +++ b/.liquibase/Data_alias/basic/2019.1.4/changelog.xml @@ -194,7 +194,8 @@ <include relativeToChangelogFile="true" file="Ticketmanagement/insertTicketAttributes_TaskType_Task.xml"/> <include relativeToChangelogFile="true" file="Ticketmanagement/insert_TaskType_Task.xml"/> <include relativeToChangelogFile="true" file="Ticketmanagement/update_TaskStatus_add_icon_and_new_status.xml"/> - + <include relativeToChangelogFile="true" file="Ticketmanagement/create_Ticket_table.xml"/> + <include relativeToChangelogFile="true" file="longerProductName_Code.xml"/> <include relativeToChangelogFile="true" file="BulkMail/create_bulkmail.xml"/> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 5974f4083e4ec47f7299f1be52b66d3f716c4359..54e741e4749b66f2ca38659ac1300a9eb164d7fe 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -5095,27 +5095,6 @@ <title>Task Id</title> <description></description> </entityFieldDb> - <entityFieldDb> - <name>CODE</name> - <dbName></dbName> - <primaryKey v="false" /> - <columnType v="4" /> - <size v="10" /> - <scale v="0" /> - <notNull v="false" /> - <isUnique v="false" /> - <index v="true" /> - <documentation></documentation> - <title>task number</title> - <description></description> - <customProperties> - <customBooleanProperty> - <name>log</name> - <global v="false" /> - <property v="true" /> - </customBooleanProperty> - </customProperties> - </entityFieldDb> <entityFieldDb> <name>STATUS</name> <dbName></dbName> @@ -9958,6 +9937,68 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>TICKET</name> + <dbName></dbName> + <idColumn>TICKETID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <documentation></documentation> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>CODE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TICKETID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TASK_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="true" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> </entities> </entityGroup> </aliasDefDb> diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 11bf4ef5b69285c21f0561b1e5798867002a99e1..c974800c2b0c92f3ab65f463eef9c7ee9bdb29b1 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -116,6 +116,30 @@ </entityNode> </childNodes> </entityNode> + <entityNode> + <name>Group</name> + <kind v="123" /> + <title>Support</title> + <childNodes> + <entityNode> + <name>Group6</name> + <kind v="123" /> + <title></title> + <childNodes> + <entityNode> + <name>Ticket</name> + <kind v="10077" /> + <title></title> + </entityNode> + <entityNode> + <name>INTERNAL_ADMINISTRATOR</name> + <kind v="159" /> + <title></title> + </entityNode> + </childNodes> + </entityNode> + </childNodes> + </entityNode> <entityNode> <name>ADMINISTRATION</name> <kind v="123" /> diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index 5ef3a514824139ad2decbba39f3efea99b9d2935..294f3f2322bdc438ea980ef640d7fcf593277c53 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -229,12 +229,6 @@ <fieldName>AttributeConditions</fieldName> <isConsumer v="false" /> </entityDependency> - <entityDependency> - <name>fc4a1e51-6bdb-46dd-9ffc-a45480051d28</name> - <entityName>Task_entity</entityName> - <fieldName>Attributes</fieldName> - <isConsumer v="false" /> - </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Attribute_entity/afterUiInit.js b/entity/Attribute_entity/afterUiInit.js index 9c97441ea2bb023f4b3961ac89c89185e9f9954c..6a175be075c7416b21489b44bdcfbbae03fde52d 100644 --- a/entity/Attribute_entity/afterUiInit.js +++ b/entity/Attribute_entity/afterUiInit.js @@ -1,27 +1,28 @@ -import("system.util"); -import("system.db"); -import("system.neon"); -import("system.vars"); -import("Context_lib"); -import("Attribute_lib"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW - && vars.get("$field.ATTRIBUTE_TYPE").trim() != $AttributeTypes.COMBOVALUE - && vars.exists("$param.AttrParentId_param") && vars.get("$param.AttrParentId_param")) -{ - var parentId = vars.get("$param.AttrParentId_param"); - var attributeId = vars.get("$field.UID"); - - var usageSql = SqlCondition.begin() - .andPrepare("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", parentId) - .buildSql("select OBJECT_TYPE from AB_ATTRIBUTEUSAGE", "1=0"); - var usages = db.array(db.COLUMN, usageSql); - - //preset the usages with the ones from the parent - usages.forEach(function (usage) - { - neon.addRecord("AttributeUsages", { - "OBJECT_TYPE" : usage - }); - }); +import("Sql_lib"); +import("system.util"); +import("system.db"); +import("system.neon"); +import("system.vars"); +import("Context_lib"); +import("Attribute_lib"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW + && vars.get("$field.ATTRIBUTE_TYPE").trim() != $AttributeTypes.COMBOVALUE + && vars.exists("$param.AttrParentId_param") && vars.get("$param.AttrParentId_param")) +{ + var parentId = vars.get("$param.AttrParentId_param"); + var attributeId = vars.get("$field.UID"); + + var usageSql = SqlCondition.begin() + .andPrepare("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", parentId) + .buildSql("select OBJECT_TYPE from AB_ATTRIBUTEUSAGE", "1=0"); + var usages = db.array(db.COLUMN, usageSql); + + //preset the usages with the ones from the parent + usages.forEach(function (usage) + { + neon.addRecord("AttributeUsages", { + "OBJECT_TYPE" : usage + }); + }); } \ No newline at end of file diff --git a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/displayValueProcess.js b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/displayValueProcess.js index c39c4f940d57a66abfcb5fe424361ee10bd55469..fd9bb084f534e9423351506c9ddc2f185cc27162 100644 --- a/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/displayValueProcess.js +++ b/entity/DocumentTemplateLink_entity/entityfields/documenttemplate_id_child/displayValueProcess.js @@ -1,13 +1,14 @@ -import("system.result"); -import("system.db"); -import("system.vars"); -import("Contact_lib"); - -var documenttemplatename = ""; -var documenttemplateId = vars.get("$field.DOCUMENTTEMPLATE_ID_CHILD"); - -documenttemplatename = db.cell(SqlCondition.begin() - .andPrepare("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID", documenttemplateId) - .buildSql("select DOCUMENTTEMPLATE.NAME from DOCUMENTTEMPLATE")); - +import("Sql_lib"); +import("system.result"); +import("system.db"); +import("system.vars"); +import("Contact_lib"); + +var documenttemplatename = ""; +var documenttemplateId = vars.get("$field.DOCUMENTTEMPLATE_ID_CHILD"); + +documenttemplatename = db.cell(SqlCondition.begin() + .andPrepare("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID", documenttemplateId) + .buildSql("select DOCUMENTTEMPLATE.NAME from DOCUMENTTEMPLATE")); + result.string(documenttemplatename); \ No newline at end of file diff --git a/entity/Employee_entity/recordcontainers/jdito/onUpdate.js b/entity/Employee_entity/recordcontainers/jdito/onUpdate.js index 6553a5d7c8c9aaa8cafcbb9a44b3c43a3a011f6c..ac20df00f13b9101bb9c41b3e6eae675f520b315 100644 --- a/entity/Employee_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/Employee_entity/recordcontainers/jdito/onUpdate.js @@ -1,38 +1,39 @@ -import("system.db"); -import("system.vars"); -import("system.tools"); -import("Person_lib"); -import("Entity_lib"); - -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 -FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function (state, value) -{ - var personId = db.cell(SqlCondition.begin() - .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") - .buildSql("select PERSON_ID from CONTACT") - ); - if (state == FieldChanges.STATE_CHANGED()) - PersUtils.setImage(personId, value); - else - PersUtils.removeImage(personId); -}); - -var user = tools.getUserByAttribute(tools.NAME, vars.get("$field.UID")); - -user[tools.TITLE] = vars.get("$field.TITLE"); -user[tools.PARAMS][tools.ISACTIVE] = vars.get("$field.ISACTIVE"); -user[tools.PARAMS][tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); -user[tools.PARAMS][tools.LASTNAME] = vars.get("$field.LASTNAME"); -user[tools.PARAMS][tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); -user[tools.PARAMS][tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); -user[tools.PARAMS][tools.CONTACTID] = vars.get("$field.CONTACT_ID"); -user[tools.PARAMS][tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); -user[tools.PARAMS].department = vars.get("$field.DEPARTMENT"); - -if (vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param") - && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) -{ - user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); -} - +import("Sql_lib"); +import("system.db"); +import("system.vars"); +import("system.tools"); +import("Person_lib"); +import("Entity_lib"); + +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 +FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function (state, value) +{ + var personId = db.cell(SqlCondition.begin() + .andPrepareVars("CONTACT.CONTACTID", "$field.CONTACT_ID") + .buildSql("select PERSON_ID from CONTACT") + ); + if (state == FieldChanges.STATE_CHANGED()) + PersUtils.setImage(personId, value); + else + PersUtils.removeImage(personId); +}); + +var user = tools.getUserByAttribute(tools.NAME, vars.get("$field.UID")); + +user[tools.TITLE] = vars.get("$field.TITLE"); +user[tools.PARAMS][tools.ISACTIVE] = vars.get("$field.ISACTIVE"); +user[tools.PARAMS][tools.FIRSTNAME] = vars.get("$field.FIRSTNAME"); +user[tools.PARAMS][tools.LASTNAME] = vars.get("$field.LASTNAME"); +user[tools.PARAMS][tools.EMAIL] = vars.get("$field.EMAIL_ADDRESS"); +user[tools.PARAMS][tools.CALENDARID] = vars.get("$field.EMAIL_ADDRESS"); +user[tools.PARAMS][tools.CONTACTID] = vars.get("$field.CONTACT_ID"); +user[tools.PARAMS][tools.DESCRIPTION] = vars.get("$field.DESCRIPTION"); +user[tools.PARAMS].department = vars.get("$field.DEPARTMENT"); + +if (vars.exists("$param.PasswordChange_param") && vars.get("$param.PasswordChange_param") + && vars.get("$field.PASSWORD") == vars.get("$field.CONFIRM_PASSWORD")) +{ + user[tools.PASSWORD] = vars.getString("$field.PASSWORD"); +} + tools.updateUser(user); \ No newline at end of file diff --git a/entity/KeywordEntry_entity/KeywordEntry_entity.aod b/entity/KeywordEntry_entity/KeywordEntry_entity.aod index 2835626afa483d756ea05900800a37c4fd85a797..e823443fa8432176e1803f54e1a13d08f73acd33 100644 --- a/entity/KeywordEntry_entity/KeywordEntry_entity.aod +++ b/entity/KeywordEntry_entity/KeywordEntry_entity.aod @@ -171,12 +171,6 @@ <fieldName>KeywordGenders</fieldName> <isConsumer v="false" /> </entityDependency> - <entityDependency> - <name>001e0934-0920-4b38-afff-caf299e96abf</name> - <entityName>Task_entity</entityName> - <fieldName>KeywordTypes</fieldName> - <isConsumer v="false" /> - </entityDependency> <entityDependency> <name>8d28f08b-675d-4bcf-9318-a508d45ca69e</name> <entityName>Task_entity</entityName> diff --git a/entity/Offer_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js b/entity/Offer_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js index c41e20315c6fbf1f10f4978391c9af3f762b2274..36e83de50431a1d2bd09760304daa4cd67a81166 100644 --- a/entity/Offer_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js +++ b/entity/Offer_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js @@ -1,3 +1,4 @@ +import("Context_lib"); import("system.result"); import("system.vars"); diff --git a/entity/TaskLink_entity/TaskLink_entity.aod b/entity/TaskLink_entity/TaskLink_entity.aod index 81535cc22679535d2b5e00c8929ed1f42a59107e..c44b974a11d511fdebf51e98729540f0afe48083 100644 --- a/entity/TaskLink_entity/TaskLink_entity.aod +++ b/entity/TaskLink_entity/TaskLink_entity.aod @@ -42,6 +42,12 @@ <fieldName>Links</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>96ab81b2-20d1-4e30-8563-4b06d8406269</name> + <entityName>Ticket_entity</entityName> + <fieldName>Links</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Task_entity/Task_entity.aod b/entity/Task_entity/Task_entity.aod index 03fd7028b4dd7a6d70627caf4f5bbdaf5b01b2dc..0a910115e6bbec902d864007ba69f80f433921be 100644 --- a/entity/Task_entity/Task_entity.aod +++ b/entity/Task_entity/Task_entity.aod @@ -16,16 +16,6 @@ <name>#PROVIDER</name> <recordContainer>db</recordContainer> </entityProvider> - <entityField> - <name>CODE</name> - <title>task number</title> - <contentType>NUMBER</contentType> - <outputFormat>0000000</outputFormat> - <inputFormat>0000000</inputFormat> - <searchable v="false" /> - <state>DISABLED</state> - <stateProcess>%aditoprj%/entity/Task_entity/entityfields/code/stateProcess.js</stateProcess> - </entityField> <entityField> <name>SUBJECT</name> <title>subject</title> @@ -34,7 +24,6 @@ <entityField> <name>STATUS</name> <title>{$TASK_STATUS}</title> - <colorProcess>%aditoprj%/entity/Task_entity/entityfields/status/colorProcess.js</colorProcess> <consumer>KeywordStates</consumer> <groupable v="true" /> <mandatory v="true" /> @@ -85,16 +74,6 @@ <inputFormat>dd.MM.yyyy HH:mm</inputFormat> <valueProcess>%aditoprj%/entity/Task_entity/entityfields/maturity_date/valueProcess.js</valueProcess> </entityField> - <entityField> - <name>TYPE</name> - <title>type</title> - <consumer>KeywordTypes</consumer> - <groupable v="true" /> - <searchable v="true" /> - <state>READONLY</state> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/type/valueProcess.js</valueProcess> - <displayValueProcess>%aditoprj%/entity/Task_entity/entityfields/type/displayValueProcess.js</displayValueProcess> - </entityField> <entityField> <name>DESCRIPTION</name> <title>description</title> @@ -169,25 +148,6 @@ <valueProcess>%aditoprj%/entity/Task_entity/entityfields/keywordstates/children/containername_param/valueProcess.js</valueProcess> <expose v="false" /> </entityParameter> - <entityParameter> - <name>WhitelistIds_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/keywordstates/children/whitelistids_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - <entityConsumer> - <name>KeywordTypes</name> - <dependency> - <name>dependency</name> - <entityName>KeywordEntry_entity</entityName> - <fieldName>SpecificContainerKeywords</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContainerName_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/keywordtypes/children/containername_param/valueProcess.js</valueProcess> - <expose v="false" /> - </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -453,43 +413,6 @@ </entityParameter> </children> </entityConsumer> - <entityConsumer> - <name>Attributes</name> - <stateProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/stateProcess.js</stateProcess> - <onValidation>%aditoprj%/entity/Task_entity/entityfields/attributes/onValidation.js</onValidation> - <dependency> - <name>dependency</name> - <entityName>AttributeRelation_entity</entityName> - <fieldName>AttributeRelations</fieldName> - </dependency> - <children> - <entityParameter> - <name>ObjectRowId_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js</valueProcess> - </entityParameter> - <entityParameter> - <name>ObjectType_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/children/objecttype_param/valueProcess.js</valueProcess> - </entityParameter> - <entityParameter> - <name>ShowEmpty_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/children/showempty_param/valueProcess.js</valueProcess> - </entityParameter> - <entityParameter> - <name>FilteredAttributeIds_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js</valueProcess> - </entityParameter> - <entityParameter> - <name>DisplaySimpleName_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - <entityParameter> - <name>Type_param</name> - <valueProcess>%aditoprj%/entity/Task_entity/entityfields/type_param/valueProcess.js</valueProcess> - <expose v="true" /> - </entityParameter> <entityActionGroup> <name>tableActions</name> <children> @@ -509,6 +432,10 @@ </entityActionField> </children> </entityActionGroup> + <entityField> + <name>TYPE</name> + <valueProcess>%aditoprj%/entity/Task_entity/entityfields/type/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -520,7 +447,7 @@ <onDBDelete>%aditoprj%/entity/Task_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <linkInformation> <linkInformation> - <name>47e1b4a5-6901-48b0-85ba-bec39b86a2d7</name> + <name>6dfe6f25-2b83-413b-89e4-5c5b9839be2e</name> <tableName>TASK</tableName> <primaryKey>TASKID</primaryKey> <isUIDTable v="true" /> @@ -528,10 +455,6 @@ </linkInformation> </linkInformation> <recordFieldMappings> - <dbRecordFieldMapping> - <name>CODE.value</name> - <recordfield>TASK.CODE</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>DESCRIPTION.value</name> <recordfield>TASK.DESCRIPTION</recordfield> @@ -572,10 +495,6 @@ <name>TASKID.value</name> <recordfield>TASK.TASKID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>TYPE.value</name> - <recordfield>TASK.TYPE</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>EDITOR_CONTACT_ID.displayValue</name> <expression>%aditoprj%/entity/Task_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js</expression> @@ -584,10 +503,6 @@ <name>REQUESTOR_CONTACT_ID.displayValue</name> <expression>%aditoprj%/entity/Task_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js</expression> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>TYPE.displayValue</name> - <expression>%aditoprj%/entity/Task_entity/recordcontainers/db/recordfieldmappings/type.displayvalue/expression.js</expression> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PARENT_CONTEXT.value</name> <recordfield>TASK.PARENT_CONTEXT</recordfield> @@ -612,6 +527,10 @@ <name>STATUS.displayValue</name> <expression>%aditoprj%/entity/Task_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TYPE.value</name> + <recordfield>TASK.TYPE</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Task_entity/entityfields/code/stateProcess.js b/entity/Task_entity/entityfields/code/stateProcess.js deleted file mode 100644 index b066ae31a4bfa6b06c5c8c9bf20df77e978fe24e..0000000000000000000000000000000000000000 --- a/entity/Task_entity/entityfields/code/stateProcess.js +++ /dev/null @@ -1,13 +0,0 @@ -import("system.neon"); -import("system.result"); -import("system.vars"); -import("ActivityTask_lib"); - -if (TaskUtils.getShowCode(vars.get("$field.TYPE"))) -{ - result.string(neon.COMPONENTSTATE_READONLY); -} -else -{ - result.string(neon.COMPONENTSTATE_INVISIBLE); -} \ No newline at end of file diff --git a/entity/Task_entity/entityfields/keywordstates/children/whitelistids_param/valueProcess.js b/entity/Task_entity/entityfields/keywordstates/children/whitelistids_param/valueProcess.js deleted file mode 100644 index e9a933ca7ebe5479c050dbe91d569683d07d3507..0000000000000000000000000000000000000000 --- a/entity/Task_entity/entityfields/keywordstates/children/whitelistids_param/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.vars"); -import("system.result"); -import("ActivityTask_lib"); - -result.object(TaskUtils.getAvailableStatus(vars.get("$field.TYPE"))); \ No newline at end of file diff --git a/entity/Task_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js b/entity/Task_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js index 291121452f76328ba9ac2421f14440a703fefc3d..c95f5ea0c85673d6f68abfdbef56f55fb63597c1 100644 --- a/entity/Task_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js +++ b/entity/Task_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js @@ -1,4 +1,4 @@ import("system.result"); import("system.vars"); -result.string(vars.get("$field.TASKID"));//TODO: sys.uid or similar? \ No newline at end of file +result.string(vars.get("$sys.uid")); \ No newline at end of file diff --git a/entity/Task_entity/entityfields/type/valueProcess.js b/entity/Task_entity/entityfields/type/valueProcess.js index 5785a095c958b5fe6e59428fce0420b546ae38db..04149ad63a18b650dc2e75a1792c870d88a55f43 100644 --- a/entity/Task_entity/entityfields/type/valueProcess.js +++ b/entity/Task_entity/entityfields/type/valueProcess.js @@ -6,5 +6,5 @@ import("KeywordRegistry_basic"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) { // Sets the type to "Task" as default value. - result.string(vars.get("$param.Type_param")); + result.string($KeywordRegistry.taskType$task()); } \ No newline at end of file diff --git a/entity/Task_entity/entityfields/type_param/valueProcess.js b/entity/Task_entity/entityfields/type_param/valueProcess.js deleted file mode 100644 index f1d6cdd9b2e130ea987bb633c2422d98befe664b..0000000000000000000000000000000000000000 --- a/entity/Task_entity/entityfields/type_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("KeywordRegistry_basic"); -import("system.result"); - -result.string($KeywordRegistry.taskType$Task()); \ No newline at end of file diff --git a/entity/Task_entity/recordcontainers/db/conditionProcess.js b/entity/Task_entity/recordcontainers/db/conditionProcess.js index 1aa0331dada93a3eaae1f0b074c473132e0c7efc..8169552d13ec3c4b1acf8a3c0864e289c1ac6ae5 100644 --- a/entity/Task_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Task_entity/recordcontainers/db/conditionProcess.js @@ -1,29 +1,39 @@ -import("Employee_lib"); -import("system.vars"); -import("system.db"); -import("system.result"); -import("Sql_lib"); - -var cond = new SqlCondition(); -var alternativeFallbackCondition = "1 = 1"; - -if (vars.getString("$param.FilterOnlyOwnTask_param") == "true") -{ - var ownContactId = EmployeeUtils.getCurrentContactId(); - if (ownContactId) - cond.andPrepareIfSet("TASK.EDITOR_CONTACT_ID", ownContactId); - else - alternativeFallbackCondition = "1 = 2"; -} -if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) -{ - var activityLinkCond = SqlCondition.begin().andPrepareVars("TASKLINK.OBJECT_ROWID", "$param.RowId_param") - .andPrepareVars("TASKLINK.OBJECT_TYPE", "$param.ObjectId_param"); - - // TODO: more performant way than IN. Maybe a join? - cond.and(db.translateStatement(activityLinkCond.buildSql("TASK.TASKID in (select TASKLINK.TASK_ID from TASKLINK", "1=2", ")"))) -} - -//TODO: use a preparedCondition when available #1030812 #1034026 -var resCond = db.translateCondition(cond.build(alternativeFallbackCondition)); -result.string(resCond); +import("Employee_lib"); +import("system.vars"); +import("system.db"); +import("system.result"); +import("Sql_lib"); +import("KeywordRegistry_basic"); + +var cond = new SqlCondition(); +cond.andPrepare("TASK.TYPE", $KeywordRegistry.taskType$task()) + +var loadNothing = false; + +if (vars.getString("$param.FilterOnlyOwnTask_param") == "true") +{ + var ownContactId = EmployeeUtils.getCurrentContactId(); + if (ownContactId) + cond.andPrepareIfSet("TASK.EDITOR_CONTACT_ID", ownContactId); + else + loadNothing = true; +} +if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) +{ + var activityLinkCond = SqlCondition.begin().andPrepareVars("TASKLINK.OBJECT_ROWID", "$param.RowId_param") + .andPrepareVars("TASKLINK.OBJECT_TYPE", "$param.ObjectId_param"); + + // TODO: more performant way than IN. Maybe a join? + cond.and(db.translateStatement(activityLinkCond.buildSql("TASK.TASKID in (select TASKLINK.TASK_ID from TASKLINK", "1=2", ")"))) +} + +if (loadNothing) +{ + result.string("1=2"); +} +else +{ + //TODO: use a preparedCondition when available #1030812 #1034026 + var resCond = db.translateCondition(cond.build("1=1")); + result.string(resCond); +} \ No newline at end of file diff --git a/entity/Ticket_entity/Ticket_entity.aod b/entity/Ticket_entity/Ticket_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..2e14fc90383ab35cb1b432e4acdf8d951ebf872f --- /dev/null +++ b/entity/Ticket_entity/Ticket_entity.aod @@ -0,0 +1,349 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.8"> + <name>Ticket_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>db</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>CODE</name> + <title>ticket number</title> + <contentType>NUMBER</contentType> + <outputFormat>0000000</outputFormat> + <inputFormat>0000000</inputFormat> + <searchable v="false" /> + <state>DISABLED</state> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/code/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/code/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TASK_SUBJECT</name> + <title>subject</title> + <mandatory v="true" /> + </entityField> + <entityField> + <name>TASK_STATUS</name> + <title>{$TICKET_STATUS}</title> + <consumer>KeywordStates</consumer> + <groupable v="true" /> + <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_status/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_status/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TASK_PRIORITY</name> + <title>Priority</title> + <consumer>KeywordPriorities</consumer> + <groupable v="true" /> + <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_priority/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_priority/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TASK_REQUESTOR_CONTACT_ID</name> + <title>{$TICKET_REQUESTOR}</title> + <consumer>ContactRequestors</consumer> + <linkedContext>Person</linkedContext> + <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_requestor_contact_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_requestor_contact_id/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TASK_EDITOR_CONTACT_ID</name> + <title>{$TICKET_EDITOR}</title> + <consumer>ContactEditors</consumer> + <linkedContext>Person</linkedContext> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_editor_contact_id/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TASK_START_DATE</name> + <title>Begin</title> + <contentType>DATE</contentType> + <resolution>MINUTE</resolution> + <outputFormat>dd.MM.yyyy HH:mm</outputFormat> + <inputFormat>dd.MM.yyyy HH:mm</inputFormat> + <groupable v="true" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_start_date/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>TASK_MATURITY_DATE</name> + <title>Maturity</title> + <contentType>DATE</contentType> + <resolution>MINUTE</resolution> + <outputFormat>dd.MM.yyyy HH:mm</outputFormat> + <inputFormat>dd.MM.yyyy HH:mm</inputFormat> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_maturity_date/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>TASK_TYPE</name> + <title>type</title> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_type/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>TASK_DESCRIPTION</name> + <title>description</title> + <contentType>LONG_TEXT</contentType> + </entityField> + <entityField> + <name>TASK_TASKID</name> + <title>TASKID (UID)</title> + <mandatory v="true" /> + <searchable v="false" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_taskid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>TASK_PRIORITY_ICON</name> + <colorProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_priority_icon/colorProcess.js</colorProcess> + <contentType>IMAGE</contentType> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_priority_icon/valueProcess.js</valueProcess> + </entityField> + <entityParameter> + <name>FilterOnlyOwnTicket_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/filteronlyownticket_param/valueProcess.js</valueProcess> + </entityParameter> + <entityConsumer> + <name>Links</name> + <dependency> + <name>dependency</name> + <entityName>TaskLink_entity</entityName> + <fieldName>Link</fieldName> + </dependency> + <children> + <entityParameter> + <name>TaskId_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/links/children/taskid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Attributes</name> + <stateProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/stateProcess.js</stateProcess> + <onValidation>%aditoprj%/entity/Ticket_entity/entityfields/attributes/onValidation.js</onValidation> + <dependency> + <name>dependency</name> + <entityName>AttributeRelation_entity</entityName> + <fieldName>AttributeRelations</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ShowEmpty_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/children/showempty_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>FilteredAttributeIds_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>DisplaySimpleName_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>MainDocuments</name> + <stateProcess>%aditoprj%/entity/Ticket_entity/entityfields/maindocuments/stateProcess.js</stateProcess> + <dependency> + <name>dependency</name> + <entityName>Document_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + <children> + <entityParameter> + <name>AssignmentRowId_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>AssignmentTable_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/maindocuments/children/assignmenttable_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Documents</name> + <selectionMode>MULTI</selectionMode> + <dependency> + <name>dependency</name> + <entityName>Document_entity</entityName> + <fieldName>Documents</fieldName> + </dependency> + <children> + <entityParameter> + <name>AssignmentRowId_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>AssignmentTable_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>LogHistories</name> + <dependency> + <name>dependency</name> + <entityName>LogHistory_entity</entityName> + <fieldName>LogHistoryProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>tablenames_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>TASK_PROGRESS</name> + <title>Progress</title> + <consumer>KeywordProgress</consumer> + <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_progress/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_progress/displayValueProcess.js</displayValueProcess> + </entityField> + <entityConsumer> + <name>KeywordProgress</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/keywordprogress/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>TICKETTYPE</name> + </entityField> + <entityField> + <name>TICKETID</name> + </entityField> + <entityField> + <name>TASK_ID</name> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_id/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>TASK_SUBJECT_DETAILS</name> + <title>subject</title> + <linkedContext>Task</linkedContext> + <valueProcess>%aditoprj%/entity/Ticket_entity/entityfields/task_subject_details/valueProcess.js</valueProcess> + </entityField> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <isRequireContainerFiltering v="true" /> + <fromClauseProcess>%aditoprj%/entity/Ticket_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> + <conditionProcess>%aditoprj%/entity/Ticket_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/Ticket_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> + <onDBInsert>%aditoprj%/entity/Ticket_entity/recordcontainers/db/onDBInsert.js</onDBInsert> + <onDBDelete>%aditoprj%/entity/Ticket_entity/recordcontainers/db/onDBDelete.js</onDBDelete> + <linkInformation> + <linkInformation> + <name>ec5c2cd3-f05b-467f-88c6-c1d4d7de87cc</name> + <tableName>TICKET</tableName> + <primaryKey>TICKETID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + <linkInformation> + <name>d73da2b3-bc44-4909-9bc0-9298cf57e7d7</name> + <tableName>TASK</tableName> + <primaryKey>TASKID</primaryKey> + <isUIDTable v="false" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>CODE.value</name> + <recordfield>TICKET.CODE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_DESCRIPTION.value</name> + <recordfield>TASK.DESCRIPTION</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_EDITOR_CONTACT_ID.value</name> + <recordfield>TASK.EDITOR_CONTACT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_MATURITY_DATE.value</name> + <recordfield>TASK.MATURITY_DATE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_PRIORITY.value</name> + <recordfield>TASK.PRIORITY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_REQUESTOR_CONTACT_ID.value</name> + <recordfield>TASK.REQUESTOR_CONTACT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_START_DATE.value</name> + <recordfield>TASK.START_DATE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_STATUS.value</name> + <recordfield>TASK.STATUS</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_SUBJECT.value</name> + <recordfield>TASK.SUBJECT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_EDITOR_CONTACT_ID.displayValue</name> + <expression>%aditoprj%/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_REQUESTOR_CONTACT_ID.displayValue</name> + <expression>%aditoprj%/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_PRIORITY.displayValue</name> + <expression>%aditoprj%/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/priority.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_PROGRESS.value</name> + <recordfield>TASK.PROGRESS</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_PROGRESS.displayValue</name> + <expression>%aditoprj%/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/progress.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_STATUS.displayValue</name> + <expression>%aditoprj%/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_TYPE.value</name> + <recordfield>TASK.TYPE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_ID.value</name> + <recordfield>TICKET.TASK_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TASK_TASKID.value</name> + <recordfield>TASK.TASKID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TICKETID.value</name> + <recordfield>TICKET.TICKETID</recordfield> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/Task_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js b/entity/Ticket_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js similarity index 100% rename from entity/Task_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js rename to entity/Ticket_entity/entityfields/attributes/children/displaysimplename_param/valueProcess.js diff --git a/entity/Task_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js b/entity/Ticket_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js similarity index 51% rename from entity/Task_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js rename to entity/Ticket_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js index 47009a542400d5bd799e4892bf7c05a261be8aea..a6ce85b4b13968d08324f9de40e545df549b06b1 100644 --- a/entity/Task_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js +++ b/entity/Ticket_entity/entityfields/attributes/children/filteredattributeids_param/valueProcess.js @@ -2,4 +2,4 @@ import("system.vars"); import("system.result"); import("ActivityTask_lib"); -result.object(TaskUtils.getTypeAttributes(vars.get("$field.TYPE"))); \ No newline at end of file +result.object(TaskUtils.getTypeAttributes(vars.get("$field.TASK_TYPE"))); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js b/entity/Ticket_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1e8cb5a2124b3f6dea5a1b671d51272804c4dcd5 --- /dev/null +++ b/entity/Ticket_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.TICKETID")) \ No newline at end of file diff --git a/entity/Task_entity/entityfields/attributes/children/objecttype_param/valueProcess.js b/entity/Ticket_entity/entityfields/attributes/children/objecttype_param/valueProcess.js similarity index 100% rename from entity/Task_entity/entityfields/attributes/children/objecttype_param/valueProcess.js rename to entity/Ticket_entity/entityfields/attributes/children/objecttype_param/valueProcess.js diff --git a/entity/Task_entity/entityfields/attributes/children/showempty_param/valueProcess.js b/entity/Ticket_entity/entityfields/attributes/children/showempty_param/valueProcess.js similarity index 100% rename from entity/Task_entity/entityfields/attributes/children/showempty_param/valueProcess.js rename to entity/Ticket_entity/entityfields/attributes/children/showempty_param/valueProcess.js diff --git a/entity/Task_entity/entityfields/attributes/onValidation.js b/entity/Ticket_entity/entityfields/attributes/onValidation.js similarity index 100% rename from entity/Task_entity/entityfields/attributes/onValidation.js rename to entity/Ticket_entity/entityfields/attributes/onValidation.js diff --git a/entity/Task_entity/entityfields/attributes/stateProcess.js b/entity/Ticket_entity/entityfields/attributes/stateProcess.js similarity index 77% rename from entity/Task_entity/entityfields/attributes/stateProcess.js rename to entity/Ticket_entity/entityfields/attributes/stateProcess.js index 8c4ca0d7a0ad5b3a03f3206a27db0c7fba0fa525..7002f05bc9db405b18e843698356101efd5650e6 100644 --- a/entity/Task_entity/entityfields/attributes/stateProcess.js +++ b/entity/Ticket_entity/entityfields/attributes/stateProcess.js @@ -3,7 +3,7 @@ import("system.vars"); import("system.neon"); import("ActivityTask_lib"); -if (TaskUtils.typeHasAttributes(vars.get("$field.TYPE"))) +if (TaskUtils.typeHasAttributes(vars.get("$field.TASK_TYPE"))) { result.string(neon.COMPONENTSTATE_EDITABLE); } diff --git a/entity/Ticket_entity/entityfields/code/displayValueProcess.js b/entity/Ticket_entity/entityfields/code/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Ticket_entity/entityfields/code/valueProcess.js b/entity/Ticket_entity/entityfields/code/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b3745b58d06c37e5cdd691e0fab9a532fe53083a --- /dev/null +++ b/entity/Ticket_entity/entityfields/code/valueProcess.js @@ -0,0 +1,6 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("-1"); \ No newline at end of file diff --git a/entity/Task_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js b/entity/Ticket_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js similarity index 55% rename from entity/Task_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js rename to entity/Ticket_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js index 9bd2844554488d1a7fb68ec959556b48ef4566b3..c95f5ea0c85673d6f68abfdbef56f55fb63597c1 100644 --- a/entity/Task_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js +++ b/entity/Ticket_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js @@ -1,4 +1,4 @@ -import("system.vars"); import("system.result"); +import("system.vars"); -result.string(vars.get("$field.TASKID")) \ No newline at end of file +result.string(vars.get("$sys.uid")); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js b/entity/Ticket_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9f9b1dd3ca646d2537ccafd3658f4d6c4621e206 --- /dev/null +++ b/entity/Ticket_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string("TICKET"); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/filteronlyownticket_param/valueProcess.js b/entity/Ticket_entity/entityfields/filteronlyownticket_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e0f3ec47e2b963a577204e41d9847dd6ad0725a8 --- /dev/null +++ b/entity/Ticket_entity/entityfields/filteronlyownticket_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string(false); \ No newline at end of file diff --git a/entity/Task_entity/entityfields/keywordtypes/children/containername_param/valueProcess.js b/entity/Ticket_entity/entityfields/keywordprogress/children/containername_param/valueProcess.js similarity index 63% rename from entity/Task_entity/entityfields/keywordtypes/children/containername_param/valueProcess.js rename to entity/Ticket_entity/entityfields/keywordprogress/children/containername_param/valueProcess.js index b139734c3ee81a4a9d2ce291db74ea5241044e81..b19308201a587f0681e4a6486ea3751b784e1ebb 100644 --- a/entity/Task_entity/entityfields/keywordtypes/children/containername_param/valueProcess.js +++ b/entity/Ticket_entity/entityfields/keywordprogress/children/containername_param/valueProcess.js @@ -2,4 +2,4 @@ import("system.result"); import("Keyword_lib"); import("KeywordRegistry_basic"); -result.string($KeywordRegistry.taskType()); +result.string($KeywordRegistry.taskProgress()); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/links/children/taskid_param/valueProcess.js b/entity/Ticket_entity/entityfields/links/children/taskid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f8071b02f44283617dd54ee8cb35c2bf40367483 --- /dev/null +++ b/entity/Ticket_entity/entityfields/links/children/taskid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.TASK_TASKID")); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js b/entity/Ticket_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9dcf6c151f4c2caafeb0adce1d7cc0a6999618e0 --- /dev/null +++ b/entity/Ticket_entity/entityfields/loghistories/children/tablenames_param/valueProcess.js @@ -0,0 +1,10 @@ +import("system.vars"); +import("system.result"); +import("Context_lib"); + +var res = []; +res.push({id: vars.get("$field.TICKETID"), tableNames: ["TICKET"]}); +res.push({id: vars.get("$field.TASK_TASKID"), tableNames: ["TASK"]}); + +res = JSON.stringify(res);//currently only strings can be passed as param +result.object(res); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js b/entity/Ticket_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c95f5ea0c85673d6f68abfdbef56f55fb63597c1 --- /dev/null +++ b/entity/Ticket_entity/entityfields/maindocuments/children/assignmentrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$sys.uid")); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/maindocuments/children/assignmenttable_param/valueProcess.js b/entity/Ticket_entity/entityfields/maindocuments/children/assignmenttable_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..09f18437abaebfab9d325e30b46537f9f9a6949a --- /dev/null +++ b/entity/Ticket_entity/entityfields/maindocuments/children/assignmenttable_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("TICKET"); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/maindocuments/stateProcess.js b/entity/Ticket_entity/entityfields/maindocuments/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5458354c9a9f66b8f11aa4e84682bbc666bea207 --- /dev/null +++ b/entity/Ticket_entity/entityfields/maindocuments/stateProcess.js @@ -0,0 +1,14 @@ +import("system.result"); +import("system.db"); +import("system.vars"); +import("system.neon"); +import("Sql_lib"); + +if (0 == db.getBinaryCount("TASK", "DOCUMENT", vars.get("$sys.uid"), SqlUtils.getSystemAlias(), "MAINDOCUMENT")) +{ + result.string(neon.COMPONENTSTATE_INVISIBLE); +} +else +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_editor_contact_id/displayValueProcess.js b/entity/Ticket_entity/entityfields/task_editor_contact_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0dde82e7728286629b1c210326725aac2ebb92c5 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_editor_contact_id/displayValueProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var id = vars.get("$this.value"); +//show the simpel title since this will be later an employee-entry and therefore no organisation is needed +var title = ContactUtils.getTitleByContactId(id); +result.string(title); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_id/valueProcess.js b/entity/Ticket_entity/entityfields/task_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..48fc3a1ef5d921f4a3fdce21148b7944925be12b --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_id/valueProcess.js @@ -0,0 +1,6 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(vars.get("$field.TASK_TASKID")); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_maturity_date/valueProcess.js b/entity/Ticket_entity/entityfields/task_maturity_date/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f86620cd5deb97d5d66c61ef83d177d2da85f3ea --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_maturity_date/valueProcess.js @@ -0,0 +1,12 @@ +import("system.eMath"); +import("system.datetime"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +{ + var startDate = vars.get("$field.TASK_START_DATE"); + var presetVal = eMath.addInt(startDate, datetime.ONE_WEEK); + result.string(presetVal); +} \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_priority/displayValueProcess.js b/entity/Ticket_entity/entityfields/task_priority/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7828c80c39140dd71172ff71c8d03ca0c62dccd0 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_priority/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getViewValue($KeywordRegistry.taskPriority(), vars.get("$field.TASK_PRIORITY"))); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_priority/valueProcess.js b/entity/Ticket_entity/entityfields/task_priority/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0639e8287e8797db0bd0a19c31781facd3409367 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_priority/valueProcess.js @@ -0,0 +1,8 @@ +import("system.util"); +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string($KeywordRegistry.taskPriority$low()); diff --git a/entity/Ticket_entity/entityfields/task_priority_icon/colorProcess.js b/entity/Ticket_entity/entityfields/task_priority_icon/colorProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d5381e94ed349aaf085f56d443df54cf3afea7ec --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_priority_icon/colorProcess.js @@ -0,0 +1,21 @@ +import("system.vars"); +import("KeywordRegistry_basic"); +import("system.result"); +import("system.neon"); + +switch(vars.getString("$field.TASK_PRIORITY")) +{ + case $KeywordRegistry.taskPriority$none(): + result.string(neon.PRIORITY_NONE_COLOR); + break; + case $KeywordRegistry.taskPriority$low(): + result.string(neon.PRIORITY_LOW_COLOR); + break; + case $KeywordRegistry.taskPriority$medium(): + result.string(neon.PRIORITY_MEDIUM_COLOR); + break; + case $KeywordRegistry.taskPriority$high(): + result.string(neon.PRIORITY_HIGH_COLOR); + break; +} + diff --git a/entity/Ticket_entity/entityfields/task_priority_icon/valueProcess.js b/entity/Ticket_entity/entityfields/task_priority_icon/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c8a46bd41b69b171557e53d30b2dc3c074e3ad99 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_priority_icon/valueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("ActivityTask_lib"); +import("KeywordRegistry_basic"); +import("system.result"); + +result.string(TaskUtils.getStatusIcon(vars.getString("$field.TASK_STATUS"))); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_progress/displayValueProcess.js b/entity/Ticket_entity/entityfields/task_progress/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..19faa7e8ceb8b7db17c67252b7d90b303589d0bf --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_progress/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getViewValue($KeywordRegistry.taskProgress(), vars.get("$field.TASK_PROGRESS"))); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_progress/valueProcess.js b/entity/Ticket_entity/entityfields/task_progress/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..854d3c94292f47f7eee1f245ceada6ec2704fee7 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_progress/valueProcess.js @@ -0,0 +1,8 @@ +import("system.util"); +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string($KeywordRegistry.taskProgress$0()); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_requestor_contact_id/displayValueProcess.js b/entity/Ticket_entity/entityfields/task_requestor_contact_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0dde82e7728286629b1c210326725aac2ebb92c5 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_requestor_contact_id/displayValueProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.vars"); +import("Contact_lib"); + +var id = vars.get("$this.value"); +//show the simpel title since this will be later an employee-entry and therefore no organisation is needed +var title = ContactUtils.getTitleByContactId(id); +result.string(title); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_requestor_contact_id/valueProcess.js b/entity/Ticket_entity/entityfields/task_requestor_contact_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1e62e7551ccb20b0b0d7aca34f64b6e448b5dda7 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_requestor_contact_id/valueProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Employee_lib"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(EmployeeUtils.getCurrentContactId()); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_start_date/valueProcess.js b/entity/Ticket_entity/entityfields/task_start_date/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5b098ba003d06ee9125c54f3f53559b2155ea8e3 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_start_date/valueProcess.js @@ -0,0 +1,12 @@ +import("system.datetime"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +{ + var presetVal = datetime.date(); + //TODO: depending on what happens in #1032274 we need to manually set the resolution to MINUTES or not (which means we've to set everything smaller than MINUTES (Seconds, etc.) to zero) + presetVal = Math.floor(presetVal / datetime.ONE_MINUTE) * datetime.ONE_MINUTE; + result.string(presetVal); +} \ No newline at end of file diff --git a/entity/Task_entity/entityfields/type/displayValueProcess.js b/entity/Ticket_entity/entityfields/task_status/displayValueProcess.js similarity index 50% rename from entity/Task_entity/entityfields/type/displayValueProcess.js rename to entity/Ticket_entity/entityfields/task_status/displayValueProcess.js index b8b8e7a4a31d73bf7c97f1cac68caaaa6da9093f..e8f71e16db074f12bd5a41e011e2fc4de151a333 100644 --- a/entity/Task_entity/entityfields/type/displayValueProcess.js +++ b/entity/Ticket_entity/entityfields/task_status/displayValueProcess.js @@ -1,6 +1,6 @@ -import("system.result"); -import("system.vars"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -result.string(KeywordUtils.getViewValue($KeywordRegistry.taskType(), vars.get("$field.TYPE"))); +import("KeywordRegistry_basic"); +import("system.vars"); +import("system.result"); +import("Keyword_lib"); + +result.string(KeywordUtils.getViewValue($KeywordRegistry.taskStatus(), vars.get("$field.TASK_STATUS"))); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_status/valueProcess.js b/entity/Ticket_entity/entityfields/task_status/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d807ce33a07a8c00ae0cd2b95a219ba3807c233b --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_status/valueProcess.js @@ -0,0 +1,13 @@ +import("ActivityTask_lib"); +import("system.util"); +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); +import("Keyword_lib"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +{ + var defaultState = TaskUtils.getDefaultStatus(vars.get("$field.TASK_TYPE")); + result.string(defaultState); +} \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_subject_details/valueProcess.js b/entity/Ticket_entity/entityfields/task_subject_details/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..575d44d113e181400c9265d78f93c57799692ffe --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_subject_details/valueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); + +var responsible = vars.get("$field.TASK_EDITOR_CONTACT_ID.displayValue"); +result.string(vars.get("$field.TASK_SUBJECT") + (responsible ? " (" + responsible + ")" : "")); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_taskid/valueProcess.js b/entity/Ticket_entity/entityfields/task_taskid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4af99287f59a86e98d9b4c552c010fe13c106cc7 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_taskid/valueProcess.js @@ -0,0 +1,7 @@ +import("system.util"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(util.getNewUUID()); \ No newline at end of file diff --git a/entity/Ticket_entity/entityfields/task_type/valueProcess.js b/entity/Ticket_entity/entityfields/task_type/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..68c9898c516c39fd154e5c53f6e22ee2dd4e16e6 --- /dev/null +++ b/entity/Ticket_entity/entityfields/task_type/valueProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); +import("KeywordRegistry_basic"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +{ + // Sets the type to "Task" as default value. + result.string($KeywordRegistry.taskType$ticket()); +} \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/conditionProcess.js b/entity/Ticket_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e5a38557f5de3aa40bcf2234f5cc1a27d9ecbe1a --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,42 @@ +import("system.logging"); +import("Employee_lib"); +import("system.vars"); +import("system.db"); +import("system.result"); +import("Sql_lib"); +import("KeywordRegistry_basic"); + +var cond = new SqlCondition(); +cond.andPrepare("TASK.TYPE", $KeywordRegistry.taskType$ticket()) + +var loadNothing = false; + +if (vars.getString("$param.FilterOnlyOwnTicket_param") == "true") +{ + var ownContactId = EmployeeUtils.getCurrentContactId(); + if (ownContactId) + cond.andPrepareIfSet("TASK.EDITOR_CONTACT_ID", ownContactId); + else + loadNothing = true; +} + +if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) +{ + var activityLinkCond = SqlCondition.begin().andPrepareVars("TASKLINK.OBJECT_ROWID", "$param.RowId_param") + .andPrepareVars("TASKLINK.OBJECT_TYPE", "$param.ObjectId_param"); + + // TODO: more performant way than IN. Maybe a join? + cond.and(db.translateStatement(activityLinkCond.buildSql("TASK.TASKID in (select TASKLINK.TASK_ID from TASKLINK", "1=2", ")"))) +} + +if (loadNothing) +{ + result.string("1=2"); +} +else +{ + //TODO: use a preparedCondition when available #1030812 #1034026 + var resCond = db.translateCondition(cond.build("1=1")); + logging.log(resCond) + result.string(resCond); +} \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/fromClauseProcess.js b/entity/Ticket_entity/recordcontainers/db/fromClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..12885dc890edd5411d5e080ca1a7a98af3088223 --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/fromClauseProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("TICKET left join TASK on TASK_ID = TASKID"); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/onDBDelete.js b/entity/Ticket_entity/recordcontainers/db/onDBDelete.js new file mode 100644 index 0000000000000000000000000000000000000000..533e52691a63b864202ef1d916048b1f7d289144 --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/onDBDelete.js @@ -0,0 +1,9 @@ +import("system.logging"); +import("system.vars"); +import("system.db"); +import("Sql_lib"); + +var condition = SqlCondition.begin() + .andPrepareVars("TASKLINK.TASK_ID", "$field.TASK_TASKID"); +logging.log("delete " + vars.get("$field.TASK_TASKID")) +db.deleteData("TASKLINK", condition.build("1=2")); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/onDBInsert.js b/entity/Ticket_entity/recordcontainers/db/onDBInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..0a2c2a214c48b0e752b2c1bc122ae428e275fbc7 --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/onDBInsert.js @@ -0,0 +1,6 @@ +import("Util_lib"); +import("system.vars"); +import("system.db"); +import("ActivityTask_lib") + +CodeUtils.setCode(vars.get("$field.TICKETID"), "TICKET", "TICKETID", "CODE"); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/orderClauseProcess.js b/entity/Ticket_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e1eed9e6c15fff6062b3ed8161413699d5301f28 --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,4 @@ +import("system.db"); +import("system.result"); + +result.object({"TASK.MATURITY_DATE": db.DESCENDING}); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..e5961584dd2e3bd5741ac96032105a8cc43ec58b --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/editor_contact_id.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Person_lib"); + +//TODO: try to find a better solution for this -> #TITLE-mechanic when available +var subSql = PersUtils.getResolvingDisplaySubSql("TASK.EDITOR_CONTACT_ID"); +result.string(subSql); \ No newline at end of file diff --git a/entity/Task_entity/recordcontainers/db/recordfieldmappings/type.displayvalue/expression.js b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/priority.displayvalue/expression.js similarity index 73% rename from entity/Task_entity/recordcontainers/db/recordfieldmappings/type.displayvalue/expression.js rename to entity/Ticket_entity/recordcontainers/db/recordfieldmappings/priority.displayvalue/expression.js index 8f9ef6854e6d5c7f94f11bd1eec4865d67074b17..0b2c6568c32b748a32d429eddffbc29e9f24d980 100644 --- a/entity/Task_entity/recordcontainers/db/recordfieldmappings/type.displayvalue/expression.js +++ b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/priority.displayvalue/expression.js @@ -2,5 +2,5 @@ import("system.result"); import("Keyword_lib"); import("KeywordRegistry_basic"); -var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.taskType(), "TASK.TYPE"); -result.string(sql); +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.taskPriority(), "TASK.PRIORITY"); +result.string(sql); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/progress.displayvalue/expression.js b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/progress.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..4666f5143991d0e7ade783064a6094470f7f397e --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/progress.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.taskProgress(), "TASK.PROGRESS"); +result.string(sql); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..6c6d6087a2615c447bc2b84294d4e029b1cde9ba --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/requestor_contact_id.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Person_lib"); + +//TODO: try to find a better solution for this -> #TITLE-mechanic when available +var subSql = PersUtils.getResolvingDisplaySubSql("TASK.REQUESTOR_CONTACT_ID"); +result.string(subSql); \ No newline at end of file diff --git a/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..7f15c2dfb29cfb0697cf46955ed2840b4480a8ef --- /dev/null +++ b/entity/Ticket_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js @@ -0,0 +1,2 @@ +// do not use this, because TaskUtils.getTypeStatusKeyword(vars.get("$field.TASK_TYPE")) has to be called, which is not possible in a subselect. +// --> only use display value process \ No newline at end of file diff --git a/neonContext/Task/Task.aod b/neonContext/Task/Task.aod index 73a85997d1948f608eec8fa6ca79a68729c4efce..34cc2cb4de6771d99d1c7582943f42fb0e113e40 100644 --- a/neonContext/Task/Task.aod +++ b/neonContext/Task/Task.aod @@ -1,34 +1,30 @@ -<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> - <name>Task</name> - <title>Task</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <documentation>%aditoprj%/neonContext/Task/documentation.adoc</documentation> - <mainview>TaskMain_view</mainview> - <filterview>TaskFilter_view</filterview> - <editview>TaskEdit_view</editview> - <preview>TaskPreview_view</preview> - <entity>Task_entity</entity> - <references> - <neonViewReference> - <name>5e6fdab4-8781-4e2d-af7a-755d834b631d</name> - <view>TaskFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>7a4bcf0f-2861-4400-8fab-152c6a9ecb9b</name> - <view>TaskPreview_view</view> - </neonViewReference> - <neonViewReference> - <name>b9bd19b5-2a67-47a4-83cd-41ba30e81888</name> - <view>TaskEdit_view</view> - </neonViewReference> - <neonViewReference> - <name>83309ef0-d1c0-4f74-bb44-41fd8e054b4b</name> - <view>TaskMain_view</view> - </neonViewReference> - <neonViewReference> - <name>b2d84509-c72b-497e-9422-e4efae2e6b68</name> - <view>TaskMainPreview_view</view> - </neonViewReference> - </references> -</neonContext> +<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>Task</name> + <title>Task</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/neonContext/Task/documentation.adoc</documentation> + <mainview>TaskMain_view</mainview> + <filterview>TaskFilter_view</filterview> + <editview>TaskEdit_view</editview> + <preview>TaskPreview_view</preview> + <entity>Task_entity</entity> + <references> + <neonViewReference> + <name>5e6fdab4-8781-4e2d-af7a-755d834b631d</name> + <view>TaskFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>7a4bcf0f-2861-4400-8fab-152c6a9ecb9b</name> + <view>TaskPreview_view</view> + </neonViewReference> + <neonViewReference> + <name>b9bd19b5-2a67-47a4-83cd-41ba30e81888</name> + <view>TaskEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>83309ef0-d1c0-4f74-bb44-41fd8e054b4b</name> + <view>TaskMain_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/Ticket/Ticket.aod b/neonContext/Ticket/Ticket.aod new file mode 100644 index 0000000000000000000000000000000000000000..4d119be97707d5803cd89a47d119b532ea5fb274 --- /dev/null +++ b/neonContext/Ticket/Ticket.aod @@ -0,0 +1,29 @@ +<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>Ticket</name> + <title>Ticket</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <mainview>TicketMain_view</mainview> + <filterview>TicketFilter_view</filterview> + <editview>TicketEdit_view</editview> + <preview>TicketPreview_view</preview> + <entity>Ticket_entity</entity> + <references> + <neonViewReference> + <name>3191f35b-3dde-4912-b728-130fa1fc1b7e</name> + <view>TicketFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>f5c0ef30-deea-4a8b-a177-2f2052621ca3</name> + <view>TicketEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>a1830cdc-a1a1-4110-b666-7a74157f78fc</name> + <view>TicketMain_view</view> + </neonViewReference> + <neonViewReference> + <name>c290c5f1-53d3-4634-bf42-0de2ee89974c</name> + <view>TicketPreview_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/TaskEdit_view/TaskEdit_view.aod b/neonView/TaskEdit_view/TaskEdit_view.aod index 4d44b6272b1c108cfaa569dc452c7f1331c31461..d0995eb3aba18df0dc69dcdef0e0cfc665ea7165 100644 --- a/neonView/TaskEdit_view/TaskEdit_view.aod +++ b/neonView/TaskEdit_view/TaskEdit_view.aod @@ -13,10 +13,6 @@ <editMode v="true" /> <entityField>#ENTITY</entityField> <fields> - <entityFieldLink> - <name>f8dcc490-1b86-47c3-88fa-8005f8e0095b</name> - <entityField>TYPE</entityField> - </entityFieldLink> <entityFieldLink> <name>fb5768fe-2dd2-45cd-8d21-f20af279f409</name> <entityField>SUBJECT</entityField> @@ -64,10 +60,5 @@ <entityField>Links</entityField> <view>TaskLinkMultiEdit_view</view> </neonViewReference> - <neonViewReference> - <name>74f3f70d-c25f-455c-a619-593f569360a6</name> - <entityField>Attributes</entityField> - <view>AttributeRelationMultiEdit_view</view> - </neonViewReference> </children> </neonView> diff --git a/neonView/TaskMainPreview_view/TaskMainPreview_view.aod b/neonView/TaskMainPreview_view/TaskMainPreview_view.aod deleted file mode 100644 index efa23f33b6a49391cfe6ff89f0c08eb046e0fa27..0000000000000000000000000000000000000000 --- a/neonView/TaskMainPreview_view/TaskMainPreview_view.aod +++ /dev/null @@ -1,58 +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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>TaskMainPreview_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <headerFooterLayout> - <name>layout</name> - <header>Header</header> - </headerFooterLayout> - </layout> - <children> - <cardViewTemplate> - <name>Header</name> - <iconField>PRIORITY_ICON</iconField> - <titleField>SUBJECT</titleField> - <subtitleField>CODE</subtitleField> - <descriptionField>STATUS</descriptionField> - <favoriteAction1>newActivity</favoriteAction1> - <entityField>#ENTITY</entityField> - </cardViewTemplate> - <genericViewTemplate> - <name>Info</name> - <showDrawer v="true" /> - <entityField>#ENTITY</entityField> - <fields> - <entityFieldLink> - <name>f988850e-53ed-443d-bd3d-16946eba656e</name> - <entityField>START_DATE</entityField> - </entityFieldLink> - <entityFieldLink> - <name>dda6aefc-9d4f-4d93-9a45-bc97a278c050</name> - <entityField>MATURITY_DATE</entityField> - </entityFieldLink> - <entityFieldLink> - <name>a2c82cd5-6dcd-42aa-b650-85369f4e8d39</name> - <entityField>PROGRESS</entityField> - </entityFieldLink> - <entityFieldLink> - <name>ebdffed8-4999-4ec1-ac4d-c22514dfed0c</name> - <entityField>PRIORITY</entityField> - </entityFieldLink> - <entityFieldLink> - <name>05de9afc-429e-46a8-8e3b-2ff689ed090e</name> - <entityField>REQUESTOR_CONTACT_ID</entityField> - </entityFieldLink> - <entityFieldLink> - <name>bbf1a736-acf9-4b41-9df9-5675fc6d8943</name> - <entityField>EDITOR_CONTACT_ID</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - <neonViewReference> - <name>c4f66270-1d64-4243-9561-fb5642cff3f1</name> - <entityField>Links</entityField> - <view>TaskLinkPreviewList_view</view> - </neonViewReference> - </children> -</neonView> diff --git a/neonView/TaskMain_view/TaskMain_view.aod b/neonView/TaskMain_view/TaskMain_view.aod index adf0d2c480a382d698b8a3bba7a677f9ff75d938..627f9530baab988f9b5ae5de4016be2d36b78c46 100644 --- a/neonView/TaskMain_view/TaskMain_view.aod +++ b/neonView/TaskMain_view/TaskMain_view.aod @@ -48,10 +48,5 @@ <entityField>#ENTITY</entityField> <view>TaskPreview_view</view> </neonViewReference> - <neonViewReference> - <name>f45ff4cb-e469-46ee-808f-8c406eccbcd2</name> - <entityField>Attributes</entityField> - <view>AttributeRelationTree_view</view> - </neonViewReference> </children> </neonView> diff --git a/neonView/TaskPreview_view/TaskPreview_view.aod b/neonView/TaskPreview_view/TaskPreview_view.aod index 54a1ed4e5d71c2382a0cf0355e51964edcc01ec2..b6c57674524f7e9f54ea7ce4dcb492d46fde62b6 100644 --- a/neonView/TaskPreview_view/TaskPreview_view.aod +++ b/neonView/TaskPreview_view/TaskPreview_view.aod @@ -13,8 +13,6 @@ <name>Header</name> <iconField>PRIORITY_ICON</iconField> <titleField>SUBJECT</titleField> - <subtitleField>CODE</subtitleField> - <descriptionField>TYPE</descriptionField> <favoriteAction1>newActivity</favoriteAction1> <entityField>#ENTITY</entityField> </cardViewTemplate> diff --git a/neonView/TicketEdit_view/TicketEdit_view.aod b/neonView/TicketEdit_view/TicketEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..1dd2512b719b2f404fa9a99fc621ecc413111026 --- /dev/null +++ b/neonView/TicketEdit_view/TicketEdit_view.aod @@ -0,0 +1,65 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>TicketEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Edit</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>46ef8d86-47fc-495d-bd33-9cb43ea29b25</name> + <entityField>TASK_SUBJECT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>60dc6a4c-78a0-4105-b679-e9ae280e9e9a</name> + <entityField>TASK_DESCRIPTION</entityField> + </entityFieldLink> + <entityFieldLink> + <name>7bc8570c-4bb2-4e37-9dd3-5661adf88fcb</name> + <entityField>TASK_START_DATE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>e8fdd5ff-4edf-46c4-96fb-9900695f6ca0</name> + <entityField>TASK_MATURITY_DATE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>a2eee9f8-a0fd-484f-b1ae-bc0f989a0e54</name> + <entityField>TASK_STATUS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>05462ebf-04cb-407f-bc9e-56f016766ee1</name> + <entityField>TASK_PROGRESS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>677a46e7-a846-4b84-8c31-2a888e7dd7f3</name> + <entityField>TASK_PRIORITY</entityField> + </entityFieldLink> + <entityFieldLink> + <name>58eb48d2-1ee1-4f55-a5e0-28b05cf8b8bf</name> + <entityField>TASK_REQUESTOR_CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>c023e4ba-8779-4ca3-9bba-50bbc26b54f2</name> + <entityField>TASK_EDITOR_CONTACT_ID</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + <neonViewReference> + <name>135e702d-aa52-4787-9f05-6e9fa1569567</name> + <entityField>Links</entityField> + <view>TaskLinkMultiEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>5a61eda9-d71b-4b15-83f6-f4580a214876</name> + <entityField>Attributes</entityField> + <view>AttributeRelationMultiEdit_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/TicketFilter_view/TicketFilter_view.aod b/neonView/TicketFilter_view/TicketFilter_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..4bc66b93a89f99bef586483b9a0c70127ed6bdf0 --- /dev/null +++ b/neonView/TicketFilter_view/TicketFilter_view.aod @@ -0,0 +1,121 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>TicketFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> + <dashletConfigurations> + <neonDashletConfiguration> + <name>mytickets</name> + <title>My tasks</title> + <description>Show tasks where I am editor</description> + <fragment>Ticket/filter</fragment> + <singleton v="true" /> + <requiresConfiguration v="false" /> + <icon>VAADIN:TASKS</icon> + <categories> + <neonDashletCategory> + <name>tasks</name> + <title>Tickets</title> + </neonDashletCategory> + </categories> + <parameters> + <neonDashletParameter> + <name>FilterOnlyOwnTicket_param</name> + <value>true</value> + </neonDashletParameter> + </parameters> + </neonDashletConfiguration> + </dashletConfigurations> + <layout> + <groupLayout> + <name>layout</name> + </groupLayout> + </layout> + <children> + <timelineViewTemplate> + <name>TicketsTimeline</name> + <favoriteActionGroup1>tableActions</favoriteActionGroup1> + <dateField>TASK_MATURITY_DATE</dateField> + <titleField>TASK_SUBJECT</titleField> + <descriptionField>TASK_DESCRIPTION</descriptionField> + <iconIdField>TASK_PRIORITY_ICON</iconIdField> + <entityField>#ENTITY</entityField> + </timelineViewTemplate> + <tableViewTemplate> + <name>TicketsTable</name> + <favoriteActionGroup1>tableActions</favoriteActionGroup1> + <entityField>#ENTITY</entityField> + <title></title> + <columns> + <neonTableColumn> + <name>97c51024-1193-412a-a1e7-d5b4fe5ea1b3</name> + <entityField>TASK_PRIORITY_ICON</entityField> + </neonTableColumn> + <neonTableColumn> + <name>37366161-eeb1-4f2e-9e25-843e85f2c4b6</name> + <entityField>TASK_STATUS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>077df121-a59b-48ab-9772-aa29fa0d7c1d</name> + <entityField>TASK_SUBJECT</entityField> + <expandRatio v="100" /> + </neonTableColumn> + <neonTableColumn> + <name>7e2dca2a-6a53-41cc-8dd7-a8ee370ff4de</name> + <entityField>TASK_REQUESTOR_CONTACT_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>fb4ad106-1d84-445b-ab4a-ac36b6e3b0c2</name> + <entityField>TASK_EDITOR_CONTACT_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>cf98ce13-f3c4-4c6b-8964-a7a5d17b05c2</name> + <entityField>TASK_PRIORITY</entityField> + </neonTableColumn> + <neonTableColumn> + <name>38ac59d8-ad7e-4e0f-85b8-6cba129ffabf</name> + <entityField>TASK_MATURITY_DATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>7eb5fb76-7e83-4151-9364-28749712c58a</name> + <entityField>TASK_PROGRESS</entityField> + </neonTableColumn> + <neonTableColumn> + <name>2a20110d-0b42-4f47-9361-2256c5c5aad5</name> + <entityField>TASK_DESCRIPTION</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + <treeTableViewTemplate> + <name>TicketsTreeTable</name> + <favoriteActionGroup1>tableActions</favoriteActionGroup1> + <defaultGroupFields> + <element>TYPE</element> + </defaultGroupFields> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>34e2d188-bf3e-4049-9094-2c68a2552fc9</name> + <entityField>TASK_PRIORITY_ICON</entityField> + </neonTableColumn> + <neonTableColumn> + <name>fce7d0f3-b045-4230-9adb-2c11716a1e39</name> + <entityField>TASK_SUBJECT</entityField> + <expandRatio v="100" /> + </neonTableColumn> + <neonTableColumn> + <name>32562679-18bb-4084-a2f5-eca18e0b91bb</name> + <entityField>TASK_PRIORITY</entityField> + </neonTableColumn> + <neonTableColumn> + <name>1be2b011-6759-4ba9-9ec1-6cc30db7f959</name> + <entityField>TASK_MATURITY_DATE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>33319779-919b-4672-aa0a-0e94f0d8c640</name> + <entityField>TASK_STATUS</entityField> + </neonTableColumn> + </columns> + </treeTableViewTemplate> + </children> +</neonView> diff --git a/neonView/TicketMain_view/TicketMain_view.aod b/neonView/TicketMain_view/TicketMain_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..680fad48fab63e9a2e04b9fa8b96e589a38fb95f --- /dev/null +++ b/neonView/TicketMain_view/TicketMain_view.aod @@ -0,0 +1,48 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>TicketMain_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <masterSlaveLayout> + <name>layout</name> + <master>bfecc398-890e-485f-afa0-74e24f41b019</master> + </masterSlaveLayout> + </layout> + <children> + <genericViewTemplate> + <name>details</name> + <showDrawer v="true" /> + <drawerCaption></drawerCaption> + <fixedDrawer v="true" /> + <hideLabels v="false" /> + <entityField>#ENTITY</entityField> + <title>details</title> + <fields> + <entityFieldLink> + <name>3f746e73-b8cd-4d08-b352-a2307e080410</name> + <entityField>TASK_DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + <neonViewReference> + <name>6846f680-84ef-46da-a0ea-6797044cf693</name> + <entityField>Documents</entityField> + <view>DocumentFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>ffa776bd-013c-4d4d-aedd-490625ef0fe1</name> + <entityField>LogHistories</entityField> + <view>LogHistoryFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>bfecc398-890e-485f-afa0-74e24f41b019</name> + <entityField>#ENTITY</entityField> + <view>TicketPreview_view</view> + </neonViewReference> + <neonViewReference> + <name>f45ff4cb-e469-46ee-808f-8c406eccbcd2</name> + <entityField>Attributes</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/TicketPreview_view/TicketPreview_view.aod b/neonView/TicketPreview_view/TicketPreview_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..b60429fe488a50a3d27f93543198053216548e70 --- /dev/null +++ b/neonView/TicketPreview_view/TicketPreview_view.aod @@ -0,0 +1,79 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>TicketPreview_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <headerFooterLayout> + <name>layout</name> + <header>Header</header> + </headerFooterLayout> + </layout> + <children> + <cardViewTemplate> + <name>Header</name> + <iconField>TASK_PRIORITY_ICON</iconField> + <titleField>TASK_SUBJECT</titleField> + <subtitleField>CODE</subtitleField> + <favoriteAction1>newActivity</favoriteAction1> + <entityField>#ENTITY</entityField> + </cardViewTemplate> + <genericViewTemplate> + <name>Info</name> + <showDrawer v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>afbb79a4-418f-44ba-892d-c41843e57416</name> + <entityField>TASK_STATUS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>ffdd1606-4d33-4580-84bd-42b411d15168</name> + <entityField>TASK_START_DATE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>d419374d-e56b-40ce-9ded-e6214c8572f0</name> + <entityField>TASK_MATURITY_DATE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>f3d37da9-9104-4dff-9796-24ca81e26976</name> + <entityField>TASK_PROGRESS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>f3d555e1-94f0-46d1-8d2e-0863c32f236c</name> + <entityField>TASK_PRIORITY</entityField> + </entityFieldLink> + <entityFieldLink> + <name>1f8a7860-d0f7-4f86-af23-382d82c062c2</name> + <entityField>TASK_REQUESTOR_CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>9e2ef777-209c-4ad7-91e7-8422896ebc08</name> + <entityField>TASK_EDITOR_CONTACT_ID</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + <neonViewReference> + <name>0ad1cd97-a128-4b10-87f8-434fc72723bd</name> + <entityField>Links</entityField> + <view>TaskLinkPreviewList_view</view> + </neonViewReference> + <neonViewReference> + <name>b3f080e0-a1fb-42bd-ac4a-3788fb077b9c</name> + <entityField>MainDocuments</entityField> + <view>DocumentList_view</view> + </neonViewReference> + <genericViewTemplate> + <name>Description</name> + <showDrawer v="true" /> + <drawerCaption>Description</drawerCaption> + <hideLabels v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>4b4997bf-fb16-4669-9b47-7cbd279159c6</name> + <entityField>TASK_DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index 174dfc5ff20cada09eeae3c7f92fa5802f1907cc..69402dc76a471f0879cf7ed1995823c58bb602e4 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -102,18 +102,6 @@ TaskUtils.hasTasks = function(pRowId, pObjectType) return true; } -/** - * Sets the code of the given Task to the current max-code + 1 - */ -TaskUtils.setCode = function(pTaskId) -{ - var max = db.cell("select max(CODE) from TASK"); - if (!max) - max = -1; - - db.updateData("TASK", ["CODE"], null, [parseInt(max)+1], SqlCondition.equals("TASK.TASKID", pTaskId, "1=2")); -} - TaskUtils.getTypeGroup = function(pType) { return KeywordUtils.getAttributeRelation(pType, $KeywordRegistry.taskType(), "group", "Task"); diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index 276c521b0f52d3de505491a4868c559016d27c28..ba206cf6ba91abafba3a5b01695f068f097d9fc2 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -47,8 +47,8 @@ $KeywordRegistry.taskStatus$waiting = function(){return "00595a73-22e2-4c3b-a21c $KeywordRegistry.taskStatus$ended = function(){return "7c9d6681-6cf5-4395-b276-3941b6fd0d57";}; $KeywordRegistry.taskType = function(){return "TaskType";}; -$KeywordRegistry.taskType$Task = function(){return "4dee8727-8299-422e-ae41-6cdf9de2dfd7";}; -$KeywordRegistry.taskType$bugTicket = function(){return "f3da0edd-49d9-4061-98c1-8fda8631be7e";}; +$KeywordRegistry.taskType$task = function(){return "4dee8727-8299-422e-ae41-6cdf9de2dfd7";}; +$KeywordRegistry.taskType$ticket = function(){return "f3da0edd-49d9-4061-98c1-8fda8631be7e";}; $KeywordRegistry.taskType$supportTicket = function(){return "7bf77721-470f-4cdf-a6af-452bf05a405b";}; $KeywordRegistry.productPricelist = function(){return "ProductPricelist";}; diff --git a/process/Util_lib/process.js b/process/Util_lib/process.js index 7120f0e2ee9bc23d8fdc9b3de06c0680f1f923ab..d72ca6cdbaade78eb6424b3fcfda4bf0450def5d 100644 --- a/process/Util_lib/process.js +++ b/process/Util_lib/process.js @@ -1,3 +1,4 @@ +import("Sql_lib"); import("system.neon"); import("system.project"); import("system.process"); @@ -495,6 +496,9 @@ NumberSequencingUtils.getMaxUniqueNumber = function(pColumn, pTable, pCondition) /** * functions for trees + * Do not create an instance of this! + * + * @class */ function TreeUtils () {} @@ -566,4 +570,23 @@ TreeUtils.treeOrderBy = function(pData, pLayerIndex, pOrderByIndexes) return 0; }) +} + +/** + * functions for numbered codes + * Do not create an instance of this! + * + * @class + */ +function CodeUtils () {} +/** + * Sets the code of the given Table to the current max-code + 1 + */ +CodeUtils.setCode = function(pId, pTable, pIdCol, pCodeCol) +{ + var max = db.cell("select max(" + pCodeCol + ") from " + pTable); + if (!max) + max = -1; + + db.updateData(pTable, [pCodeCol], null, [parseInt(max)+1], SqlCondition.equals(pTable + "." + pIdCol, pId, "1=2")); } \ No newline at end of file