[rt-devel] Listing.html, # of tickets
Bruce Campbell
bruce_campbell at ripe.net
Tue Apr 16 14:41:55 EDT 2002
On Tue, 16 Apr 2002, Matt Disney wrote:
> I've tried to add a line to the header of
> $RTPath/WebRT/html/Search/Listing.html so that it displays the number
> of tickets resulting from the query:
>
> <& /Elements/Header, Title => "Search Results: ".$session{'tickets'}->Count()." Tickets", Refresh => $session{'tickets_refresh_interval'} &>
->Count essentially changes the SQL query from:
select field.field.field from (etc)
to
select count(id) from (etc)
If a Limit statement is applied (which is how the 50 per page stuff does),
count is faithfully reporting how many rows would be returned ;)
> I'm not entirely sure this is a bug exactly, I'm just wanting to know
> if anyone has suggestions on how I might go about accumulating the
> total number of tickets for a search.
Depending on your installation, I'd be rather careful (repeating rather
broad searches just to get a count on each new page is ugly), however
storing the total results in the %session, and checking that you haven't
already gotten a total result for the current search would be nifty.
--
Bruce Campbell RIPE
Systems/Network Engineer NCC
www.ripe.net - PGP562C8B1B Operations
More information about the Rt-devel
mailing list