diff options
Diffstat (limited to 'rt/html/Admin/Elements')
41 files changed, 3577 insertions, 0 deletions
diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue new file mode 100644 index 000000000..3e3f414b3 --- /dev/null +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<b><&|/l&>Add Value</&></b></b></b></b> +<TABLE BORDER="0"> +<TR><TD><small> +<&|/l&>Sort</&>:<br> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-new-SortOrder" > +</TD> +<TD><small> +<&|/l&>Name</&>:<br> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-new-Name" > +</TD> +<TD><small> +<&|/l&>Description</&>:<br> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-new-Description"> +</TD></TR> +</TABLE> + +<%init> +</%init> +<%args> +$CustomField => undef +</%args> diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled new file mode 100644 index 000000000..0dc6ac792 --- /dev/null +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -0,0 +1,48 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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::WebPath %>/Admin/Users/Create.html"> +<&|/l&>New user called</&> <INPUT NAME="Name" size=10><input type=submit value="<&|/l&>Create</&>"> +</form> diff --git a/rt/html/Admin/Elements/CustomFieldTabs b/rt/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..d7acf33cc --- /dev/null +++ b/rt/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/io) { + $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 custom field'), + path => "Admin/CustomFields/", + }; + $tabs->{"B"} = { title => loc('New custom field'), + path => "Admin/CustomFields/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab (sort keys %{$tabs->{'this'}->{'subtabs'}}) { + if ($tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{'subtabs'} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{'current_subtab'} = $current_subtab; + } +} +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/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField new file mode 100644 index 000000000..d8c5b29b2 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomField @@ -0,0 +1,157 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 NAME="CustomField" VALUE="<%$id %>"> +<INPUT TYPE=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 NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=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"; +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)); + } + push @results, $msg; + $CustomFieldObj->SetSortOrder($CustomFieldObj->id); + $title = loc('Created CustomField [_1]', $CustomFieldObj->Name()); + } else { + $CustomFieldObj->Load($CustomField) || Abort(loc('No CustomField')); + $title = loc('Editing CustomField [_1]', $CustomFieldObj->Name()); + + my @aresults = ProcessCustomFieldUpdates ( + CustomFieldObj => $CustomFieldObj, + ARGSRef => \%ARGS ); + push @results, @aresults; + } + + +$id = $CustomFieldObj->id; + + #we're asking about enabled on the web page but really care about disabled. + my $Disabled = ($Enabled ? 0 : 1); + + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + +} + + +</%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/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues new file mode 100644 index 000000000..9cc3858b9 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 (!$values->Count) { +<p><em><&|/l&>(no values)</&></em></p> +% return; +% } +<i><&|/l&>(Check box to delete)</&></i> +<table> +<tr> +<td> </td> +<td><&|/l&>Sort</&></td> +<td><&|/l&>Name</&></td> +<td><&|/l&>Description</&></td> +</tr> +% while (my $value = $values->Next) { +<tr> +<td> +<input type="checkbox" name="Delete-CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>"> +</td> +<td> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-SortOrder" value="<%$value->SortOrder%>"> +</td> +<td> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Name" value="<%$value->Name%>"> +</td> +<td> +<font size="-1"> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Description" value="<%$value->Description%>"> +</font> +</td> +</tr> +% } +</table> +<%init> + +my $values = $CustomField->ValuesObj(); + +</%init> +<%args> +$CustomField => undef +</%args> diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields new file mode 100644 index 000000000..1cd3df568 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFields @@ -0,0 +1,189 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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::WebPath%><% $m->request_comp->path |n %>" METHOD="POST" NAME="EditCustomFields"> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $Object->Id %>"/> +<INPUT TYPE=HIDDEN NAME="ObjectType" VALUE="<% $ObjectType %>"/> +<INPUT TYPE=HIDDEN NAME="SubType" VALUE="<% $SubType %>"/> +<INPUT TYPE=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); + +# {{{ 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/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers new file mode 100644 index 000000000..c93bf81f5 --- /dev/null +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 { +<i><&|/l&>(Check box to delete)</&></i><br><BR> +<ul> +% while (my $watcher=$Members->Next) { +<li> +<INPUT TYPE=CHECKBOX NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" + UNCHECKED> +% if ($watcher->MemberObj->IsUser) { +<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } else { +<a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } +<%$watcher->MemberObj->Object->Name%></a> +% } +% } +</ul> + +<%INIT> +my $Members = $Watchers->MembersObj; +</%INIT> + +<%ARGS> +$QueueObj => undef +$Watchers => undef +</%ARGS> + + + diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip new file mode 100644 index 000000000..907ae9a92 --- /dev/null +++ b/rt/html/Admin/Elements/EditScrip @@ -0,0 +1,197 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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" name="id" value="<%$id%>"> +<input type="hidden" name="Queue" value="<%$Queue%>"> +<& /Elements/TitleBoxStart, title => loc('Scrip Fields') &> +<TABLE> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>: +</TD> +<TD> +<input Name="Scrip-<%$id%>-Description" value="<%$scrip->Description%>"> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Condition</&>: +</TD> +<TD> +<& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $scrip->ConditionObj->Id &><BR> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Action</&>: +</TD> +<TD> +<& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $scrip->ActionObj->Id &> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Template</&>: +</TD> +<TD> +<& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $scrip->TemplateObj->Id, Queue => $Queue &> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Stage</&>: +</TD> +<TD> +<& /Admin/Elements/SelectStage, Name => "Scrip-$id-Stage", Default => $scrip->Stage &> +</TD> +</TR> +</table> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +<br> +<& /Elements/TitleBoxStart, 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> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomIsApplicableCode"><%$scrip->CustomIsApplicableCode%></TEXTAREA> +</TD> +</TR> +<TR> +<TD class=labeltop> +<&|/l&>Custom action preparation code</&>: +</TD> +<TD> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomPrepareCode"><%$scrip->CustomPrepareCode%></TEXTAREA> +</TD> +</TR> +<TR> +<TD class=labeltop> +<&|/l&>Custom action cleanup code</&>: +</TD> +<TD> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomCommitCode"><%$scrip->CustomCommitCode%></TEXTAREA> +</TD> +</TR> +</table> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> + +</FORM> +<%init> +my (@actions); + + +my $scrip = new RT::Scrip($session{'CurrentUser'}); + +if ( $id eq 'new' ) { + + my ( $retval, $msg ) = $scrip->Create( + Queue => $Queue, + ScripAction => $ARGS{"Scrip-new-ScripAction"}, + ScripCondition => $ARGS{"Scrip-new-ScripCondition"}, + Template => $ARGS{"Scrip-new-Template"}, + Description => $ARGS{"Scrip-new-Description"}, + CustomPrepareCode => $ARGS{"Scrip-new-CustomPrepareCode"}, + CustomCommitCode => $ARGS{"Scrip-new-CustomCommitCode"}, + CustomIsApplicableCode => $ARGS{"Scrip-new-CustomIsApplicableCode"}, + ); + if ( defined $retval ) { + push @actions, $msg; + $id = $scrip->id; + } + else { + Abort( $msg); + } +} +elsif ($id) { + my ($val,$msg) =$scrip->Load($id); + if ($val) { + $id = $scrip->id; + } else { + Abort ($msg); + } + my @attribs = qw ( + Queue + ScripAction + ScripCondition + Template + Stage + Description + CustomPrepareCode + CustomCommitCode + CustomIsApplicableCode + ); + my @results = UpdateRecordObject( AttributesRef => \@attribs, + AttributePrefix => 'Scrip-'.$scrip->Id, + Object => $scrip, + ARGSRef => \%ARGS ); + push (@actions, @results); +} + +elsif ($ARGS{'create'}) { + $id = 'new'; +} + +# }}} +</%init> + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 +</%ARGS> diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips new file mode 100644 index 000000000..9526118b5 --- /dev/null +++ b/rt/html/Admin/Elements/EditScrips @@ -0,0 +1,121 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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" name="id" value="<%$id%>"> + +<h2><&|/l&>Current Scrips</&></h2> +% if ($Scrips->Count == 0 ) { +<P><i><&|/l&>(No scrips)</&></i></P> +% } else { +<TABLE> +<P><i><&|/l&>(Check box to delete)</&></i></P> + +% while (my $scrip = $Scrips->Next ) { +<TR> +<TD> +<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>" value="1"> +</TD> +<TD> +<a href="Scrip.html?id=<%$scrip->Id%>&Queue=<%$id%>"><% $scrip->Description || "<i>(".loc('no value').")</i>" |n %></a><br> +<small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small> +</TD> +</TR> +% } + +</TABLE> + +% } +<& /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); +} + +if ($QueueObj->id) { + $Scrips->LimitToQueue($id); +} +else { + $Scrips->LimitToGlobal(); +} + + + + +# {{{ deal with modifying and deleting existing scrips +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the scrip + if ($key =~ /^DeleteScrip-(\d+)/) { + my $id = $1; + my $scrip = new RT::Scrip($session{'CurrentUser'}); + $scrip->Load($id); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, loc("Scrip deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} +</%init> + +<%ARGS> +$id => undef +$title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates new file mode 100644 index 000000000..207ffd001 --- /dev/null +++ b/rt/html/Admin/Elements/EditTemplates @@ -0,0 +1,126 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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" NAME="id" VALUE="<%$id%>"> + +% if ($Templates->Count == 0 ) { +<P><i><&|/l&>(No templates)</&></i></P> +% } else { +<TABLE> +<TR> +<TH> +<i><&|/l&>(Check box to delete)</&></i> +</TH> +<TH> +</TH> +</TR> +% my $count; +% while (my $TemplateObj = $Templates->Next) { +<TR> +<TD> +<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>" value="1"> +</TD> +<TD> +<A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>"> +<B><% loc($TemplateObj->Name) %></B></A> +<br><% loc($TemplateObj->Description) %> +</TD> +</TR> + +% } +</TABLE> +% } + +<& /Elements/Submit, Label => loc('Delete Template') &> +</FORM> + +<%INIT> +my $Templates = RT::Templates->new($session{'CurrentUser'}); +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +my @actions; + +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $Templates->LimitToQueue($id); +} +else { + $Templates->LimitToGlobal(); +} + +# Now let callbacks add their extra limits +$m->comp('/Elements/Callback', Templates => $Templates, %ARGS); + +# {{{ deal with deleting existing templates +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the template + if ($key =~ /^DeleteTemplate-(\d+)/) { + my $id = $1; + my $TemplateObj = RT::Template->new($session{'CurrentUser'}); + $TemplateObj->Load($id); + my ($retval, $msg) = $TemplateObj->Delete; + if ($retval) { + push @actions, loc("Template deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} +</%INIT> +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$Template => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments new file mode 100644 index 000000000..fb96dc09a --- /dev/null +++ b/rt/html/Admin/Elements/EditUserComments @@ -0,0 +1,54 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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" 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/html/Admin/Elements/GlobalCustomFieldTabs b/rt/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..8d4eaca23 --- /dev/null +++ b/rt/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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('Modify scrips which apply to all queues'), + path => 'Admin/Global/CustomFields/Users.html', + }, + B => { title => loc('Groups'), + text => loc('Edit system templates'), + path => 'Admin/Global/CustomFields/Groups.html', + }, + + F => { title => loc('Tickets'), + text => loc('Modify global custom fields'), + path => 'Admin/Global/CustomFields/Queue-Tickets.html', + }, + + G => { title => loc('Ticket Transactions'), + text => loc('Modify global group rights'), + path => 'Admin/Global/CustomFields/Queue-Transactions.html', + }, + +}; + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs new file mode 100644 index 000000000..60edda40e --- /dev/null +++ b/rt/html/Admin/Elements/GroupTabs @@ -0,0 +1,100 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 group'), + path => "Admin/Groups/", }; +$tabs->{"B"} = { title => loc('New group'), + path => "Admin/Groups/Modify.html?Create=1", + separator => 1, }; + +# Now let callbacks add their extra tabs +$m->comp( '/Elements/Callback', tabs => $tabs, %ARGS ); +foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { + if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} + $tabs->{'this'}->{"current_subtab"} = $current_tab; + $current_tab = "Admin/Groups/Modify.html?id=".$GroupObj->id if $GroupObj; + +</%INIT> +<%ARGS> +$GroupObj => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef +</%ARGS> + diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header new file mode 100644 index 000000000..b80908094 --- /dev/null +++ b/rt/html/Admin/Elements/Header @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields new file mode 100644 index 000000000..3df9d6292 --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -0,0 +1,59 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips new file mode 100644 index 000000000..2e3791257 --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 ($Scrips->Count == 0) { + +<P><i><&|/l&>(No scrips)</&></i></P> + +% } else { + +<UL> + +% while (my $scrip = $Scrips->Next ) { +<LI> +<a href="<%$RT::WebPath%>/Admin/Global/Scrip.html?id=<%$scrip->Id%>&Queue=<%0%>"> +% if ($scrip->Description) { +<% $scrip->Description %> +% } else { +<i>(<&|/l, $scrip->Id&>Scrip #[_1]</&>)</i> +% } +</a><br> +<small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small> +</LI> +% } + +</UL> + +% } + +<%init> +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +$Scrips->LimitToGlobal(); +</%INIT> diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate new file mode 100644 index 000000000..6749f3e65 --- /dev/null +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/ObjectCustomFields b/rt/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..a87e1579d --- /dev/null +++ b/rt/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,109 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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)); + + + +my $Type = $1; +my $Types = $Type.'s'; +my $ObjectTabs; +my $Object = $ObjectType->new($session{'CurrentUser'}); + + +my $QualifiedType; +my $FriendlySubTypes; +if ($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)); + $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/html/Admin/Elements/PickCustomFields b/rt/html/Admin/Elements/PickCustomFields new file mode 100644 index 000000000..c2a30f9a3 --- /dev/null +++ b/rt/html/Admin/Elements/PickCustomFields @@ -0,0 +1,96 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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" name="Object-<%$id%>-CF-<%$CustomFieldObj->Id%>" value="1" <% $Checked ? 'CHECKED' : '' %> +> + </TD> +% } + <TD valign="TOP"> + <A HREF="<%$RT::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::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::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/html/Admin/Elements/PickObjects b/rt/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..b07a88240 --- /dev/null +++ b/rt/html/Admin/Elements/PickObjects @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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> +% if (!$ReadOnly) { + <TD valign="TOP"> +<input type="checkbox" name="Object-<%$Object->id%>-CF-<%$id%>" value="1" <% $Checked ? 'CHECKED' : ''%> +> + </TD> +% } + <TD valign="TOP"> +% if ($Object->Name) { + <b><%$Object->Name%></b><br> +% } else { + <i>(<%loc("no name")%>)</i><br> +% } + <%$Object->can('Description') && $Object->Description%> + </TD> +%# <TD valign="TOP"> +%# <i><% $CustomFieldObj->FriendlyTypeComposite %></i> +%# </TD> + </TD> +</TR> +% } +</TABLE> +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 +</%ARGS> diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser new file mode 100644 index 000000000..01f294a59 --- /dev/null +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs new file mode 100644 index 000000000..93522d0a2 --- /dev/null +++ b/rt/html/Admin/Elements/QueueTabs @@ -0,0 +1,118 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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, + } + } + }; +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) { + $tabs->{"A"} = { title => loc('Select queue'), + path => "Admin/Queues/", + }; + $tabs->{"B"} = { title => loc('New queue'), + path => "Admin/Queues/Modify.html?Create=1", + separator => 1, }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); +foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { + if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} + $current_tab = "Admin/Queues/Modify.html?id=".$id if $id; +</%INIT> + +<%ARGS> +$QueueObj => undef +$id => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectCustomFieldLookupType b/rt/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..ec9f740b9 --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyLookupType($option) %></OPTION> +%} +</SELECT> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'LookupType' +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType new file mode 100644 index 000000000..3f25b8e71 --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 && "SELECTED"%>><% $cf->FriendlyTypeComposite($option) %></OPTION> +%} +</SELECT> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'TypeComposite' +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups new file mode 100644 index 000000000..92bd47587 --- /dev/null +++ b/rt/html/Admin/Elements/SelectGroups @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 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/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup new file mode 100644 index 000000000..272e1f0c7 --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyGroup @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue new file mode 100644 index 000000000..3a30d09c8 --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyQueue @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser new file mode 100644 index 000000000..fc6c01205 --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyUser @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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%>: <%$user->Name%></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/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers new file mode 100644 index 000000000..95056aec9 --- /dev/null +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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> +<SELECT MULTIPLE NAME="<%$Name%>Users" SIZE=10> +%while (my $user = $users->Next) { +<OPTION VALUE="User-<%$user->id%>"><%$user->Name%></OPTION> +%} +</SELECT> +<br> +% } +% if ($Show ne 'Users') { +<b><&|/l&>Groups</&></b> +<SELECT MULTIPLE NAME="<%$Name%>Groups" SIZE=10> +%while (my $group = $groups->Next) { +<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 +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights new file mode 100644 index 000000000..3e61d5071 --- /dev/null +++ b/rt/html/Admin/Elements/SelectRights @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 NAME="CheckACL" VALUE="<%$ACLDesc%>"> + <TABLE BORDER=0> +<TR> +<TD valign=top width="180" align="left"> +% my %current_rights; +<h3><&|/l&>Current rights</&></h3> +% if ($ACLObj->Count() == 0) { +<i><&|/l&>No rights granted.</&></i> <BR> +% } else { +<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> +% while (my $right = $ACLObj->Next()) { +% if ($right->RightName) { +% $current_rights{$right->RightName} = 1; +<input type=checkbox value="<%$right->Id%>" name="RevokeRight-<%$ACLDesc%>-<%$right->RightName%>"> <% loc($right->RightName) %><br> +% } +% } +% } +</TD> +<TD valign=top> +<h3><&|/l&>New rights</&></h3> +<SELECT SIZE=5 MULTIPLE NAME="GrantRight-<%$ACLDesc%>"> +% foreach $right (sort keys %Rights) { +% next if $current_rights{$right}; + <OPTION VALUE="<%$right%>" + ><% loc($right) %></OPTION> +% } +<OPTION VALUE="" SELECTED><&|/l&>(no value)</&></OPTION> +</SELECT> +</TD> +</TR> +</TABLE> +<%INIT> + my ($right, $ACLDesc, $AppliesTo, %Rights); + + # if the principal id points to a user, we really want to point + # to their ACL equivalence group. The machinations we're going through + # lead me to start to suspect that we really want users and groups + # to just be the same table. or _maybe_ that we want an object db. + my $princ = RT::Principal->new($RT::SystemUser); + $princ->Load($PrincipalId); + if ($princ->PrincipalType eq 'User') { + my $group = RT::Group->new($RT::SystemUser); + $group->LoadACLEquivalenceGroup($princ); + $PrincipalId = $group->PrincipalId; + } + + + my $ACLObj = new RT::ACL($session{'CurrentUser'}); + my $ACE = new RT::ACE($session{'CurrentUser'}); + + + $ACLObj->LimitToObject( $Object); + $ACLObj->LimitToPrincipal( Id => $PrincipalId); + $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/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip new file mode 100644 index 000000000..a9e979699 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScrip @@ -0,0 +1,70 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 && 'SELECTED' %> +>-</OPTION> +%while (my $Scrip = $Scrips->Next) { +<OPTION VALUE=<% $Scrip->Id %> +<% $Scrip->Id == $Default && 'SELECTED' %> +><% 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/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction new file mode 100644 index 000000000..8d88d6458 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripAction @@ -0,0 +1,70 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 && 'SELECTED' %> +>-</OPTION> +%while (my $ScripAction = $ScripActions->Next) { +<OPTION VALUE=<%$ScripAction->Id%> +<% defined $Default && $ScripAction->Id == $Default && 'SELECTED' %> +><% loc($ScripAction->Name) %> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition new file mode 100644 index 000000000..faa99fda6 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripCondition @@ -0,0 +1,70 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 && 'SELECTED' %> +>-</OPTION> +%while (my $ScripCondition = $ScripConditions->Next) { +<OPTION VALUE=<%$ScripCondition->Id%> +<% defined $Default && $ScripCondition->Id == $Default && 'SELECTED' %> +><% loc($ScripCondition->Name) %> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple new file mode 100644 index 000000000..571695091 --- /dev/null +++ b/rt/html/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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%>><&|/l&>Single</&></option> + <option value="0" <%$MultipleDefault%>><&|/l&>Multiple</&></option> + </select> + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = "SELECTED"; +} +elsif ($Default == 0 ) { + $MultipleDefault = "SELECTED"; +} + +</%INIT> +<%ARGS> +$Name => 'Single' +$Default => 1 +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectStage b/rt/html/Admin/Elements/SelectStage new file mode 100644 index 000000000..0fbf5c609 --- /dev/null +++ b/rt/html/Admin/Elements/SelectStage @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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) { +<OPTION VALUE=<%$stage%> +<% ($stage eq $Default) && 'SELECTED' %> +><% loc($stage) %> +</OPTION> +% } +<%INIT> +if ($Default eq '') { + $Default = 'TransactionCreate'; +} +my @stages = 'TransactionCreate'; +push @stages, 'TransactionBatch' if $RT::UseTransactionBatch; +push @stages, 'Disabled'; +</%INIT> +<%ARGS> +$Default => 'TransactionCreate' +$Name => 'Stage' +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate new file mode 100644 index 000000000..7d83b6768 --- /dev/null +++ b/rt/html/Admin/Elements/SelectTemplate @@ -0,0 +1,83 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 'none' && 'SELECTED' %> +>-</OPTION> +%while (my $Template = $PrimaryTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED' %> +><% loc($Template->Name) %> +</OPTION> +%} +%while (my $Template = $OtherTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED'%> +><&|/l, loc($Template->Name) &>Global template: [_1]</&> +</OPTION> +%} +</SELECT> + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); + +</%INIT> +<%ARGS> + +$Queue => undef +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers new file mode 100644 index 000000000..a88aa8ff7 --- /dev/null +++ b/rt/html/Admin/Elements/SelectUsers @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 NAME="<%$Name%>" SIZE=10> +%while (my $user = $users->Next) { +<OPTION VALUE="<%$user->id%>"><%$user->Name%> +%} +</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/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs new file mode 100644 index 000000000..646f552f5 --- /dev/null +++ b/rt/html/Admin/Elements/SystemTabs @@ -0,0 +1,92 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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', + } + +}; + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/Tabs b/rt/html/Admin/Elements/Tabs new file mode 100644 index 000000000..f90a629a2 --- /dev/null +++ b/rt/html/Admin/Elements/Tabs @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + +</%INIT> + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/ToolTabs b/rt/html/Admin/Elements/ToolTabs new file mode 100755 index 000000000..773b81099 --- /dev/null +++ b/rt/html/Admin/Elements/ToolTabs @@ -0,0 +1,78 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/Tools/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { + + A => { title => loc('System Configuration'), + path => 'Admin/Tools/Configuration.html', + } + +}; + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs new file mode 100644 index 000000000..0ffd29b0f --- /dev/null +++ b/rt/html/Admin/Elements/UserTabs @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 + }, +# Scrips => { title => loc('Rights'), +# path => "Admin/Users/Rights.html?id=".$id +# } + + } +} +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { + $tabs->{"A"} = { title => loc('Select user'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { title => loc('New user'), + path => "Admin/Users/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +#foreach my $tab ( sort keys %{$tabs} ) { +# if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { +# $tabs->{$tab}->{"current_subtab"} = $current_subtab; +# } +#} +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> |