- # Don't display next links if we're on the last ticket
- if ( $item_map->{$id}->{next} ) {
- $search->child( next =>
- title => loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
- $search->child( last =>
- title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
+
+ # TODO needs a "Can extract article into a class applied to this queue" check
+ $actions->child( 'extract-article' =>
+ title => loc('Extract Article'),
+ path => "/Articles/Article/ExtractIntoClass.html?Ticket=".$obj->id,
+ );
+
+ if ( defined $session{"tickets"} ) {
+ # we have to update session data if we get new ItemMap
+ my $updatesession = 1 unless ( $session{"tickets"}->{'item_map'} );
+
+ my $item_map = $session{"tickets"}->ItemMap;
+
+ if ($updatesession) {
+ $session{"tickets"}->PrepForSerialization();
+ }
+
+ my $search = Menu()->child('search');
+ # Don't display prev links if we're on the first ticket
+ if ( $item_map->{$id}->{prev} ) {
+ $search->child( first =>
+ title => '<< ' . loc('First'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{first});
+ $search->child( prev =>
+ title => '< ' . loc('Prev'), class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{prev});
+ }
+ # Don't display next links if we're on the last ticket
+ if ( $item_map->{$id}->{next} ) {
+ $search->child( next =>
+ title => loc('Next') . ' >', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
+ if ( $item_map->{last} ) {
+ $search->child( last =>
+ title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
+ }
+ }