[rt-users] relative times in search

darren chamberlain darren at boston.com
Thu Feb 27 08:40:31 EST 2003


* Les Mikesell <les at futuresource.com> [2003-02-27 08:28]:
> Is there a way to get an offset from the current time
> into a bookmarkable search?  It would be handy to
> have a one-click way to see things that happened
> in the last 12 or 24 hours.

I have a little component, /Elements/QuickLink, that I think I got from
this list a while ago.  It has a few quick links:

  * Tickets I own
  * Unresolved Tickets I own
  * All Unresolved Tickets
  * Tickets Opened Today (2003/02/27)
  * Tickets Opened Yesterday (2003/02/26)

The date for the last two is calculated, of course.  I've attached the
component -- put it in $RT/local/WebRT/html/Elements, and link to it
from somewhere.

(darren)

-- 
Maybe that's the only truth in the world.  Not the Bibles or poetry or
philosophy but just the old jokes.
    -- Robert Shea and Robert Anton Wilson
-------------- next part --------------
<& /Elements/TitleBoxStart, title => "Quick Links" &>

% if ($session{'CurrentUser'}->Privileged()) {
<a href="/Search/Listing.html?NewSearch=1&OwnerOp=%3D&ValueOfOwner=<%$session{'CurrentUser'}->Id%>&TicketsSortOrder=DESC">Tickets I own</a>
<br>
<a href="/Search/Listing.html?NewSearch=1&OwnerOp=%3D&ValueOfOwner=<%$session{'CurrentUser'}->Id%>&StatusOp=%21%3D&ValueOfStatus=resolved&TicketsSortOrder=DESC">Unresolved Tickets I own</a>
<br>
<a href="/Search/Listing.html?NewSearch=1&StatusOp=%21%3D&ValueOfStatus=resolved&TicketsSortOrder=DESC">All Unresolved Tickets</a>
<br>
<a href="/Search/Listing.html?NewSearch=1&DateType=Created&DateOp=%3E&ValueOfDate=<% $today %>">Tickets Opened Today <small>(<% $today %>)</small></a>
<br>
<a href="/Search/Listing.html?NewSearch=1&DateType=Created&DateOp=%3E&ValueOfDate=<% $yesterday %>">Tickets Opened Yesterday <small>(<% $yesterday %>)</small></a>
% }

<& /Elements/TitleBoxEnd &>
<%args>
    $today => POSIX::strftime("%Y/%m/%d", localtime(time))
    $yesterday => POSIX::strftime("%Y/%m/%d", localtime(time - (60*60*24)))
</%args>
<%perl>
    use POSIX ();
</%perl>




More information about the rt-users mailing list