rt 4.2.14 (#13852)
[freeside.git] / rt / share / html / Elements / EditCustomFieldCombobox
index 718ff30..e0fc002 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 %#
 %# END BPS TAGGED BLOCK }}}
 % while ($Values and my $value = $Values->Next and $Multiple) {
-<input type="checkbox" class="checkbox CF-<%$CustomField->id%>-Edit" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" class="CF-<%$CustomField->id%>-Edit" value="<% $value->Id %>" /><% $value->Content %>
+<input type="checkbox" id="<%$delete_name%>" class="checkbox CF-<%$CustomField->id%>-Edit" name="<%$delete_name%>" class="CF-<%$CustomField->id%>-Edit" value="<% $value->Id %>" />
+<label for="<%$delete_name%>"><% $value->Content %></label>
 <br />
 % }
 % (!$Multiple or !$MaxValues or !$Values or $Values->Count < $MaxValues) or return;
 <& /Widgets/ComboBox,
-    Name    => $NamePrefix . $CustomField->Id . "-Value",
+    Name    => $name,
     Default => $Default,
     Rows    => $Rows,
     Class   => "CF-".$CustomField->id."-Edit",
     Values  => [map {$_->Name} @{$CustomField->Values->ItemsArrayRef}],
 &>
+
+<%INIT>
+my $name = $Name || $NamePrefix . $CustomField->Id . '-Value';
+my $delete_name = $name;
+$delete_name =~ s!-Value$!-DeleteValueIds!;
+</%INIT>
+
 <%ARGS>
 $Object => undef
 $CustomField => undef
@@ -66,4 +74,5 @@ $Values => undef
 $Multiple => 0
 $Rows => undef
 $MaxValues => undef
+$Name => undef
 </%ARGS>