[Rt-commit] rt branch, 4.6/select-queue-in-ticket-create, repushed
Aaron Trevena
ast at bestpractical.com
Wed Jan 22 15:01:48 EST 2020
The branch 4.6/select-queue-in-ticket-create was deleted and repushed:
was ed7fe7c1161b54db8ae4ac915557b79a87c9481f
now 1354b5a6ca7abbcc4ec680f0e49415dce3e253d7
1: d50cfccc9f ! 1: 771c36decf Select Queue in Ticket Create page
@@ -8,6 +8,50 @@
create button and modal are possible by over-riding template
Auto-complete lookup will be used if configured in place of selectbox
in ticket create page in same way as previous modal
+
+diff --git a/share/html/Elements/CreateTicket b/share/html/Elements/CreateTicket
+--- a/share/html/Elements/CreateTicket
++++ b/share/html/Elements/CreateTicket
+@@
+ % }
+
+ % my $button_start = '<input type="submit" class="button btn btn-primary form-control" value="';
+-% my $button_start_modal = '<input type="submit" class="button btn btn-primary form-control ticket-create-modal" value="';
+-% my $button_only_start_modal = '<input type="submit" class="btn btn-primary ticket-create-modal" value="';
++% my $button_only_start = '<input type="submit" class="btn btn-primary" value="';
+ % my $button_end = '" />';
+ % my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', AutoSubmit => 1, SendTo => $SendTo, Placeholder => loc('Queue'), Hyperlink => $Hyperlink );
+
+@@
+ % }
+ % elsif ($ButtonOnly) {
+ <div class="create-wide">
+-<&|/l_unsafe, $button_only_start_modal, $button_end &>[_1]Create new ticket[_2]</&>
++<&|/l_unsafe, $button_only_start, $button_end &>[_1]Create new ticket[_2]</&>
+ </div>
+ <div class="create-medium">
+-<&|/l_unsafe, $button_start_modal, $button_end &>[_1]Create[_2]</&>
++<&|/l_unsafe, $button_start, $button_end &>[_1]Create[_2]</&>
+ </div>
+ <div class="create-narrow">
+-<&|/l_unsafe, $button_start_modal, $button_end &>[_1]+[_2]</&>
++<&|/l_unsafe, $button_start, $button_end &>[_1]+[_2]</&>
+ </div>
+ % }
+ % else {
+@@
+ <&|/l_unsafe, $button_start, $button_end, $queue_selector &>[_1]New ticket in[_2] [_3]</&>
+ </div>
+ <div class="create-medium">
+-<&|/l_unsafe, $button_start_modal, $button_end &>[_1]New ticket[_2]</&>
++<&|/l_unsafe, $button_start, $button_end &>[_1]New ticket[_2]</&>
+ </div>
+ <div class="create-narrow">
+-<&|/l_unsafe, $button_start_modal, $button_end &>[_1]+[_2]</&>
++<&|/l_unsafe, $button_start, $button_end &>[_1]+[_2]</&>
+ </div>
+ % }
+
diff --git a/share/html/Elements/SelectObject b/share/html/Elements/SelectObject
--- a/share/html/Elements/SelectObject
@@ -69,18 +113,121 @@
+$ARGS{OnChange} .= "jQuery(this).closest('form').submit();" if ($AutoSubmit);
</%init>
+diff --git a/share/html/Elements/SelectQueueAutocomplete b/share/html/Elements/SelectQueueAutocomplete
+--- a/share/html/Elements/SelectQueueAutocomplete
++++ b/share/html/Elements/SelectQueueAutocomplete
+@@
+ $CheckQueueRight => 'CreateTicket'
+ $AutoSubmit => 0
+ $Return => 'Name'
++$SelectedId => undef
+ </%args>
+ <%init>
+-my $DefaultQueue = RT::Queue->new($session{'CurrentUser'});
+-$DefaultQueue->Load( $Default );
++
++my $Value = '';
++if ($SelectedId) {
++ my $SelectedQueue = RT::Queue->new($session{'CurrentUser'});
++ $SelectedQueue->Load( $SelectedId );
++ $Value = $SelectedQueue->Name;
++} elsif ($Default) {
++ my $DefaultQueue = RT::Queue->new($session{'CurrentUser'});
++ $DefaultQueue->Load( $Default );
++ if ($DefaultQueue->id) {
++ $Value = $DefaultQueue->Name;
++ }
++}
+
+ undef $CheckQueueRight if $ShowAllQueues;
+ </%init>
+ <input name="<% $Name %>"
+ type="text"
+ size="25"
+- value="<% $DefaultQueue->id ? $DefaultQueue->Name : "" %>"
++ value="<% $Value %>"
+ class="<% $Class %>"
+ data-autocomplete="Queues"
+ placeholder="<% $Placeholder %>"
+ data-autocomplete-checkright="<% $CheckQueueRight %>"
+ data-autocomplete-return="<% $Return %>"
+- <% $AutoSubmit ? 'data-autocomplete-autosubmit=1' : '' %>
++% if ($AutoSubmit) {
++ data-autocomplete-autosubmit=1
++ onInput="jQuery('#QueueChanged').val(1);"
++% }
+ />
+
+diff --git a/share/html/Helpers/CreateInQueue b/share/html/Helpers/CreateInQueue
+deleted file mode 100644
+--- a/share/html/Helpers/CreateInQueue
++++ /dev/null
+@@
+-%# BEGIN BPS TAGGED BLOCK {{{
+-%#
+-%# COPYRIGHT:
+-%#
+-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+-%# <sales at bestpractical.com>
+-%#
+-%# (Except where explicitly superseded by other copyright notices)
+-%#
+-%#
+-%# LICENSE:
+-%#
+-%# This work is made available to you under the terms of Version 2 of
+-%# the GNU General Public License. A copy of that license should have
+-%# been provided with this software, but in any event can be snarfed
+-%# from www.gnu.org.
+-%#
+-%# This work is distributed in the hope that it will be useful, but
+-%# WITHOUT ANY WARRANTY; without even the implied warranty of
+-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-%# General Public License for more details.
+-%#
+-%# You should have received a copy of the GNU General Public License
+-%# along with this program; if not, write to the Free Software
+-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+-%# 02110-1301 or visit their web page on the internet at
+-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+-%#
+-%#
+-%# CONTRIBUTION SUBMISSION POLICY:
+-%#
+-%# (The following paragraph is not intended to limit the rights granted
+-%# to you to modify and distribute this software under the terms of
+-%# the GNU General Public License and is only of importance to you if
+-%# you choose to contribute your changes and enhancements to the
+-%# community by submitting them to Best Practical Solutions, LLC.)
+-%#
+-%# By intentionally submitting any modifications, corrections or
+-%# derivatives to this work, or any other work intended for use with
+-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+-%# you are the copyright holder for those contributions and you grant
+-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+-%# royalty-free, perpetual, license to use, copy, create derivative
+-%# works based on those contributions, and sublicense and distribute
+-%# those contributions and any derivatives thereof.
+-%#
+-%# END BPS TAGGED BLOCK }}}
+-<div class="modal-dialog modal-dialog-centered" role="document">
+- <div class="modal-content">
+- <div class="modal-header">
+- <h5 class="modal-title"><&|/l&>Select Queue</&></h5>
+- <a href="javascript:void(0)" class="close" data-dismiss="modal" aria-label="Close">
+- <span aria-hidden="true">×</span>
+- </a>
+- </div>
+- <div class="modal-body">
+- <& /Elements/CreateInQueue &>
+- </div>
+- </div>
+-</div>
+-% $m->abort;
+
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
-@@
- Title => $title,
- &>
- <& /Elements/Tabs &>
--
-+
- <& /Elements/ListActions, actions => \@results &>
-
- <form action="<% RT->Config->Get('WebPath') %>/Ticket/Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
@@
<div id="ticket-create-metadata">
@@ -177,3 +324,22 @@
$RT::Logger->crit("After display call; error is $@");
$m->abort();
+diff --git a/share/static/js/util.js b/share/static/js/util.js
+--- a/share/static/js/util.js
++++ b/share/static/js/util.js
+@@
+ return false;
+ });
+
+- jQuery(".ticket-create-modal").click(function(ev){
+- ev.preventDefault();
+- jQuery.get(
+- RT.Config.WebHomePath + "/Helpers/CreateInQueue",
+- showModal
+- );
+- });
+-
+ jQuery("#articles-create, .article-create-modal").click(function(ev){
+ ev.preventDefault();
+ jQuery.get(
+
2: ed7fe7c116 ! 2: 5769015e0f Select Queue in Ticket Create page Tests and test dependancies
@@ -443,3 +443,4 @@
$m->content_contains($cf_name, 'has cf field' );
$m->submit_form(
+
-: ------- > 3: 1354b5a6ca fixup tests
More information about the rt-commit
mailing list