[Rt-commit] [rtir] 03/07: skip RTIR ticket create modal if there's only one choice

Dustin Graves dustin at bestpractical.com
Thu May 12 20:11:38 EDT 2016


This is an automated email from the git hooks/post-receive script.

dustin pushed a commit to branch 3.4/popup-ticket-create
in repository rtir.

commit e1741796bf62b3df7f95160802d8fa2f0cc1aa47
Author: Dustin Graves <dustin at bestpractical.com>
Date:   Fri Apr 29 22:34:12 2016 +0000

    skip RTIR ticket create modal if there's only one choice
    
    Like Self Service, if there is only one queue the user can create a
    ticket it, they should be taken directly to the create page with no
    popup.
---
 static/js/rtir.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/static/js/rtir.js b/static/js/rtir.js
index 94abd8c..e583cd0 100644
--- a/static/js/rtir.js
+++ b/static/js/rtir.js
@@ -12,6 +12,13 @@ jQuery(function() {
         jQuery.get(
             RT.Config.WebHomePath + '/RTIR/Helpers/CreateInRTIRQueueModal?Lifecycle=' + lifecycle + '&LifecycleDesc=' + lifecycleDesc + '&' + queryString,
             function(html) {
+                // If there's only one queue, just create a ticket in it and skip the modal
+                var queues = jQuery(html).find("select[name='Queue'] > option");
+                if (queues.length === 1) {
+                    window.location.href = RT.Config .WebHomePath + '/RTIR/Create.html?Queue=' + queues.first().val();
+                    return;
+                }
+
                 jQuery("<div class='modal'></div>")
                     .append(html).appendTo("body")
                     .bind('modal:close', function(ev,modal) { modal.elm.remove(); })

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list