diff options
Diffstat (limited to 'rt/share/html/Admin/Elements')
45 files changed, 4087 insertions, 0 deletions
diff --git a/rt/share/html/Admin/Elements/AddCustomFieldValue b/rt/share/html/Admin/Elements/AddCustomFieldValue new file mode 100755 index 000000000..9fe464a5d --- /dev/null +++ b/rt/share/html/Admin/Elements/AddCustomFieldValue @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<h3><&|/l&>Add Value</&></h3> + +<table border="0"> + +<tr> +<th><&|/l&>Sort</&></th> +<th><&|/l&>Name</&></th> +<th><&|/l&>Description</&></th> +% if ( $CustomField->Type ne 'Combobox' ) { +<th><&|/l&>Category</&></th> +% } +</tr> + +% my $paramtag = "CustomField-". $CustomField->Id ."-Value-new"; +<tr> +<td><input type="text" size="3" name="<% $paramtag %>-SortOrder" /></td> +<td><input type="text" size="25" name="<% $paramtag %>-Name" /></td> +<td><input type="text" size="45" name="<% $paramtag %>-Description" /></td> +% if ( $CustomField->Type ne 'Combobox' ) { +<td> +% my $BasedOnObj = $CustomField->BasedOnObj; +% if ( $BasedOnObj and $BasedOnObj->id ) { +% my $Categories = $BasedOnObj->Values; +<select 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="" /> +% } +</td> +% } +</tr> + +</table> +<%args> +$CustomField => undef +</%args> diff --git a/rt/share/html/Admin/Elements/ConfigureMyRT b/rt/share/html/Admin/Elements/ConfigureMyRT new file mode 100644 index 000000000..35c01bc52 --- /dev/null +++ b/rt/share/html/Admin/Elements/ConfigureMyRT @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<%args> +$Action +$OnSave +$items +$panes +$current_portlets +$ReadOnly => 0 +</%args> +<%init> +my $portlets = $current_portlets; +my @panes; +for my $pane (@$panes) { + push @panes, $m->comp( + '/Widgets/SelectionBox:new', + Action => $Action, + Name => $pane, + Available => $items, + AutoSave => 1, + ReadOnly => $ReadOnly, + OnSubmit => sub { + my $sel = shift; + $portlets->{$pane} = [ + map { m/(\w+)-(.*)$/; + { type => $1, + name => $2 } } @{ $sel->{Current} } + ]; + $OnSave->( $portlets, $pane ); + }, + Selected => [ map { join( '-', @{$_}{qw/type name/} ) } + @{ $portlets->{$pane} } ] + ); +} + +return @panes; +</%init> diff --git a/rt/share/html/Admin/Elements/CreateUserCalled b/rt/share/html/Admin/Elements/CreateUserCalled new file mode 100755 index 000000000..78eb82c02 --- /dev/null +++ b/rt/share/html/Admin/Elements/CreateUserCalled @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<form method="get" action="<% RT->Config->Get('WebPath') %>/Admin/Users/Create.html"> +<&|/l&>New user called</&> <input name="Name" size="10" /><input type="submit" class="button" value="<&|/l&>Create</&>" /> +</form> diff --git a/rt/share/html/Admin/Elements/CustomFieldTabs b/rt/share/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..30f5adf11 --- /dev/null +++ b/rt/share/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,118 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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')) { + $tabs->{"A"} = { title => loc('Select'), + path => "Admin/CustomFields/", + }; + $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 new file mode 100755 index 000000000..368ea2d68 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomField @@ -0,0 +1,159 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/ListActions, actions => \@results &> + + +<form method="post" action="CustomField.html"> +<input type="hidden" class="hidden" name="CustomField" value="<%$id %>" /> +<input type="hidden" class="hidden" name="Queue" value="<%$Queue%>" /> + +<table width="100%" border="0"> +<tr><td align="right"> +<&|/l&>Name</&>: +</td><td> +<input name="Name" value="<%$CustomFieldObj->Name%>" size="20" /> +</td></tr> +<tr><td align="right"> +<&|/l&>Description</&>: +</td><td> +<input name="Description" value="<%$CustomFieldObj->Description%>" size="80" /> +</td></tr> +<tr><td align="right"> +<&|/l&>Type</&>: +</td><td> +<& /Admin/Elements/SelectCustomFieldType, Name => "Type", Default => $CustomFieldObj->Type &> +</td></tr> +<tr><td> +</td><td> +<input type="hidden" class="hidden" name="SetEnabled" value="1" /> +<input type="checkbox" class="checkbox" name="Enabled" value="1" <%$EnabledChecked%> /> <&|/l&>Enabled (Unchecking this box disables this custom field)</&> +</td></tr> +</table> + +<p> +% if ($CustomFieldObj->Id and $CustomFieldObj->Type =~ /Select/) { +<h2><&|/l&>Values</&></h2> +<font size="-1"> +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +</font> +% } +<&/Elements/Submit, Label => loc('Create') &> +</form> + + + +<%INIT> + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +my $EnabledChecked = 'checked="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, + ); + + # if there is an error, then abort. But since at this point there's + # stuff already printed, clear it out. + # (This only works in conjunction with temporarily turning autoflush + # off in the files that use this component.) + unless ($val) { + $m->clear_buffer; + Abort(loc("Could not create CustomField: [_1]", $msg), SuppressHeader => 1); + } + push @results, $msg; + $CustomFieldObj->SetSortOrder($CustomFieldObj->id); + $title = loc('Created CustomField [_1]', $CustomFieldObj->Name()); + } else { + $CustomFieldObj->Load($CustomField) || Abort(loc('No CustomField'), SuppressHeader => 1); + $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 =""; + } + +} + + +</%INIT> +<%ARGS> +$id => undef +$title => undef +$Queue => undef +$CustomField => undef +$Type => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValues b/rt/share/html/Admin/Elements/EditCustomFieldValues new file mode 100755 index 000000000..96610b2b5 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFieldValues @@ -0,0 +1,104 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% unless ( $values->Count ) { +<p><em><&|/l&>(no values)</&></em></p> +% return; +% } + +<table> + +<tr> +<th> </th> +<th><&|/l&>Sort</&></th> +<th><&|/l&>Name</&></th> +<th><&|/l&>Description</&></th> +% if ($CustomField->Type ne 'Combobox') { +<th><&|/l&>Category</&></th> +% } +</tr> + +% while ( my $value = $values->Next ) { +% my $paramtag = "CustomField-". $CustomField->Id ."-Value-". $value->Id; +<tr> +<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> +% if ( $CustomField->Type ne 'Combobox' ) { +<td> +% if ( $Categories ) { +% my $selected = $value->Category; +% $selected = '' unless defined $selected; +<select 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 || '' %>" /> +% } +</td> +% } +</tr> +% } + +</table> +<i><&|/l&>(Check box to delete)</&></i> +<%init> + +my $values = $CustomField->ValuesObj(); + +my $BasedOnObj = $CustomField->BasedOnObj; +my $Categories; +if ($BasedOnObj and $BasedOnObj->Id) { + $Categories = $BasedOnObj->Values; +} +</%init> +<%args> +$CustomField => undef +</%args> diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValuesSource b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource new file mode 100644 index 000000000..c4b41114d --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<div id="values-source-class-block"> +<select name="ValuesClass"> +% foreach my $source( @sources ) { +<option value="<% $source->{'Class'} %>" <% $source->{'Class'} eq $CustomField->ValuesClass && 'selected="selected"' %>><% $source->{'Description'} %></option> +% } +</select> +</div> + +<%INIT> +return unless $CustomField->IsSelectionType; + +my @sources; +foreach my $class( 'RT::CustomFieldValues', RT->Config->Get('CustomFieldValuesSources') ) { + next unless $class; + + local $@; + eval "require $class"; + if( $@ ) { + $RT::Logger->crit("Couldn't load class '$class': $@"); + next; + } + + my %res = ( Class => $class ); + $res{'Description'} = $class->SourceDescription if $class->can('SourceDescription'); + $res{'Description'} ||= $class; + $res{'Description'} = 'Provide list of values below' if $class eq 'RT::CustomFieldValues'; + push @sources, \%res; +} + +return unless grep $_->{'Class'} ne 'RT::CustomFieldValues', @sources; + +</%INIT> +<%ARGS> +$CustomField => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditCustomFields b/rt/share/html/Admin/Elements/EditCustomFields new file mode 100755 index 000000000..89c6d0f65 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFields @@ -0,0 +1,205 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/ListActions, actions => \@results &> + +<form action="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>" method="post" name="EditCustomFields"> +<input type="hidden" class="hidden" name="id" value="<% $Object->Id || ''%>" /> +<input type="hidden" class="hidden" name="ObjectType" value="<% $ObjectType %>" /> +<input type="hidden" class="hidden" name="SubType" value="<% $SubType %>" /> +<input type="hidden" class="hidden" name="UpdateCFs" value="1" /> + +% if ($Object->Id) { +<h2><&|/l&>Global Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &> +% } +<h2><&|/l&>Selected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &> +<h2><&|/l&>Unselected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &> + +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +</form> + + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +my @results; +my (@GlobalCFs, @UnassignedCFs); + +my $id = $Object->Id; +if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { + $m->out('<p><i>', loc('(No custom fields)'), '</i></p>'); + return; +} + +my $lookup = $ObjectType; +$lookup .= "-$SubType" if $SubType; + +$CustomFields->LimitToLookupType($lookup); +$CustomFields->OrderBy( FIELD => 'Name' ); + + +my ($GlobalCFs, $ObjectCFs); +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); + +# Check sanity of SortOrders +my %SortOrders; +$SortOrders{ $_->SortOrder }++ + while ($_ = $ObjectCFs->Next); + +# If there are duplicates, run though and squash them +if (grep $_ > 1, values %SortOrders) { + my $i = 1; + while ( my $ObjectCF = $ObjectCFs->Next ) { + $ObjectCF->SetSortOrder( $i++ ); + } + $ObjectCFs->GotoFirstItem; +} + +# {{{ deal with moving sortorder of custom fields +if ($CustomField and $Move) { + my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); + $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); + + my $TargetObj; + my $target_order = $SourceObj->SortOrder + $Move; + while (my $ObjectCF = $ObjectCFs->Next) { + my $this_order = $ObjectCF->SortOrder; + + # if we have an exact match, finish the loop now + ($TargetObj = $ObjectCF, 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 = $ObjectCF; + } + + 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 + } + + $ObjectCFs->GotoFirstItem; +} +# }}} + +if ($id) { + $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); + $GlobalCFs->LimitToObjectId(0); + $GlobalCFs->LimitToLookupType($lookup); +} + +while (my $cf = $CustomFields->Next) { + my $cf_id = $cf->Id; + + if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { + push @GlobalCFs, $cf; + next; + } + + if ($UpdateCFs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$id-CF-$cf_id"; + if ($ARGS{$key}) { + if (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->AddToObject($Object); + push (@results, $msg); + push @UnassignedCFs, $cf if !$val; + } + } + else { + push @UnassignedCFs, $cf; + if ($ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->RemoveFromObject($Object); + push (@results, $msg); + pop @UnassignedCFs if !$val; + } + } + } + elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + push @UnassignedCFs, $cf; + } + else { + } +} + +# redo search... +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); + +</%INIT> +<%ARGS> +$title => undef +$Move => undef +$Source => undef +$CustomField => undef +$FindDisabledCustomFields => undef +$UpdateCFs => 0 +$Object +$ObjectType +$SubType => '' +</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditQueueWatchers b/rt/share/html/Admin/Elements/EditQueueWatchers new file mode 100755 index 000000000..56ffb0e0f --- /dev/null +++ b/rt/share/html/Admin/Elements/EditQueueWatchers @@ -0,0 +1,78 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +%if ($Members->Count == 0 ) { +<ul> +<li><i><&|/l&>none</&></i> +% } else { +<ul> +% while (my $watcher=$Members->Next) { +<li> +<input type="checkbox" class="checkbox" name="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" + unchecked /> +% if ($watcher->MemberObj->IsUser) { +<a href="<%RT->Config->Get('WebPath')%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } else { +<a href="<%RT->Config->Get('WebPath')%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } +<%$watcher->MemberObj->Object->Name%></a> +% } +% } +</ul> +<i><&|/l&>(Check box to delete)</&></i><br /><br /> + +<%INIT> +my $Members = $Watchers->MembersObj; +</%INIT> + +<%ARGS> +$QueueObj => undef +$Watchers => undef +</%ARGS> + + + diff --git a/rt/share/html/Admin/Elements/EditScrip b/rt/share/html/Admin/Elements/EditScrip new file mode 100755 index 000000000..29ec71cd7 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditScrip @@ -0,0 +1,197 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/ListActions, actions => \@actions &> + +<form method="post" action="Scrip.html"> +<input type="hidden" class="hidden" name="id" value="<% $id %>" /> +<input type="hidden" class="hidden" name="Queue" value="<% $Queue %>" /> + +<&| /Widgets/TitleBox, title => loc('Scrip Fields') &> +<table> + +<tr><td align="right"><&|/l&>Description</&>:</td><td> +<input name="Scrip-<% $id %>-Description" + value="<% $ARGS{"Scrip-$id-Description"} || $scrip->Description || '' %>" /> +</td></tr> + +<tr><td align="right"><&|/l&>Condition</&>:</td><td> +<& /Admin/Elements/SelectScripCondition, + Name => "Scrip-$id-ScripCondition", + Default => $ARGS{"Scrip-$id-ScripCondition"} || $scrip->ConditionObj->Id, +&></td></tr> + +<tr><td align="right"><&|/l&>Action</&>:</td><td> +<& /Admin/Elements/SelectScripAction, + Name => "Scrip-$id-ScripAction", + Default => $ARGS{"Scrip-$id-ScripAction"} || $scrip->ActionObj->Id, +&></td></tr> + +<tr><td align="right"><&|/l&>Template</&>:</td><td> +<& /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> +<& /Admin/Elements/SelectStage, + Name => "Scrip-$id-Stage", + Default => $ARGS{"Scrip-$id-Stage"} || $scrip->Stage, +&></td></tr> + +</table> +</&> + +<& /Elements/Submit, + Label => $SubmitLabel, + Reset => 1, +&><br /> + +<&| /Widgets/TitleBox, title => loc('User Defined conditions and actions') &> +<table> +<tr><td colspan="2"> +<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> +% 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> +% $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> +% $code = $ARGS{"Scrip-$id-CustomCommitCode"} || $scrip->CustomCommitCode || ''; +% $lines = @{[ $code =~ /\n/gs ]} + 3; +% $lines = $min_lines if $lines < $min_lines; +<textarea cols="80" rows="<% $lines %>" name="Scrip-<% $id || '' %>-CustomCommitCode"><% $code %></textarea> +</td></tr> + +</table> +</&> + +<& /Elements/Submit, + Label => $SubmitLabel, + Reset => 1, +&> + +</form> +<%init> + +my (@actions, $SubmitLabel); +my $scrip = RT::Scrip->new( $session{'CurrentUser'} ); + +if ( $id ) { + $scrip->Load( $id ); + unless ( $id = $scrip->id ) { + push @actions, loc("Couldn't load scrip #[_1]", $id); + } + $SubmitLabel = loc('Save Changes'); +} + +unless ( $id ) { + $id = 'new'; + $SubmitLabel = loc('Create'); +} + +my $min_lines = 10; + +</%init> + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 +</%ARGS> + +<%METHOD Process> +<%ARGS> +$id => undef +$Queue => undef +</%ARGS> +<%INIT> +return ($id) unless $id; + +my $scrip = RT::Scrip->new( $session{'CurrentUser'} ); +if ( $id eq 'new' ) { + return $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"}, + Stage => $ARGS{"Scrip-new-Stage"}, + ); +} +else { + $scrip->Load( $id ); + return (undef, loc("Couldn't load scrip #[_1]", $id)) + unless $scrip->id; + + my @attribs = qw(Queue ScripAction ScripCondition Template Stage + Description CustomPrepareCode CustomCommitCode CustomIsApplicableCode); + my @results = UpdateRecordObject( + AttributesRef => \@attribs, + AttributePrefix => 'Scrip-'.$scrip->Id, + Object => $scrip, + ARGSRef => \%ARGS + ); + return ($scrip->id, @results); +} +</%INIT> +</%METHOD> diff --git a/rt/share/html/Admin/Elements/EditScrips b/rt/share/html/Admin/Elements/EditScrips new file mode 100755 index 000000000..df349e1b9 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditScrips @@ -0,0 +1,124 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/ListActions, actions => \@actions &> + +<form action="Scrips.html" method="post"> +<input type="hidden" class="hidden" name="id" value="<% $id %>" /> + +<h2><&|/l&>Current Scrips</&></h2> +<& /Elements/CollectionList, + OrderBy => 'Description', + Order => 'ASC', + Rows => 100, + %ARGS, + Format => $Format, + DisplayFormat => "__CheckBox.{DeleteScrip}__, $Format", + Collection => $Scrips, + AllowSorting => 1, + PassArguments => [ qw(Query Format Rows Page Order OrderBy id) ], +&> + +% if ( $Scrips->Count ) { +<p><i><&|/l&>(Check box to delete)</&></i></p> +% } else { +<p><i><&|/l&>(No scrips)</&></i></p> +% } +<& /Elements/Submit, + Caption => loc("Delete selected scrips"), + Label => loc("Delete") +&> +</form> + +<%init> +my (@actions); + +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +if ( $id ) { + $QueueObj->Load( $id ); + unless ( $QueueObj->id ) { + push @actions, loc("Couldn't load queue #[_1]", $id) + } +} + +if ($QueueObj->id) { + $Scrips->LimitToQueue($id); +} +else { + $Scrips->LimitToGlobal(); +} + +# {{{ 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'}); + $scrip->Load( $id ); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, loc("Scrip deleted"); + } + else { + push @actions, $msg; + } +} +# }}} + +my $dir_path = $m->request_comp->dir_path; +$Format ||= qq{'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__id__</a>/TITLE:#'} + .qq{,'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__Description__</a>/TITLE:Description'} + .q{,__Stage__, __Condition__, __Action__, __Template__}; + +</%init> + +<%ARGS> +$id => undef +$title => undef +$Format => undef +@DeleteScrip => () +</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditTemplates b/rt/share/html/Admin/Elements/EditTemplates new file mode 100755 index 000000000..0bd68c2c0 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditTemplates @@ -0,0 +1,127 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/ListActions, actions => \@actions &> + +<form method="get" action="Templates.html"> +<input type="hidden" class="hidden" name="id" value="<% $id %>" /> + +% unless ( $Templates->Count ) { +<p><i><&|/l&>(No templates)</&></i></p> +% } else { + + +<& /Elements/CollectionList, + OrderBy => 'id', + Order => 'ASC', + %ARGS, + DisplayFormat => '__CheckBox.{DeleteTemplates}__,'. $Format, + Format => $Format, + Collection => $Templates, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy FindDisabledQueues)], +&> + +<i><&|/l&>(Check box to delete)</&></i> +% } + +<& /Elements/Submit, Label => loc('Delete Template') &> +</form> + +<%INIT> +my $dir_path = $m->request_comp->dir_path; +$Format ||= qq{'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__id__</a>/TITLE:#'} + .qq{,'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__Name__</a>/TITLE:Name'} + .qq{,'__Description__'}; + +my $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); +$QueueObj->Load( $id ) if $id; + +my $Templates = RT::Templates->new($session{'CurrentUser'}); +if ( $QueueObj->id ) { + $Templates->LimitToQueue( $id ); +} +else { + $Templates->LimitToGlobal; +} + +# Now let callbacks add their extra limits +$m->callback( %ARGS, Templates => $Templates ); +$Templates->RedoSearch; + +# deal with deleting existing templates +my @actions; +# backwards compatibility, use DeleteTemplates array for this +foreach my $key (keys %ARGS) { + next unless $key =~ /^DeleteTemplate-(\d+)/; + push @DeleteTemplates, $1; +} + +foreach my $id( @DeleteTemplates ) { + my $TemplateObj = RT::Template->new( $session{'CurrentUser'} ); + $TemplateObj->Load( $id ); + unless ( $TemplateObj->id ) { + push @actions, loc("Couldn't load template #[_1]", $id); + next; + } + + my ($retval, $msg) = $TemplateObj->Delete; + if ( $retval ) { + push @actions, loc("Template #[_1] deleted", $id); + } + else { + push @actions, $msg; + } +} +</%INIT> +<%ARGS> +$id => 0 + +$Format => undef + +@DeleteTemplates => () +</%ARGS> diff --git a/rt/share/html/Admin/Elements/EditUserComments b/rt/share/html/Admin/Elements/EditUserComments new file mode 100755 index 000000000..21bad8209 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditUserComments @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/Header, Title => "Comments about $name" &> +<&|/l&>These comments aren't generally visible to the user</&>:<br /> +<input type="hidden" class="hidden" name="id" value="<%$id%>" /> +<textarea cols="60" rows="15" wrap="soft" name="Comments"><% $UserObj->Comments %></textarea> +</form> + +<%ARGS> +$UserObj => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/GlobalCustomFieldTabs b/rt/share/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..a53d7f24b --- /dev/null +++ b/rt/share/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,105 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100755 index 000000000..2b5bb6540 --- /dev/null +++ b/rt/share/html/Admin/Elements/GroupTabs @@ -0,0 +1,102 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100755 index 000000000..659c40b01 --- /dev/null +++ b/rt/share/html/Admin/Elements/Header @@ -0,0 +1,52 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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/Header, %ARGS &> + +<%ARGS> +$Title => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/ListGlobalCustomFields b/rt/share/html/Admin/Elements/ListGlobalCustomFields new file mode 100755 index 000000000..d3777217c --- /dev/null +++ b/rt/share/html/Admin/Elements/ListGlobalCustomFields @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% my $count = 0; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $count++; +<font size="-1"><%$CustomFieldObj->id%>/<% loc($CustomFieldObj->Type) %>/<%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%></font> +<br /> +% } +% if (!$count) { +<font size="-1"><&|/l&>(No custom fields)</&></font> +% } + +<%init> +my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +$CustomFields->LimitToGlobal(); +</%INIT> diff --git a/rt/share/html/Admin/Elements/ListGlobalScrips b/rt/share/html/Admin/Elements/ListGlobalScrips new file mode 100755 index 000000000..e03224a2d --- /dev/null +++ b/rt/share/html/Admin/Elements/ListGlobalScrips @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% unless ( $Scrips->Count ) { +<p><i><&|/l&>(No scrips)</&></i></p> +% } else { + +<& /Elements/CollectionList, + OrderBy => 'Description', + Order => 'ASC', + Rows => 0, + %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 $Scrips = RT::Scrips->new( $session{'CurrentUser'} ); +$Scrips->LimitToGlobal; +</%INIT> diff --git a/rt/share/html/Admin/Elements/ModifyTemplate b/rt/share/html/Admin/Elements/ModifyTemplate new file mode 100755 index 000000000..a0057617b --- /dev/null +++ b/rt/share/html/Admin/Elements/ModifyTemplate @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<table> +<tr> +<td align="right"> +<&|/l&>Name</&>: +</td> +<td> +<input name="Name" value="<%$Name%>" size="20" /><br /> +</td> +</tr> +<tr> +<td align="right"> +<&|/l&>Description</&>: +</td> +<td> +<input name="Description" value="<%$Description%>" size="80" /><br /> +</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> +</tr> +</table> + +<%INIT> + +</%INIT> + +<%ARGS> +$Name => undef +$Description => undef +$Content => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/ObjectCustomFields b/rt/share/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..d3fc28b8e --- /dev/null +++ b/rt/share/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,111 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100644 index 000000000..b27227990 --- /dev/null +++ b/rt/share/html/Admin/Elements/PickCustomFields @@ -0,0 +1,98 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% if (@CustomFields == 0) { +<p><i><&|/l&>(None)</&></i></p> +% } else { +<table cellspacing="0" cellpadding="2"> +% my $count; +% foreach my $CustomFieldObj (@CustomFields) { +<tr> +% if (!$ReadOnly) { + <td valign="top"> +<input type="checkbox" class="checkbox" name="Object-<%$id%>-CF-<%$CustomFieldObj->Id%>" value="1" <% $Checked ? 'checked="checked"' : '' %> +/> + </td> +% } + <td valign="top"> + <a href="<% RT->Config->Get('WebPath') %>/Admin/CustomFields/Modify.html?id=<%$CustomFieldObj->id()%>"> +% if ($CustomFieldObj->Name) { +<b><%$CustomFieldObj->Name%></b> +% } else { +<i>(<&|/l&>no name</&>)</i> +% } +</a><br /> + <%$CustomFieldObj->Description%> + </td> + <td valign="top"> + <i><% $CustomFieldObj->FriendlyTypeComposite %></i> + </td> +% # show 'move up' unless it's the first item +% if ($count++ and $Checked) { + <td valign="top"> + [<a href="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>] +% } else { + <td valign="top" align="right"> +% } + +% # show 'move down' unless it's the last item +% if ($count != @CustomFields and $Checked) { +% $m->print(' | ') if $count > 1; + [<a href="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>] +% } + </td> +</tr> +% } +</table> +% } +<%ARGS> +@CustomFields +$id +$ReadOnly => 0 +$Checked => 0 +$SubType +</%ARGS> diff --git a/rt/share/html/Admin/Elements/PickObjects b/rt/share/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..74e02c94f --- /dev/null +++ b/rt/share/html/Admin/Elements/PickObjects @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% if (@Objects == 0) { +<p><i><&|/l&>(None)</&></i></p> +% } else { +<table cellspacing="0" cellpadding="2"> +% my $count; +% foreach my $Object (@Objects) { +<tr> +% my $id = "Object-".$Object->id."-CF-".$id; +% if (!$ReadOnly) { + <td valign="top"> +<input type="checkbox" id="<% $id %>" name="<% $id %>" value="1" <% $Checked ? 'checked="checked"' : ''%> +/> + </td> +% } + <td valign="top"> + <label for="<% $id %>"> +% if ($Object->Name) { + <b><%$Object->Name%></b><br /> +% } else { + <i>(<%loc("no name")%>)</i><br /> +% } + <%$Object->can('Description') ? ($Object->Description||'') : '' %> + </label> + </td> +</tr> +% } +</table> +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 +</%ARGS> diff --git a/rt/share/html/Admin/Elements/QueueRightsForUser b/rt/share/html/Admin/Elements/QueueRightsForUser new file mode 100755 index 000000000..60651ee97 --- /dev/null +++ b/rt/share/html/Admin/Elements/QueueRightsForUser @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<ul> +%while(my $ACE = $ACL->Next) { + +<li><checkbox name="delete_ace_<%$ACE->id%>" value="1"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) + +%} +</ul> + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); +</%INIT> +<%ARGS> +$PrincipalId => undef +$QueueObj => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/QueueTabs b/rt/share/html/Admin/Elements/QueueTabs new file mode 100755 index 000000000..b4f2d1f27 --- /dev/null +++ b/rt/share/html/Admin/Elements/QueueTabs @@ -0,0 +1,123 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100644 index 000000000..1eb1f63c4 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomField @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +<option value="" <% not $Default and qq[ selected="selected"] |n %>>--</option> +% while (my $CustomFieldObj = $CustomFields->Next) { +% next if $OnlySelectionType and not $CustomFieldObj->IsSelectionType; +% next if $Not and $CustomFieldObj->id == $Not; +<option value="<%$CustomFieldObj->id%>"<% $Default == $CustomFieldObj->id && qq[ selected="selected"] |n%>><% $CustomFieldObj->Name %></option> +%} +</select> +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit; +$CustomFields->LimitToLookupType( $LookupType ) if $LookupType; +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); + +$Default = $Default->id || 0 if ref $Default; +</%INIT> +<%ARGS> +$None => 1 +$Name => 'BasedOn' +$Default => 0 +$LookupType => 'RT::Queue-RT::Ticket' +$OnlySelectionType => 1 +$Not => 0 +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldLookupType b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..c4e7a56a4 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +%for my $option ($cf->LookupTypes) { +<option value="<%$option%>"<%defined ($Default) && ($option eq $Default) && qq[ selected="selected"] |n%>><% $cf->FriendlyLookupType($option) %></option> +%} +</select> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=> '' +$Name => 'LookupType' +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldType b/rt/share/html/Admin/Elements/SelectCustomFieldType new file mode 100755 index 000000000..a37b80020 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomFieldType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +%for my $option ($cf->TypeComposites) { +<option value="<%$option%>"<%$option eq $Default && qq[ selected="selected"] |n%>><% $cf->FriendlyTypeComposite($option) %></option> +%} +</select> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'TypeComposite' +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectGroups b/rt/share/html/Admin/Elements/SelectGroups new file mode 100755 index 000000000..b6250251c --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectGroups @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select multiple="multiple" name="<%$Name%>" size="10"> +%while (my $group = $groups->Next) { +<option value="<%$group->id%>"><%$group->Name%> +%} +</select> + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain); + +</%INIT> +<%ARGS> +$Name => 'groups' +$Domain => 'UserDefined'; +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectModifyGroup b/rt/share/html/Admin/Elements/SelectModifyGroup new file mode 100755 index 000000000..1bf4d22a7 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyGroup @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +%while ( $Group = $Groups->Next) { +<a href="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><br /> +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; +</%INIT> +<%ARGS> +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectModifyQueue b/rt/share/html/Admin/Elements/SelectModifyQueue new file mode 100755 index 000000000..f5ba69296 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyQueue @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +%while ( $queue = $queues->Next) { +<a href="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><br /> +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; +</%INIT> +<%ARGS> +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectModifyUser b/rt/share/html/Admin/Elements/SelectModifyUser new file mode 100755 index 000000000..32a60ba36 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyUser @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +%while ( $user = $users->Next) { +<a href="Modify.html?id=<%$user->id%>"><%$user->id%>: <& /Elements/ShowUser, User => $user &></a><br /> +%} +<%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'); + +} +</%INIT> +<%ARGS> +$IdLike => undef +$EmailLike => undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectNewGroupMembers b/rt/share/html/Admin/Elements/SelectNewGroupMembers new file mode 100755 index 000000000..1083b4359 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectNewGroupMembers @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +% 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 /> +% } + +% 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> +% } + +<%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'); + + +</%INIT> +<%ARGS> +$Name => 'Users' +$Show => 'All' +$Group +$SkipUsers => {} +$SkipGroups => {} +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectRights b/rt/share/html/Admin/Elements/SelectRights new file mode 100755 index 000000000..4c1940acc --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectRights @@ -0,0 +1,121 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<input type="hidden" class="hidden" name="CheckACL" value="<%$ACLDesc%>" /> + <table border="0"> +<tr> +<td valign="top" width="180" align="left"> +<%PERL> +my %current_rights; +my @pairs; +while ( my $ace = $ACLObj->Next ) { + my $right = $ace->RightName; + $current_rights{ $right } = 1; + push @pairs, [$right, loc($right)]; +} +@pairs = sort { $a->[1] cmp $b->[1] } @pairs; +</%PERL> +<h3><&|/l&>Current rights</&></h3> +% unless ( @pairs ) { +<i><&|/l&>No rights granted.</&></i> <br /> +% } else { +<i>(<&|/l&>Check box to revoke right</&>)</i><br /> +% foreach my $pair ( @pairs ) { +<input type="checkbox" class="checkbox" value="<% $pair->[0] %>" name="RevokeRight-<% $ACLDesc %>" /> <% $pair->[1] %><br /> +% } } +</td> +<td valign="top"> +<h3><&|/l&>New rights</&></h3> +<select size="5" multiple="multiple" name="GrantRight-<%$ACLDesc%>"> +% foreach my $pair (sort { $a->[1] cmp $b->[1] } map [$_, loc($_)], grep !$current_rights{$_}, keys %Rights) { + <option value="<% $pair->[0] %>" title="<% loc($Rights{$pair->[0]}) %>"><% $pair->[1] %></option> +% } +<option value="" selected="selected"><&|/l&>(no value)</&></option> +</select> +</td> +</tr> +</table> +<%INIT> + my ($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); + $ACLObj->OrderBy(FIELD=>'RightName'); + + 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; +</%INIT> + +<%ARGS> +$PrincipalType => undef +$PrincipalId => undef +$Object =>undef +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectScrip b/rt/share/html/Admin/Elements/SelectScrip new file mode 100755 index 000000000..b5f6e639d --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScrip @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +<option value="" +<% $Default eq undef && qq[ selected="selected"] |n %> +>-</option> +%while (my $Scrip = $Scrips->Next) { +<option value="<% $Scrip->Id %>" +<% $Scrip->Id == $Default && qq[ selected="selected"] |n %> +><% loc($Scrip->Name) %> +</option> +%} +</select> + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'Scrip' + +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectScripAction b/rt/share/html/Admin/Elements/SelectScripAction new file mode 100755 index 000000000..f6d5bb23f --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScripAction @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +<option value="" +<% ! defined $Default && qq[ selected="selected"] |n %> +>-</option> +%while (my $ScripAction = $ScripActions->Next) { +<option value="<%$ScripAction->Id%>" +<% defined $Default && $ScripAction->Id == $Default && qq[ selected="selected"] |n %> +><% loc($ScripAction->Name) %> +</option> +%} +</select> + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; +$ScripActions->OrderBy(FIELD => 'Name'); + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectScripCondition b/rt/share/html/Admin/Elements/SelectScripCondition new file mode 100755 index 000000000..34e700d9e --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScripCondition @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +<option value="" +<% ! defined $Default && qq[ selected="selected"] %> +>-</option> +%while (my $ScripCondition = $ScripConditions->Next) { +<option value="<%$ScripCondition->Id%>" +<% defined $Default && $ScripCondition->Id == $Default && qq[ selected="selected"] %> +><% loc($ScripCondition->Name) %> +</option> +%} +</select> + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; +$ScripConditions->OrderBy(FIELD => 'Name'); + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectSingleOrMultiple b/rt/share/html/Admin/Elements/SelectSingleOrMultiple new file mode 100755 index 000000000..07d224b50 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} + <select name="<%$Name%>"> + <option value="1" <%$SingleDefault|n%>><&|/l&>Single</&></option> + <option value="0" <%$MultipleDefault|n%>><&|/l&>Multiple</&></option> + </select> + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = qq[ selected="selected"]; +} +elsif ($Default == 0 ) { + $MultipleDefault = qq[ selected="selected"]; +} + +</%INIT> +<%ARGS> +$Name => 'Single' +$Default => 1 +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectStage b/rt/share/html/Admin/Elements/SelectStage new file mode 100644 index 000000000..3188d0ecc --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectStage @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +% foreach my $stage (@stages) { + +%# allow [stage, display] in place of a scalar stage name +% my ($value, $display) = ref($stage) ? @$stage : ($stage, $stage); + +<option value="<%$value%>" +<% ($value eq $Default) && qq[ selected="selected"] |n %> +><% loc($display) %> +</option> + +% } +<%INIT> +if ( !defined $Default || $Default eq '') { + $Default = 'TransactionCreate'; +} +my @stages = 'TransactionCreate'; + +push @stages, RT->Config->Get('UseTransactionBatch') + ? 'TransactionBatch' + : ['TransactionBatch', 'TransactionBatch (DISABLED)']; + +push @stages, 'Disabled'; +</%INIT> +<%ARGS> +$Default => 'TransactionCreate' +$Name => 'Stage' +</%ARGS> diff --git a/rt/share/html/Admin/Elements/SelectTemplate b/rt/share/html/Admin/Elements/SelectTemplate new file mode 100755 index 000000000..c1a7a0f61 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectTemplate @@ -0,0 +1,87 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select name="<%$Name%>"> +<option value="" +<% 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> +%} +%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> +%} +</select> + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +$PrimaryTemplates->OrderBy(FIELD => 'Name'); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); +$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 new file mode 100755 index 000000000..6ae6a1c52 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectUsers @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<select multiple="multiple" name="<% $Name %>" size="10"> +% while ( my $user = $users->Next ) { +<option value="<% $user->id %>">\ +<& /Elements/ShowUser, User => $user &>\ +</option> +% } +</select> + +<%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(); + +</%INIT> +<%ARGS> +$Name => 'Users' +</%ARGS> diff --git a/rt/share/html/Admin/Elements/ShowKeyInfo b/rt/share/html/Admin/Elements/ShowKeyInfo new file mode 100644 index 000000000..35d38a718 --- /dev/null +++ b/rt/share/html/Admin/Elements/ShowKeyInfo @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 }}} +<&| /Widgets/TitleBox, title => $title &> +% if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) { +<% loc('No keys for this address') %> +% } else { +<table> + +% unless ( $Type eq 'private' ) { +<tr><th><% loc('Trust') %>:</th> <td><% loc( $res{'info'}{'Trust'} ) %></td></tr> +% } + +<tr><th><% loc('Created') %>:</th> +<td><% $res{'info'}{'Created'}? $res{'info'}{'Created'}->AsString( Time => 0 ): loc('never') %></td></tr> + +<tr><th><% loc('Expire') %>:</th> +<td><% $res{'info'}{'Expire'}? $res{'info'}{'Expire'}->AsString( Time => 0 ): loc('never') %></td></tr> + +% foreach my $uinfo( @{ $res{'info'}{'User'} } ) { +<tr><th><% loc('User (created - expire)') %>:</th> +<td><% $uinfo->{'String'} %>\ +(<% $uinfo->{'Created'}? $uinfo->{'Created'}->AsString( Time => 0 ): loc('never') %> - \ +<% $uinfo->{'Expire'}? $uinfo->{'Expire'}->AsString( Time => 0 ): loc('never') %>) +</td></tr> +% } + +</table> +% } +</&> + +<%ARGS> +$EmailAddress +$Type => 'public' +</%ARGS> +<%INIT> +require RT::Crypt::GnuPG; +my %res = RT::Crypt::GnuPG::GetKeyInfo( $EmailAddress, $Type ); + +my $title; +unless ( $Type eq 'private' ) { + $title = loc('GnuPG public key(s) for [_1]', $EmailAddress); +} else { + $title = loc('GnuPG private key(s) for [_1]', $EmailAddress); +} + +</%INIT> diff --git a/rt/share/html/Admin/Elements/SystemTabs b/rt/share/html/Admin/Elements/SystemTabs new file mode 100755 index 000000000..4a20dab58 --- /dev/null +++ b/rt/share/html/Admin/Elements/SystemTabs @@ -0,0 +1,102 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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', + }, + +}; + +# Use current $tabs as $subtabs if there is no $subtabs for this tab +$subtabs = ($subtabs) ? $subtabs : $tabs; + + # 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 new file mode 100755 index 000000000..f7b0ad7ef --- /dev/null +++ b/rt/share/html/Admin/Elements/Tabs @@ -0,0 +1,95 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100755 index 000000000..d8be841b9 --- /dev/null +++ b/rt/share/html/Admin/Elements/ToolTabs @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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 new file mode 100755 index 000000000..a5c3d9a2b --- /dev/null +++ b/rt/share/html/Admin/Elements/UserTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# <jesse@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> |