[Rt-commit] [rtir] 09/09: Massage all search result views in RTIR to limit by constituency

Jesse Vincent jesse at bestpractical.com
Mon Mar 16 02:41:36 EDT 2015


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

jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.

commit 425a34209841eea2c11cbbcb09bf60944dbc348d
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Mar 15 23:39:31 2015 -0700

    Massage all search result views in RTIR to limit by constituency
    
    Massage all search result views in RTIR to limit by constituency
    if there's a constituency filter in place and to turn 'regular'
    RT ticket links in search results into smarter RTIR links
---
 html/Callbacks/RTIR/Elements/ShowSearch/ModifySearch | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/html/Callbacks/RTIR/Elements/ShowSearch/ModifySearch b/html/Callbacks/RTIR/Elements/ShowSearch/ModifySearch
new file mode 100644
index 0000000..f3141f8
--- /dev/null
+++ b/html/Callbacks/RTIR/Elements/ShowSearch/ModifySearch
@@ -0,0 +1,16 @@
+<%init>
+#return unless $m->request_comp->path =~ m{^/RTIR/};
+if (my $c = $m->{'RTIR_ConstituencyFilter'}) {
+    $Search->{Query} .= " AND 'QueueCF.{RTIR Constituency}' = '$c'" unless ( $Search->{Query} =~ /QueueCF.\{RTIR Constituency\}/);
+    $OriginalSearch->{Query} .=  " AND 'QueueCF.{RTIR Constituency}' = '$c'" unless ( $OriginalSearch->{Query} =~ /QueueCF.\{RTIR Constituency\}/);
+}
+# If we're inside RTIR, try to make all the ticket search links point to RTIR
+# A better implementation would check that the ticket is an RTIR ticket, but that
+# would be very, very, computationally intensive
+$OriginalSearch->{Format} =~ s/__WebPath__\/Ticket\/Display.html\?id=__id__/__RTIRTicketURI__/gsm;
+$Search->{Format} =~ s/__WebPath__\/Ticket\/Display.html\?id=__id__/__RTIRTicketURI__/gsm;
+</%init>
+<%args>
+$OriginalSearch => undef
+$Search => undef
+</%args>
\ No newline at end of file

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


More information about the rt-commit mailing list