From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/Admin/Elements/AddCustomFieldValue | 44 ++++++ rt/html/Admin/Elements/CreateUserCalled | 26 ++++ rt/html/Admin/Elements/EditCustomField | 127 +++++++++++++++ rt/html/Admin/Elements/EditCustomFieldValues | 42 +++++ rt/html/Admin/Elements/EditCustomFields | 214 ++++++++++++++++++++++++++ rt/html/Admin/Elements/EditQueueWatchers | 55 +++++++ rt/html/Admin/Elements/EditScrip | 149 ++++++++++++++++++ rt/html/Admin/Elements/EditScrips | 97 ++++++++++++ rt/html/Admin/Elements/EditTemplates | 104 +++++++++++++ rt/html/Admin/Elements/EditUserComments | 32 ++++ rt/html/Admin/Elements/GroupTabs | 76 +++++++++ rt/html/Admin/Elements/Header | 28 ++++ rt/html/Admin/Elements/ListGlobalCustomFields | 37 +++++ rt/html/Admin/Elements/ListGlobalScrips | 37 +++++ rt/html/Admin/Elements/ModifyQueue | 78 ++++++++++ rt/html/Admin/Elements/ModifyTemplate | 60 ++++++++ rt/html/Admin/Elements/ModifyUser | 99 ++++++++++++ rt/html/Admin/Elements/QueueRightsForUser | 40 +++++ rt/html/Admin/Elements/QueueTabs | 93 +++++++++++ rt/html/Admin/Elements/SelectCustomFieldType | 36 +++++ rt/html/Admin/Elements/SelectGroups | 37 +++++ rt/html/Admin/Elements/SelectModifyGroup | 33 ++++ rt/html/Admin/Elements/SelectModifyQueue | 33 ++++ rt/html/Admin/Elements/SelectModifyUser | 49 ++++++ rt/html/Admin/Elements/SelectNewGroupMembers | 61 ++++++++ rt/html/Admin/Elements/SelectRights | 90 +++++++++++ rt/html/Admin/Elements/SelectScrip | 48 ++++++ rt/html/Admin/Elements/SelectScripAction | 48 ++++++ rt/html/Admin/Elements/SelectScripCondition | 48 ++++++ rt/html/Admin/Elements/SelectSingleOrMultiple | 43 ++++++ rt/html/Admin/Elements/SelectTemplate | 61 ++++++++ rt/html/Admin/Elements/SelectUsers | 40 +++++ rt/html/Admin/Elements/SystemTabs | 70 +++++++++ rt/html/Admin/Elements/Tabs | 63 ++++++++ rt/html/Admin/Elements/UserTabs | 74 +++++++++ 35 files changed, 2272 insertions(+) create mode 100644 rt/html/Admin/Elements/AddCustomFieldValue create mode 100644 rt/html/Admin/Elements/CreateUserCalled create mode 100644 rt/html/Admin/Elements/EditCustomField create mode 100644 rt/html/Admin/Elements/EditCustomFieldValues create mode 100644 rt/html/Admin/Elements/EditCustomFields create mode 100644 rt/html/Admin/Elements/EditQueueWatchers create mode 100644 rt/html/Admin/Elements/EditScrip create mode 100644 rt/html/Admin/Elements/EditScrips create mode 100644 rt/html/Admin/Elements/EditTemplates create mode 100644 rt/html/Admin/Elements/EditUserComments create mode 100644 rt/html/Admin/Elements/GroupTabs create mode 100644 rt/html/Admin/Elements/Header create mode 100644 rt/html/Admin/Elements/ListGlobalCustomFields create mode 100644 rt/html/Admin/Elements/ListGlobalScrips create mode 100644 rt/html/Admin/Elements/ModifyQueue create mode 100644 rt/html/Admin/Elements/ModifyTemplate create mode 100644 rt/html/Admin/Elements/ModifyUser create mode 100644 rt/html/Admin/Elements/QueueRightsForUser create mode 100644 rt/html/Admin/Elements/QueueTabs create mode 100644 rt/html/Admin/Elements/SelectCustomFieldType create mode 100644 rt/html/Admin/Elements/SelectGroups create mode 100644 rt/html/Admin/Elements/SelectModifyGroup create mode 100644 rt/html/Admin/Elements/SelectModifyQueue create mode 100644 rt/html/Admin/Elements/SelectModifyUser create mode 100644 rt/html/Admin/Elements/SelectNewGroupMembers create mode 100644 rt/html/Admin/Elements/SelectRights create mode 100644 rt/html/Admin/Elements/SelectScrip create mode 100644 rt/html/Admin/Elements/SelectScripAction create mode 100644 rt/html/Admin/Elements/SelectScripCondition create mode 100644 rt/html/Admin/Elements/SelectSingleOrMultiple create mode 100644 rt/html/Admin/Elements/SelectTemplate create mode 100644 rt/html/Admin/Elements/SelectUsers create mode 100644 rt/html/Admin/Elements/SystemTabs create mode 100644 rt/html/Admin/Elements/Tabs create mode 100644 rt/html/Admin/Elements/UserTabs (limited to 'rt/html/Admin/Elements') diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue new file mode 100644 index 000000000..8850734f2 --- /dev/null +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -0,0 +1,44 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<&|/l&>Add Value + + + + +
+<&|/l&>Sort:
+ +
+<&|/l&>Name:
+ +
+<&|/l&>Description:
+ +
+ +<%init> + +<%args> +$CustomField => undef + diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled new file mode 100644 index 000000000..8ceccca73 --- /dev/null +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +
+<&|/l&>New user called +
diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField new file mode 100644 index 000000000..a09600ba7 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomField @@ -0,0 +1,127 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@results &> + + +
+ + + + + + + + +
+<&|/l&>Name: + + +
+<&|/l&>Description: + + +
+<&|/l&>Type: + +<& /Admin/Elements/SelectCustomFieldType, Name => "Type", Default => $CustomFieldObj->Type &> +
+ + +> <&|/l&>Enabled (Unchecking this box disables this custom field) +
+ +

+% if ($CustomFieldObj->Id and $CustomFieldObj->Type =~ /Select/) { +

<&|/l&>Values

+ +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> + +% } +<&/Elements/Submit&> +
+ + + +<%INIT> + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +my $EnabledChecked = "CHECKED"; +my (@results); + +if (! $CustomField ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} else { + + if ($CustomField eq 'new') { + my ($val, $msg) = $CustomFieldObj->Create(Queue => $Queue, + Name => $Name, + Type => $Type, + Description => $Description, + ); + Abort(loc("Could not create CustomField", $msg)) unless ($val); + push @results, $msg; + $CustomFieldObj->SetSortOrder($CustomFieldObj->id); + $title = loc('Created CustomField [_1]', $CustomFieldObj->Name()); + } else { + $CustomFieldObj->Load($CustomField) || Abort(loc('No CustomField')); + $title = loc('Editing CustomField [_1]', $CustomFieldObj->Name()); + + my @aresults = ProcessCustomFieldUpdates ( + CustomFieldObj => $CustomFieldObj, + ARGSRef => \%ARGS ); + push @results, @aresults; + } + + +$id = $CustomFieldObj->id; + + #we're asking about enabled on the web page but really care about disabled. + my $Disabled = ($Enabled ? 0 : 1); + + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + +} + + + +<%ARGS> +$id => undef +$title => undef +$Queue => undef +$CustomField => undef +$Type => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues new file mode 100644 index 000000000..64564adfb --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -0,0 +1,42 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<&|/l&>(Check box to delete) +
    +% while (my $v = $values->Next) { +
  • +<%$v->SortOrder%>: + +<%$v->Name%> +% if ($v->Description) { +(<%$v->Description%>) +% } +
  • +% } +
+<%init> +my $values = $CustomField->Values(); + +<%args> +$CustomField => undef + diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields new file mode 100644 index 000000000..a86b051d0 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFields @@ -0,0 +1,214 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + + + +
+<%$caption%>:
+
+% if ($CustomFields->Count == 0 ) { +

<&|/l&>(No custom fields)

+% } else { + + + + + +% my $count; +% while (my $CustomFieldObj = $CustomFields->Next) { +% # show 'move up' unless it's the first item +% if ($count++) { + +% } + + + +
+
    +% while (my $CustomFieldObj = $CustomFields->Next) { +
  • <%$CustomFieldObj->Name%> (<% $CustomFieldObj->FriendlyType %>)
    +<%$CustomFieldObj->Description%> +
  • +% } +
+
+<&|/l&>Move up +% } else { + +% } + +% # show 'move down' unless it's the last item +% if (!$CustomFields->IsLast) { +% $m->print(' | ') if $count > 1; +<&|/l&>Move down +% } +
+% } +
+% if ($id) { + +% } + <&|/l&>Include disabled custom fields in listing. + +
+ + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +my $caption; + +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $CustomFields->LimitToQueue($id); +} +else { + $CustomFields->LimitToGlobal(); +} + +if ($FindDisabledCustomFields) { + $caption = loc("All Custom Fields"); + $CustomFields->{'find_disabled_rows'} = 1; +} else { + $caption = loc("Enabled Custom Fields"); +} + +# {{{ deal with moving sortorder of custom fields +if ($CustomField and $Move) { + my $SourceObj = RT::CustomField->new($session{'CurrentUser'}); + $SourceObj->Load($CustomField) || Abort(loc('No CustomField')); + + my $TargetObj; + my $target_order = $SourceObj->SortOrder + $Move; + while (my $CustomFieldObj = $CustomFields->Next) { + my $this_order = $CustomFieldObj->SortOrder; + + # if we have an exact match, finish the loop now + ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order; + + # otherwise, we need to apropos toward the general direction + # ... first, check the sign is correct + next unless ($this_order - $SourceObj->SortOrder) * $Move > 0; + + # ... next, see if we already have a candidate + if ($TargetObj) { + # ... if yes, compare the delta and choose the smaller one + my $orig_delta = abs($TargetObj->SortOrder - $target_order); + my $this_delta = abs($this_order - $target_order); + next if $orig_delta < $this_delta; + } + + $TargetObj = $CustomFieldObj; + } + + if ($TargetObj) { + # swap their sort order + my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder); + $TargetObj->SetSortOrder($s); + $SourceObj->SetSortOrder($t); + # because order changed, we must redo search for subsequent uses + $CustomFields->RedoSearch; + } + + $CustomFields->GotoFirstItem; +} +# }}} + +# {{{ now process the 'copy queue' action +my @actions; +if ($Source and $Source ne $id) { + my $SourceQueue = RT::Queue->new($session{'CurrentUser'}); + $SourceQueue->Load($Source) || Abort(loc("Couldn't load queue")); + my $SourceCustomFields = RT::CustomFields->new($session{'CurrentUser'}); + $SourceCustomFields->LimitToQueue($SourceQueue->id); + + # delete old fields + foreach my $CustomFieldObj ( @{$CustomFields->ItemsArrayRef} ) { + $CustomFieldObj->Delete; + } + + # add new fields + while (my $SourceCustomFieldObj = $SourceCustomFields->Next) { + my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); + my ($val, $msg) = $CustomFieldObj->Create( + id => $SourceCustomFieldObj->id, + Queue => $id, + Name => $SourceCustomFieldObj->Name, + Type => $SourceCustomFieldObj->Type, + Description => $SourceCustomFieldObj->Description, + ); + Abort(loc("Could not create CustomField") . ": $msg") unless ($val); + push @actions, $msg; + + $CustomFieldObj->SetSortOrder($SourceCustomFieldObj->SortOrder); + + # add new values + my $values = $SourceCustomFieldObj->Values(); + while (my $v = $values->Next) { + my ( $addval, $addmsg ) = $CustomFieldObj->AddValue( + Name => $v->Name, + Description => $v->Description, + SortOrder => $v->SortOrder + ); + } + } + + # because content changed, we must redo search for subsequent uses + $CustomFields->RedoSearch; + $CustomFields->GotoFirstItem; +} +# }}} + +# {{{ deal with deleting existing custom fields +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the custom field + if ($key =~ /^DeleteCustomField-(\d+)/) { + my $id = $1; + my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); + $CustomFieldObj->Load($id); + my ($retval, $msg) = $CustomFieldObj->Delete; + if ($retval) { + push @actions, loc("Custom field deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + + +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$CustomField => undef +$FindDisabledCustomFields => undef + diff --git a/rt/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers new file mode 100644 index 000000000..db39bfb67 --- /dev/null +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +%if ($Members->Count == 0 ) { +
    +
  • <&|/l&>none +% } else { +<&|/l&>(Check box to delete)

    + + +<%INIT> +my $Members = $Watchers->MembersObj; + + +<%ARGS> +$QueueObj => undef +$Watchers => undef + + + + diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip new file mode 100644 index 000000000..5393ebfde --- /dev/null +++ b/rt/html/Admin/Elements/EditScrip @@ -0,0 +1,149 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +<%init> +my (@actions); + + +my $scrip = new RT::Scrip($session{'CurrentUser'}); + +if ( $id eq 'new' ) { + + my ( $retval, $msg ) = $scrip->Create( + Queue => $Queue, + ScripAction => $ARGS{"Scrip-new-ScripAction"}, + ScripCondition => $ARGS{"Scrip-new-ScripCondition"}, + Template => $ARGS{"Scrip-new-Template"}, + Description => $ARGS{"Scrip-new-Description"}, + CustomPrepareCode => $ARGS{"Scrip-new-CustomPrepareCode"}, + CustomCommitCode => $ARGS{"Scrip-new-CustomCommitCode"}, + CustomIsApplicableCode => $ARGS{"Scrip-new-CustomIsApplicableCode"}, + ); + if ( defined $retval ) { + push @actions, $msg; + } + else { + Abort( $msg); + } +} +elsif ($id) { + my ($val,$msg) =$scrip->Load($id); + if ($val) { + $id = $scrip->id; + } else { + Abort ($msg); + } + my @attribs = qw ( + Queue + ScripAction + ScripCondition + Template + Description + CustomPrepareCode + CustomCommitCode + CustomIsApplicableCode + ); + my @results = UpdateRecordObject( AttributesRef => \@attribs, + AttributePrefix => 'Scrip-'.$scrip->Id, + Object => $scrip, + ARGSRef => \%ARGS ); + push (@actions, @results); +} + +elsif ($ARGS{'create'}) { + $id = 'new'; +} + +# }}} + + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 + diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips new file mode 100644 index 000000000..24515d8c1 --- /dev/null +++ b/rt/html/Admin/Elements/EditScrips @@ -0,0 +1,97 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + +
    + + +

    <&|/l&>Current Scrips:

    +% if ($Scrips->Count == 0 ) { +

    <&|/l&>(No scrips)

    +% } else { +
    +<&|/l&>Description: + + +
    +<&|/l&>Condition: + +<& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $scrip->ConditionObj->Id &>
    +
    +<&|/l&>Custom condition: + + +
    +<&|/l&>Action: + +<& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $scrip->ActionObj->Id &> +
    +<&|/l&>Custom action preparation code: + + +
    +<&|/l&>Custom action cleanup code: + + +
    +<&|/l&>Template: + +<& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $scrip->TemplateObj->Id, Queue => $Queue &> +
    +

    <&|/l&>(Check box to delete)

    + +% while (my $scrip = $Scrips->Next ) { + + + + +% } + +
    + + +<% $scrip->Description || "(".loc('no value').")" |n %>
    +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3] +
    + +% } +<& /Elements/Submit &> + +<%init> +my (@actions); + +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); + + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $Scrips->LimitToQueue($id); +} +else { + $Scrips->LimitToGlobal(); +} + + + + +# {{{ deal with modifying and deleting existing scrips +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the scrip + if ($key =~ /^DeleteScrip-(\d+)/) { + my $id = $1; + my $scrip = new RT::Scrip($session{'CurrentUser'}); + $scrip->Load($id); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, loc("Scrip deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + + +<%ARGS> +$id => undef +$title => undef + diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates new file mode 100644 index 000000000..12677ca78 --- /dev/null +++ b/rt/html/Admin/Elements/EditTemplates @@ -0,0 +1,104 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + +
    + + +% if ($Templates->Count == 0 ) { +

    <&|/l&>(No templates)

    +% } else { + + + + + +% my $count; +% while (my $TemplateObj = $Templates->Next) { + + + + + +% } +
    +<&|/l&>(Check box to delete) + +
    + + + +<% loc($TemplateObj->Name) %> +
    <% loc($TemplateObj->Description) %> +
    +% } + +<& /Elements/Submit &> +
    + +<%INIT> +my $Templates = RT::Templates->new($session{'CurrentUser'}); +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +my @actions; + +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $Templates->LimitToQueue($id); +} +else { + $Templates->LimitToGlobal(); +} + +# Now let callbacks add their extra limits +$m->comp('/Elements/Callback', Templates => $Templates, %ARGS); + +# {{{ deal with deleting existing templates +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the template + if ($key =~ /^DeleteTemplate-(\d+)/) { + my $id = $1; + my $TemplateObj = RT::Template->new($session{'CurrentUser'}); + $TemplateObj->Load($id); + my ($retval, $msg) = $TemplateObj->Delete; + if ($retval) { + push @actions, loc("Template deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$Template => undef + diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments new file mode 100644 index 000000000..f791876be --- /dev/null +++ b/rt/html/Admin/Elements/EditUserComments @@ -0,0 +1,32 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => "Comments about $name" &> +<&|/l&>These comments aren't generally visible to the user:
    + + + + +<%ARGS> +$UserObj => undef + diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs new file mode 100644 index 000000000..87377820c --- /dev/null +++ b/rt/html/Admin/Elements/GroupTabs @@ -0,0 +1,76 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Groups/', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ( $GroupObj and $GroupObj->id ) { +$tabs->{"this"} = { class => "currentnav", + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id, + title => $GroupObj->Name, + current_subtab => $current_subtab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id }, + + D => { title => loc('Members'), + path => "Admin/Groups/Members.html?id=" . $GroupObj->id }, + + F => { title => loc('Group Rights'), + path => "Admin/Groups/GroupRights.html?id=" . $GroupObj->id, }, + G => { title => loc('User Rights'), + path => "Admin/Groups/UserRights.html?id=" . $GroupObj->id, }, + } +} +} +$tabs->{"A"} = { title => loc('Select group'), + path => "Admin/Groups/", }; +$tabs->{"B"} = { title => loc('New group'), + path => "Admin/Groups/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'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} + $tabs->{'this'}->{"current_subtab"} = $current_tab; + $current_tab = "Admin/Groups/Modify.html?id=".$GroupObj->id if $GroupObj; + + +<%ARGS> +$GroupObj => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + + diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header new file mode 100644 index 000000000..92a7c54ca --- /dev/null +++ b/rt/html/Admin/Elements/Header @@ -0,0 +1,28 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $Title &> + +<%ARGS> +$Title => undef + diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields new file mode 100644 index 000000000..032f680ee --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +% my $count = 0; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $count++; +<%$CustomFieldObj->id%>/<% loc($CustomFieldObj->Type) %>/<%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%> +
    +% } +% if (!$count) { +<&|/l&>(No custom fields) +% } + +<%init> +my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +$CustomFields->LimitToGlobal(); + diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips new file mode 100644 index 000000000..8dba3b6c4 --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +% my $count = 0; +% while (my $scrip = $Scrips->Next ) { +% $count++; +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3] +
    +% } +% if (!$count) { +<&|/l&>(No scrips) +% } + +<%init> +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +$Scrips->LimitToGlobal(); + diff --git a/rt/html/Admin/Elements/ModifyQueue b/rt/html/Admin/Elements/ModifyQueue new file mode 100644 index 000000000..e5761df35 --- /dev/null +++ b/rt/html/Admin/Elements/ModifyQueue @@ -0,0 +1,78 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc('Editing Configuration for queue [_1]', $QueueObj->Id) &> + +
    + + + + + + + + + + + + + + + + + +
    +<&|/l&>Queue Name: +
    +<&|/l&>Description:
    +<&|/l&>Correspondence Address: + + + + +<&|/l&>Comment Address: + +
    +<&|/l&>Priority starts at: + + +<&|/l&>Over time, priority moves toward: + +
    +<&|/l&>Requests should be due in: + + <&|/l&>days. +
    +<& /Elements/Submit &> +
    +<& /Elements/TitleBoxEnd &> + +<%INIT> + + + +<%ARGS> + + +$QueueObj => undef + diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate new file mode 100644 index 000000000..5f75bac5f --- /dev/null +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + +
    +<&|/l&>Name: + +
    +
    +<&|/l&>Description: + +
    +
    +<&|/l&>Content:
    +
    + +
    + +<%INIT> + + + +<%ARGS> +$Name => undef +$Description => undef +$Content => undef + diff --git a/rt/html/Admin/Elements/ModifyUser b/rt/html/Admin/Elements/ModifyUser new file mode 100644 index 000000000..876e8a71b --- /dev/null +++ b/rt/html/Admin/Elements/ModifyUser @@ -0,0 +1,99 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc('Editing Configuration for user [_1]', $UserObj->Name) &> + +
    + + +<&|/l&>Name: +
    +<&|/l&>New Password:
    +<&|/l&>Retype Password:
    + +<&|/l&>Comments: + +
    +<&|/l&>Signature: +
    +<&|/l&>EmailAddress: +
    +<&|/l&>FreeformContactInfo: +
    +<&|/l&>Organization: +
    +<&|/l&>RealName: +
    +<&|/l&>NickName: +
    +<&|/l&>Lang: +
    +<&|/l&>EmailEncoding: +
    +<&|/l&>WebEncoding: +
    +<&|/l&>ExternalContactInfoId: +
    +<&|/l&>ContactInfoSystem: +
    +<&|/l&>UnixUsername: +
    +<&|/l&>ExternalAuthId: +
    +<&|/l&>AuthSystem: +
    +<&|/l&>HomePhone: +
    +<&|/l&>WorkPhone: +
    +<&|/l&>MobilePhone: +
    +<&|/l&>PagerPhone: +
    +<&|/l&>Address1: +
    +<&|/l&>Address2: +
    +<&|/l&>City: +
    +<&|/l&>State: +
    +<&|/l&>Zip: +
    +<&|/l&>Country: +
    +<& /Elements/Submit &> +
    +<& /Elements/TitleBoxEnd &> + +<%INIT> + + + +<%ARGS> + + +$UserObj => undef + diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser new file mode 100644 index 000000000..05bb51196 --- /dev/null +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +
      +%while(my $ACE = $ACL->Next) { + +
    • <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) + +%} +
    + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); + +<%ARGS> +$PrincipalId => undef +$QueueObj => undef + diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs new file mode 100644 index 000000000..3b4805afc --- /dev/null +++ b/rt/html/Admin/Elements/QueueTabs @@ -0,0 +1,93 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Queues/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> +my $tabs; +if ($id) { + $tabs->{'this'} = { + title => $QueueObj->Name, + path => "Admin/Queues/Modify.html?id=".$id, + current_subtab => $current_tab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Queues/Modify.html?id=".$id, + }, + D => { title => loc('Watchers'), + path => "Admin/Queues/People.html?id=".$id, + }, + + E => { title => loc('Scrips'), + path => "Admin/Queues/Scrips.html?id=".$id, + }, + F => { title => loc('Templates'), + path => "Admin/Queues/Templates.html?id=".$id, + }, + + G => { title => loc('Custom Fields'), + path => 'Admin/Queues/CustomFields.html?id='.$id, + }, + + H => { title => loc('Group Rights'), + path => "Admin/Queues/GroupRights.html?id=".$id, + }, + I => { title => loc('User Rights'), + path => "Admin/Queues/UserRights.html?id=".$id, + } + } + }; +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) { + $tabs->{"A"} = { title => loc('Select queue'), + path => "Admin/Queues/", + }; + $tabs->{"B"} = { title => loc('New queue'), + path => "Admin/Queues/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'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} + $current_tab = "Admin/Queues/Modify.html?id=".$id if $id; + + +<%ARGS> +$QueueObj => undef +$id => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType new file mode 100644 index 000000000..b5f4c079a --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + + +<%ARGS> +$Default=>undef +$Name => 'Type' + diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups new file mode 100644 index 000000000..5df49ad04 --- /dev/null +++ b/rt/html/Admin/Elements/SelectGroups @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'System'); + + +<%ARGS> +$Name => 'groups' + diff --git a/rt/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup new file mode 100644 index 000000000..47978d3bf --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyGroup @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +%while ( $Group = $Groups->Next) { +<%$Group->id%>: <%$Group->Name%>
    +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; + +<%ARGS> + diff --git a/rt/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue new file mode 100644 index 000000000..c5152ac95 --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyQueue @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +%while ( $queue = $queues->Next) { +<%$queue->id%>: <%$queue->Name%>
    +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; + +<%ARGS> + diff --git a/rt/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser new file mode 100644 index 000000000..9e7789b4c --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyUser @@ -0,0 +1,49 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +%while ( $user = $users->Next) { +<%$user->id%>: <%$user->Name%>
    +%} +<%INIT> +my ($user); +my $users = new RT::Users($session{'CurrentUser'}); +$users->Limit(FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=' ); + +if (defined $IdLike) { +$users->Limit(FIELD => 'Name', + VALUE => $IdLike, + OPERATOR => 'LIKE' ); +} +if (defined $EmailLike) { +$users->Limit(FIELD => 'EmailAddress', + VALUE => $EmailLike, + OPERATOR => 'LIKE'); + +} + +<%ARGS> +$IdLike => undef +$EmailLike => undef + diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers new file mode 100644 index 000000000..e5c28e909 --- /dev/null +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +% if ($Show ne 'Groups') { +<&|/l&>Users + +
    +% } +% if ($Show ne 'Users') { +<&|/l&>Groups + +% } + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + +my $groups = new RT::Groups($session{'CurrentUser'}); + +# self-recursive group membership considered harmful! +$groups->Limit(FIELD => 'id', VALUE => $Group->id, OPERATOR => '!=' ); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + + + +<%ARGS> +$Name => 'Users' +$Show => 'All' +$Group + diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights new file mode 100644 index 000000000..37a06dc4d --- /dev/null +++ b/rt/html/Admin/Elements/SelectRights @@ -0,0 +1,90 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + + + + + +
    +

    <&|/l&>Current rights

    +% if ($ACLObj->Count() > 0) { +(<&|/l&>Check box to revoke right)
    +% } else { +<&|/l&>No rights granted.
    +% } +% while (my $right = $ACLObj->Next()) { +% if ($right->RightName) { + <% loc($right->RightName) %>
    +% } +% } +
    +

    <&|/l&>New rights

    + +
    +<%INIT> + my ($right, $ACLDesc, $AppliesTo, %Rights); + + # if the principal id points to a user, we really want to point + # to their ACL equivalence group. The machinations we're going through + # lead me to start to suspect that we really want users and groups + # to just be the same table. or _maybe_ that we want an object db. + my $princ = RT::Principal->new($RT::SystemUser); + $princ->Load($PrincipalId); + if ($princ->PrincipalType eq 'User') { + my $group = RT::Group->new($RT::SystemUser); + $group->LoadACLEquivalenceGroup($princ); + $PrincipalId = $group->PrincipalId; + } + + + my $ACLObj = new RT::ACL($session{'CurrentUser'}); + my $ACE = new RT::ACE($session{'CurrentUser'}); + + + $ACLObj->LimitToObject( $Object); + $ACLObj->LimitToPrincipal( Id => $PrincipalId); + + if (ref($Object) && UNIVERSAL::can($Object, 'AvailableRights')) { + %Rights = %{$Object->AvailableRights}; + } + + else { + %Rights = { loc('System Error') => loc("No rights found")}; + } + + $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; + + +<%ARGS> +$PrincipalType => undef +$PrincipalId => undef +$Object =>undef + diff --git a/rt/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip new file mode 100644 index 000000000..18e4098a0 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScrip @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'Scrip' + + diff --git a/rt/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction new file mode 100644 index 000000000..0d7f8ccfa --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripAction @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + + diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition new file mode 100644 index 000000000..aeb366a44 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripCondition @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + + diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple new file mode 100644 index 000000000..98e9ee78c --- /dev/null +++ b/rt/html/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = "SELECTED"; +} +elsif ($Default == 0 ) { + $MultipleDefault = "SELECTED"; +} + + +<%ARGS> +$Name => 'Single' +$Default => 1 + diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate new file mode 100644 index 000000000..70ff4d1cc --- /dev/null +++ b/rt/html/Admin/Elements/SelectTemplate @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); + + +<%ARGS> + +$Queue => undef +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + + diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers new file mode 100644 index 000000000..d4c8a85ad --- /dev/null +++ b/rt/html/Admin/Elements/SelectUsers @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + + +<%ARGS> +$Name => 'Users' + diff --git a/rt/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs new file mode 100644 index 000000000..f38febdd7 --- /dev/null +++ b/rt/html/Admin/Elements/SystemTabs @@ -0,0 +1,70 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, subtabs => $tabs, + current_tab => 'Admin/Global/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { + + A => { title => loc('Scrips'), + path => 'Admin/Global/Scrips.html', + }, + B => { title => loc('Templates'), + path => 'Admin/Global/Templates.html', + }, + + F => { title => loc('Custom Fields'), + path => 'Admin/Global/CustomFields.html', + }, + + G => { title => loc('Group Rights'), + path => 'Admin/Global/GroupRights.html', + }, + H => { title => loc('User Rights'), + path => 'Admin/Global/UserRights.html', + } + +}; + + # 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_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/Tabs b/rt/html/Admin/Elements/Tabs new file mode 100644 index 000000000..8fa2708fb --- /dev/null +++ b/rt/html/Admin/Elements/Tabs @@ -0,0 +1,63 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Tabs, + tabs => $tabs, + current_toptab => 'Admin/', + current_tab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { A => { title => loc('Users'), + path => 'Admin/Users/', + }, + B => { title => loc('Groups'), + path => 'Admin/Groups/', + }, + C => { title => loc('Queues'), + path => 'Admin/Queues/', + }, + D => { 'title' => loc('Global'), + path => 'Admin/Global/', + }, + }; + + # 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_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + + + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs new file mode 100644 index 000000000..764fdfcb5 --- /dev/null +++ b/rt/html/Admin/Elements/UserTabs @@ -0,0 +1,74 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Users/', + current_subtab => $current_subtab, + 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 +# } + + } +} +} +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} ) { + if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } +} + + + +<%ARGS> +$UserObj => undef +$id => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + -- cgit v1.2.1