[Rt-commit] r8671 - rt/branches/3.6-RELEASE/html/Ticket/Elements
nicholas at bestpractical.com
nicholas at bestpractical.com
Tue Aug 21 11:30:27 EDT 2007
Author: nicholas
Date: Tue Aug 21 11:30:26 2007
New Revision: 8671
Modified:
rt/branches/3.6-RELEASE/html/Ticket/Elements/EditCustomFields
Log:
svn merge -r8090:8094 http://code.bestpractical.com/bps-public/rt/branches/3.7-EXPERIMENTAL-TUNIS/html/Ticket/Elements/EditCustomFields html/Ticket/Elements/EditCustomFields
r8091 | ruz | 2007-07-10 21:44:12 +0000 (Tue, 10 Jul 2007) | 2 lines
* get rid of Count call, use counter to figure out if we have even or odd number of CFs
* use less nested tables
r8093 | ruz | 2007-07-10 21:59:45 +0000 (Tue, 10 Jul 2007) | 1 line
* skip a CF if user has no right to change it
Modified: rt/branches/3.6-RELEASE/html/Ticket/Elements/EditCustomFields
==============================================================================
--- rt/branches/3.6-RELEASE/html/Ticket/Elements/EditCustomFields (original)
+++ rt/branches/3.6-RELEASE/html/Ticket/Elements/EditCustomFields Tue Aug 21 11:30:26 2007
@@ -46,22 +46,15 @@
%#
%# END BPS TAGGED BLOCK }}}
<table>
-<tr>
-<td valign="top" width="50%">
-<table>
-
% my $i = 0;
-% my $cfcount = $CustomFields->Count;
-% $cfcount++ if ($cfcount % 2) ; # if we have an odd number of
-% #custom fields, fudge it so we know where to put in the table break
-% while (my $CustomField = $CustomFields->Next()) {
-% if ($cfcount == 2 * $i) {
-</table>
-</td>
-<td valign="top" width="50%">
-<table>
-% }
+% while ( my $CustomField = $CustomFields->Next ) {
+% next unless $CustomField->CurrentUserHasRight('ModifyCustomField');
% $i++;
+% if ( $i % 2 ) {
+<tr>
+% }
+<td width="50%">
+<table>
<tr id="CF-<%$CustomField->id%>-EditRow">
<td class="labeltop">
<b><%$CustomField->Name%></b><br />
@@ -75,15 +68,25 @@
&>
% if (my $msg = $m->notes('InvalidField-' . $CustomField->Id)) {
<br />
- <em style="color: red"><% $msg %></em></td>
+ <em style="color: red"><% $msg %></em>
% }
+ </td>
</tr>
-% }
</table>
</td>
+
+% unless ( $i % 2 ) {
</tr>
-</table>
+% }
+
+% }
+%# close row if required
+% if ( $i % 2 ) {
+</tr>
+% }
+
+</table>
<%INIT>
my $CustomFields;
my $NamePrefix;
More information about the Rt-commit
mailing list