Changed fro menu-structure of RT4.2
[usit-rt.git] / local / html / Callbacks / UiOCallbacks / Elements / Tabs / Privileged
CommitLineData
84fb5b46
MKG
1<%INIT>
2
3my $spamqueuename = "spam-suspects";
4my $spamqueue = new RT::Queue($RT::SystemUser);
5$spamqueue->Load($spamqueuename);
6
7
8my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
9my $id = undef;
10if ( ( $m->request_args->{'id'} || '' ) =~ /^(\d+)$/ ) {
11 $id = $1;
12 $Ticket->Load($id);
13}
14
15my $request_path = $HTML::Mason::Commands::r->path_info;
16if ( $request_path =~ m{^/Ticket/} && $id ) {
17
18
19my $actions = PageMenu()->child('actions');
20
21my $takesteal = ($actions->{'children'}->{'take'} or $actions->{'children'}->{'steal'});
22PageMenu()->child(
23 takesteal => title => $takesteal->{'title'},
24 path => $takesteal->{'path'},
25) if ($takesteal);
26
27
28
29if ($Ticket->CurrentUserHasRight('DeleteTicket') &&
30 ($Ticket->Status ne 'deleted')) {
31 $actions->child(
32 isSpam => title => 'IsSpam',
dab09ea8 33 path => "Ticket/Display.html?Status=deleted&Queue=$spamqueuename&id=".$id,
84fb5b46
MKG
34 );
35} else {
36 $actions->child(
37 isSpam => title => 'IsSpam',
dab09ea8 38 path => "Ticket/Display.html?Queue=$spamqueuename&id=".$id,
84fb5b46
MKG
39 );
40}
41
42if ($Ticket->Queue eq $spamqueue->id) {
43 if ($Ticket->CurrentUserHasRight('DeleteTicket') &&
44 ($Ticket->Status ne 'deleted')) {
45 $actions->child(
46 isSpam => title => 'IsSpam',
dab09ea8 47 path => "Ticket/Display.html?Status=deleted&Queue=$spamqueuename&id=".$id,
84fb5b46
MKG
48 );
49 }
50 }
51
52 $actions->child(
53 Export => title => 'Export',
dab09ea8 54 path => "Ticket/Export.html?id=".$id,
84fb5b46
MKG
55 );
56
57
58}
59
60my $tickets_menu = Menu()->child('search');
61my $search = $tickets_menu->child('current_search');
62my $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
70my $tools = Menu()->child('tools');
71my $admin = $tools->child('config');
cbe6f6ed
MKG
72my $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);
84fb5b46
MKG
78
79
80
81</%INIT>
82