in our company we were very unhappy about the way the "Closed" Tickets are counted by default for the 7 day stats.
I solved the problem, but probably not in an optimal manner.
I'll post the code I implemented here and hope someone might suggest improvements.
So I modified Kernel/System/Ticket.pm (in version 1.416.2.10) from line 4756 on (it says # database query there).
I put everything from there in an else branch until the commented lines with "#=item _TicketSearchSqlAndStringCreate()" and put this if branch above it:
Code: Select all
if ( $Result eq 'COUNT' && ( $Param{TicketCloseTimeNewerDate} || $Param{TicketCloseTimeOlderDate} ) )
{
my $NOTHING;
my $AltSQL;
$AltSQL = $SQL;
$SQL =~ s/SELECT DISTINCT count\(\*\)/SELECT */g;
my %Tickets;
my @TicketIDs;
my $Count;
return if !$Self->{DBObject}->Prepare( SQL => $SQL . $SQLExt . ' GROUP BY th.ticket_id', Limit => $Limit );
while ( my @Row = $Self->{DBObject}->FetchrowArray() ) {
$Count = $Count + 1;
}
$Tickets{ $Count } = $NOTHING;
push @TicketIDs, $Count;
# fill cache
if ($CacheObject) {
$CacheObject->Set(
Type => 'TicketSearch',
Key => $AltSQL . $SQLExt . $Result . $Limit,
Value => $Count,
TTL => $Param{CacheTTL} || 60 * 4,
);
}
return $Count;
}
What I would love to have is a third graph with reopened tickets and then the 7 day stats would be perfect!
Any feedback is welcome
