diff options
Diffstat (limited to 'rt/share/html/Admin/Elements')
45 files changed, 161 insertions, 1121 deletions
diff --git a/rt/share/html/Admin/Elements/AddCustomFieldValue b/rt/share/html/Admin/Elements/AddCustomFieldValue index 4871f7a17..4a68c369d 100755 --- a/rt/share/html/Admin/Elements/AddCustomFieldValue +++ b/rt/share/html/Admin/Elements/AddCustomFieldValue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -54,7 +54,7 @@ <th><&|/l&>Name</&></th> <th><&|/l&>Description</&></th> % if ( $CustomField->Type ne 'Combobox' ) { -<th><&|/l&>Category</&></th> +<th class="categoryheader"><&|/l&>Category</&></th> % } </tr> @@ -68,16 +68,18 @@ % my $BasedOnObj = $CustomField->BasedOnObj; % if ( $BasedOnObj and $BasedOnObj->id ) { % my $Categories = $BasedOnObj->Values; -<select name="<% $paramtag %>-Category" size="1"> +<select class="editcategory" name="<% $paramtag %>-Category" size="1"> <option value=""><&|/l&>(no value)</&></option> % while (my $Value = $Categories->Next) { <option value="<% $Value->Name %>"><% $Value->Name %></option> % } % } else { -<input type="text" size="10" name="<% $paramtag %>-Category" value="" /> +<input type="text" size="10" class="editcategory" name="<% $paramtag %>-Category" value="" /> % } </td> % } + +% $m->callback(CallbackName => 'AfterCustomFieldValueInput', CustomFieldObj => $CustomField, ARGSRef => \%ARGS ); </tr> </table> diff --git a/rt/share/html/Admin/Elements/ConfigureMyRT b/rt/share/html/Admin/Elements/ConfigureMyRT index f9b472d99..8b625a901 100644 --- a/rt/share/html/Admin/Elements/ConfigureMyRT +++ b/rt/share/html/Admin/Elements/ConfigureMyRT @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/CreateUserCalled b/rt/share/html/Admin/Elements/CreateUserCalled index bf994be85..5f83f4b3d 100755 --- a/rt/share/html/Admin/Elements/CreateUserCalled +++ b/rt/share/html/Admin/Elements/CreateUserCalled @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/CustomFieldTabs b/rt/share/html/Admin/Elements/CustomFieldTabs deleted file mode 100644 index 17b241cb7..000000000 --- a/rt/share/html/Admin/Elements/CustomFieldTabs +++ /dev/null @@ -1,121 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Tabs, - current_tab => 'Admin/CustomFields/', - subtabs => $tabs, - current_subtab => $current_tab, - Title => $Title &> -<%INIT> -my $tabs; - -if ($id) { - my $cf = RT::CustomField->new( $session{'CurrentUser'} ); - $cf->Load($id); - $tabs = { - this => { - title => $cf->Name, - path => "Admin/CustomFields/Modify.html?id=" . $id, - current_subtab => $current_tab, - - subtabs => { - - C => { title => loc('Basics'), - path => "Admin/CustomFields/Modify.html?id=" . $id, - }, - F => { title => loc('Group Rights'), - path => "Admin/CustomFields/GroupRights.html?id=" - . $id, }, - G => { - title => loc('User Rights'), - path => "Admin/CustomFields/UserRights.html?id=" . $id, - }, - - } } - - }; - - - if ($cf->LookupType =~ /^RT::(?:Queue|Group)(?:\Z|-)/i) { - $tabs->{'this'}->{subtabs}->{D} = { - title => loc('Applies to'), - path => "Admin/CustomFields/Objects.html?id=" . $id, - }; - } -} - -if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField') - || $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomFieldValues') ) { - $tabs->{"A"} = { title => loc('Select'), - path => "Admin/CustomFields/", - }; -} -if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField')) { - $tabs->{"B"} = { title => loc('Create'), - path => "Admin/CustomFields/Modify.html?Create=1", - separator => 1, - }; -} - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - -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; - } -} -if( $id ) { $current_tab = "Admin/CustomFields/Modify.html?id=" . $id } -</%INIT> -<%ARGS> -$Title => undef -$id => undef -$current_tab => undef -$subtabs => undef -$current_subtab => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditCustomField b/rt/share/html/Admin/Elements/EditCustomField index 920698d98..632b3d8f8 100755 --- a/rt/share/html/Admin/Elements/EditCustomField +++ b/rt/share/html/Admin/Elements/EditCustomField @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValues b/rt/share/html/Admin/Elements/EditCustomFieldValues index c2a027b81..4d0dc51b8 100755 --- a/rt/share/html/Admin/Elements/EditCustomFieldValues +++ b/rt/share/html/Admin/Elements/EditCustomFieldValues @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -58,7 +58,7 @@ <th><&|/l&>Name</&></th> <th><&|/l&>Description</&></th> % if ($CustomField->Type ne 'Combobox') { -<th><&|/l&>Category</&></th> +<th class="categoryheader"><&|/l&>Category</&></th> % } </tr> @@ -68,22 +68,23 @@ <td><input type="checkbox" class="checkbox" name="Delete-<% $paramtag %>" /></td> <td><input type="text" size="3" name="<% $paramtag %>-SortOrder" value="<% $value->SortOrder %>" /></td> <td><input type="text" size="25" name="<% $paramtag %>-Name" value="<% $value->Name %>" /></td> -<td><input type="text" size="45" name="<% $paramtag %>-Description" value="<% $value->Description %>" /></td> +<td><input type="text" size="45" name="<% $paramtag %>-Description" value="<% $value->Description || '' %>" /></td> % if ( $CustomField->Type ne 'Combobox' ) { <td> % if ( $Categories ) { % my $selected = $value->Category; % $selected = '' unless defined $selected; -<select name="<% $paramtag %>-Category" size="1"> +<select class="editcategory" name="<% $paramtag %>-Category" size="1"> <option value=""<% $selected eq '' ? q[ selected="selected"] : "" |n%>><&|/l&>(no value)</&></option> % while (my $Value = $Categories->Next) { <option value="<% $Value->Name %>"<% $selected eq $Value->Name ? q[ selected="selected"] : "" |n%>><% $Value->Name %></option> % } % } else { -<input type="text" size="10" name="<% $paramtag %>-Category" value="<% $value->Category || '' %>" /> +<input type="text" size="10" class="editcategory" name="<% $paramtag %>-Category" value="<% $value->Category || '' %>" /> % } </td> % } +% $m->callback(CallbackName => 'AfterCustomFieldValueInput', CustomFieldObj => $CustomField, CustomFieldValueObj => $value, ARGSRef => \%ARGS ); </tr> % } diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValuesSource b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource index 9455c74db..5b11ec8e0 100644 --- a/rt/share/html/Admin/Elements/EditCustomFieldValuesSource +++ b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/EditCustomFields b/rt/share/html/Admin/Elements/EditCustomFields index 91d5cffaa..aa7b62204 100755 --- a/rt/share/html/Admin/Elements/EditCustomFields +++ b/rt/share/html/Admin/Elements/EditCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/EditQueueWatchers b/rt/share/html/Admin/Elements/EditQueueWatchers index 017c9ec8e..073278c9e 100755 --- a/rt/share/html/Admin/Elements/EditQueueWatchers +++ b/rt/share/html/Admin/Elements/EditQueueWatchers @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/EditScrip b/rt/share/html/Admin/Elements/EditScrip index c2e9de19f..858ab9d9b 100755 --- a/rt/share/html/Admin/Elements/EditScrip +++ b/rt/share/html/Admin/Elements/EditScrip @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -47,7 +47,7 @@ %# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> -<form method="post" action="Scrip.html"> +<form method="post" action="Scrip.html" id="ModifyScrip" name="ModifyScrip"> <input type="hidden" class="hidden" name="id" value="<% $id %>" /> <input type="hidden" class="hidden" name="Queue" value="<% $Queue %>" /> @@ -55,12 +55,13 @@ <table> <tr><td align="right"><&|/l&>Description</&>:</td><td> -<input name="Scrip-<% $id %>-Description" - size="60" +<tr><td class="label"><&|/l&>Description</&>:</td><td class="value">\ +<input name="Scrip-<% $id %>-Description" \ + size="60" \ value="<% $ARGS{"Scrip-$id-Description"} || $scrip->Description || '' %>" /> </td></tr> -<tr><td align="right"><&|/l&>Condition</&>:</td><td> +<tr><td class="label"><&|/l&>Condition</&>:</td><td class="value">\ <& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $ARGS{"Scrip-$id-ScripCondition"} || $scrip->ConditionObj->Id, @@ -75,7 +76,7 @@ ScripX => $ARGS{"Scrip-$id-ScripCondition"} || $scrip->ConditionObj->Id, &> -<tr><td align="right"><&|/l&>Action</&>:</td><td> +<tr><td class="label"><&|/l&>Action</&>:</td><td class="value">\ <& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $ARGS{"Scrip-$id-ScripAction"} || $scrip->ActionObj->Id, @@ -90,14 +91,14 @@ ScripX => $ARGS{"Scrip-$id-ScripAction"} || $scrip->ActionObj->Id, &> -<tr><td align="right"><&|/l&>Template</&>:</td><td> +<tr><td class="label"><&|/l&>Template</&>:</td><td class="value">\ <& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $ARGS{"Scrip-$id-Template"} || $scrip->TemplateObj->Id, Queue => $Queue, &></td></tr> -<tr><td align="right"><&|/l&>Stage</&>:</td><td> +<tr><td class="label"><&|/l&>Stage</&>:</td><td class="value">\ <& /Admin/Elements/SelectStage, Name => "Scrip-$id-Stage", Default => $ARGS{"Scrip-$id-Stage"} || $scrip->Stage, @@ -106,6 +107,7 @@ </table> </&> +% if ($session{CurrentUser}->HasRight(Object => $RT::System, Right => 'ExecuteCode')) { <& /Elements/Submit, Label => $SubmitLabel, Reset => 1, @@ -117,21 +119,21 @@ <i><&|/l&>(Use these fields when you choose 'User Defined' for a condition or action)</&></i> </td></tr> -<tr><td class="labeltop"><&|/l&>Custom condition</&>:</td><td> +<tr><td class="labeltop"><&|/l&>Custom condition</&>:</td><td class="value"> % my $code = $ARGS{"Scrip-$id-CustomIsApplicableCode"} || $scrip->CustomIsApplicableCode || ''; % my $lines = @{[ $code =~ /\n/gs ]} + 3; % $lines = $min_lines if $lines < $min_lines; <textarea cols="80" rows="<% $lines %>" name="Scrip-<% $id %>-CustomIsApplicableCode"><% $code %></textarea> </td></tr> -<tr><td class="labeltop"><&|/l&>Custom action preparation code</&>:</td><td> +<tr><td class="labeltop"><&|/l&>Custom action preparation code</&>:</td><td class="value"> % $code = $ARGS{"Scrip-$id-CustomPrepareCode"} || $scrip->CustomPrepareCode || ''; % $lines = @{[ $code =~ /\n/gs ]} + 3; % $lines = $min_lines if $lines < $min_lines; <textarea cols="80" rows="<% $lines %>" name="Scrip-<% $id %>-CustomPrepareCode"><% $code %></textarea> </td></tr> -<tr><td class="labeltop"><&|/l&>Custom action cleanup code</&>:</td><td> +<tr><td class="labeltop"><&|/l&>Custom action cleanup code</&>:</td><td class="value"> % $code = $ARGS{"Scrip-$id-CustomCommitCode"} || $scrip->CustomCommitCode || ''; % $lines = @{[ $code =~ /\n/gs ]} + 3; % $lines = $min_lines if $lines < $min_lines; @@ -141,6 +143,8 @@ </table> </&> +% } + <& /Elements/Submit, Label => $SubmitLabel, Reset => 1, @@ -167,6 +171,9 @@ unless ( $id ) { my $min_lines = 10; +my ($ok, $msg) = $scrip->CompileCheck; +push @actions, $msg if !$ok; + </%init> <%ARGS> diff --git a/rt/share/html/Admin/Elements/EditScrips b/rt/share/html/Admin/Elements/EditScrips index be208d6c4..2fdcae670 100755 --- a/rt/share/html/Admin/Elements/EditScrips +++ b/rt/share/html/Admin/Elements/EditScrips @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -89,12 +89,14 @@ if ( $id ) { if ($QueueObj->id) { $Scrips->LimitToQueue($id); + $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'}; } else { $Scrips->LimitToGlobal(); + $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'GlobalScrips'}; } -# {{{ deal with modifying and deleting existing scrips +# deal with modifying and deleting existing scrips # we still support DeleteScrip-id format but array is preferred foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) { my $scrip = RT::Scrip->new($session{'CurrentUser'}); @@ -107,10 +109,6 @@ foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) { push @actions, $msg; } } -# }}} - -$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'}; - </%init> <%ARGS> diff --git a/rt/share/html/Admin/Elements/EditTemplates b/rt/share/html/Admin/Elements/EditTemplates index 5839720e0..2f681aca3 100755 --- a/rt/share/html/Admin/Elements/EditTemplates +++ b/rt/share/html/Admin/Elements/EditTemplates @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/EditUserComments b/rt/share/html/Admin/Elements/EditUserComments index 9fb2230e8..28563c6a4 100755 --- a/rt/share/html/Admin/Elements/EditUserComments +++ b/rt/share/html/Admin/Elements/EditUserComments @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/GlobalCustomFieldTabs b/rt/share/html/Admin/Elements/GlobalCustomFieldTabs deleted file mode 100755 index 475681b05..000000000 --- a/rt/share/html/Admin/Elements/GlobalCustomFieldTabs +++ /dev/null @@ -1,105 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/SystemTabs, subtabs => $tabs, - current_tab => 'Admin/Global/CustomFields/index.html', - current_subtab => $current_tab, - Title => $Title &> -<%INIT> - -my $tabs = { - - A => { - title => loc('Users'), - text => loc('Select custom fields for all users'), - path => 'Admin/Global/CustomFields/Users.html', - }, - - B => { - title => loc('Groups'), - text => loc('Select custom fields for all user groups'), - path => 'Admin/Global/CustomFields/Groups.html', - }, - - C => { - title => loc('Queues'), - text => loc('Select custom fields for all queues'), - path => 'Admin/Global/CustomFields/Queues.html', - }, - - F => { - title => loc('Tickets'), - text => loc('Select custom fields for tickets in all queues'), - path => 'Admin/Global/CustomFields/Queue-Tickets.html', - }, - - G => { - title => loc('Ticket Transactions'), - text => loc('Select custom fields for transactions on tickets in all queues'), - path => 'Admin/Global/CustomFields/Queue-Transactions.html', - }, - -}; - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - - foreach my $tab (sort keys %{$tabs}) { - if ($tabs->{$tab}->{'path'} eq $current_tab) { - $tabs->{$tab}->{"subtabs"} = $subtabs; - $tabs->{$tab}->{"current_subtab"} = $current_subtab; - } - } -</%INIT> - - -<%ARGS> -$id => undef -$current_tab => '' -$subtabs => undef -$current_subtab => undef -$Title => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/GroupTabs b/rt/share/html/Admin/Elements/GroupTabs deleted file mode 100755 index 7a677ee3c..000000000 --- a/rt/share/html/Admin/Elements/GroupTabs +++ /dev/null @@ -1,102 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED 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, }, - H => { title => loc('History'), - path => "Admin/Groups/History.html?id=" . $GroupObj->id }, - } -} -} -$tabs->{"A"} = { title => loc('Select'), - path => "Admin/Groups/", }; -$tabs->{"B"} = { title => loc('Create'), - path => "Admin/Groups/Modify.html?Create=1", - separator => 1, }; - -# Now let callbacks add their extra tabs -$m->callback( %ARGS, tabs => $tabs ); -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; - -</%INIT> -<%ARGS> -$GroupObj => undef -$subtabs => undef -$current_subtab => undef -$current_tab => undef -$Title => undef -</%ARGS> - diff --git a/rt/share/html/Admin/Elements/Header b/rt/share/html/Admin/Elements/Header index fac422520..afb745e0d 100755 --- a/rt/share/html/Admin/Elements/Header +++ b/rt/share/html/Admin/Elements/Header @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/ListGlobalCustomFields b/rt/share/html/Admin/Elements/ListGlobalCustomFields index 1fd8b768b..1d1cd392d 100755 --- a/rt/share/html/Admin/Elements/ListGlobalCustomFields +++ b/rt/share/html/Admin/Elements/ListGlobalCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -56,6 +56,6 @@ % } <%init> -my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +my $CustomFields = RT::CustomFields->new ($session{'CurrentUser'}); $CustomFields->LimitToGlobal(); </%INIT> diff --git a/rt/share/html/Admin/Elements/ListGlobalScrips b/rt/share/html/Admin/Elements/ListGlobalScrips index 7f1039ed9..701ffbfa7 100755 --- a/rt/share/html/Admin/Elements/ListGlobalScrips +++ b/rt/share/html/Admin/Elements/ListGlobalScrips @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -56,15 +56,12 @@ %ARGS, Format => $Format, Collection => $Scrips, - ShowHeader => 0, &> % } <%init> -my $Format = q{'<a href="__WebPath__/Admin/Global/Scrip.html?id=__id__&Queue=0">__id__</a>/TITLE:#'} - .q{,'<a href="__WebPath__/Admin/Global/Scrip.html?id=__id__&Queue=0">__AutoDescription__</a>/TITLE:Condition, Action and Template'} - .q{__NEWLINE__,'','<small>__Description__</small>'}; +my $Format = RT->Config->Get('AdminSearchResultFormat')->{'GlobalScrips'}; my $Scrips = RT::Scrips->new( $session{'CurrentUser'} ); $Scrips->LimitToGlobal; diff --git a/rt/share/html/Admin/Elements/ModifyTemplate b/rt/share/html/Admin/Elements/ModifyTemplate index 062090531..ebe7c73bc 100755 --- a/rt/share/html/Admin/Elements/ModifyTemplate +++ b/rt/share/html/Admin/Elements/ModifyTemplate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -47,38 +47,35 @@ %# END BPS TAGGED BLOCK }}} <table> <tr> -<td align="right"> -<&|/l&>Name</&>: -</td> -<td> -<input name="Name" value="<%$Name%>" size="20" /><br /> -</td> +<td class="label"><&|/l&>Name</&>:</td> +<td class="value"><input name="Name" value="<%$Name||''%>" size="20" /></td> </tr> <tr> -<td align="right"> -<&|/l&>Description</&>: -</td> -<td> -<input name="Description" value="<%$Description%>" size="80" /><br /> -</td> +<td class="label"><&|/l&>Description</&>:</td> +<td class="value"><input name="Description" value="<%$Description||''%>" size="80" /></td> </tr> <tr> -<td align="right" valign="top"> -<&|/l&>Content</&>:<br /> -</td> -<td> -<textarea name="Content" rows="25" cols="80" wrap="soft"> -<%$Content%></textarea> +<td class="label"><&|/l&>Type</&>:</td> +<td class="value"> +<input type="radio" name="Type" value="Perl" <% $Type eq "Perl" ? 'checked="checked"' : "" |n %>><&|/l&>Perl</&></input><br /> +<input type="radio" name="Type" value="Simple" <% $Type eq "Simple" ? 'checked="checked"' : "" |n %>><&|/l&>Simple</&></input><br /> </td> </tr> +<tr> +<td class="label" valign="top"><&|/l&>Content</&>:</td> +<td class="value"><textarea name="Content" rows="25" cols="80" wrap="soft"><%$Content||''%></textarea></td> +</tr> </table> <%INIT> +$Type = 'Perl' if !$Type; + </%INIT> <%ARGS> -$Name => undef -$Description => undef -$Content => undef +$Name => '' +$Description => '' +$Content => '' +$Type => 'Perl' </%ARGS> diff --git a/rt/share/html/Admin/Elements/ObjectCustomFields b/rt/share/html/Admin/Elements/ObjectCustomFields deleted file mode 100644 index 7798b8ea8..000000000 --- a/rt/share/html/Admin/Elements/ObjectCustomFields +++ /dev/null @@ -1,111 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Header, Title => $title &> -<& $ObjectTabs, -$id ? ( - id => $Object->id, - current_tab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, - current_subtab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, - "${Type}Obj" => $Object, -) : ( - current_tab => "Admin/Global/CustomFields/${QualifiedType}s.html", -), - Title => $title - &> - -<& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object &> -<%INIT> -# XXX TODO: Validate here? -#$ObjectType =~ /^RT::(Queue|User|Group)$/ -# or Abort(loc("Object of type [_1] cannot take custom fields", $ObjectType), SuppressHeader => 1); - - - -my $Type = $1; -my $Types = $Type.'s'; -my $ObjectTabs; -my $Object = $ObjectType->new($session{'CurrentUser'}); - - -my $QualifiedType; -my $FriendlySubTypes; -if (defined $SubType && $SubType =~/^RT::(.*)$/) { - $FriendlySubTypes = RT::CustomField->new($session{'CurrentUser'})->FriendlyLookupType($Object->CustomFieldLookupType); - $QualifiedType = "$Type-$1"; -} else { - $QualifiedType = $Type; -} - -if ($id) { - $Object->Load($id) || Abort(loc("Couldn't load object [_1]", $id), SuppressHeader => 1); - $ObjectTabs = "/Admin/Elements/${Type}Tabs"; -} else { - $ObjectTabs = "/Admin/Elements/GlobalCustomFieldTabs"; - -} - -my $title; -if ($id) { -$title = loc('Edit Custom Fields for [_1]', $Object->Name); -} -elsif ($SubType) { - - $title= loc("Modify Custom Fields which apply to [_1] for all [_2]", loc(lc($FriendlySubTypes)), loc(lc($Types))); -} else { - $title =loc("Modify Custom Fields which apply to all [_1]", loc(lc($Types))); - -} -my $sub_type_url; -$sub_type_url = "SubType=$SubType" if $SubType; - -</%INIT> -<%ARGS> -$id => undef -$ObjectType -$SubType => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/PickCustomFields b/rt/share/html/Admin/Elements/PickCustomFields index 10699421d..1c58b6ab4 100644 --- a/rt/share/html/Admin/Elements/PickCustomFields +++ b/rt/share/html/Admin/Elements/PickCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/PickObjects b/rt/share/html/Admin/Elements/PickObjects index dbf84cb1d..24a9e69a4 100644 --- a/rt/share/html/Admin/Elements/PickObjects +++ b/rt/share/html/Admin/Elements/PickObjects @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/QueueRightsForUser b/rt/share/html/Admin/Elements/QueueRightsForUser index 9acf98fc5..b8ef1b1d8 100755 --- a/rt/share/html/Admin/Elements/QueueRightsForUser +++ b/rt/share/html/Admin/Elements/QueueRightsForUser @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -54,7 +54,7 @@ </ul> <%INIT> -my $ACL = new RT::ACL($session{'CurrentUser'}); +my $ACL = RT::ACL->new($session{'CurrentUser'}); $ACL->LimitToQueue($QueueObj->id); $ACL->LimitPrincipalToUser($PrincipalId); </%INIT> diff --git a/rt/share/html/Admin/Elements/QueueTabs b/rt/share/html/Admin/Elements/QueueTabs deleted file mode 100755 index 8ce08dfd3..000000000 --- a/rt/share/html/Admin/Elements/QueueTabs +++ /dev/null @@ -1,123 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED 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, - }, - - G1 => { title => loc('Ticket Custom Fields'), - path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket&id='.$id, - }, - - G2 => { title => loc('Transaction Custom Fields'), - path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&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, - }, - J => { title => loc('History'), - path => "Admin/Queues/History.html?id=" . $QueueObj->id - }, - } - }; -} -if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) { - $tabs->{"A"} = { title => loc('Select'), - path => "Admin/Queues/", - }; - $tabs->{"B"} = { title => loc('Create'), - path => "Admin/Queues/Modify.html?Create=1", - separator => 1, }; -} - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); -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; -</%INIT> - -<%ARGS> -$QueueObj => undef -$id => undef -$subtabs => undef -$current_subtab => undef -$current_tab => undef -$Title => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectCustomField b/rt/share/html/Admin/Elements/SelectCustomField index fac69fad5..7f4e45eb5 100644 --- a/rt/share/html/Admin/Elements/SelectCustomField +++ b/rt/share/html/Admin/Elements/SelectCustomField @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldLookupType b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType index e124dfb64..514264b2e 100644 --- a/rt/share/html/Admin/Elements/SelectCustomFieldLookupType +++ b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldType b/rt/share/html/Admin/Elements/SelectCustomFieldType index 6eb149764..50175cab9 100755 --- a/rt/share/html/Admin/Elements/SelectCustomFieldType +++ b/rt/share/html/Admin/Elements/SelectCustomFieldType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -52,7 +52,7 @@ </select> <%INIT> my $cf = RT::CustomField->new($session{'CurrentUser'}); - +$Default = "Freeform-1" if $Default eq "-0"; </%INIT> <%ARGS> $Default=>undef diff --git a/rt/share/html/Admin/Elements/SelectGroups b/rt/share/html/Admin/Elements/SelectGroups index d6888adf1..e839f754a 100755 --- a/rt/share/html/Admin/Elements/SelectGroups +++ b/rt/share/html/Admin/Elements/SelectGroups @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -52,7 +52,7 @@ </select> <%INIT> -my $groups = new RT::Groups($session{'CurrentUser'}); +my $groups = RT::Groups->new($session{'CurrentUser'}); $groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain); </%INIT> diff --git a/rt/share/html/Admin/Elements/SelectModifyGroup b/rt/share/html/Admin/Elements/SelectModifyGroup index 85dee9e16..8e51fa6b7 100755 --- a/rt/share/html/Admin/Elements/SelectModifyGroup +++ b/rt/share/html/Admin/Elements/SelectModifyGroup @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -50,7 +50,7 @@ %} <%INIT> my ($Group); -my $Groups = new RT::Groups($session{'CurrentUser'}); +my $Groups = RT::Groups->new($session{'CurrentUser'}); $Groups->UnLimit; </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectModifyQueue b/rt/share/html/Admin/Elements/SelectModifyQueue index d676d0178..e0f7d22b3 100755 --- a/rt/share/html/Admin/Elements/SelectModifyQueue +++ b/rt/share/html/Admin/Elements/SelectModifyQueue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -50,7 +50,7 @@ %} <%INIT> my ($queue); -my $queues = new RT::Queues($session{'CurrentUser'}); +my $queues = RT::Queues->new($session{'CurrentUser'}); $queues->UnLimit; </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectModifyUser b/rt/share/html/Admin/Elements/SelectModifyUser index 2941064dc..f170b824f 100755 --- a/rt/share/html/Admin/Elements/SelectModifyUser +++ b/rt/share/html/Admin/Elements/SelectModifyUser @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -50,9 +50,9 @@ %} <%INIT> my ($user); -my $users = new RT::Users($session{'CurrentUser'}); +my $users = RT::Users->new($session{'CurrentUser'}); $users->Limit(FIELD => 'id', - VALUE => $RT::SystemUser->id, + VALUE => RT->SystemUser->id, OPERATOR => '!=' ); if (defined $IdLike) { diff --git a/rt/share/html/Admin/Elements/SelectNewGroupMembers b/rt/share/html/Admin/Elements/SelectNewGroupMembers index 04e99e578..f386ba551 100755 --- a/rt/share/html/Admin/Elements/SelectNewGroupMembers +++ b/rt/share/html/Admin/Elements/SelectNewGroupMembers @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -46,58 +46,41 @@ %# %# END BPS TAGGED BLOCK }}} % if ( $Show ne 'Groups' ) { -<b><&|/l&>Users</&></b> -<br /> -<select multiple="multiple" name="<% $Name %>Users" size="10"> -<%perl> -my @users = sort { lc($a->[0]) cmp lc($b->[0]) } - map { [$m->scomp("/Elements/ShowUser", User => $_), $_] } - @{ $users->ItemsArrayRef }; -</%perl> -% for (@users) { -% my ($rendered, $user) = @$_; -% next if $SkipUsers->{ $user->id }; -<option value="User-<% $user->id %>"><% $rendered |n%></option> -% } -</select> -<br /> +<label for="<% $Name %>Users"><&|/l&>Add user</&>:</label> +<input type="text" value="" name="<% $Name %>Users" id="<% $Name %>Users" /><br /> +<script type="text/javascript"> +jQuery(function(){ + jQuery("#<% $Name %>Users").autocomplete({ + source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Users?return=Name;privileged=1;exclude=<% $user_ids |u %>", + // Auto-submit once a user is chosen + select: function( event, ui ) { + jQuery(event.target).val(ui.item.value); + jQuery(event.target).closest("form").submit(); + } + }); +}); +</script> % } % if ( $Show ne 'Users' ) { -<b><&|/l&>Groups</&></b> -<br /> -<select multiple="multiple" name="<% $Name %>Groups" size="10"> -% while ( my $group = $groups->Next ) { -% next if $SkipGroups->{ $group->id }; -<option value="Group-<% $group->id %>"><% $group->Name %></option> -% } -</select> +<label for="<% $Name %>Groups"><&|/l&>Add group</&>:</label> +<input type="text" value="" name="<% $Name %>Groups" id="<% $Name %>Groups" /><br /> +<script type="text/javascript"> +jQuery(function(){ + jQuery("#<% $Name %>Groups").autocomplete({ + source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Groups?exclude=<% $group_ids |u %>", + // Auto-submit once a user is chosen + select: function( event, ui ) { + jQuery(event.target).val(ui.item.value); + jQuery(event.target).closest("form").submit(); + } + }); +}); +</script> % } - <%INIT> -my $users = new RT::Users($session{'CurrentUser'}); - -$users->Limit( - FIELD => 'id', - VALUE => $RT::SystemUser->id, - OPERATOR => '!=', - ENTRYAGGREGATOR => 'AND' -); -$users->Limit( - FIELD => 'id', - VALUE => $RT::Nobody->id, - OPERATOR => '!=', - ENTRYAGGREGATOR => 'AND' -); -$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'); - - +my $user_ids = join(',', grep { $SkipUsers->{$_} } keys %$SkipUsers); +my $group_ids = join(',', grep { $SkipGroups->{$_} } keys %$SkipGroups); </%INIT> <%ARGS> $Name => 'Users' diff --git a/rt/share/html/Admin/Elements/SelectRights b/rt/share/html/Admin/Elements/SelectRights index 7ec8d1b42..73f5bced3 100755 --- a/rt/share/html/Admin/Elements/SelectRights +++ b/rt/share/html/Admin/Elements/SelectRights @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -95,21 +95,20 @@ while ( my $ace = $ACLObj->Next ) { } - my $ACLObj = new RT::ACL($session{'CurrentUser'}); - my $ACE = new RT::ACE($session{'CurrentUser'}); + my $ACLObj = RT::ACL->new($session{'CurrentUser'}); + my $ACE = RT::ACE->new($session{'CurrentUser'}); $ACLObj->LimitToObject( $Object); $ACLObj->LimitToPrincipal( Id => $PrincipalId); $ACLObj->OrderBy(FIELD=>'RightName'); - if (ref($Object) && UNIVERSAL::can($Object, 'AvailableRights')) { + eval { %Rights = %{$Object->AvailableRights}; - } - - else { - %Rights = ( loc('System Error') => loc("No rights found") ); - } + }; + if ($@) { + %Rights = ( loc('System Error') => loc("No rights found") ); + } $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; </%INIT> diff --git a/rt/share/html/Admin/Elements/SelectScrip b/rt/share/html/Admin/Elements/SelectScrip index 7e070df8e..f0adab10a 100755 --- a/rt/share/html/Admin/Elements/SelectScrip +++ b/rt/share/html/Admin/Elements/SelectScrip @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/SelectScripAction b/rt/share/html/Admin/Elements/SelectScripAction index 4dd39f55b..750815b07 100755 --- a/rt/share/html/Admin/Elements/SelectScripAction +++ b/rt/share/html/Admin/Elements/SelectScripAction @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -62,10 +62,19 @@ form.submit()"> <%INIT> my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); -$ScripActions->UnLimit; -$ScripActions->OrderBy(FIELD => 'Name'); +# hide user-defined if the user can't execute code +if ($session{CurrentUser}->HasRight(Object => $RT::System, Right => 'ExecuteCode')) { + $ScripActions->UnLimit; +} else { + $ScripActions->Limit( + FIELD => 'ExecModule', + OPERATOR => '!=', + VALUE => 'UserDefined', + ); +} +$ScripActions->OrderBy(FIELD => 'Name'); </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectScripCondition b/rt/share/html/Admin/Elements/SelectScripCondition index 67438a72a..1023df6e0 100755 --- a/rt/share/html/Admin/Elements/SelectScripCondition +++ b/rt/share/html/Admin/Elements/SelectScripCondition @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -62,9 +62,19 @@ form.submit()"> <%INIT> my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); -$ScripConditions->UnLimit; -$ScripConditions->OrderBy(FIELD => 'Name'); +# hide user-defined if the user can't execute code +if ($session{CurrentUser}->HasRight(Object => $RT::System, Right => 'ExecuteCode')) { + $ScripConditions->UnLimit; +} else { + $ScripConditions->Limit( + FIELD => 'ExecModule', + OPERATOR => '!=', + VALUE => 'UserDefined', + ); +} + +$ScripConditions->OrderBy(FIELD => 'Name'); </%INIT> <%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectSingleOrMultiple b/rt/share/html/Admin/Elements/SelectSingleOrMultiple index 1a2667840..bf2824397 100755 --- a/rt/share/html/Admin/Elements/SelectSingleOrMultiple +++ b/rt/share/html/Admin/Elements/SelectSingleOrMultiple @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/SelectStage b/rt/share/html/Admin/Elements/SelectStage index 38a7f18a5..369dee9af 100644 --- a/rt/share/html/Admin/Elements/SelectStage +++ b/rt/share/html/Admin/Elements/SelectStage @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) diff --git a/rt/share/html/Admin/Elements/SelectTemplate b/rt/share/html/Admin/Elements/SelectTemplate index ffaebeeb7..8d45c7de1 100755 --- a/rt/share/html/Admin/Elements/SelectTemplate +++ b/rt/share/html/Admin/Elements/SelectTemplate @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -47,19 +47,12 @@ %# END BPS TAGGED BLOCK }}} <select name="<%$Name%>"> <option value="" -<% defined($Default) && $Default eq 'none' && qq[ selected="selected"] |n %> ->-</option> +<% defined($Default) && $Default eq 'none' && qq[ selected="selected"] |n %>>-</option> %while (my $Template = $PrimaryTemplates->Next) { -<option value="<%$Template->Id%>" -<% ($Template->Id == $Default) && qq[ selected="selected"] |n %> -><% loc($Template->Name) %> -</option> +<option value="<%$Template->Id%>" <% ($Template->Id == $Default) && qq[ selected="selected"] |n %>><% loc($Template->Name) %></option> %} %while (my $Template = $OtherTemplates->Next) { -<option value="<%$Template->Id%>" -<% defined($Default) && ($Template->Id == $Default) && qq[ selected="selected"] |n %> -><&|/l, loc($Template->Name) &>Global template: [_1]</&> -</option> +<option value="<%$Template->Id%>" <% defined($Default) && ($Template->Id == $Default) && qq[ selected="selected"] |n %>><&|/l, loc($Template->Name) &>Global template: [_1]</&></option> %} </select> @@ -73,15 +66,12 @@ $PrimaryTemplates->OrderBy(FIELD => 'Name'); } my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); -$OtherTemplates->LimitToGlobal($DefaultQueue); +$OtherTemplates->LimitToGlobal; $OtherTemplates->OrderBy(FIELD => 'Name'); </%INIT> <%ARGS> - $Queue => undef $Default => 'none' -$DefaultQueue => undef $Name => 'Template' - </%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectUsers b/rt/share/html/Admin/Elements/SelectUsers index 14ebf822c..1851f23f8 100755 --- a/rt/share/html/Admin/Elements/SelectUsers +++ b/rt/share/html/Admin/Elements/SelectUsers @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -54,10 +54,10 @@ </select> <%INIT> -my $users = new RT::Users($session{'CurrentUser'}); +my $users = RT::Users->new($session{'CurrentUser'}); -$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); -$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => RT->SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => RT->Nobody->id, OPERATOR => '!=' ); $users->LimitToPrivileged(); </%INIT> diff --git a/rt/share/html/Admin/Elements/ShowKeyInfo b/rt/share/html/Admin/Elements/ShowKeyInfo index acb51c5de..2ec319a63 100644 --- a/rt/share/html/Admin/Elements/ShowKeyInfo +++ b/rt/share/html/Admin/Elements/ShowKeyInfo @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -80,6 +80,7 @@ $EmailAddress $Type => 'public' </%ARGS> <%INIT> +return if ($m->cache_self( key => join("||",$EmailAddress,$Type, $$), expires_in => '2 minutes')); require RT::Crypt::GnuPG; my %res = RT::Crypt::GnuPG::GetKeyInfo( $EmailAddress, $Type ); diff --git a/rt/share/html/Admin/Elements/SystemTabs b/rt/share/html/Admin/Elements/SystemTabs deleted file mode 100755 index 66183efd2..000000000 --- a/rt/share/html/Admin/Elements/SystemTabs +++ /dev/null @@ -1,99 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED 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/index.html', - }, - - G => { title => loc('Group Rights'), - path => 'Admin/Global/GroupRights.html', - }, - H => { title => loc('User Rights'), - path => 'Admin/Global/UserRights.html', - }, - I => { title => loc('RT at a glance'), - path => 'Admin/Global/MyRT.html', - }, - -}; - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - - if ($current_tab) { - foreach my $tab (sort keys %{$tabs}) { - if ($tabs->{$tab}->{'path'} eq $current_tab) { - $tabs->{$tab}->{"subtabs"} = $subtabs || {}; - $tabs->{$tab}->{"current_subtab"} = $current_subtab; - } - } - } -</%INIT> - - -<%ARGS> -$id => undef -$current_tab => undef -$subtabs => undef -$current_subtab => undef -$Title => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/Tabs b/rt/share/html/Admin/Elements/Tabs deleted file mode 100755 index c56ee2e55..000000000 --- a/rt/share/html/Admin/Elements/Tabs +++ /dev/null @@ -1,95 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED 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('Custom Fields'), - path => 'Admin/CustomFields/', - }, - E => { 'title' => loc('Global'), - path => 'Admin/Global/', - }, - F => { 'title' => loc('Tools'), - path => 'Admin/Tools/', - }, - }; - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - - if( defined $current_tab ) { - foreach my $tab (keys %{$tabs}) { - if ($tabs->{$tab}->{'path'} eq $current_tab) { - $tabs->{$tab}->{"subtabs"} = $subtabs; - $tabs->{$tab}->{"current_subtab"} = $current_subtab; - } - } - } - -</%INIT> - - -<%ARGS> -$subtabs => undef -$current_tab => undef -$current_subtab => undef -$Title => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/ToolTabs b/rt/share/html/Admin/Elements/ToolTabs deleted file mode 100755 index c3cb6e397..000000000 --- a/rt/share/html/Admin/Elements/ToolTabs +++ /dev/null @@ -1,82 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Tabs, - Title => $Title, - current_tab => 'Admin/Tools/', - subtabs => $tabs, - current_subtab => $current_tab, -&> - -<%INIT> - my $tabs = { - A => { title => loc('System Configuration'), - path => 'Admin/Tools/Configuration.html', - }, - E => { title => loc('Shredder'), - path => 'Admin/Tools/Shredder/', - }, - }; - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - - foreach my $tab ( values %{$tabs} ) { - next unless $tab->{'path'} eq $current_tab; - - $tab->{"subtabs"} = $subtabs; - $tab->{"current_subtab"} = $current_subtab; - } -</%INIT> - -<%ARGS> -$id => undef -$current_tab => undef -$subtabs => undef -$current_subtab => undef -$Title => undef -</%ARGS> diff --git a/rt/share/html/Admin/Elements/UserTabs b/rt/share/html/Admin/Elements/UserTabs deleted file mode 100755 index 330c442b5..000000000 --- a/rt/share/html/Admin/Elements/UserTabs +++ /dev/null @@ -1,116 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# -%# (Except where explicitly superseded by other copyright notices) -%# -%# -%# LICENSE: -%# -%# 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. -%# -%# You should have received a copy of the GNU General Public License -%# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -%# -%# -%# CONTRIBUTION SUBMISSION POLICY: -%# -%# (The following paragraph is not intended to limit the rights granted -%# to you to modify and distribute this software under the terms of -%# the GNU General Public License and is only of importance to you if -%# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) -%# -%# By intentionally submitting any modifications, corrections or -%# derivatives to this work, or any other work intended for use with -%# Request Tracker, to Best Practical Solutions, LLC, you confirm that -%# you are the copyright holder for those contributions and you grant -%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, -%# royalty-free, perpetual, license to use, copy, create derivative -%# works based on those contributions, and sublicense and distribute -%# those contributions and any derivatives thereof. -%# -%# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Tabs, - subtabs => $tabs, - current_tab => 'Admin/Users/', - current_subtab => $current_tab, - Title => $Title &> -<%INIT> -my $tabs; -if ($id) { -$tabs->{'this'} = { title => eval { $UserObj->Name }, - - path => "Admin/Users/Modify.html?id=".$id, -subtabs => { - Basics => { title => loc('Basics'), - path => "Admin/Users/Modify.html?id=".$id - }, - Memberships => { title => loc('Memberships'), - path => "Admin/Users/Memberships.html?id=".$id - }, - History => { title => loc('History'), - path => "Admin/Users/History.html?id=".$id - }, - 'MyRT' => { title => loc('RT at a glance'), - path => "Admin/Users/MyRT.html?id=".$id - }, - } -}; - if ( RT->Config->Get('GnuPG')->{'Enable'} ) { - $tabs->{'this'}{'subtabs'}{'GnuPG'} = { - title => loc('GnuPG'), - path => "Admin/Users/GnuPG.html?id=".$id, - }; - } -} - -if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { - $tabs->{"A"} = { title => loc('Select'), - path => "Admin/Users/", - }; - $tabs->{"B"} = { title => loc('Create'), - path => "Admin/Users/Modify.html?Create=1", - separator => 1, - }; -} - - # Now let callbacks add their extra tabs - $m->callback( %ARGS, tabs => $tabs ); - -#foreach my $tab ( sort keys %{$tabs} ) { -# if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { -# $tabs->{$tab}->{"current_subtab"} = $current_subtab; -# } -#} -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/Users/Modify.html?id=".$id if $id; -</%INIT> -<%ARGS> -$UserObj => undef -$id => undef -$current_tab => undef -$subtabs => undef -$current_subtab => undef -$Title => undef -</%ARGS> |