From 63e4c43268b9eb494da7dcf2530e5e3253cb2c2d Mon Sep 17 00:00:00 2001 From: reneeb Date: Wed, 26 Jan 2022 12:26:10 +0100 Subject: [PATCH 1/2] Show parameters of transition actions One can do several actions during a transition in the process management. For each action a TransitionAction module exists and those actions need various parameters. As it is hard to remember all the parameters, those parameters should be shown in the dialog when an action module is selected. This commit implements this behaviour. Nevertheless, the reference that is shown under the parameter list could be nicer. But I'm not a CSS ninja ;-) --- Kernel/Config/Files/XML/ProcessManagement.xml | 11 ++ .../AdminProcessManagementTransitionAction.pm | 48 ++++++ .../TransitionAction/DynamicFieldSet.pm | 29 ++++ .../TransitionAction/TicketArticleCreate.pm | 77 +++++++++ .../TransitionAction/TicketCreate.pm | 156 ++++++++++++++++++ .../TransitionAction/TicketCustomerSet.pm | 33 ++++ .../TransitionAction/TicketLockSet.pm | 29 ++++ .../TransitionAction/TicketOwnerSet.pm | 29 ++++ .../TransitionAction/TicketQueueSet.pm | 29 ++++ .../TransitionAction/TicketResponsibleSet.pm | 29 ++++ .../TransitionAction/TicketSLASet.pm | 29 ++++ .../TransitionAction/TicketServiceSet.pm | 29 ++++ .../TransitionAction/TicketStateSet.pm | 29 ++++ .../TransitionAction/TicketTitleSet.pm | 29 ++++ .../TransitionAction/TicketTypeSet.pm | 29 ++++ ...ssManagement.TransitionActionParameters.js | 108 ++++++++++++ 16 files changed, 723 insertions(+) create mode 100644 var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js diff --git a/Kernel/Config/Files/XML/ProcessManagement.xml b/Kernel/Config/Files/XML/ProcessManagement.xml index 5755d50875..99b11c647e 100644 --- a/Kernel/Config/Files/XML/ProcessManagement.xml +++ b/Kernel/Config/Files/XML/ProcessManagement.xml @@ -240,6 +240,7 @@ Core.Agent.Admin.ProcessManagement.js + Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js @@ -646,4 +647,14 @@ + + + Show optional parameters in parameter list, too. If disabled, the optional parameters are only shown + in an extra table + + Frontend::Admin::View::AdminProcessManagement + + 1 + + diff --git a/Kernel/Modules/AdminProcessManagementTransitionAction.pm b/Kernel/Modules/AdminProcessManagementTransitionAction.pm index e74e34f7c9..7c5e441818 100644 --- a/Kernel/Modules/AdminProcessManagementTransitionAction.pm +++ b/Kernel/Modules/AdminProcessManagementTransitionAction.pm @@ -57,6 +57,8 @@ sub Run { my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout'); my $EntityObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::DB::Entity'); my $TransitionActionObject = $Kernel::OM->Get('Kernel::System::ProcessManagement::DB::TransitionAction'); + my $MainObject = $Kernel::OM->Get('Kernel::System::Main'); + my $ConfigObject = $Kernel::OM->Get('Kernel::Config'); # ------------------------------------------------------------ # # TransitionActionNew @@ -429,6 +431,52 @@ sub Run { ); } + # ------------------------------------------------------------ # + # Get parameters of transition action module + # ------------------------------------------------------------ # + elsif ( $Self->{Subaction} eq 'ActionParams' ) { + my $TransAction = $ParamObject->GetParam( Param => 'TransitionAction' ); + my $ModuleOrig = ( split /::/, $TransAction // '' )[-1]; + my $Module = $ModuleOrig =~ s{[^A-Za-z1-2]}{}gr; + my $Class = sprintf "Kernel::System::ProcessManagement::TransitionAction::%s", + $Module || 'ThisModuleLikelyDoesntExistInThisInstallation'; + + my $ClassExists = $MainObject->Require( + $Class, + Silent => 1, + ); + + my @ModuleParams; + + if ( $Module && $Module eq $ModuleOrig && $ClassExists ) { + my $Object = $Kernel::OM->Get($Class); + + if ( $Object->can('Params') ) { + @ModuleParams = $Object->Params(); + + for my $Param ( @ModuleParams ) { + $Param{Value} = $LayoutObject->{LanguageObject}->Translate( $Param{Value} ); + } + } + } + + my $Optionals = $ConfigObject->Get('TransitionActionParams::SetOptionalParameters') // ''; + + my $JSON = $LayoutObject->JSONEncode( + Data => { + Params => \@ModuleParams, + NoOptionals => ( $Optionals ? 0 : 1 ), + }, + ); + + return $LayoutObject->Attachment( + ContentType => 'application/json; charset=' . $LayoutObject->{Charset}, + Content => $JSON, + Type => 'inline', + NoCache => 1, + ); + } + # ------------------------------------------------------------ # # Error # ------------------------------------------------------------ # diff --git a/Kernel/System/ProcessManagement/TransitionAction/DynamicFieldSet.pm b/Kernel/System/ProcessManagement/TransitionAction/DynamicFieldSet.pm index a742f0ba21..0df00de279 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/DynamicFieldSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/DynamicFieldSet.pm @@ -58,6 +58,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Fieldname (replace with the real fieldname)', + Value => 'New value (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketArticleCreate.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketArticleCreate.pm index 9da3e35ddc..6cdc8468c9 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketArticleCreate.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketArticleCreate.pm @@ -62,6 +62,83 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'CommunicationChannel', + Value => 'Email|Phone|Internal (required)', + }, + { + Key => 'From', + Value => 'agent@example.tld', + Optional => 1, + }, + { + Key => 'To', + Value => 'customer@example.tld', + Optional => 1, + }, + { + Key => 'Subject', + Value => 'A subject (required)', + }, + { + Key => 'Body', + Value => 'A text for the article (required)', + }, + { + Key => 'ContentType', + Value => 'text/html; charset=utf-8 (required)', + }, + { + Key => 'IsVisibleForCustomer', + Value => '0|1 (required)', + }, + { + Key => 'DynamicField_ (replace )', + Value => 'A value', + Optional => 1, + }, + { + Key => 'HistoryType', + Value => 'EmailCustomer|AddNote|WebRequestCustomer|... (required)', + }, + { + Key => 'HistoryComment', + Value => 'Article created (required)', + }, + { + Key => 'SenderType', + Value => 'agent|customer|system (required)', + }, + { + Key => 'UnlockOnAway', + Value => '0|1', + Optional => 1, + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketCreate.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketCreate.pm index 81daedd9db..dedc247a23 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketCreate.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketCreate.pm @@ -65,6 +65,162 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Title', + Value => 'A title (required)', + }, + { + Key => 'CommunicationChannel', + Value => 'Email|Phone|Internal (required)', + }, + { + Key => 'From', + Value => 'agent@example.tld', + Optional => 1, + }, + { + Key => 'To', + Value => 'customer@example.tld', + Optional => 1, + }, + { + Key => 'Subject', + Value => 'A subject (required)', + }, + { + Key => 'Body', + Value => 'A text for the article (required)', + }, + { + Key => 'ContentType', + Value => 'text/html; charset=utf-8 (required)', + }, + { + Key => 'CustomerID', + Value => '12345', + Optional => 1, + }, + { + Key => 'CustomerUser', + Value => 'customer@example.tld', + Optional => 1, + }, + { + Key => 'IsVisibleForCustomer', + Value => '0|1 (required)', + }, + { + Key => 'DynamicField_ (replace )', + Value => 'A value', + Optional => 1, + }, + { + Key => 'Attachments', + Value => '...', + Optional => 1, + }, + { + Key => 'State', + Value => 'open (required)', + }, + { + Key => 'Lock', + Value => 'lock|unlock (required)', + }, + { + Key => 'Owner', + Value => 'ownerlogin (required)', + }, + { + Key => 'Priority', + Value => '3 normal (required)', + }, + { + Key => 'Queue', + Value => 'Misc (required)', + }, + { + Key => 'Type', + Value => 'A type', + Optional => 1, + }, + { + Key => 'Service', + Value => 'ServiceName', + Optional => 1, + }, + { + Key => 'SLA', + Value => 'SLA-Name', + Optional => 1, + }, + { + Key => 'Responsible', + Value => 'responsiblelogin', + Optional => 1, + }, + { + Key => 'TimeUnit', + Value => 'responsiblelogin', + Optional => 1, + }, + { + Key => 'HistoryType', + Value => 'EmailCustomer|AddNote|WebRequestCustomer|... (required)', + }, + { + Key => 'HistoryComment', + Value => 'Article created (required)', + }, + { + Key => 'SenderType', + Value => 'agent|customer|system (required)', + }, + { + Key => 'PendingTime', + Value => '2022-19-21 14:25:00', + Optional => 1, + }, + { + Key => 'PendingTimeDiff', + Value => 'diff in minutes', + Optional => 1, + }, + { + Key => 'LinkAs', + Value => 'Normal|Parent|Child|...', + Optional => 1, + }, + { + Key => 'ArchiveFlag', + Value => 'y|n', + Optional => 1, + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketCustomerSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketCustomerSet.pm index b5cb733166..6c2bb4baea 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketCustomerSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketCustomerSet.pm @@ -57,6 +57,39 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'CustomerID', + Value => '1234 (required - or CustomerUserID)', + }, + { + Key => 'CustomerUserID', + Value => 'a_customer (required - or CustomerID)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketLockSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketLockSet.pm index d77a7c1105..c8e67202a4 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketLockSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketLockSet.pm @@ -57,6 +57,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Lock', + Value => 'lock|unlock (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketOwnerSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketOwnerSet.pm index 8adc81e06a..b7896f792a 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketOwnerSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketOwnerSet.pm @@ -57,6 +57,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Owner', + Value => 'a_user_login (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketQueueSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketQueueSet.pm index 7bf484a034..9826629723 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketQueueSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketQueueSet.pm @@ -57,6 +57,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Queue', + Value => 'A::Queue::Name (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketResponsibleSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketResponsibleSet.pm index f51d3f96f2..9f5b208cda 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketResponsibleSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketResponsibleSet.pm @@ -58,6 +58,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Responsible', + Value => 'a_user_login (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketSLASet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketSLASet.pm index 971683661c..f414da07ea 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketSLASet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketSLASet.pm @@ -58,6 +58,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'SLA', + Value => 'SLA-Name (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketServiceSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketServiceSet.pm index f26c22f05d..1f635cddae 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketServiceSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketServiceSet.pm @@ -59,6 +59,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Service', + Value => 'ServiceName (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketStateSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketStateSet.pm index 96364908a8..bfe00c53fc 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketStateSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketStateSet.pm @@ -59,6 +59,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'State', + Value => 'a state name (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketTitleSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketTitleSet.pm index 139024b726..74b497eb41 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketTitleSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketTitleSet.pm @@ -57,6 +57,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Title', + Value => 'A new title (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/Kernel/System/ProcessManagement/TransitionAction/TicketTypeSet.pm b/Kernel/System/ProcessManagement/TransitionAction/TicketTypeSet.pm index 7392c6ad83..d21acc4d3b 100644 --- a/Kernel/System/ProcessManagement/TransitionAction/TicketTypeSet.pm +++ b/Kernel/System/ProcessManagement/TransitionAction/TicketTypeSet.pm @@ -58,6 +58,35 @@ sub new { return $Self; } +=head2 Params() + +Returns the configuration params for this transition action module + + my @Params = $Object->Params(); + +Each element is a hashreference that describes the config parameter. +Currently only the keys I, I and I are used. + +=cut + +sub Params { + my ($Self) = @_; + + my @Params = ( + { + Key => 'Type', + Value => 'A new type (required)', + }, + { + Key => 'UserID', + Value => '1 (can overwrite the logged in user)', + Optional => 1, + }, + ); + + return @Params; +} + =head2 Run() Run Data diff --git a/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js b/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js new file mode 100644 index 0000000000..e5a6012256 --- /dev/null +++ b/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js @@ -0,0 +1,108 @@ +// -- +// Copyright (C) 2021 Perl-Services.de, https://perl-services.de +// -- +// This software comes with ABSOLUTELY NO WARRANTY. For details, see +// the enclosed file COPYING for license information (GPL). If you +// did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt. +// -- + +"use strict"; + +var Core = Core || {}; + +Core.Agent = Core.Agent || {}; +Core.Agent.Admin = Core.Agent.Admin || {}; +Core.Agent.Admin.ProcessManagement = Core.Agent.Admin.ProcessManagement || {}; + +Core.Agent.Admin.ProcessManagement.TransitionActionParameters = (function (TargetNS) { + function ClearParameters() { + $('#ConfigParams input[name^="ConfigKey"]').each( function ( i, field ) { + let $field = $(field); + if ( $field.attr('id') === "ConfigKey[1]" ) { + return; + } + $field.parent().remove(); + }); + + $('#ConfigKey[1]').val(''); + $('#ConfigValue[1]').val(''); + } + + function SetParameters ( Module ) { + let Data = { + TransitionAction: Module, + Action: 'AdminProcessManagementTransitionAction', + Subaction: 'ActionParams', + }; + + Core.AJAX.FunctionCall( + Core.Config.Get('CGIHandle'), + Data, + function ( Response ) { + var ParameterList = $('
    '); + + $.each( Response.Params, function ( ParamIndex, Param ) { + + ParameterList.append( + $('
  • ').text( Param.Key + ' - ' + Param.Value ) + ); + + if ( Response.NoOptionals && Param.Optional ) { + return; + } + + var ConfigParamHTML; + + if ( ParamIndex != 0 ) { + ConfigParamHTML = $('#ConfigParamContainer').html().replace(/_INDEX_/g, parseInt(ParamIndex) + 1); + } + else { + ConfigParamHTML = $('#ConfigAdd').closest('.WidgetSimple').find('.Content fieldset').last(); + } + + let $ParamElem = $(ConfigParamHTML); + + $ParamElem.find('input[name^="ConfigKey"]').val( Param.Key ); + $ParamElem.find('input[name^="ConfigValue"]').attr( 'placeholder', Param.Value ); + + if ( ParamIndex != 0 ) { + let LastField = $('#ConfigAdd').closest('.WidgetSimple').find('.Content fieldset').last(); + $ParamElem.insertAfter(LastField); + } + }); + + $('#ConfigParams').append( + $('
    ', { id: 'ParameterList' } ) + .append( $('
    ' ) ) + .append( $('

    ').text('All Parameters') ) + .append( ParameterList ) + ); + } + ); + } + + TargetNS.Init = function() { + $('#Module').on('change', function () { + let Module = $('#Module option:selected').val(); + + // check if user has already filled some parameter fields + + + // clear parameters + ClearParameters(); + $('#ParameterList').remove(); + + if ( !Module || Module === '' ) { + return; + } + + // request list of parameters + SetParameters( Module ); + }); + }; + + Core.Init.RegisterNamespace(TargetNS, 'APP_MODULE'); + + return TargetNS; +}(Core.Agent.Admin.ProcessManagement.TransitionActionParameters || {})); + From a4fdf8e178ca3d4c7e7dac3922db696f29e30575 Mon Sep 17 00:00:00 2001 From: reneeb Date: Wed, 26 Jan 2022 12:35:37 +0100 Subject: [PATCH 2/2] update javascript documentation --- ...ssManagement.TransitionActionParameters.js | 47 +++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js b/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js index e5a6012256..15ea2c9628 100644 --- a/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js +++ b/var/httpd/htdocs/js/Core.Agent.Admin.ProcessManagement.TransitionActionParameters.js @@ -1,9 +1,16 @@ // -- -// Copyright (C) 2021 Perl-Services.de, https://perl-services.de +// OTOBO is a web-based ticketing system for service organisations. // -- -// This software comes with ABSOLUTELY NO WARRANTY. For details, see -// the enclosed file COPYING for license information (GPL). If you -// did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt. +// Copyright (C) 2021-2022 Rother OSS GmbH, https://otobo.de +// -- +// This program is free software: you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free Software +// Foundation, either version 3 of the License, or (at your option) any later version. +// This program is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . // -- "use strict"; @@ -14,7 +21,23 @@ Core.Agent = Core.Agent || {}; Core.Agent.Admin = Core.Agent.Admin || {}; Core.Agent.Admin.ProcessManagement = Core.Agent.Admin.ProcessManagement || {}; +/** + * @namespace Core.Agent.Admin.ProcessManagement.TransitionActionParameter + * @memberof Core.Agent.Admin.ProcessManagement + * @author + * @description + * This namespace contains the special module functions for the ProcessManagement module. + */ Core.Agent.Admin.ProcessManagement.TransitionActionParameters = (function (TargetNS) { + + /** + * @private + * @name ClearParameters + * @memberof Core.Agent.Admin.ProcessManagement.TransitionActionParameters + * @function + * @description + * Removes the paremeters in the dalog + */ function ClearParameters() { $('#ConfigParams input[name^="ConfigKey"]').each( function ( i, field ) { let $field = $(field); @@ -28,6 +51,15 @@ Core.Agent.Admin.ProcessManagement.TransitionActionParameters = (function (Targe $('#ConfigValue[1]').val(''); } + /** + * @private + * @name SetParameters + * @memberof Core.Agent.Admin.ProcessManagement.TransitionActionParameters + * @function + * @description + * Retrieves the parameter list from the backend and + * shows the parameters in the dialog + */ function SetParameters ( Module ) { let Data = { TransitionAction: Module, @@ -81,6 +113,13 @@ Core.Agent.Admin.ProcessManagement.TransitionActionParameters = (function (Targe ); } + /** + * @name Init + * @memberof Core.Agent.Admin.ProcessManagement.TransitionActionParameters + * @function + * @description + * This function initializes the module functionality. + */ TargetNS.Init = function() { $('#Module').on('change', function () { let Module = $('#Module option:selected').val();