Skip to content

Commit

Permalink
Issue #2153: Change sysconfig name, small code restructuring, for nic…
Browse files Browse the repository at this point in the history
…er diffs with older versions.
  • Loading branch information
Sven committed May 3, 2024
1 parent 3d9f3f9 commit 925e4e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Kernel/Config/Files/XML/Ticket.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4759,7 +4759,7 @@
</Item>
</Value>
</Setting>
<Setting Name="Ticket::Frontend::MoveType::Dropdown::MoveTicketEvenItIsLocked" Required="1" Valid="1">
<Setting Name="Ticket::Frontend::MoveType::Dropdown::MoveEvenIfLocked" Required="1" Valid="1">
<Description Translatable="1">As soon as the move queue option dropdown is enabled for example in the AgentTicketZoom dialogue, it is possible to move tickets locked to other agents to another queue by activating this option.</Description>
<Navigation>Frontend::Agent::View::TicketMove</Navigation>
<Value>
Expand Down
52 changes: 23 additions & 29 deletions Kernel/Modules/AgentTicketMove.pm
Original file line number Diff line number Diff line change
Expand Up @@ -180,39 +180,33 @@ sub Run {
# get config object
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');

# check if lock check is needed or disabled
my $MoveTicketEvenItIsLocked = $ConfigObject->Get('Ticket::Frontend::MoveType::Dropdown::MoveTicketEvenItIsLocked');

if ( !$MoveTicketEvenItIsLocked ) {
# check if ticket is locked
if ( !$ConfigObject->Get('Ticket::Frontend::MoveType::Dropdown::MoveEvenIfLocked') && $TicketObject->TicketLockGet( TicketID => $Self->{TicketID} ) ) {
my $AccessOk = $TicketObject->OwnerCheck(
TicketID => $Self->{TicketID},
OwnerID => $Self->{UserID},
);

# check if ticket is locked
if ( $TicketObject->TicketLockGet( TicketID => $Self->{TicketID} ) ) {
my $AccessOk = $TicketObject->OwnerCheck(
TicketID => $Self->{TicketID},
OwnerID => $Self->{UserID},
if ( !$AccessOk ) {
my $Output = $LayoutObject->Header(
Type => 'Small',
BodyClass => 'Popup',
);
$Output .= $LayoutObject->Warning(
Message => Translatable('Sorry, you need to be the ticket owner to perform this action.'),
Comment => Translatable('Please change the owner first.'),
);

if ( !$AccessOk ) {
my $Output = $LayoutObject->Header(
Type => 'Small',
BodyClass => 'Popup',
);
$Output .= $LayoutObject->Warning(
Message => Translatable('Sorry, you need to be the ticket owner to perform this action.'),
Comment => Translatable('Please change the owner first.'),
);

# show back link
$LayoutObject->Block(
Name => 'TicketBack',
Data => { %Param, TicketID => $Self->{TicketID} },
);
# show back link
$LayoutObject->Block(
Name => 'TicketBack',
Data => { %Param, TicketID => $Self->{TicketID} },
);

$Output .= $LayoutObject->Footer(
Type => 'Small',
);
return $Output;
}
$Output .= $LayoutObject->Footer(
Type => 'Small',
);
return $Output;
}
}

Expand Down

0 comments on commit 925e4e7

Please sign in to comment.