[Rt-commit] r18543 - in rt/3.8/trunk: . share/html/Ticket
sartak at bestpractical.com
sartak at bestpractical.com
Mon Feb 23 19:38:12 EST 2009
Author: sartak
Date: Mon Feb 23 19:38:11 2009
New Revision: 18543
Added:
rt/3.8/trunk/share/html/Ticket/Elements/EditTransactionCustomFields
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/share/html/Ticket/Create.html
rt/3.8/trunk/share/html/Ticket/Update.html
Log:
r80472 at onn: sartak | 2009-02-23 19:37:51 -0500
Factor out edit transaction custom fields into a new template with a massage callback
Modified: rt/3.8/trunk/share/html/Ticket/Create.html
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Create.html (original)
+++ rt/3.8/trunk/share/html/Ticket/Create.html Mon Feb 23 19:38:11 2009
@@ -118,15 +118,7 @@
<& /Ticket/Elements/EditCustomFields, %ARGS, QueueObj => $QueueObj &>
</td>
</tr>
-% if ($TxnCFs->Count) {
-% while (my $CF = $TxnCFs->Next()) {
-<tr>
-<td class="label"><% $CF->Name %>:</td>
-<td><& /Elements/EditCustomField, CustomField => $CF, NamePrefix =>
- "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></td>
-</td></tr>
-% }
-% }
+<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, QueueObj => $QueueObj &>
<tr>
% if (exists $session{'Attachments'}) {
<td class="label">
@@ -340,7 +332,6 @@
$QueueObj->Disabled && Abort(loc("Cannot create tickets in a disabled queue."));
my $CFs = $QueueObj->TicketCustomFields();
-my $TxnCFs = $QueueObj->TicketTransactionCustomFields();
my $ValidCFs = $m->comp(
'/Elements/ValidateCustomFields',
Added: rt/3.8/trunk/share/html/Ticket/Elements/EditTransactionCustomFields
==============================================================================
--- (empty file)
+++ rt/3.8/trunk/share/html/Ticket/Elements/EditTransactionCustomFields Mon Feb 23 19:38:11 2009
@@ -0,0 +1,83 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2009 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., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+% if ($CustomFields->Count) {
+% while (my $CF = $CustomFields->Next()) {
+% next unless $CF->CurrentUserHasRight('ModifyCustomField');
+<tr>
+<td class="label"><% $CF->Name %>:</td>
+<td>
+<& /Elements/EditCustomField,
+ CustomField => $CF,
+ NamePrefix => $NamePrefix
+&>
+<em><% $CF->FriendlyType %></em>
+</td>
+</td></tr>
+% }
+% }
+
+<%INIT>
+my $CustomFields;
+
+if ($TicketObj) {
+ $CustomFields = $TicketObj->TransactionCustomFields();
+} else {
+ $CustomFields = $QueueObj->TicketTransactionCustomFields();
+}
+
+$NamePrefix .= "Object-RT::Transaction--CustomField-";
+
+$m->callback( CallbackName => 'MassageTransactionCustomFields', CustomFields => $CustomFields );
+
+</%INIT>
+<%ARGS>
+$NamePrefix => ''
+$TicketObj => undef
+$QueueObj => undef
+</%ARGS>
+
Modified: rt/3.8/trunk/share/html/Ticket/Update.html
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Update.html (original)
+++ rt/3.8/trunk/share/html/Ticket/Update.html Mon Feb 23 19:38:11 2009
@@ -97,17 +97,7 @@
<& /Ticket/Elements/UpdateCc, %ARGS, TicketObj => $TicketObj &>
-
-% if (my $TxnCFs = $TicketObj->TransactionCustomFields) {
-% while (my $CF = $TxnCFs->Next()) {
-% next unless $CF->CurrentUserHasRight('ModifyCustomField');
-<tr>
-<td class="label"><% $CF->Name %>:</td>
-<td><& /Elements/EditCustomField, CustomField => $CF, NamePrefix =>
- "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></td>
-</tr>
-% } # end if while
-% } # end of if
+<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $TicketObj &>
% if (exists $session{'Attachments'}) {
<tr><td><&|/l&>Attached file</&>:</td>
More information about the Rt-commit
mailing list