Skip to content

Commit

Permalink
Issue #2507: Tidied some rebase conflicts and accepted code policy su…
Browse files Browse the repository at this point in the history
…ggestions.
  • Loading branch information
stefanhaerter committed Jan 26, 2024
1 parent b2d71c7 commit 1599e89
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Kernel/System/DynamicField/Driver/BaseDateTime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ sub EditFieldRender {
push @ResultLabels, $Self->EditLabelRender(
%Param,
Mandatory => $Param{Mandatory} || '0',
FieldName => ( $FieldConfig->{MultiValue} ? $FieldName . '_0' : $FieldName ) . 'Used',
FieldName => $FieldName . 'Used',
);
}

Expand Down
6 changes: 4 additions & 2 deletions Kernel/System/DynamicField/Driver/BaseReference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ sub EditFieldRender {
Mandatory => $Param{Mandatory},
);
my @ResultHTML;
for my $ValueIndex ( 0 .. ( $DFDetails->{Multiselect} ? 0 : $#{$Value} ) ) {
my @ResultLabels;
for my $ValueIndex ( 0 .. ( $DFDetails->{Multiselect} ? 0 : $#{$Value} ) ) {
my $FieldID = $DFDetails->{MultiValue} ? $FieldName . '_' . $ValueIndex : $FieldName;

if ( !$ValueIndex ) {
Expand Down Expand Up @@ -1010,8 +1010,10 @@ sub GetFieldState {
my $PossibleValues = $Self->PossibleValuesGet(
DynamicFieldConfig => $DynamicFieldConfig,
Object => {

# ticket specific
CustomerUserID => $Param{GetParam}->{CustomerUser},

# general
$Param{GetParam}->%*,
},
Expand All @@ -1022,7 +1024,7 @@ sub GetFieldState {
);

my $Value = $Param{GetParam}{DynamicField}{ 'DynamicField_' . $DynamicFieldConfig->{Name} };
if ( $Value && !$PossibleValues->{ $Value } ) {
if ( $Value && !$PossibleValues->{$Value} ) {
$Return{NewValue} = undef;
}

Expand Down
12 changes: 8 additions & 4 deletions Kernel/System/DynamicField/Driver/BaseScript.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1043,9 +1043,10 @@ sub GetFieldState {
my $DynamicFieldConfig = $Param{DynamicFieldConfig};

# for ticket dynamic fields we need the queue
$GetParam{Queue} = defined $Param{GetParam}{Queue} ? $Param{GetParam}{Queue}
$GetParam{Queue} = defined $Param{GetParam}{Queue}
? $Param{GetParam}{Queue}
: $Param{GetParam}{Dest} && $Param{GetParam}{Dest} =~ /\|\|(.+)$/ ? $1
: undef;
: undef;

# the required args have to be present
for my $Required ( @{ $DynamicFieldConfig->{Config}{RequiredArgs} // [] } ) {
Expand Down Expand Up @@ -1077,11 +1078,14 @@ sub GetFieldState {
my $NewValue = $Self->Evaluate(
DynamicFieldConfig => $DynamicFieldConfig,
Object => {

# ticket specifics
CustomerUserID => $Param{CustomerUser},
TicketID => $Param{TicketID},

# ITSM config item specifics
ConfigItemID => $Param{ConfigItemID},
ConfigItemID => $Param{ConfigItemID},

# general
%GetParam,
},
Expand All @@ -1095,7 +1099,7 @@ sub GetFieldState {
);

return (
NewValue => $NewValue,
NewValue => $NewValue,
);
}

Expand Down
11 changes: 7 additions & 4 deletions Kernel/System/DynamicField/Driver/Lens.pm
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ sub GetFieldState {
{
# if this field is non ACL reducible, set the field values
if ( !$IsACLReducible ) {
return (
return (
NewValue => $AttributeFieldValue,
);
}
Expand Down Expand Up @@ -657,7 +657,7 @@ sub GetFieldState {
# convert Filter key => key back to key => value using map
%{$PossibleValues} = map { $_ => $PossibleValues->{$_} } keys %Filter;
}
}
}
elsif ( $Param{ConfigItemObject} ) {
my $ACL = $Param{ConfigItemObject}->ConfigItemAcl(
%{ $Param{GetParam} },
Expand Down Expand Up @@ -685,8 +685,11 @@ sub GetFieldState {
}

# check whether all selected entries are still valid
if ( defined $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} &&
( $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} || $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} eq '0' ) )
if (
defined $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"}
&&
( $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} || $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} eq '0' )
)
{
# multiselect fields
if ( ref( $DFParam->{"DynamicField_$DynamicFieldConfig->{Name}"} ) ) {
Expand Down

0 comments on commit 1599e89

Please sign in to comment.