[Rt-commit] [rtir] 01/02: Don't hardcode a list AND exclude things not in the list

Kevin Falcone falcone at bestpractical.com
Fri Jul 18 16:51:49 EDT 2014


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

falcone pushed a commit to branch master
in repository rtir.

commit ffe3918b93a73b7b2ac780a5d0eb9710a2c2c97d
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Jul 18 16:46:31 2014 -0400

    Don't hardcode a list AND exclude things not in the list
    
    Noticed that 4eb6f329 does "Name not like" AND "Name =" which basically
    results in the first part of the clause being ignored, since the second
    part is a list of "Queue is Named Incidents, Incident Reports,
    Investigations OR Blocks".
    
    Results in clearer SQL being generated.
---
 .../RTIR/Elements/QueueSummaryByLifecycle/SQLFilter   | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/html/Callbacks/RTIR/Elements/QueueSummaryByLifecycle/SQLFilter b/html/Callbacks/RTIR/Elements/QueueSummaryByLifecycle/SQLFilter
index 1efaff9..6d1271d 100644
--- a/html/Callbacks/RTIR/Elements/QueueSummaryByLifecycle/SQLFilter
+++ b/html/Callbacks/RTIR/Elements/QueueSummaryByLifecycle/SQLFilter
@@ -47,13 +47,8 @@
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
 for my $type (RT::IR->Queues) {
-    $Queues->Limit( FIELD => 'Name',
-                    OPERATOR => 'NOT STARTSWITH',
-                    VALUE => "$type - ",
-                    SUBCLAUSE => 'Constituencies',
-                    CASESENSITIVE => 0,
-            );
-
+# displaying on the RTIR homepage
+# we don't have a good solution for showing this on an RTIR dashboard
     if ( $m->request_comp->path =~ m{^/RTIR/} ){
         $Queues->Limit( FIELD => 'Name',
                         OPERATOR => '=',
@@ -62,7 +57,17 @@ for my $type (RT::IR->Queues) {
                         ENTRYAGGREGATOR => 'OR',
                         CASESENSITIVE => 0,
                 );
+    } else {
+# anywhere else, skip constituency Queues.  In the if() clause
+# we're hardcoding 4 Queues, so we don't also need to skip the constituency queues.
+        $Queues->Limit( FIELD => 'Name',
+                        OPERATOR => 'NOT STARTSWITH',
+                        VALUE => "$type - ",
+                        SUBCLAUSE => 'Constituencies',
+                        CASESENSITIVE => 0,
+                );
     }
+
 }
 </%INIT>
 <%ARGS>

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


More information about the rt-commit mailing list