Owner and Owner's fileds searches

Hello.
This is revisited patch, for different searches based on Owners info.

Bug was submetted by Olivier Horec, we worked together to fix this issue.
Olivier, didn’t response that all things was fixed in his system, but
AFAIK I covered all issues.
Issues:

  • Owner is ENUM field(tickets_sql), but it’s also watcher field, but
    extended searches by owner’s fields doesn’t work.
  • If we just switch from ENUM to WATCHER_FIELD, then we loose backward
    compatibility, because ENUM allow user to search by user ID and Name
    at the same time
  • Also we have discovered that if you limit Tickets by FIELD => 'Type’
    then current code doesn’t check if it’s Type of the Ticket or Type of
    any other object(Group for example) and you can get approvals in
    result set.

Changes:

  • first issue is addressed with changing ENUM to WATCHER_FIELD.
  • second thing is covered in _WatcherLimit method with special exception.
  • third bug fixed with checking ALIAS in several Limit methods of
    the RT::Tickets class.

NOTE: this patch could be tested and should be. Please, write tests
for all issues, if nobody will take care about this soon, I’ll do it
myself later.

Best regards, Ruslan.

owner_searches.patch (3.44 KB)