From 88e42ff8acad7e7c7b7e6b4c053be7a06bf971a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20H=C3=A4rter?= Date: Fri, 23 Feb 2024 09:51:30 +0100 Subject: [PATCH] Issue #3035: Remove field order from pre-filled params. --- Kernel/Modules/AdminDynamicFieldCheckbox.pm | 2 +- Kernel/Modules/AdminDynamicFieldContactWD.pm | 2 +- Kernel/Modules/AdminDynamicFieldDB.pm | 2 +- Kernel/Modules/AdminDynamicFieldDateTime.pm | 2 +- Kernel/Modules/AdminDynamicFieldDropdown.pm | 2 +- Kernel/Modules/AdminDynamicFieldLens.pm | 2 +- Kernel/Modules/AdminDynamicFieldMultiselect.pm | 2 +- Kernel/Modules/AdminDynamicFieldReference.pm | 2 +- Kernel/Modules/AdminDynamicFieldScript.pm | 2 +- Kernel/Modules/AdminDynamicFieldSet.pm | 2 +- Kernel/Modules/AdminDynamicFieldText.pm | 2 +- Kernel/Modules/AdminDynamicFieldTitle.pm | 2 +- Kernel/Modules/AdminDynamicFieldWebService.pm | 2 +- var/httpd/htdocs/js/Core.Agent.Admin.DynamicField.js | 5 ++++- 14 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Kernel/Modules/AdminDynamicFieldCheckbox.pm b/Kernel/Modules/AdminDynamicFieldCheckbox.pm index 1ad80657a2..6aac45b811 100644 --- a/Kernel/Modules/AdminDynamicFieldCheckbox.pm +++ b/Kernel/Modules/AdminDynamicFieldCheckbox.pm @@ -97,7 +97,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldContactWD.pm b/Kernel/Modules/AdminDynamicFieldContactWD.pm index d2f4e7b14a..f02aaebd45 100644 --- a/Kernel/Modules/AdminDynamicFieldContactWD.pm +++ b/Kernel/Modules/AdminDynamicFieldContactWD.pm @@ -102,7 +102,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldDB.pm b/Kernel/Modules/AdminDynamicFieldDB.pm index d287bb248e..14f46e80fa 100644 --- a/Kernel/Modules/AdminDynamicFieldDB.pm +++ b/Kernel/Modules/AdminDynamicFieldDB.pm @@ -97,7 +97,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldDateTime.pm b/Kernel/Modules/AdminDynamicFieldDateTime.pm index 1010175a2b..a184e899e4 100644 --- a/Kernel/Modules/AdminDynamicFieldDateTime.pm +++ b/Kernel/Modules/AdminDynamicFieldDateTime.pm @@ -97,7 +97,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldDropdown.pm b/Kernel/Modules/AdminDynamicFieldDropdown.pm index f5fd02a3f5..5ae6ae8522 100644 --- a/Kernel/Modules/AdminDynamicFieldDropdown.pm +++ b/Kernel/Modules/AdminDynamicFieldDropdown.pm @@ -102,7 +102,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldLens.pm b/Kernel/Modules/AdminDynamicFieldLens.pm index 81284c8f34..f88ba56168 100644 --- a/Kernel/Modules/AdminDynamicFieldLens.pm +++ b/Kernel/Modules/AdminDynamicFieldLens.pm @@ -136,7 +136,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldMultiselect.pm b/Kernel/Modules/AdminDynamicFieldMultiselect.pm index b1a6fca6f7..f429d7a59a 100644 --- a/Kernel/Modules/AdminDynamicFieldMultiselect.pm +++ b/Kernel/Modules/AdminDynamicFieldMultiselect.pm @@ -102,7 +102,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldReference.pm b/Kernel/Modules/AdminDynamicFieldReference.pm index 088b24babc..804ae375e8 100644 --- a/Kernel/Modules/AdminDynamicFieldReference.pm +++ b/Kernel/Modules/AdminDynamicFieldReference.pm @@ -183,7 +183,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldScript.pm b/Kernel/Modules/AdminDynamicFieldScript.pm index d9cc26a7cf..1bbf1f1f50 100644 --- a/Kernel/Modules/AdminDynamicFieldScript.pm +++ b/Kernel/Modules/AdminDynamicFieldScript.pm @@ -70,7 +70,7 @@ sub Run { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $Param{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldSet.pm b/Kernel/Modules/AdminDynamicFieldSet.pm index 3fdfb883c6..9aa2e7b970 100644 --- a/Kernel/Modules/AdminDynamicFieldSet.pm +++ b/Kernel/Modules/AdminDynamicFieldSet.pm @@ -97,7 +97,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldText.pm b/Kernel/Modules/AdminDynamicFieldText.pm index 06b8a7099e..ad3f56b99f 100644 --- a/Kernel/Modules/AdminDynamicFieldText.pm +++ b/Kernel/Modules/AdminDynamicFieldText.pm @@ -140,7 +140,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldTitle.pm b/Kernel/Modules/AdminDynamicFieldTitle.pm index d3065898c1..0bce3bbcea 100644 --- a/Kernel/Modules/AdminDynamicFieldTitle.pm +++ b/Kernel/Modules/AdminDynamicFieldTitle.pm @@ -95,7 +95,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/Kernel/Modules/AdminDynamicFieldWebService.pm b/Kernel/Modules/AdminDynamicFieldWebService.pm index 9e6eb5f28a..cbdcb6098e 100644 --- a/Kernel/Modules/AdminDynamicFieldWebService.pm +++ b/Kernel/Modules/AdminDynamicFieldWebService.pm @@ -156,7 +156,7 @@ sub _Add { if ( IsHashRefWithData($FieldConfig) ) { # copy standard stuff - for my $Key (qw(ObjectType FieldType FieldOrder Label Name ValidID)) { + for my $Key (qw(ObjectType FieldType Label Name ValidID)) { $GetParam{$Key} = $FieldConfig->{$Key}; } diff --git a/var/httpd/htdocs/js/Core.Agent.Admin.DynamicField.js b/var/httpd/htdocs/js/Core.Agent.Admin.DynamicField.js index ef8ed1b4ae..558b7dbbcb 100644 --- a/var/httpd/htdocs/js/Core.Agent.Admin.DynamicField.js +++ b/var/httpd/htdocs/js/Core.Agent.Admin.DynamicField.js @@ -230,11 +230,14 @@ Core.Agent.Admin.DynamicField = (function (TargetNS) { TargetNS.DynamicFieldClone = function() { $('.DynamicFieldClone').on('click', function (Event) { + // get field order + var FieldOrder = parseInt($('#MaxFieldOrder').val(), 10) + 1; + // don't interfere with MasterAction Event.stopPropagation(); Event.preventDefault(); - window.location = $(this).attr('href'); + window.location = $(this).attr('href') + ';FieldOrder=' + FieldOrder; return false; });