rt 4.2.16
[freeside.git] / rt / share / html / Search / Elements / EditFormat
index bb869fe..9e2e11e 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<table>
+<table class="edit-columns">
 
 <tr>
 <th><&|/l&>Add Columns</&>:</th>
 <td valign="top"><select size="6" name="SelectDisplayColumns" multiple="multiple">
 % my %seen;
 % foreach my $field ( grep !$seen{lc $_}++, @$AvailableColumns) {
-<option value="<% $field %>"><% loc($field) %></option>
+<option value="<% $field %>" <% $selected{$field} ? 'selected="selected"' : '' |n%>>\
+<% $field =~ /^(?:CustomField|CF)\./ ? $field : loc($field) %></option>
 % }
 </select></td>
-
-<td><&|/l&>Link</&>:
+<td>
+<div class="row">
+<span class="label"><&|/l&>Link</&>:</span>
+<span class="value">
 <select name="Link">
 <option value="None">-</option>
 <option value="Display"><&|/l&>Display</&></option>
 <option value="Comment"><&|/l&>Comment</&></option>
 <option value="Resolve"><&|/l&>Resolve</&></option>
 </select>
-<br /><&|/l&>Title</&>: <input name="Title" size="10" />
-<br /><&|/l&>Size</&>:
-<select name="Size">
+</span>
+</div>
+<div class="row">
+<span class="label"><&|/l&>Title</&>:</span>
+<span class="value"><input name="Title" size="10" /></span>
+</div>
+<div class="row">
+<span class="label"><&|/l&>Size</&>:</span>
+<span class="value"><select name="Size">
 <option value="">-</option>
 <option value="Small"><&|/l&>Small</&></option>
 <option value="Large"><&|/l&>Large</&></option>
 </select>
-<br /><&|/l&>Style</&>:
-<select name="Face">
+</span>
+</div>
+<div class="row">
+<span class="label"><&|/l&>Style</&>:</span>
+<span class="value"><select name="Face">
 <option value="">-</option>
 <option value="Bold"><&|/l&>Bold</&></option>
 <option value="Italic"><&|/l&>Italic</&></option>
 </select>
+</span>
+</div>
 </td>
 
 <td><input type="submit" class="button" name="AddCol" value=" &rarr; " /></td>
 <td valign="top">
 <select size="4" name="CurrentDisplayColumns">
 % my $i=0;
+% my $current = $ARGS{CurrentDisplayColumns} || ''; $current =~ s/^\d+>//;
 % foreach my $field ( @$CurrentFormat ) {
-<option value="<% $i++ %>><% $field->{Column} %>"><% loc( $field->{Column} ) %></option>
+<option value="<% $i++ %>><% $field->{Column} %>" <% $field->{Column} eq $current ? 'selected="selected"' : '' |n%>>\
+<% $field->{Column} =~ /^(?:CustomField|CF)\./ ? $field->{Column} : loc( $field->{Column} ) %></option>
 % }
 </select>
 <br />
 </tr>
 </table>
 
+<%init>
+my $selected = $ARGS{SelectDisplayColumns};
+$selected = [ $selected ] unless ref $selected;
+my %selected;
+$selected{$_}++ for grep {defined} @{ $selected };
+</%init>
 <%ARGS>
 $CurrentFormat => undef
 $AvailableColumns => undef