Skip to content

Commit

Permalink
Issue #2866: Made dynamic field configs dependend upon relevant checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter authored and svenoe committed Jan 24, 2024
1 parent 7c86752 commit b2ae6f2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
27 changes: 20 additions & 7 deletions Kernel/Output/HTML/TicketZoom/Agent/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ our @ObjectDependencies = (
'Kernel::System::Encode',
'Kernel::System::Log',
'Kernel::System::SystemAddress',
'Kernel::System::Ticket',
'Kernel::System::Ticket::Article',
'Kernel::System::User',
);
Expand Down Expand Up @@ -126,17 +127,29 @@ sub ArticleMetaFields {
}
}

# check if ticket is normal or process ticket
my $IsProcessTicket = $Kernel::OM->Get('Kernel::System::Ticket')->TicketCheckForProcessType(
TicketID => $Param{TicketID}
);

# get zoom settings
my $DisplaySettings = $ConfigObject->Get("Ticket::Frontend::AgentTicketZoom");

# get dynamic field config for frontend module
my $DynamicFieldFilter = {
%{ $ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")->{DynamicField} || {} },
%{
$ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")->{DynamicFieldWidgetDynamicField}
%{ $DisplaySettings->{DynamicField} || {} },
IsHashRefWithData( $DisplaySettings->{DynamicFieldWidgetDisplay} )
? %{
$DisplaySettings->{DynamicFieldWidgetDynamicField}
|| {}
},
%{
$ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")->{ProcessWidgetDynamicField}
}
: (),
$IsProcessTicket
? %{
$DisplaySettings->{ProcessWidgetDynamicField}
|| {}
},
}
: (),
};

# get the dynamic fields for article object
Expand Down
13 changes: 8 additions & 5 deletions Kernel/Output/HTML/TicketZoom/TicketInformation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,22 @@ sub Run {
);
}

# TODO order of dynamic field configs here differs from similar places - check why
# get dynamic field config for frontend module
my $DynamicFieldFilter = {
%{
IsHashRefWithData( $Self->{DisplaySettings}{DynamicFieldWidgetDisplay} )
? %{
$ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")
->{DynamicFieldWidgetDynamicField}
|| {}
},
%{
}
: (),
$IsProcessTicket
? %{
$ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")
->{ProcessWidgetDynamicField}
|| {}
},
}
: (),
%{ $ConfigObject->Get("Ticket::Frontend::AgentTicketZoom")->{DynamicField} || {} },
};

Expand Down

0 comments on commit b2ae6f2

Please sign in to comment.