projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rt 4.2.14 (#13852)
[freeside.git]
/
rt
/
share
/
html
/
Helpers
/
Autocomplete
/
Groups
diff --git
a/rt/share/html/Helpers/Autocomplete/Groups
b/rt/share/html/Helpers/Autocomplete/Groups
index
b6a6f1a
..
7cfd618
100644
(file)
--- a/
rt/share/html/Helpers/Autocomplete/Groups
+++ b/
rt/share/html/Helpers/Autocomplete/Groups
@@
-2,7
+2,7
@@
%#
%# COPYRIGHT:
%#
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-201
3
Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-201
7
Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@
-45,12
+45,12
@@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% $r->content_type('application/json');
+% $r->content_type('application/json
; charset=utf-8
');
<% JSON( \@suggestions ) |n %>
% $m->abort;
<%ARGS>
$term => undef
<% JSON( \@suggestions ) |n %>
% $m->abort;
<%ARGS>
$term => undef
-$max =>
10
+$max =>
undef
$exclude => ''
$op => 'LIKE'
</%ARGS>
$exclude => ''
$op => 'LIKE'
</%ARGS>
@@
-66,6
+66,9
@@
$m->abort unless $CurrentUser->Privileged;
# Sanity check the operator
$op = 'LIKE' unless $op =~ /^(?:LIKE|(?:START|END)SWITH|=|!=)$/i;
# Sanity check the operator
$op = 'LIKE' unless $op =~ /^(?:LIKE|(?:START|END)SWITH|=|!=)$/i;
+$m->callback( CallbackName => 'ModifyMaxResults', max => \$max );
+$max //= 10;
+
my $groups = RT::Groups->new( $CurrentUser );
$groups->RowsPerPage( $max );
$groups->LimitToUserDefinedGroups();
my $groups = RT::Groups->new( $CurrentUser );
$groups->RowsPerPage( $max );
$groups->LimitToUserDefinedGroups();
@@
-73,6
+76,7
@@
$groups->Limit(
FIELD => 'Name',
OPERATOR => $op,
VALUE => $term,
FIELD => 'Name',
OPERATOR => $op,
VALUE => $term,
+ CASESENSITIVE => 0,
);
# Exclude groups we don't want
);
# Exclude groups we don't want
@@
-83,6
+87,8
@@
foreach (split /\s*,\s*/, $exclude) {
my @suggestions;
while ( my $group = $groups->Next ) {
my @suggestions;
while ( my $group = $groups->Next ) {
- push @suggestions, $group->Name;
+ my $suggestion = { id => $group->Id, label => $group->Name, value => $group->Name };
+ $m->callback( CallbackName => "ModifySuggestion", suggestion => $suggestion, group => $group );
+ push @suggestions, $suggestion;
}
</%INIT>
}
</%INIT>