import of rt 3.0.4
[freeside.git] / rt / html / Admin / Elements / QueueTabs
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
10 %# from www.gnu.org.
11 %# 
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 %# General Public License for more details.
16 %# 
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <& /Admin/Elements/Tabs, 
25     subtabs => $tabs, 
26     current_tab => 'Admin/Queues/', 
27     current_subtab => $current_tab, 
28     Title => $Title &>
29
30 <%INIT>
31 my $tabs;
32 if ($id) {
33   $tabs->{'this'}  = {
34                 title => $QueueObj->Name,
35                         path => "Admin/Queues/Modify.html?id=".$id,
36                     current_subtab => $current_tab,     
37                 subtabs => {
38                  C => { title => loc('Basics'),
39                         path => "Admin/Queues/Modify.html?id=".$id,
40                            },
41                  D => { title => loc('Watchers'),
42                         path => "Admin/Queues/People.html?id=".$id,
43                       },
44
45                  E => { title => loc('Scrips'),
46                              path => "Admin/Queues/Scrips.html?id=".$id,
47                            },
48                  F => { title => loc('Templates'),
49                                 path => "Admin/Queues/Templates.html?id=".$id,
50                               },
51
52                  G => { title => loc('Custom Fields'),
53                         path => 'Admin/Queues/CustomFields.html?id='.$id,
54                         },
55
56                  H => { title => loc('Group Rights'),
57                           path => "Admin/Queues/GroupRights.html?id=".$id,
58                         },      
59                  I => { title => loc('User Rights'),
60                           path => "Admin/Queues/UserRights.html?id=".$id,
61                         }
62         }
63         };
64 }
65 if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) {
66   $tabs->{"A"} = { title => loc('Select queue'),
67                         path => "Admin/Queues/",
68                            };
69   $tabs->{"B"} = { title => loc('New queue'),
70                         path => "Admin/Queues/Modify.html?Create=1",
71                         separator => 1,
72                            };
73 }
74
75   # Now let callbacks add their extra tabs
76   $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
77 foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) {  
78     if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) {
79         $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"}        = $subtabs; 
80         $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; 
81     }                                                                           
82 }   
83                         $current_tab = "Admin/Queues/Modify.html?id=".$id if $id;
84 </%INIT>
85   
86 <%ARGS>
87 $QueueObj => undef
88 $id => undef
89 $subtabs => undef
90 $current_subtab => undef
91 $current_tab => undef
92 $Title => undef
93 </%ARGS>