diff options
Diffstat (limited to 'rt/share/html/Elements/SelectCustomFieldValue')
-rwxr-xr-x | rt/share/html/Elements/SelectCustomFieldValue | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/rt/share/html/Elements/SelectCustomFieldValue b/rt/share/html/Elements/SelectCustomFieldValue index 3e1bdbe60..21887b810 100755 --- a/rt/share/html/Elements/SelectCustomFieldValue +++ b/rt/share/html/Elements/SelectCustomFieldValue @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# <sales@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -56,7 +56,20 @@ % } </select> % } -% else { +% elsif ( $CustomField->Type eq 'Autocomplete' ) { +<input type="text" id="CF-<% $CustomField->id %>" name="<% $Name %>" size="20" /> +<script type="text/javascript"> +% my @options; +% my $values = $CustomField->Values; +% while (my $value = $values->Next) { +% push @options, { +% value => $value->Name, +% label => $value->Description ? $value->Name . ' (' . $value->Description . ')' : $value->Name, +% }; +% } +jQuery('#'+'CF-' + <% $CustomField->id %>).autocomplete({ source: <% JSON::to_json(\@options) |n %> }); +</script> +% } else { <input name="<%$Name%>" size="20" /> % } <%args> |