[rt-users] suggestion for improvement
Smylers
smylers at gbdirect.co.uk
Wed Nov 27 11:15:49 EST 2002
On Sunday Sven Sternberger wrote:
> 2. Could we add the Queue name to the page title of the search page.
Yes.
We do something like that in Search/Listing.html. The code snippet
below is copied, pasted, and tweaked slightly from what we're actually
using because we have other changes in there too. But I'd expect
something along these lines in an <%INIT> section to work for you:
# Loop through the restrictions on the current search criteria,
# looking for a single Queue restriction:
my $queue_name;
foreach (values %{{$session{tickets}->DescribeRestrictions}})
{
if (/^Queue = (.*)/)
{
# If $queue_name has already been set in a previous iteration of
# this loop then the search criteria involves more than one queue
# so this isn't a single-queue search:
if ($queue_name)
{
$queue_name = undef;
last;
}
# Else assume that this is a single-queue search until proven
# otherwise and rememember the name of the queue for later:
$queue_name = $1;
}
}
my $title = $queuename ? "$queuename Tickets" : 'Search';
Then deploy $title appropriately in the call to /Elements/Header.
Good luck!
Smylers
--
GBdirect
http://www.gbdirect.co.uk/
More information about the rt-users
mailing list