rt 4.2.16
[freeside.git] / rt / share / html / Elements / SelectUsers
index b250ba6..137c2f9 100755 (executable)
@@ -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)
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 <select name="UserField">
-% foreach my $col (RT::User->BasicColumns) {
+% foreach my $col (@fields) {
 <option <% ($UserField eq $col->[0]) ? 'selected="selected"' : '' |n %> value="<% $col->[0] %>"><% loc($col->[1]) %></option>
 % }
 % while (my $CF = $CFs->Next) {
 my $CFs = RT::CustomFields->new($session{'CurrentUser'});
 $CFs->LimitToChildType('RT::User');
 $CFs->OrderBy( FIELD => 'Name' );
+
+my @fields = RT::User->BasicColumns;
+
+if ( $Fields and ref $Fields eq 'ARRAY' ) {
+    if ( ref $Fields->[0] eq 'ARRAY' ) {
+        @fields = @$Fields;
+    }
+    else {
+        # make the name equal the label
+        @fields = [ @$Fields, @$Fields ];
+    }
+}
 </%INIT>
 <%ARGS>
 $UserField  => ''
 $UserOp     => ''
 $UserString => ''
+$Fields     => undef
 </%ARGS>