Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IT.WESER-EMS: Add prio param to AgentTicketZoom MenuModules for individual sorting #647

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Kernel/Config/Files/XML/Calendar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">550</Item>
</Hash>
</Value>
</Setting>
Expand Down
1 change: 1 addition & 0 deletions Kernel/Config/Files/XML/ProcessManagement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
<Item Key="Target"></Item>
<Item Key="PopupType">TicketAction</Item>
<Item Key="Cluster"></Item>
<Item Key="Prio">480</Item>
</Hash>
</Value>
</Setting>
Expand Down
21 changes: 21 additions & 0 deletions Kernel/Config/Files/XML/Ticket.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5425,6 +5425,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">000</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5440,6 +5441,7 @@
<Item Key="Target"></Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">100</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5457,6 +5459,7 @@
<Item Key="PopupType">TicketHistory</Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">200</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5475,6 +5478,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">210</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5492,6 +5496,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">300</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5509,6 +5514,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">310</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5526,6 +5532,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">320</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5543,6 +5550,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">People</Item>
<Item Key="ClusterPriority">430</Item>
<Item Key="Prio">400</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5560,6 +5568,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">People</Item>
<Item Key="ClusterPriority">430</Item>
<Item Key="Prio">410</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5577,6 +5586,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">People</Item>
<Item Key="ClusterPriority">430</Item>
<Item Key="Prio">420</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5594,6 +5604,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Communication</Item>
<Item Key="ClusterPriority">435</Item>
<Item Key="Prio">420</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5611,6 +5622,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Communication</Item>
<Item Key="ClusterPriority">435</Item>
<Item Key="Prio">425</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5628,6 +5640,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Communication</Item>
<Item Key="ClusterPriority">435</Item>
<Item Key="Prio">426</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5645,6 +5658,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Communication</Item>
<Item Key="ClusterPriority">435</Item>
<Item Key="Prio">427</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5662,6 +5676,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">800</Item>
<Item Key="Prio">430</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5679,6 +5694,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">440</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5694,6 +5710,7 @@
<Item Key="Target"></Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">448</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5711,6 +5728,7 @@
<Item Key="PopupType">TicketAction</Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">450</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5728,6 +5746,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">460</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5745,6 +5764,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1"></Item>
<Item Key="ClusterPriority"></Item>
<Item Key="Prio">470</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -5763,6 +5783,7 @@
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority"></Item>
<Item Key="ExternalLink">1</Item>
<Item Key="Prio">500</Item>
</Hash>
</Value>
</Setting>
Expand Down
4 changes: 4 additions & 0 deletions Kernel/Config/Files/XML/Znuny.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">998</Item>
<Item Key="Prio">999</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -321,6 +322,7 @@
<Item Key="PopupType"></Item>
<Item Key="ClusterName" Translatable="1">Miscellaneous</Item>
<Item Key="ClusterPriority">999</Item>
<Item Key="Prio">999</Item>
</Hash>
</Value>
</Setting>
Expand Down Expand Up @@ -3591,6 +3593,7 @@
<Item Key="Link">Action=AgentTicketMarkSeenUnseen;Subaction=Unseen;TicketID=[% Data.TicketID | html %]</Item>
<Item Key="Target"></Item>
<Item Key="PopupType"></Item>
<Item Key="Prio">001</Item>
</Hash>
</Value>
</Setting>
Expand All @@ -3606,6 +3609,7 @@
<Item Key="Link">Action=AgentTicketMarkSeenUnseen;Subaction=Seen;TicketID=[% Data.TicketID | html %]</Item>
<Item Key="Target"></Item>
<Item Key="PopupType"></Item>
<Item Key="Prio">001</Item>
</Hash>
</Value>
</Setting>
Expand Down
13 changes: 7 additions & 6 deletions Kernel/Modules/AgentTicketZoom.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1209,28 +1209,29 @@ sub MaskAgentZoom {

# check the configured priority for this item. The lowest ClusterPriority
# within the same cluster wins.
my $Priority = $MenuClusters{ $Menus{$Menu}->{ClusterName} }->{Priority} || 0;
my $Priority = $MenuClusters{ $Menus{$Menu}->{ClusterName} }->{Prio} || 0;
$Menus{$Menu}->{ClusterPriority} ||= 0;
if ( !$Priority || $Priority !~ /^\d{3}$/ || $Priority > $Menus{$Menu}->{ClusterPriority} ) {
$Priority = $Menus{$Menu}->{ClusterPriority};
}
$MenuClusters{ $Menus{$Menu}->{ClusterName} }->{Priority} = $Priority;
$MenuClusters{ $Menus{$Menu}->{ClusterName} }->{Prio} = $Priority;
$MenuClusters{ $Menus{$Menu}->{ClusterName} }->{Items}->{$Menu} = $Item;
}
}

for my $Cluster ( sort keys %MenuClusters ) {
$ZoomMenuItems{ $MenuClusters{$Cluster}->{Priority} . $Cluster } = {
$ZoomMenuItems{ $MenuClusters{$Cluster}->{Prio} . $Cluster } = {
Name => $Cluster,
Type => 'Cluster',
Link => '#',
Class => 'ClusterLink',
Items => $MenuClusters{$Cluster}->{Items},
Prio => $MenuClusters{$Cluster}->{Prio},
};
}

# display all items
for my $Item ( sort keys %ZoomMenuItems ) {
# display all items, the lowest Prio will be displayed first
for my $Item ( sort { ($ZoomMenuItems{$a}->{Prio} // 999) <=> ($ZoomMenuItems{$b}->{Prio} // 999) } keys %ZoomMenuItems ) {
if ( $ZoomMenuItems{$Item}->{ExternalLink} && $ZoomMenuItems{$Item}->{ExternalLink} == 1 ) {
$LayoutObject->Block(
Name => 'TicketMenuExternalLink',
Expand All @@ -1253,7 +1254,7 @@ sub MaskAgentZoom {
},
);

for my $SubItem ( sort keys %{ $ZoomMenuItems{$Item}->{Items} } ) {
for my $SubItem ( sort { ($ZoomMenuItems{$Item}->{Items}->{$a}->{Priority} // 999) <=> ($ZoomMenuItems{$Item}->{Items}->{$b}->{Priority} // 999) } keys %{ $ZoomMenuItems{$Item}->{Items} } ) {
$LayoutObject->Block(
Name => 'TicketMenuSubContainerItem',
Data => $ZoomMenuItems{$Item}->{Items}->{$SubItem},
Expand Down
Loading