[rt-users] help with ModifyQuery callback

Allen allen+rtlist at crystalfontz.com
Wed Oct 12 16:06:38 EDT 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtsearch.zip
Type: application/zip
Size: 5097 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111012/94014279/attachment.zip>


More information about the rt-users mailing list