[Rt-commit] r2354 - in rt/branches/3.4-RELEASE: . html/Admin/Elements html/Admin/Global/CustomFields html/Admin/Queues html/Admin/Users

jesse at bestpractical.com jesse at bestpractical.com
Mon Mar 14 02:22:37 EST 2005


Author: jesse
Date: Mon Mar 14 02:22:36 2005
New Revision: 2354

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/html/Admin/Elements/EditCustomFields
   rt/branches/3.4-RELEASE/html/Admin/Elements/PickCustomFields
   rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Groups.html
   rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Tickets.html
   rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Transactions.html
   rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Users.html
   rt/branches/3.4-RELEASE/html/Admin/Queues/CustomFields.html
   rt/branches/3.4-RELEASE/html/Admin/Users/CustomFields.html
Log:
 r8456 at hualien:  jesse | 2005-03-14 02:20:50 -0500
 Overhaul of custom field editing code to make it easier to add custom fields 
 for new object types


Modified: rt/branches/3.4-RELEASE/html/Admin/Elements/EditCustomFields
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Elements/EditCustomFields	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Elements/EditCustomFields	Mon Mar 14 02:22:36 2005
@@ -46,10 +46,10 @@
 <& /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">
+<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>

Modified: rt/branches/3.4-RELEASE/html/Admin/Elements/PickCustomFields
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Elements/PickCustomFields	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Elements/PickCustomFields	Mon Mar 14 02:22:36 2005
@@ -75,7 +75,7 @@
 %  # show 'move up' unless it's the first item
 %  if ($count++ and $Checked) {
   <TD valign="TOP">
-    [<a href="CustomFields.html?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>]
+    [<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>
 %  }
@@ -83,7 +83,7 @@
 %  # show 'move down' unless it's the last item
 %  if ($count != @CustomFields and $Checked) {
 %  $m->print(' | ') if $count > 1;
-    [<a href="CustomFields.html?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
+    [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>]
 %  }
   </TD>
 </TR>

Modified: rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Groups.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Groups.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Groups.html	Mon Mar 14 02:22:36 2005
@@ -1,46 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse at 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/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+    current_tab => "Admin/Global/CustomFields/Groups.html",
+    current_subtab => "Admin/Global/CustomFields/Groups.html",
+    Title => $title
+    &>
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Group', Object=> $object &>
+<%INIT>
+  my $title = loc( 'Edit Custom Fields for all groups');
+  my $object = RT::Group->new($session{'CurrentUser'});
+</%INIT>

Modified: rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Tickets.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Tickets.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Tickets.html	Mon Mar 14 02:22:36 2005
@@ -1,47 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse at 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/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue',
-SubType => 'RT::Ticket' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+    current_tab => "Admin/Global/CustomFields/Queue-Tickets.html",
+    current_subtab => "Admin/Global/CustomFields/Queue-Tickets.html",
+    Title => $title
+    &>
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket' &>
+<%INIT>
+  my $title = loc( 'Edit Custom Fields for tickets in all queues');
+  my $object = RT::Queue->new($session{'CurrentUser'});
+</%INIT>

Modified: rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Transactions.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Transactions.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Queue-Transactions.html	Mon Mar 14 02:22:36 2005
@@ -1,47 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse at 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/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue',
-SubType => 'RT::Transaction' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+    current_tab => "Admin/Global/CustomFields/Queue-Transactions.html",
+    current_subtab => "Admin/Global/CustomFields/Queue-Transactions.html",
+    Title => $title
+    &>
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket-RT::Transaction' &>
+<%INIT>
+  my $title = loc( 'Edit Custom Fields for tickets in all queues');
+  my $object = RT::Queue->new($session{'CurrentUser'});
+</%INIT>

Modified: rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Users.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Users.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Global/CustomFields/Users.html	Mon Mar 14 02:22:36 2005
@@ -1,46 +1,11 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC 
-%#                                          <jesse at 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/ObjectCustomFields, %ARGS, ObjectType => 'RT::User' &>
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/GlobalCustomFieldTabs,
+    current_tab => "Admin/Global/CustomFields/Users.html",
+    current_subtab => "Admin/Global/CustomFields/Users.html",
+    Title => $title
+    &>
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::User', Object=> $object &>
+<%INIT>
+  my $title = loc( 'Edit Custom Fields for all users');
+  my $object = RT::User->new($session{'CurrentUser'});
+</%INIT>

Modified: rt/branches/3.4-RELEASE/html/Admin/Queues/CustomFields.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Queues/CustomFields.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Queues/CustomFields.html	Mon Mar 14 02:22:36 2005
@@ -43,4 +43,28 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Queue' &>
+<& /Admin/Elements/Header, Title => $title &>
+<&    /Admin/Elements/QueueTabs,
+    id => $Object->id, 
+    current_tab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", 
+    current_subtab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", 
+    QueueObj => $Object,
+    Title => $title
+    &>
+
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &>
+<%INIT>
+my $Object = RT::Queue->new( $session{'CurrentUser'} );
+
+$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) );
+my $FriendlySubTypes =
+  RT::CustomField->new( $session{'CurrentUser'} )
+  ->FriendlyLookupType( $Object->CustomFieldLookupType );
+
+my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name );
+
+</%INIT>
+<%ARGS>
+$id => undef
+$SubType => 'RT::Queue-RT::Ticket'
+</%ARGS>

Modified: rt/branches/3.4-RELEASE/html/Admin/Users/CustomFields.html
==============================================================================
--- rt/branches/3.4-RELEASE/html/Admin/Users/CustomFields.html	(original)
+++ rt/branches/3.4-RELEASE/html/Admin/Users/CustomFields.html	Mon Mar 14 02:22:36 2005
@@ -43,4 +43,27 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::User' &>
+<& /Admin/Elements/Header, Title => $title &>
+<&    /Admin/Elements/UserTabs,
+    id => $Object->id, 
+    current_tab => "Admin/Users/CustomFields.html?$id=".$id, 
+    current_subtab => "Admin/Users/CustomFields.html?id=".$id, 
+    UserObj => $Object,
+    Title => $title
+    &>
+
+    <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::User' &>
+<%INIT>
+my $Object = RT::User->new( $session{'CurrentUser'} );
+
+$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) );
+my $FriendlySubTypes =
+  RT::CustomField->new( $session{'CurrentUser'} )
+  ->FriendlyLookupType( $Object->CustomFieldLookupType );
+
+my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name );
+
+</%INIT>
+<%ARGS>
+$id => undef
+</%ARGS>


More information about the Rt-commit mailing list