[rt-users] help with ModifyQuery callback

Izz Abdullah Izz.Abdullah at hibbett.com
Wed Oct 12 16:15:15 EDT 2011


I appreciate the code, but yes, I have been asked to hard code the fts for simple search.  The thing is, simple search is now displayed on privileged users top-bar in RT4.0.2 and it is very easy to just punch something in and search.  Of course, management doesn't want to type 'fulltext:' before the term, so I've been on a hunt for a solution.  I don't think your code will do what I need since I need to change the functionality of the search box in the topsection that is now rt4.0.2.

Thank you though...by the way an addition to my fiasco:

I edited the ModifyQuery callback to contain only one line:
$$query = $$query . " new open resolved stalled rejected deleted";
AND the search functionality still returns 0 results.  Something else is not quite right...any ideas?

Cleared mason cache = sudo rm -rf /opt/rt4/var/mason_data/obj/*
Changed ownership of directory tree is sudo chown -R root:www-data /Callbacks
  (I have another callback in Ticket that works perfectly)
And of course restarting apache in Ubuntu...

What am I missing?

-----Original Message-----
From: Allen [mailto:allen+rtlist at crystalfontz.com] 
Sent: Wednesday, October 12, 2011 3:07 PM
To: rt-users at lists.bestpractical.com
Cc: Izz Abdullah
Subject: Re: help with ModifyQuery callback

If you really want to search full text most of the time, using the Tickets section with all the dropdowns and page submits can be cumbersome. I can see why you want to modify the simple search page. I don;t know how to do that, but attached is a PHP script that searches the database directly.

You'll need to put in code for your mysql connection to the RT database at the top of the file. You will also need to recode all the php function shortcuts for making HTML form elements (show_open_form(), make_radio(), etc) using your favorite form making widget or just writing out the html manually. Then search the file for "YOURDOMAIN" and substitute your appropriate domain name.

Using Callbacks, I added menu items inside RT so that links to this "Easier Search" page show up when you hover over the global "Tickets"
navigation menu and when inside that section, adds a link next to the other page nav items like "Edit Search", "Show results", etc. How to do that was discussed on this list a couple of weeks ago. Search for:
RT4 Callback changes Elements/Tabs/Default

Doing it this way is not ideal since it accesses the database directly instead of through RT API, which means if schema or anything changes, this script will be broken. But it works ok for now.

Allen



More information about the rt-users mailing list