[Rt-commit] rt branch, 4.4/queue-autocomplete, repushed
Dustin Graves
dustin at bestpractical.com
Wed Dec 2 18:00:40 EST 2015
The branch 4.4/queue-autocomplete was deleted and repushed:
was a055b0b592e78bc043cc5eb75dc253678aea784d
now ca98144351ed05400bd3be259322d4f85fe44cad
--: ------- > 1: c712931 Fix extraneous whitespace warnings from po linter
--: ------- > 2: dea515e Updated translations from Launchpad
--: ------- > 3: 5cb67b2 Avoid using a stale dbh in rt-setup-database
--: ------- > 4: d99f77e failing and warning externalauth tests
--: ------- > 5: 3091165 One last missing undef $m in ldap_privileged.t
--: ------- > 6: 3a80169 skip when ::Authen::ExternalAuth can't load like other externalauth tests do
--: ------- > 7: 5d5e872 French i18n updates
--: ------- > 8: 6c0c5b2 Add "HeldBy" -> "Held By" en localization from Assets
--: ------- > 9: e641431 po mismerge
--: ------- > 10: 5ea7017 Fix mismerge of _DurationAsString
--: ------- > 11: 615120d Fix failing test in ldapimport/user-import.t
--: ------- > 12: 2f14fe9 Remove calls to removed ->screendebug
--: ------- > 13: 4a861ef Switch ExternalAuth example in RT_Config to JSGantt
--: ------- > 14: ec6ce9c Fix My_DBI being removed from ExternalServices due to "db" vs "dbi"
--: ------- > 15: e525b1a Avoid returning undef for default catalog
--: ------- > 16: 719dfea Avoid undef warnings in upgrading dashboards
--: ------- > 17: b9c4bdf Unify our upgrading cored extensions documentation
--: ------- > 18: b6d9c46 Install rt-ldapimport
--: ------- > 19: 5f68191 Updated translations from Launchpad
--: ------- > 20: f968229 Handle non-ckeditor for syncing scrips
1: a055b0b ! 21: ca98144 add autocomplete textbox for queue selection
@@ -33,7 +33,7 @@
% my $button_start = '<input type="submit" class="button" value="';
% my $button_end = '" />';
-% my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', OnChange => 'document.CreateTicketInQueue.submit()', SendTo => $SendTo );
-+% my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', AutoSubmit => 1, SendTo => $SendTo, Placeholder => 'Queue' );
++% my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', AutoSubmit => 1, SendTo => $SendTo, Placeholder => loc('Queue') );
<&|/l_unsafe, $button_start, $button_end, $queue_selector &>[_1]New ticket in[_2] [_3]</&>
% $m->callback(CallbackName => 'BeforeFormEnd');
</form>
@@ -66,7 +66,7 @@
+$AutoSubmit => 0
</%args>
+<%init>
-+$ARGS{OnChange} = 'document.CreateTicketInQueue.submit()' if $AutoSubmit;
++$ARGS{OnChange} = 'jQuery(this).closest("form").submit();' if $AutoSubmit;
+</%init>
diff --git a/share/html/Elements/SelectQueueAutocomplete b/share/html/Elements/SelectQueueAutocomplete
@@ -130,6 +130,7 @@
+$ShowAllQueues => 1
+$CheckQueueRight => 'CreateTicket'
+$AutoSubmit => 0
++$Return => 'Name'
+</%args>
+<%init>
+my $DefaultQueue = RT::Queue->new($session{'CurrentUser'});
@@ -143,10 +144,9 @@
+ class="<% $Class %>"
+ data-autocomplete="Queues"
+ placeholder="<% $Placeholder %>"
++ data-autocomplete-checkright="<% $CheckQueueRight %>"
++ data-autocomplete-return="<% $Return %>"
+ <% $AutoSubmit ? 'data-autocomplete-autosubmit=1' : '' %>
-+
-+%# valuefield should be id for create ticket, name for query builder
-+ data-autocomplete-params="right=<% $CheckQueueRight || '' |u %>&valuefield=<% $ARGS{OnChange} ? 'Id' : 'Name' %>"
+/>
diff --git a/share/html/Helpers/Autocomplete/Queues b/share/html/Helpers/Autocomplete/Queues
@@ -209,10 +209,15 @@
+$max => 10
+$op => 'STARTSWITH'
+$right => undef
-+$valuefield => 'Name';
++$return => 'Name';
+</%ARGS>
+<%INIT>
-+$m->abort unless defined $term
++# Only allow certain return fields
++$return = 'Name'
++ unless $return =~ /^(?:id|Name)$/;
++
++$m->abort unless defined $return
++ and defined $term
+ and length $term;
+
+# Sanity check the operator
@@ -231,7 +236,7 @@
+my @suggestions;
+while (my $q = $queues->Next) {
+ next if $right and not $q->CurrentUserHasRight($right);
-+ my $value = lc($valuefield) eq 'id' ? $q->Id : $q->Name;
++ my $value = $q->$return;
+ push @suggestions, { label => $q->Name, value => $value };
+}
+</%INIT>
@@ -251,7 +256,7 @@
-webkit-border-radius: 0 0 0 5px;
}
--#simple-search input.field {
+-#topactions input[type="search"] {
+#topactions input.field {
border-radius: 3px;
-moz-border-radius: 3px;
@@ -278,7 +283,7 @@
color: #000;
}
--#simple-search input.field {
+-#topactions input[type="search"] {
+#topactions input.field {
border-radius: 3px;
-moz-border-radius: 3px;
@@ -317,7 +322,7 @@
-webkit-border-radius: 0 0 0 5px;
}
--#simple-search input.field {
+-#topactions input[type="search"] {
+#topactions input.field {
border-radius: 3px;
-moz-border-radius: 3px;
@@ -391,6 +396,9 @@
+ };
+ }
+
++ var checkRight = input.attr("data-autocomplete-checkright");
++ if (checkRight) queryargs.push("right=" + checkRight);
++
var exclude = input.attr('data-autocomplete-exclude');
if (exclude) {
queryargs.push("exclude="+exclude);
More information about the rt-commit
mailing list