[Rt-devel] Tickets_Overlay.pm logic problem

Richard Ellis Richard.Ellis at Sun.COM
Fri Jul 2 08:08:38 EDT 2004


Hi,

I am working with Kelly Hickel and a Perl Developer here at Sun to
further update the Statistics module and one of the functions we have
been asked to implement by our Business Unit is selectable date ranges
for data retrieval.

This is fine except for one major problem and we have tracked the issues
back to LimitCreated in Tickets_Overlay.pm

I'll put the full logic here in the hope that someone can come up with
an idea. The code snippets are from Statistics/Resolution/index.html

At the moment the date range is a number of days from the current day
backwards. When the rows are being rendered each created figure is
limited by the existence of the next day i.e.

$tix->LimitCreated(VALUE => $dates[$d]->ISO, OPERATOR => ">=");
if ($dates[$d+1]) {
        $tix->LimitCreated(VALUE => $dates[$d+1]->ISO, OPERATOR =>
"<=");
}

WILL GIVE US

Created >= 2004-06-30 23:00:00  AND Created <= 2004-07-02 23:00:00

when the last day is reached which currently will always be the last day
but could be any date in the past

THE

if ($dates[$d+1]) {

   $tix->LimitCreated(VALUE => $dates[$d+1]->ISO, OPERATOR => "<=");
}

IS NOT EXECUTED SO WE ARE LEFT WITH

Created >= 2004-06-30 23:00:00

This works fine if the last day is the current day but if the last
selected day is a day in the past, then all data from that last selected
day to the current day is totalled up and displayed as the final day's
data.

Basically the final date needs to be limited on the selectable date 
version. We can't see how to limit the date range without altering
LimitCreated or some very complex logic.

If anyone has a bright idea, please let us know as this is currently a
show-stopeer on our new functions.

Thanks

Rik




More information about the Rt-devel mailing list