summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/EditCustomFieldAutocomplete
diff options
context:
space:
mode:
Diffstat (limited to 'rt/share/html/Elements/EditCustomFieldAutocomplete')
-rw-r--r--rt/share/html/Elements/EditCustomFieldAutocomplete21
1 files changed, 13 insertions, 8 deletions
diff --git a/rt/share/html/Elements/EditCustomFieldAutocomplete b/rt/share/html/Elements/EditCustomFieldAutocomplete
index 13a43ed67..70ff3968b 100644
--- a/rt/share/html/Elements/EditCustomFieldAutocomplete
+++ b/rt/share/html/Elements/EditCustomFieldAutocomplete
@@ -49,19 +49,19 @@
<textarea cols="<% $Cols %>" rows="<% $Rows %>" name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default %></textarea><div id="<% $name %>-Choices" class="autocomplete"></div>
<script type="text/javascript">
new Ajax.Autocompleter(
- "<% $name %>-Values",
- "<% $name %>-Choices",
- "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues",
- { tokens: [ '\n' ] }
+ <% $name |n,j%>+"-Values",
+ <% $name |n,j%>+"-Choices",
+ <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues",
+ { tokens: [ '\n' ], parameters: <% $Context |n,j %> }
);
% } else {
<input type="text" id="<% $name %>-Value" name="<% $name %>-Value" class="CF-<%$CustomField->id%>-Edit" value="<% $Default %>"/><div id="<% $name %>-Choices" class="autocomplete"></div>
<script type="text/javascript">
new Ajax.Autocompleter(
- "<% $name %>-Value",
- "<% $name %>-Choices",
- "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues",
- {}
+ <% $name |n,j%>+"-Value",
+ <% $name |n,j%>+"-Choices",
+ <% RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues",
+ { parameters: <% $Context |n,j %> }
);
% }
</script>
@@ -76,6 +76,11 @@ if ( $Multiple and $Values ) {
$Default .= $value->Content ."\n";
}
}
+my $Context = "";
+if ($CustomField->ContextObject) {
+ $Context .= "ContextId=" . $CustomField->ContextObject->Id . "&";
+ $Context .= "ContextType=". ref($CustomField->ContextObject);
+}
</%INIT>
<%ARGS>
$CustomField => undef