And I was just about to say that I only found the regexp in ShowSearch:
$SearchArg->{‘Query’} =~
s/CurrentUser/$session{‘CurrentUser’}->Id/ge;
I confirmed that you are right. The saved search does work from the
ataglance page.
I was actually trying to do some customization of the Quicksearch doodad
which resulted in lots of trying and nothing doing – if that makes any
sense. Clearly I have to put some thought into the context before I go
mucking about. So, in /Elements/Quicksearch under local, I have this:
<&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "",
titleright => loc("Edit"), titleright_href =>
$RT::WebPath.'/Prefs/Quicksearch.html' &>
<& /Elements/QueueSummary,
cache => 'quick_search_queues',
queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') &&
!exists $unwanted->{$_->Name} },
conditions => [ {cond => "Status = 'new'", name => loc ('new') },
{cond => "Status = 'open'", name => loc ('open') },
{cond => "Status = 'stalled'", name => loc
('stalled') },
{cond => "Status = 'resolved'", name => loc
('resolved') },
{cond => "Owner = '__CurrentUser__'", name => loc
('mine') } ] &>
<%INIT>
my $unwanted =
$session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
Hah! If only it were that simple.
David Smithson
CLICK HERE FOR ONLINE SUPPORTFrom: Todd Chapman [mailto:todd@chaka.net]
Sent: Monday, July 31, 2006 8:30 PM
To: David Smithson
Cc: Drew Taylor; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Searching by CurrentUser with QueryBuilder
I think the problem is that the replacement of CurrentUser
with the user id is done in /Elements/ShowSearch. That is
only used for showing searches on the RT homepage. The link
at the top of the search is to the query builder with the
value replaced. Loading it from saved searches isn’t going to
work.
It would be better if the replacement was done in the
TicketSQL parser.
-Todd