From 0ed2f8cdc55ec92c0a9dbaf7170ad319e02db8b9 Mon Sep 17 00:00:00 2001 From: Vinzent Broens <v.broens@adito.de> Date: Fri, 1 Oct 2021 11:46:05 +0000 Subject: [PATCH] Service 2001021 bugfixing2 --- .../AttributeFilter_entity.aod | 2 +- .../InboxFilter_entity/InboxFilter_entity.aod | 2 +- .../SupportTicketTemplate_entity.aod | 15 ++++++++--- .../entityfields/active_icon/colorProcess.js | 25 +++++++++++-------- .../displayValueProcess.js | 10 -------- .../documenttemplate_id/stateProcess.js | 13 ++++++++++ .../entityfields/templateno/onValidation.js | 17 +++++++++++++ .../entityfields/templateno/valueProcess.js | 7 ++---- .../expression.js | 6 +++++ .../SupportTicket_entity.aod | 5 ---- .../openadminview/onActionProcess.js | 1 - .../entityfields/task_status/titleProcess.js | 15 ----------- .../recordcontainers/db/onDBUpdate.js | 1 + .../task_status.displayvalue/expression.js | 2 -- .../_____LANGUAGE_EXTRA.aod | 6 +++++ .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 13 ++++++++++ .../_____LANGUAGE_en/_____LANGUAGE_en.aod | 6 +++++ .../SupportTicketTemplateEdit_view.aod | 2 +- process/KeywordRegistry_basic/process.js | 2 ++ process/TicketTemplate_lib/process.js | 1 + 20 files changed, 95 insertions(+), 56 deletions(-) delete mode 100644 entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/displayValueProcess.js create mode 100644 entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/stateProcess.js create mode 100644 entity/SupportTicketTemplate_entity/entityfields/templateno/onValidation.js create mode 100644 entity/SupportTicketTemplate_entity/recordcontainers/db/recordfieldmappings/documenttemplate_id.displayvalue/expression.js delete mode 100644 entity/SupportTicket_entity/entityfields/task_status/titleProcess.js delete mode 100644 entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_status.displayvalue/expression.js diff --git a/entity/AttributeFilter_entity/AttributeFilter_entity.aod b/entity/AttributeFilter_entity/AttributeFilter_entity.aod index d23d907b6e..365718d1c4 100644 --- a/entity/AttributeFilter_entity/AttributeFilter_entity.aod +++ b/entity/AttributeFilter_entity/AttributeFilter_entity.aod @@ -21,7 +21,7 @@ </entityField> <entityField> <name>COMPONENT</name> - <title>Component</title> + <title>Search component</title> <consumer>KeywordComponent</consumer> <mandatory v="true" /> <valueProcess>%aditoprj%/entity/AttributeFilter_entity/entityfields/component/valueProcess.js</valueProcess> diff --git a/entity/InboxFilter_entity/InboxFilter_entity.aod b/entity/InboxFilter_entity/InboxFilter_entity.aod index 5f4616f78a..cdd385f811 100644 --- a/entity/InboxFilter_entity/InboxFilter_entity.aod +++ b/entity/InboxFilter_entity/InboxFilter_entity.aod @@ -20,7 +20,7 @@ </entityField> <entityField> <name>COMPONENT</name> - <title>Component</title> + <title>Search component</title> <consumer>KeywordComponent</consumer> <displayValueProcess>%aditoprj%/entity/InboxFilter_entity/entityfields/component/displayValueProcess.js</displayValueProcess> </entityField> diff --git a/entity/SupportTicketTemplate_entity/SupportTicketTemplate_entity.aod b/entity/SupportTicketTemplate_entity/SupportTicketTemplate_entity.aod index 3be511ca9e..55224bb6ed 100644 --- a/entity/SupportTicketTemplate_entity/SupportTicketTemplate_entity.aod +++ b/entity/SupportTicketTemplate_entity/SupportTicketTemplate_entity.aod @@ -92,11 +92,12 @@ <name>TEMPLATENO</name> <title>Template No.</title> <contentType>NUMBER</contentType> - <maxValue v="999" /> - <minValue v="1" /> + <outputFormat>000</outputFormat> + <inputFormat>000</inputFormat> <mandatory v="true" /> - <state>READONLY</state> + <state>AUTO</state> <valueProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/templateno/valueProcess.js</valueProcess> + <onValidation>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/templateno/onValidation.js</onValidation> </entityField> <entityField> <name>PRIORITY</name> @@ -230,14 +231,16 @@ <title>Individual Answer</title> <contentType>BOOLEAN</contentType> <groupable v="true" /> + <state>AUTO</state> </entityField> <entityField> <name>DOCUMENTTEMPLATE_ID</name> <title>Individual Reply Template</title> <consumer>ReplyDocumentTemplates</consumer> <mandatoryProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/mandatoryProcess.js</mandatoryProcess> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/stateProcess.js</stateProcess> <titleProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/titleProcess.js</titleProcess> - <displayValueProcess>%aditoprj%/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/displayValueProcess.js</displayValueProcess> </entityField> <entityConsumer> <name>ReplyDocumentTemplates</name> @@ -360,6 +363,10 @@ <recordfield>TICKETTEMPLATE.DOCUMENTTEMPLATE_ID</recordfield> <isFilterable v="false" /> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DOCUMENTTEMPLATE_ID.displayValue</name> + <expression>%aditoprj%/entity/SupportTicketTemplate_entity/recordcontainers/db/recordfieldmappings/documenttemplate_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/SupportTicketTemplate_entity/entityfields/active_icon/colorProcess.js b/entity/SupportTicketTemplate_entity/entityfields/active_icon/colorProcess.js index 9f6b4ca223..63d07d348c 100644 --- a/entity/SupportTicketTemplate_entity/entityfields/active_icon/colorProcess.js +++ b/entity/SupportTicketTemplate_entity/entityfields/active_icon/colorProcess.js @@ -2,16 +2,19 @@ import("system.neon"); import("system.result"); import("system.vars"); -var str_pmtType = vars.get( "$field.ACTIVE"); -var str_ret = ""; -switch( str_pmtType) +if (vars.get( "$field.ACTIVE")) { - case "0": - str_ret = neon.PRIORITY_HIGH_COLOR; - break; - case "1": - str_ret = neon.PRIORITY_LOW_COLOR; - break; + switch( vars.get( "$field.ACTIVE")) + { + case "0": + result.string(neon.PRIORITY_HIGH_COLOR); + break; + case "1": + result.string(neon.PRIORITY_LOW_COLOR); + break; + } +} +else +{ + result.string(neon.PRIORITY_NONE_COLOR); } - -result.string( str_ret); diff --git a/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/displayValueProcess.js b/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/displayValueProcess.js deleted file mode 100644 index 2f5bed9490..0000000000 --- a/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/displayValueProcess.js +++ /dev/null @@ -1,10 +0,0 @@ -import("Sql_lib"); -import("system.vars"); -import("system.result"); - - -var sql = newSelect("DOCUMENTTEMPLATE.NAME") - .from("DOCUMENTTEMPLATE") - .where("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID",vars.get("$field.DOCUMENTTEMPLATE_ID")) - .cell(); -result.string(sql.tostring); \ No newline at end of file diff --git a/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/stateProcess.js b/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/stateProcess.js new file mode 100644 index 0000000000..9eb72a64e4 --- /dev/null +++ b/entity/SupportTicketTemplate_entity/entityfields/documenttemplate_id/stateProcess.js @@ -0,0 +1,13 @@ +import("Util_lib"); +import("system.vars"); +import("system.neon"); +import("system.result"); + +if(Utils.toBoolean(vars.get("$field.INDIVIDUAL_ANSWER"))) +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} +else +{ + result.string(neon.COMPONENTSTATE_INVISIBLE); +} diff --git a/entity/SupportTicketTemplate_entity/entityfields/templateno/onValidation.js b/entity/SupportTicketTemplate_entity/entityfields/templateno/onValidation.js new file mode 100644 index 0000000000..1f76109237 --- /dev/null +++ b/entity/SupportTicketTemplate_entity/entityfields/templateno/onValidation.js @@ -0,0 +1,17 @@ +import("system.neon"); +import("system.translate"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var sql = new SqlBuilder() + .selectCount("TEMPLATENO") + .from("TICKETTEMPLATE") + .where("TICKETTEMPLATE.TEMPLATENO", vars.get("$field.TEMPLATENO")) + .andIfSet("TICKETTEMPLATE.TICKETTEMPLATEID", vars.get("$field.TEMPLATE_ID"),SqlBuilder.NOT_EQUAL()) + .cell(); + +if (sql > 0) +{ + result.string(translate.text("Number has to be unique") + "."); +} \ No newline at end of file diff --git a/entity/SupportTicketTemplate_entity/entityfields/templateno/valueProcess.js b/entity/SupportTicketTemplate_entity/entityfields/templateno/valueProcess.js index b2ecc35230..72cfe326b3 100644 --- a/entity/SupportTicketTemplate_entity/entityfields/templateno/valueProcess.js +++ b/entity/SupportTicketTemplate_entity/entityfields/templateno/valueProcess.js @@ -1,13 +1,10 @@ import("Util_lib"); import("system.neon"); -import("system.eMath"); import("system.result"); -import("system.db"); import("system.vars"); -var str_templateNo = vars.get( "$field.TEMPLATENO"); -if( !str_templateNo && [neon.OPERATINGSTATE_NEW, neon.OPERATINGSTATE_EDIT].includes( vars.get( "$sys.recordstate"))) +if(!vars.get("$this.value") && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { - result.string(NumberSequencingUtils.getNextUniqueNumber("TEMPLATENO", "TICKETTEMPLATE")); + result.string(NumberSequencingUtils.getNextUniqueNumber("TEMPLATENO", "TICKETTEMPLATE",0)); } \ No newline at end of file diff --git a/entity/SupportTicketTemplate_entity/recordcontainers/db/recordfieldmappings/documenttemplate_id.displayvalue/expression.js b/entity/SupportTicketTemplate_entity/recordcontainers/db/recordfieldmappings/documenttemplate_id.displayvalue/expression.js new file mode 100644 index 0000000000..993f0f5ff4 --- /dev/null +++ b/entity/SupportTicketTemplate_entity/recordcontainers/db/recordfieldmappings/documenttemplate_id.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("Sql_lib"); +import("system.result"); + +result.string(newSelect("NAME") +.from("DOCUMENTTEMPLATE") +.where("DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID = TICKETTEMPLATE.DOCUMENTTEMPLATE_ID").toString()); \ No newline at end of file diff --git a/entity/SupportTicket_entity/SupportTicket_entity.aod b/entity/SupportTicket_entity/SupportTicket_entity.aod index 2a2933e684..d997c1e836 100644 --- a/entity/SupportTicket_entity/SupportTicket_entity.aod +++ b/entity/SupportTicket_entity/SupportTicket_entity.aod @@ -41,7 +41,6 @@ <groupable v="true" /> <mandatory v="true" /> <stateProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/task_status/stateProcess.js</stateProcess> - <titleProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/task_status/titleProcess.js</titleProcess> <valueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/task_status/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/task_status/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/SupportTicket_entity/entityfields/task_status/onValueChange.js</onValueChange> @@ -1025,10 +1024,6 @@ <name>TASK_PROGRESS.displayValue</name> <expression>%aditoprj%/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_progress.displayvalue/expression.js</expression> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>TASK_STATUS.displayValue</name> - <expression>%aditoprj%/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_status.displayvalue/expression.js</expression> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>TASK_TYPE.value</name> <recordfield>TASK.KIND</recordfield> diff --git a/entity/SupportTicket_entity/entityfields/openadminview/onActionProcess.js b/entity/SupportTicket_entity/entityfields/openadminview/onActionProcess.js index a7200fa506..0ae33907cd 100644 --- a/entity/SupportTicket_entity/entityfields/openadminview/onActionProcess.js +++ b/entity/SupportTicket_entity/entityfields/openadminview/onActionProcess.js @@ -4,7 +4,6 @@ import("Context_lib"); AdminViewUtils.open("TICKETID", [ ["TASK_ID", vars.get("$field.TASK_ID")], ["TASK_REQUESTOR_CONTACT_ID", vars.get("$field.TASK_REQUESTOR_CONTACT_ID")], - ["TASK_PARENT_ID", vars.get("$field.TASK_PARENT_ID")], ["TICKET_EDITOR_CONTACT_ID", vars.get("$field.TICKET_EDITOR_CONTACT_ID")], ["MAILSIGNATURE_ID", vars.get("$field.MAILSIGNATURE_ID")], ["INBOX_ID", vars.get("$field.INBOX_ID")], diff --git a/entity/SupportTicket_entity/entityfields/task_status/titleProcess.js b/entity/SupportTicket_entity/entityfields/task_status/titleProcess.js deleted file mode 100644 index bcde88cc19..0000000000 --- a/entity/SupportTicket_entity/entityfields/task_status/titleProcess.js +++ /dev/null @@ -1,15 +0,0 @@ -import("system.translate"); -import("system.vars"); -import("system.neon"); -import("system.result"); - -// FOR CHANGE STATUS ACTION - -var actionName = vars.get("$param.ActionName_param"); -if( (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) && actionName ) -{ - if(actionName == "changeStatusAfterForwardEmail") - { - result.string(translate.text("Select new status")); - } -} \ No newline at end of file diff --git a/entity/SupportTicket_entity/recordcontainers/db/onDBUpdate.js b/entity/SupportTicket_entity/recordcontainers/db/onDBUpdate.js index b80e95042c..58ba8d1829 100644 --- a/entity/SupportTicket_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/SupportTicket_entity/recordcontainers/db/onDBUpdate.js @@ -1,3 +1,4 @@ +import("Context_lib"); import("ActivityTask_lib"); import("system.datetime"); import("system.tools"); diff --git a/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_status.displayvalue/expression.js b/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_status.displayvalue/expression.js deleted file mode 100644 index 2ff9626978..0000000000 --- a/entity/SupportTicket_entity/recordcontainers/db/recordfieldmappings/task_status.displayvalue/expression.js +++ /dev/null @@ -1,2 +0,0 @@ -// do not use this, because TaskUtils.getTypeStatusKeyword(vars.get("$field.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/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index c0dec5cc10..22b7b76079 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -11003,6 +11003,12 @@ <entry> <key>Inbox \"%0\" has been deleted.</key> </entry> + <entry> + <key>Employee group already selected</key> + </entry> + <entry> + <key>Show my finished Tickets in the last 4 weeks</key> + </entry> <entry> <key>Move</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index e87c99efc3..148dda55e0 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -27,6 +27,7 @@ </entry> <entry> <key>Original editor</key> + <value>Originaler Bearbeiter</value> </entry> <entry> <key>Single (Service/External)</key> @@ -9145,6 +9146,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Returned by</key> + <value>Zurückgegeben durch</value> </entry> <entry> <key>My workflow tasks</key> @@ -11837,6 +11839,10 @@ Bitte Datumseingabe prüfen</value> <key>Workshop for project-realization planned</key> <value>Workshop für Projektumsetzung geplannt</value> </entry> + <entry> + <key>Show my finished Tickets in the last 4 weeks</key> + <value>Meine abgeschlossenen Tickets der letzten 4 Tage anzeigen</value> + </entry> <entry> <key>Ticket created through duplication by</key> <value>Ticket durch Duplizierung erstellt. Anwender</value> @@ -13209,6 +13215,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Ticket returned to pool</key> + <value>Ticket zurück in den Pool gegeben</value> </entry> <entry> <key>Contigent exhausted, please buy some new one to continue</key> @@ -14163,6 +14170,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Pull next ticket or create new ones</key> + <value></value> </entry> <entry> <key>Abgeschlossen</key> @@ -14187,6 +14195,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Ticket returned</key> + <value>Ticket zurückgegeben</value> </entry> <entry> <key>Ticket filter</key> @@ -14196,6 +14205,7 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>Pull Ticket</key> + <value>Ticket ziehen</value> </entry> <entry> <key>Service-Admin</key> @@ -14452,6 +14462,9 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Do you really want to resynchronize the user completely?\nThe data in ADITO will be deleted.\nThe outlook contacts must be cleared manually.</key> </entry> + <entry> + <key>Employee group already selected.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index ec3bdcc2ff..b9ef429fe9 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -11093,6 +11093,12 @@ <entry> <key>Inbox \"%0\" has been deleted.</key> </entry> + <entry> + <key>Employee group already selected</key> + </entry> + <entry> + <key>Show my finished Tickets in the last 4 weeks</key> + </entry> <entry> <key>Move</key> </entry> diff --git a/neonView/SupportTicketTemplateEdit_view/SupportTicketTemplateEdit_view.aod b/neonView/SupportTicketTemplateEdit_view/SupportTicketTemplateEdit_view.aod index cbf558764d..56392a16b7 100644 --- a/neonView/SupportTicketTemplateEdit_view/SupportTicketTemplateEdit_view.aod +++ b/neonView/SupportTicketTemplateEdit_view/SupportTicketTemplateEdit_view.aod @@ -21,7 +21,7 @@ <entityField>NAME</entityField> </entityFieldLink> <entityFieldLink> - <name>e6f7252c-371d-46df-87eb-2254ea6aa6aa</name> + <name>9cffec22-cf83-4e72-9602-b5bce02def48</name> <entityField>TEMPLATENO</entityField> </entityFieldLink> <entityFieldLink> diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index cc85d170a7..429ad73d64 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -407,6 +407,8 @@ $KeywordRegistry.employeeGroupStatus = function(){return "EmployeeGroupStatus";} $KeywordRegistry.employeeGroupStatus$active = function(){return "ACTIVE";}; $KeywordRegistry.employeeGroupStatus$inactive = function(){return "INACTIVE";}; +$KeywordRegistry.ticketTemplateIndivAnswer$active = function(){return "1";} +$KeywordRegistry.ticketTemplateIndivAnswer$inactive = function(){return "0";} $KeywordRegistry.ticketCategory = function(){return "TicketCategory";} $KeywordRegistry.ticketCategory$undefined = function(){return "UNDEFINED";} $KeywordRegistry.ticketCategory$all = function(){return "ALL";} diff --git a/process/TicketTemplate_lib/process.js b/process/TicketTemplate_lib/process.js index 6d1a536b74..0fb6c6aedb 100644 --- a/process/TicketTemplate_lib/process.js +++ b/process/TicketTemplate_lib/process.js @@ -115,6 +115,7 @@ TicketTemplateUtils.checkIndividualAnswer = function (pTemplateId) .from("TICKETTEMPLATE") .join("DOCUMENTTEMPLATE","TICKETTEMPLATE.DOCUMENTTEMPLATE_ID = DOCUMENTTEMPLATE.DOCUMENTTEMPLATEID") .whereIfSet("TICKETTEMPLATE.TICKETTEMPLATEID",pTemplateId) + .and("TICKETTEMPLATE.INDIVIDUAL_ANSWER", $KeywordRegistry.ticketTemplateIndivAnswer$active()) .cell() return sql; } \ No newline at end of file -- GitLab