summaryrefslogtreecommitdiff
path: root/rt/html/Admin/Elements
diff options
context:
space:
mode:
authorivan <ivan>2005-10-15 09:11:20 +0000
committerivan <ivan>2005-10-15 09:11:20 +0000
commitd4d0590bef31071e8809ec046717444b95b3f30a (patch)
treeee1236da50578390d2642114f28eaed99a5efb18 /rt/html/Admin/Elements
parentd39d52aac8f38ea9115628039f0df5aa3ac826de (diff)
import rt 3.4.4
Diffstat (limited to 'rt/html/Admin/Elements')
-rw-r--r--rt/html/Admin/Elements/AddCustomFieldValue12
-rw-r--r--rt/html/Admin/Elements/CreateUserCalled6
-rw-r--r--rt/html/Admin/Elements/CustomFieldTabs116
-rw-r--r--rt/html/Admin/Elements/EditCustomField6
-rw-r--r--rt/html/Admin/Elements/EditCustomFieldValues50
-rw-r--r--rt/html/Admin/Elements/EditCustomFields222
-rw-r--r--rt/html/Admin/Elements/EditQueueWatchers9
-rw-r--r--rt/html/Admin/Elements/EditScrip6
-rw-r--r--rt/html/Admin/Elements/EditScrips10
-rw-r--r--rt/html/Admin/Elements/EditTemplates8
-rw-r--r--rt/html/Admin/Elements/EditUserComments6
-rwxr-xr-xrt/html/Admin/Elements/GlobalCustomFieldTabs93
-rw-r--r--rt/html/Admin/Elements/GroupTabs10
-rw-r--r--rt/html/Admin/Elements/Header8
-rw-r--r--rt/html/Admin/Elements/ListGlobalCustomFields6
-rw-r--r--rt/html/Admin/Elements/ListGlobalScrips36
-rw-r--r--rt/html/Admin/Elements/ModifyTemplate6
-rw-r--r--rt/html/Admin/Elements/ObjectCustomFields109
-rw-r--r--rt/html/Admin/Elements/PickCustomFields96
-rw-r--r--rt/html/Admin/Elements/PickObjects80
-rw-r--r--rt/html/Admin/Elements/QueueRightsForUser8
-rw-r--r--rt/html/Admin/Elements/QueueTabs17
-rw-r--r--rt/html/Admin/Elements/SelectCustomFieldLookupType58
-rw-r--r--rt/html/Admin/Elements/SelectCustomFieldType12
-rw-r--r--rt/html/Admin/Elements/SelectGroups6
-rw-r--r--rt/html/Admin/Elements/SelectModifyGroup6
-rw-r--r--rt/html/Admin/Elements/SelectModifyQueue6
-rw-r--r--rt/html/Admin/Elements/SelectModifyUser6
-rw-r--r--rt/html/Admin/Elements/SelectNewGroupMembers6
-rw-r--r--rt/html/Admin/Elements/SelectRights19
-rw-r--r--rt/html/Admin/Elements/SelectScrip6
-rw-r--r--rt/html/Admin/Elements/SelectScripAction10
-rw-r--r--rt/html/Admin/Elements/SelectScripCondition10
-rw-r--r--rt/html/Admin/Elements/SelectSingleOrMultiple6
-rw-r--r--rt/html/Admin/Elements/SelectStage11
-rw-r--r--rt/html/Admin/Elements/SelectTemplate6
-rw-r--r--rt/html/Admin/Elements/SelectUsers6
-rw-r--r--rt/html/Admin/Elements/SystemTabs8
-rw-r--r--rt/html/Admin/Elements/Tabs13
-rwxr-xr-xrt/html/Admin/Elements/ToolTabs6
-rw-r--r--rt/html/Admin/Elements/UserTabs75
41 files changed, 880 insertions, 316 deletions
diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue
index 0e59fe320..3e3f414b3 100644
--- a/rt/html/Admin/Elements/AddCustomFieldValue
+++ b/rt/html/Admin/Elements/AddCustomFieldValue
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,20 +42,20 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<b><&|/l&>Add Value</&></b></b></b></b>
<TABLE BORDER="0">
<TR><TD><small>
<&|/l&>Sort</&>:<br>
-<input name="CustomField-<% $CustomField->Id %>-AddValue-SortOrder" size="5">
+<input size=3 name="CustomField-<%$CustomField->Id%>-Value-new-SortOrder" >
</TD>
<TD><small>
<&|/l&>Name</&>:<br>
-<input size=20 name="CustomField-<% $CustomField->Id %>-AddValue-Name">
+<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-new-Name" >
</TD>
<TD><small>
<&|/l&>Description</&>:<br>
-<input size="60" name="CustomField-<% $CustomField->Id %>-AddValue-Description">
+<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-new-Description">
</TD></TR>
</TABLE>
diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled
index 01fa9fe94..0dc6ac792 100644
--- a/rt/html/Admin/Elements/CreateUserCalled
+++ b/rt/html/Admin/Elements/CreateUserCalled
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# 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
index 5657d43fd..d8c5b29b2 100644
--- a/rt/html/Admin/Elements/EditCustomField
+++ b/rt/html/Admin/Elements/EditCustomField
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@results &>
diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues
index 79b6501e1..9cc3858b9 100644
--- a/rt/html/Admin/Elements/EditCustomFieldValues
+++ b/rt/html/Admin/Elements/EditCustomFieldValues
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,22 +42,42 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<i><&|/l&>(Check box to delete)</&></i>
-<ul>
-% while (my $v = $values->Next) {
-<li>
-<INPUT TYPE="text" SIZE="2" NAME="CustomField-<%$CustomField->Id%>-SortOrder<%$v->Id()%>" VALUE="<%$v->SortOrder()%>">
-<input type="checkbox" name="CustomField-<%$CustomField->Id%>-DeleteValue" value="<%$v->id%>">
-<%$v->Name%>
-% if ($v->Description) {
-<i>(<%$v->Description%>)</i>
+%# END BPS TAGGED BLOCK }}}
+% if (!$values->Count) {
+<p><em><&|/l&>(no values)</&></em></p>
+% return;
% }
-</li>
+<i><&|/l&>(Check box to delete)</&></i>
+<table>
+<tr>
+<td>&nbsp;</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>
% }
-</ul>
+</table>
<%init>
-my $values = $CustomField->Values();
+
+my $values = $CustomField->ValuesObj();
+
</%init>
<%args>
$CustomField => undef
diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields
index d901b216e..1cd3df568 100644
--- a/rt/html/Admin/Elements/EditCustomFields
+++ b/rt/html/Admin/Elements/EditCustomFields
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,95 +42,64 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<& /Elements/ListActions, actions => \@actions &>
-
-<TABLE>
-<TR>
-<TD VALIGN=TOP>
-<h2><%$caption%></h2>
-</TD></TR></TABLE>
-% if ($CustomFields->Count == 0 ) {
-<P><i><&|/l&>(No custom fields)</&></i></P>
-% } else {
-<TABLE cellspacing=0 cellpadding=2>
-% my $count;
-% while (my $CustomFieldObj = $CustomFields->Next) {
-<TR>
- <TD valign="TOP">
-% if ($CustomFieldObj->Name) {
- <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><b><%$CustomFieldObj->Name%></b></a><br>
-% } else {
- <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><i>(<%loc("no name")%>)</i></a><br>
-% }
- <%$CustomFieldObj->Description%>
- </TD>
- <TD valign="TOP">
- <i><% $CustomFieldObj->FriendlyType %></i>
- </TD>
-% # show 'move up' unless it's the first item
-% if ($count++) {
- <TD valign="TOP">
- <a href="CustomFields.html?id=<%$id%>&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 (!$CustomFields->IsLast) {
-% $m->print(' | ') if $count > 1;
- <a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>
-% }
-</TD>
-</TR>
+%# 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 &>
-</TABLE>
-% }
-<FORM METHOD=GET ACTION="CustomFields.html">
-% if ($id) {
-<INPUT TYPE="Hidden" NAME="id" VALUE="<%$id%>">
-% }
-<input type="checkbox" name="FindDisabledCustomFields"> <&|/l&>Include disabled custom fields in listing.</&>
-<input type=submit value="<&|/l&>Go!</&>">
+<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &>
</FORM>
<%INIT>
my $CustomFields = RT::CustomFields->new($session{'CurrentUser'});
-my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-my $caption;
+my @results;
+my (@GlobalCFs, @UnassignedCFs);
-if ($id) {
- $QueueObj->Load($id);
+my $id = $Object->Id;
+if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) {
+ $m->out('<P><i>', loc('(No custom fields)'), '</i></P>');
+ return;
}
-if ($QueueObj->id) {
- $CustomFields->LimitToQueue($id);
-}
-else {
- $CustomFields->LimitToGlobal();
-}
-
-if ($FindDisabledCustomFields) {
- $caption = loc("All Custom Fields");
- $CustomFields->{'find_disabled_rows'} = 1;
-} else {
- $caption = loc("Enabled Custom Fields");
-}
+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::CustomField->new($session{'CurrentUser'});
- $SourceObj->Load($CustomField) || Abort(loc('No CustomField'));
+ my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'});
+ $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField );
my $TargetObj;
my $target_order = $SourceObj->SortOrder + $Move;
- while (my $CustomFieldObj = $CustomFields->Next) {
- my $this_order = $CustomFieldObj->SortOrder;
+ while (my $ObjectCF = $ObjectCFs->Next) {
+ my $this_order = $ObjectCF->SortOrder;
# if we have an exact match, finish the loop now
- ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order;
+ ($TargetObj = $ObjectCF, last) if $this_order == $target_order;
# otherwise, we need to apropos toward the general direction
# ... first, check the sign is correct
@@ -144,7 +113,7 @@ if ($CustomField and $Move) {
next if $orig_delta < $this_delta;
}
- $TargetObj = $CustomFieldObj;
+ $TargetObj = $ObjectCF;
}
if ($TargetObj) {
@@ -153,83 +122,68 @@ if ($CustomField and $Move) {
$TargetObj->SetSortOrder($s);
$SourceObj->SetSortOrder($t);
# because order changed, we must redo search for subsequent uses
- $CustomFields->RedoSearch;
}
- $CustomFields->GotoFirstItem;
+ $ObjectCFs->GotoFirstItem;
}
# }}}
-# {{{ now process the 'copy queue' action
-my @actions;
-if ($Source and $Source ne $id) {
- my $SourceQueue = RT::Queue->new($session{'CurrentUser'});
- $SourceQueue->Load($Source) || Abort(loc("Couldn't load queue"));
- my $SourceCustomFields = RT::CustomFields->new($session{'CurrentUser'});
- $SourceCustomFields->LimitToQueue($SourceQueue->id);
-
- # delete old fields
- foreach my $CustomFieldObj ( @{$CustomFields->ItemsArrayRef} ) {
- $CustomFieldObj->Delete;
- }
+if ($id) {
+ $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'});
+ $GlobalCFs->LimitToObjectId(0);
+ $GlobalCFs->LimitToLookupType($lookup);
+}
- # add new fields
- while (my $SourceCustomFieldObj = $SourceCustomFields->Next) {
- my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
- my ($val, $msg) = $CustomFieldObj->Create(
- id => $SourceCustomFieldObj->id,
- Queue => $id,
- Name => $SourceCustomFieldObj->Name,
- Type => $SourceCustomFieldObj->Type,
- Description => $SourceCustomFieldObj->Description,
- );
- Abort(loc("Could not create CustomField") . ": $msg") unless ($val);
- push @actions, $msg;
-
- $CustomFieldObj->SetSortOrder($SourceCustomFieldObj->SortOrder);
-
- # add new values
- my $values = $SourceCustomFieldObj->Values();
- while (my $v = $values->Next) {
- my ( $addval, $addmsg ) = $CustomFieldObj->AddValue(
- Name => $v->Name,
- Description => $v->Description,
- SortOrder => $v->SortOrder
- );
- }
- }
+while (my $cf = $CustomFields->Next) {
+ my $cf_id = $cf->Id;
- # because content changed, we must redo search for subsequent uses
- $CustomFields->RedoSearch;
- $CustomFields->GotoFirstItem;
-}
-# }}}
+ if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) {
+ push @GlobalCFs, $cf;
+ next;
+ }
-# {{{ deal with deleting existing custom fields
-foreach my $key (keys %ARGS) {
- # {{{ if we're trying to delete the custom field
- if ($key =~ /^DeleteCustomField-(\d+)/) {
- my $id = $1;
- my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
- $CustomFieldObj->Load($id);
- my ($retval, $msg) = $CustomFieldObj->Delete;
- if ($retval) {
- push @actions, loc("Custom field deleted");
+ 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;
+ }
+ }
}
- else {
- push @actions, $msg;
+ 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>
-$id => 0
$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
index f6559e7ad..c93bf81f5 100644
--- a/rt/html/Admin/Elements/EditQueueWatchers
+++ b/rt/html/Admin/Elements/EditQueueWatchers
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
%if ($Members->Count == 0 ) {
<ul>
<li><i><&|/l&>none</&></i>
@@ -51,8 +51,7 @@
<ul>
% while (my $watcher=$Members->Next) {
<li>
-<INPUT TYPE=CHECKBOX
- NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>"
+<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%>">
diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip
index 4207114fd..907ae9a92 100644
--- a/rt/html/Admin/Elements/EditScrip
+++ b/rt/html/Admin/Elements/EditScrip
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@actions &>
diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips
index 8959f6c70..9526118b5 100644
--- a/rt/html/Admin/Elements/EditScrips
+++ b/rt/html/Admin/Elements/EditScrips
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,13 +42,13 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@actions &>
<form action="Scrips.html" method="post">
<input type="hidden" name="id" value="<%$id%>">
-<P><&|/l&>Current Scrips</&>:</P>
+<h2><&|/l&>Current Scrips</&></h2>
% if ($Scrips->Count == 0 ) {
<P><i><&|/l&>(No scrips)</&></i></P>
% } else {
@@ -58,7 +58,7 @@
% while (my $scrip = $Scrips->Next ) {
<TR>
<TD>
-<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>">
+<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>
diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates
index 6ac56c235..207ffd001 100644
--- a/rt/html/Admin/Elements/EditTemplates
+++ b/rt/html/Admin/Elements/EditTemplates
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@actions &>
<FORM METHOD=GET ACTION="Templates.html">
@@ -63,7 +63,7 @@
% while (my $TemplateObj = $Templates->Next) {
<TR>
<TD>
-<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>">
+<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>" value="1">
</TD>
<TD>
<A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>">
diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments
index bc23f77fe..fb96dc09a 100644
--- a/rt/html/Admin/Elements/EditUserComments
+++ b/rt/html/Admin/Elements/EditUserComments
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# 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%>">
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
index de39ec117..60edda40e 100644
--- a/rt/html/Admin/Elements/GroupTabs
+++ b/rt/html/Admin/Elements/GroupTabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Admin/Elements/Tabs,
subtabs => $tabs,
current_tab => 'Admin/Groups/',
@@ -67,6 +67,8 @@ $tabs->{"this"} = { class => "currentnav",
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 },
}
}
}
@@ -74,7 +76,7 @@ $tabs->{"A"} = { title => loc('Select group'),
path => "Admin/Groups/", };
$tabs->{"B"} = { title => loc('New group'),
path => "Admin/Groups/Modify.html?Create=1",
- separator => 1, };
+ separator => 1, };
# Now let callbacks add their extra tabs
$m->comp( '/Elements/Callback', tabs => $tabs, %ARGS );
diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header
index 69a3ccd53..b80908094 100644
--- a/rt/html/Admin/Elements/Header
+++ b/rt/html/Admin/Elements/Header
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,8 +42,8 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<& /Elements/Header, Title => $Title &>
+%# END BPS TAGGED BLOCK }}}
+<& /Elements/Header, %ARGS &>
<%ARGS>
$Title => undef
diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields
index abca29073..3df9d6292 100644
--- a/rt/html/Admin/Elements/ListGlobalCustomFields
+++ b/rt/html/Admin/Elements/ListGlobalCustomFields
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
% my $count = 0;
% while (my $CustomFieldObj = $CustomFields->Next) {
% $count++;
diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips
index cb3f89a9f..2e3791257 100644
--- a/rt/html/Admin/Elements/ListGlobalScrips
+++ b/rt/html/Admin/Elements/ListGlobalScrips
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,17 +42,33 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-% my $count = 0;
+%# END BPS TAGGED BLOCK }}}
+
+% if ($Scrips->Count == 0) {
+
+<P><i><&|/l&>(No scrips)</&></i></P>
+
+% } else {
+
+<UL>
+
% while (my $scrip = $Scrips->Next ) {
-% $count++;
-<font size="-1"><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></font>
-<BR>
-% }
-% if (!$count) {
-<font size="-1"><&|/l&>(No scrips)</&></font>
+<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();
diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate
index acd87a73f..6749f3e65 100644
--- a/rt/html/Admin/Elements/ModifyTemplate
+++ b/rt/html/Admin/Elements/ModifyTemplate
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<TABLE>
<TR>
<TD ALIGN=RIGHT>
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
index 57b5fd8b3..01f294a59 100644
--- a/rt/html/Admin/Elements/QueueRightsForUser
+++ b/rt/html/Admin/Elements/QueueRightsForUser
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,11 +42,11 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<UL>
%while(my $ACE = $ACL->Next) {
-<LI><checkbox name="delete_ace_<%$ACE->id%>"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>)
+<LI><checkbox name="delete_ace_<%$ACE->id%>" value="1"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>)
%}
</UL>
diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs
index 0eec1fc6f..93522d0a2 100644
--- a/rt/html/Admin/Elements/QueueTabs
+++ b/rt/html/Admin/Elements/QueueTabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Admin/Elements/Tabs,
subtabs => $tabs,
current_tab => 'Admin/Queues/',
@@ -71,8 +71,12 @@ if ($id) {
path => "Admin/Queues/Templates.html?id=".$id,
},
- G => { title => loc('Custom Fields'),
- path => 'Admin/Queues/CustomFields.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'),
@@ -90,8 +94,7 @@ if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQue
};
$tabs->{"B"} = { title => loc('New queue'),
path => "Admin/Queues/Modify.html?Create=1",
- separator => 1,
- };
+ separator => 1, };
}
# Now let callbacks add their extra tabs
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
index 76606c412..3f25b8e71 100644
--- a/rt/html/Admin/Elements/SelectCustomFieldType
+++ b/rt/html/Admin/Elements/SelectCustomFieldType
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,10 +42,10 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME ="<%$Name%>">
-%for my $option ($cf->Types) {
-<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyType($option) %></OPTION>
+%for my $option ($cf->TypeComposites) {
+<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyTypeComposite($option) %></OPTION>
%}
</SELECT>
<%INIT>
@@ -54,5 +54,5 @@ my $cf = RT::CustomField->new($session{'CurrentUser'});
</%INIT>
<%ARGS>
$Default=>undef
-$Name => 'Type'
+$Name => 'TypeComposite'
</%ARGS>
diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups
index 175ce0657..92bd47587 100644
--- a/rt/html/Admin/Elements/SelectGroups
+++ b/rt/html/Admin/Elements/SelectGroups
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10>
%while (my $group = $groups->Next) {
<OPTION VALUE="<%$group->id%>"><%$group->Name%>
diff --git a/rt/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup
index b33eaea44..272e1f0c7 100644
--- a/rt/html/Admin/Elements/SelectModifyGroup
+++ b/rt/html/Admin/Elements/SelectModifyGroup
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
%while ( $Group = $Groups->Next) {
<A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR>
%}
diff --git a/rt/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue
index 2ca6bd814..3a30d09c8 100644
--- a/rt/html/Admin/Elements/SelectModifyQueue
+++ b/rt/html/Admin/Elements/SelectModifyQueue
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
%while ( $queue = $queues->Next) {
<A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR>
%}
diff --git a/rt/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser
index 97411c909..fc6c01205 100644
--- a/rt/html/Admin/Elements/SelectModifyUser
+++ b/rt/html/Admin/Elements/SelectModifyUser
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
%while ( $user = $users->Next) {
<A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR>
%}
diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers
index 90f9a0b91..95056aec9 100644
--- a/rt/html/Admin/Elements/SelectNewGroupMembers
+++ b/rt/html/Admin/Elements/SelectNewGroupMembers
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
% if ($Show ne 'Groups') {
<b><&|/l&>Users</&></b>
<SELECT MULTIPLE NAME="<%$Name%>Users" SIZE=10>
diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights
index 61a9e42ec..3e61d5071 100644
--- a/rt/html/Admin/Elements/SelectRights
+++ b/rt/html/Admin/Elements/SelectRights
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,27 +42,30 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# 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&>Check box to revoke right</&>)</i> <BR>
-% } else {
+% 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>
% }
@@ -100,7 +103,7 @@
}
else {
- %Rights = { loc('System Error') => loc("No rights found")};
+ %Rights = ( loc('System Error') => loc("No rights found") );
}
$ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id;
diff --git a/rt/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip
index 7fce6d54e..a9e979699 100644
--- a/rt/html/Admin/Elements/SelectScrip
+++ b/rt/html/Admin/Elements/SelectScrip
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME=<%$Name%>>
<OPTION VALUE=""
<% $Default eq undef && 'SELECTED' %>
diff --git a/rt/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction
index 17cd6a199..8d88d6458 100644
--- a/rt/html/Admin/Elements/SelectScripAction
+++ b/rt/html/Admin/Elements/SelectScripAction
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,14 +42,14 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME=<%$Name%>>
<OPTION VALUE=""
-<% $Default eq undef && 'SELECTED' %>
+<% ! defined $Default && 'SELECTED' %>
>-</OPTION>
%while (my $ScripAction = $ScripActions->Next) {
<OPTION VALUE=<%$ScripAction->Id%>
-<% $ScripAction->Id == $Default && 'SELECTED' %>
+<% defined $Default && $ScripAction->Id == $Default && 'SELECTED' %>
><% loc($ScripAction->Name) %>
</OPTION>
%}
diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition
index 021132be7..faa99fda6 100644
--- a/rt/html/Admin/Elements/SelectScripCondition
+++ b/rt/html/Admin/Elements/SelectScripCondition
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,14 +42,14 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME=<%$Name%>>
<OPTION VALUE=""
-<% $Default eq undef && 'SELECTED' %>
+<% ! defined $Default && 'SELECTED' %>
>-</OPTION>
%while (my $ScripCondition = $ScripConditions->Next) {
<OPTION VALUE=<%$ScripCondition->Id%>
-<% $ScripCondition->Id == $Default && 'SELECTED' %>
+<% defined $Default && $ScripCondition->Id == $Default && 'SELECTED' %>
><% loc($ScripCondition->Name) %>
</OPTION>
%}
diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple
index 9b1982606..571695091 100644
--- a/rt/html/Admin/Elements/SelectSingleOrMultiple
+++ b/rt/html/Admin/Elements/SelectSingleOrMultiple
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<select name="<%$Name%>">
<option value="1" <%$SingleDefault%>><&|/l&>Single</&></option>
<option value="0" <%$MultipleDefault%>><&|/l&>Multiple</&></option>
diff --git a/rt/html/Admin/Elements/SelectStage b/rt/html/Admin/Elements/SelectStage
index 0472d2fcd..0fbf5c609 100644
--- a/rt/html/Admin/Elements/SelectStage
+++ b/rt/html/Admin/Elements/SelectStage
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,9 +42,9 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME=<%$Name%>>
-% foreach my $stage (qw(TransactionCreate TransactionBatch Disabled)) {
+% foreach my $stage (@stages) {
<OPTION VALUE=<%$stage%>
<% ($stage eq $Default) && 'SELECTED' %>
><% loc($stage) %>
@@ -54,6 +54,9 @@
if ($Default eq '') {
$Default = 'TransactionCreate';
}
+my @stages = 'TransactionCreate';
+push @stages, 'TransactionBatch' if $RT::UseTransactionBatch;
+push @stages, 'Disabled';
</%INIT>
<%ARGS>
$Default => 'TransactionCreate'
diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate
index f48948387..7d83b6768 100644
--- a/rt/html/Admin/Elements/SelectTemplate
+++ b/rt/html/Admin/Elements/SelectTemplate
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME=<%$Name%>>
<OPTION VALUE=""
<% $Default eq 'none' && 'SELECTED' %>
diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers
index 31ac3e453..a88aa8ff7 100644
--- a/rt/html/Admin/Elements/SelectUsers
+++ b/rt/html/Admin/Elements/SelectUsers
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10>
%while (my $user = $users->Next) {
<OPTION VALUE="<%$user->id%>"><%$user->Name%>
diff --git a/rt/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs
index 4409695d8..646f552f5 100644
--- a/rt/html/Admin/Elements/SystemTabs
+++ b/rt/html/Admin/Elements/SystemTabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Admin/Elements/Tabs, subtabs => $tabs,
current_tab => 'Admin/Global/',
current_subtab => $current_tab,
@@ -59,7 +59,7 @@
},
F => { title => loc('Custom Fields'),
- path => 'Admin/Global/CustomFields.html',
+ path => 'Admin/Global/CustomFields/index.html',
},
G => { title => loc('Group Rights'),
diff --git a/rt/html/Admin/Elements/Tabs b/rt/html/Admin/Elements/Tabs
index 39eaa728b..f90a629a2 100644
--- a/rt/html/Admin/Elements/Tabs
+++ b/rt/html/Admin/Elements/Tabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/Tabs,
tabs => $tabs,
current_toptab => 'Admin/',
@@ -59,10 +59,13 @@
C => { title => loc('Queues'),
path => 'Admin/Queues/',
},
- D => { 'title' => loc('Global'),
+ D => { 'title' => loc('Custom Fields'),
+ path => 'Admin/CustomFields/',
+ },
+ E => { 'title' => loc('Global'),
path => 'Admin/Global/',
},
- E => { 'title' => loc('Tools'),
+ F => { 'title' => loc('Tools'),
path => 'Admin/Tools/',
},
};
diff --git a/rt/html/Admin/Elements/ToolTabs b/rt/html/Admin/Elements/ToolTabs
index 606bd1202..773b81099 100755
--- a/rt/html/Admin/Elements/ToolTabs
+++ b/rt/html/Admin/Elements/ToolTabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Admin/Elements/Tabs, subtabs => $tabs,
current_tab => 'Admin/Tools/',
current_subtab => $current_tab,
diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs
index 671bd6dd4..0ffd29b0f 100644
--- a/rt/html/Admin/Elements/UserTabs
+++ b/rt/html/Admin/Elements/UserTabs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,52 +42,61 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<& /Admin/Elements/Tabs,
+%# END BPS TAGGED BLOCK }}}
+<& /Admin/Elements/Tabs,
subtabs => $tabs,
- current_tab => 'Admin/Users/',
- current_subtab => $current_tab,
+ current_tab => 'Admin/Users/',
+ current_subtab => $current_tab,
Title => $Title &>
<%INIT>
my $tabs;
if ($id) {
- $tabs->{'this'} = {
- title => eval { $UserObj->Name },
+$tabs->{'this'} = { title => eval { $UserObj->Name },
+
path => "Admin/Users/Modify.html?id=".$id,
- current_subtab => $current_tab,
- subtabs => {
- A => { title => loc('Basics'),
+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",
+}
+if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) {
+ $tabs->{"A"} = { title => loc('Select user'),
+ path => "Admin/Users/",
+ };
+ $tabs->{"B"} = { title => loc('New user'),
+ path => "Admin/Users/Modify.html?Create=1",
separator => 1,
};
}
-# Now let callbacks add their extra tabs
-$m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
-
-foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) {
- if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) {
- $tabs->{'this'}->{"current_subtab"} = $current_tab;
- $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab;
- $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs;
- }
-}
-
+ # Now let callbacks add their extra tabs
+ $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
+
+#foreach my $tab ( sort keys %{$tabs} ) {
+# if ( $tabs->{$tab}->{'path'} eq $current_subtab ) {
+# $tabs->{$tab}->{"current_subtab"} = $current_subtab;
+# }
+#}
+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