Added absolute paths to ticket-menu.
[usit-rt.git] / local / html / Callbacks / UiOCallbacks / Elements / Tabs / Privileged
1 <%INIT>
2
3 my $spamqueuename = "spam-suspects";
4 my $spamqueue = new RT::Queue($RT::SystemUser);
5 $spamqueue->Load($spamqueuename);
6
7
8 my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
9 my $id = undef;
10 if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) {
11      $id  = $1;
12      $Ticket->Load($id);
13 }
14
15 my $request_path = $HTML::Mason::Commands::r->path_info;
16 if ( $request_path =~ m{^/Ticket/} && $id ) {
17
18
19 my $actions = PageMenu()->child('actions');
20
21 my $takesteal = ($actions->{'children'}->{'take'} or $actions->{'children'}->{'steal'});
22 PageMenu()->child(
23     takesteal => title => $takesteal->{'title'},
24     path => $takesteal->{'path'},
25 ) if ($takesteal);
26
27
28
29 if ($Ticket->CurrentUserHasRight('DeleteTicket') &&
30     ($Ticket->Status ne 'deleted')) {
31         $actions->child(
32             isSpam => title => 'IsSpam',
33             path => "Ticket/Display.html?Status=deleted&Queue=$spamqueuename&id=".$id,
34        );
35 } else {
36     $actions->child(
37         isSpam => title => 'IsSpam',
38         path => "Ticket/Display.html?Queue=$spamqueuename&id=".$id,
39     );
40 }
41         
42 if ($Ticket->Queue eq $spamqueue->id) {
43     if ($Ticket->CurrentUserHasRight('DeleteTicket') &&
44     ($Ticket->Status ne 'deleted')) {
45         $actions->child(
46                 isSpam => title => 'IsSpam',
47                 path => "Ticket/Display.html?Status=deleted&Queue=$spamqueuename&id=".$id,
48         );
49                 }
50         }
51
52          $actions->child(
53              Export => title => 'Export',
54              path => "Ticket/Export.html?id=".$id,
55          );
56
57
58 }
59
60 my $tickets_menu = Menu()->child('search');
61 my $search = $tickets_menu->child('current_search');
62 my $results = $search->child('results') if ($search);
63
64 $tickets_menu->child(
65     results => title => $results->{'title'},
66     path => $results->{'path'},
67     sort_order => -1,
68 ) if $results;
69
70 my $tools = Menu()->child('tools');
71 my $admin = $tools->child('config');
72 my $admin_tools = $admin->child('tools');
73 $admin_tools->child(
74     becomeuser => title => 'BecomeUser', 
75     path => "/Admin/Tools/BecomeUser.html", 
76     description => 'Become another user.',
77 );
78
79
80
81 </%INIT>
82