PATCH: Add SearchLink to config.pm's %WebOptions

Howdy!

As previously discussed, here’s the patches that allow SearchLink (and
it’s various companions) to be specified in config.pm. The syntax of a
config.pm %WebOptions entry which uses this feature is like so:

  { Header => 'Requestor(s)',
     TicketAttribute => 'Requestors->First->OwnerObj->RealName',
     SearchLink => 1,
     SearchType => 'Requestor',
     SearchAttribute => 'Requestors->First->OwnerObj->EmailAddress',
     SearchOperator => 'LIKE',
     ExtraLinks => 
       '&StatusOp=%21%3D&ValueOfStatus=dead&ValueOfStatus=resolved'
     },

The breakdown:

SearchLink: like TicketLink, a value of 1 gets you a base URI beginning;
in this case it’s “/Search/Listing.html?NewSearch=1&”. Also like
TicketLink, you can set SearchLink to an arbitrary value and that will
be used as the base URI.

SearchType: What type of search you want to do. Valid types are
Priority, Requestor, Queue, Status, Subject, Date and Content; these are
found in the code of RT::Interface::Web.

SearchAttribute: Just like TicketAttribute, this is the evaluable bit
that supplies the proper term to search for. For example, if you’re
looking to search on owner, the proper term is OwnerObj->Name; if you’re
looking to search on requestor, the proper term is
Requestors->First->OwnerObj->EmailAddress. There is an implied $Ticket->
which is prepended at eval time.

SearchOperator: The usual SQL operator; again you must match it to the
field you’re searching on. I’ve used escaped bits for mine (e.g. %3D
instead of =) but I’m not sure it’s necessary and I’m too lazy to test.

ExtraLinks behaves just as before, e.g. it gets pasted onto the end.

Hope this is useful. =]

–j
Jim Meyer, Geek At Large purp@wildbrain.com

TicketCell.patch (1.31 KB)