import rt 3.6.6
[freeside.git] / rt / html / Ticket / Elements / EditCustomFields
index 5af48cb..04d7180 100644 (file)
 %# 
 %# 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 />
         &>
 %  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;