summaryrefslogtreecommitdiff
path: root/rt/html/Admin/Elements/UserTabs
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Admin/Elements/UserTabs')
-rw-r--r--rt/html/Admin/Elements/UserTabs71
1 files changed, 37 insertions, 34 deletions
diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs
index 764fdfcb5..8d8f769a4 100644
--- a/rt/html/Admin/Elements/UserTabs
+++ b/rt/html/Admin/Elements/UserTabs
@@ -21,54 +21,57 @@
%#
%#
%# END LICENSE BLOCK
-<& /Admin/Elements/Tabs,
+<& /Admin/Elements/Tabs,
subtabs => $tabs,
- current_tab => 'Admin/Users/',
- current_subtab => $current_subtab,
+ current_tab => 'Admin/Users/',
+ current_subtab => $current_tab,
Title => $Title &>
<%INIT>
my $tabs;
-my $subtabs;
if ($id) {
-$tabs->{'this'} = { title => eval { $UserObj->Name },
-
- path => "Admin/Users/Modify.html?id=".$id,
-subtabs => {
- Queues => { title => loc('Basics'),
- path => "Admin/Users/Modify.html?id=".$id
- },
-# Scrips => { title => loc('Rights'),
-# path => "Admin/Users/Rights.html?id=".$id
-# }
-
- }
+ $tabs->{'this'} = {
+ title => eval { $UserObj->Name },
+ path => "Admin/Users/Modify.html?id=".$id,
+ current_subtab => $current_tab,
+ subtabs => {
+ A => { title => loc('Basics'),
+ path => "Admin/Users/Modify.html?id=".$id
+ },
+ }
+ }
}
+
+if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers') ) {
+ $tabs->{"A"} = {
+ title => loc('Select user'),
+ path => "Admin/Users/",
+ };
+ $tabs->{"B"} = {
+ title => loc('New user'),
+ path => "Admin/Users/Modify.html?Create=1",
+ separator => 1,
+ };
}
-if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) {
- $tabs->{"A"} = { title => loc('Select user'),
- path => "Admin/Users/",
- };
- $tabs->{"B"} = { title => loc('New user'),
- path => "Admin/Users/Modify.html?Create=1",
- separator => 1,
- };
+
+# Now let callbacks add their extra tabs
+$m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
+
+foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) {
+ if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) {
+ $tabs->{'this'}->{"current_subtab"} = $current_tab;
+ $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab;
+ $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs;
+ }
}
- # Now let callbacks add their extra tabs
- $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
-
-foreach my $tab ( sort keys %{$tabs} ) {
- if ( $tabs->{$tab}->{'path'} eq $current_subtab ) {
- $tabs->{$tab}->{"current_subtab"} = $current_subtab;
- }
-}
+$current_tab = "Admin/Users/Modify.html?id=".$id if $id;
+
</%INIT>
-
-
<%ARGS>
$UserObj => undef
$id => undef
$current_tab => undef
+$subtabs => undef
$current_subtab => undef
$Title => undef
</%ARGS>