Hi,
Post by AbdelrahmanHi all,
I am enjoying OTRS, it is the best open source help desk i found until
now, the problem is that i need to OTRS to produce reports more than
those i found in the stats module?!
I thought about using a thirdparty product to produce the reports but my
boss won't agree about that because he needs a complete solution,
therefore, he will need to produce the reports from the stats module.
So you know the SQL-statements producing the stats you want.
Post by AbdelrahmanDid any one design any custom reports?!
1) Make a copy of AccountedTime.pm, clear this files (delete all you
don't need) and
2) e.g. replace the sub Run with this on
sub Run {
my $Self = shift;
my %Param = @_;
$Param{Month} = sprintf("%02d", $Param{Month});
my $Title = "$Param{Name} $Param{Year}-$Param{Month}";
my @HeadData = ('CustomerID', 'Tickets', 'Articles', 'Time');
my @Data = ();
# get accounted time
my $Days = Days_in_Month($Param{Year},$Param{Month});
my @Tickets = ();
my $SQL = <<ENDE;
SELECT
customer_id AS Amt,
COUNT(id) AS Tickets,
SUM((SELECT COUNT(id) FROM article WHERE ticket_id = t.id)) AS
Aktivitaeten,
CAST(SUM((SELECT SUM(time_unit) FROM time_accounting WHERE ticket_id =
t.id)) AS UNSIGNED) AS Stunden
FROM ticket t
WHERE create_time >= '$Param{Year}-$Param{Month}-01 00:00:01'
AND create_time <= '$Param{Year}-$Param{Month}-$Days 23:59:59'
GROUP BY customer_id;
ENDE
$Self->{DBObject}->Prepare(SQL => $SQL);
while (my @Row = $Self->{DBObject}->FetchrowArray()) {
push (@Data, \@Row);
}
return ([$Title],[@HeadData], @Data);
}
3) correct the package name at the top of the file.
4) insert into ~/Kernel/Config/Files/Ticket.xml
<ConfigItem Name="SystemStatsMap###Ticket::StatsOwn1" Required="0"
Valid="1">
<Description Lang="en">support done per customer#
(customer_id)</Description>
<Description Lang="de">geleisteter Support pro Kunden#
(customer_id)</Description>
<Group>Ticket</Group>
<SubGroup>Core::Stats</SubGroup>
<Setting>
<Hash>
<Item Key="Name">Support pro Kunden#</Item>
<Item
Key="Module">Kernel::System::Stats::Support_per_Customer_id</Item>
<Item Key="Desc">Support der insgesamt fuer Tickets
geleistet wurde, die innerhalb des Zeitraumes -erstellt- wurden,
gruppiert nach Kunden#</I
tem>
<Item Key="SumCol">1</Item>
<Item Key="UseResultCache">0</Item>
<Item Key="Output">
<Array>
<Item>Print</Item>
<Item>CSV</Item>
</Array>
</Item>
<Item Key="OutputDefault">Print</Item>
</Hash>
</Setting>
</ConfigItem>
Post by AbdelrahmanI didn't find anything in the developer documentation and i didn't
understand a thing from the *.pm in system\stats\ on the server
HELP
abdelrahman
Bye, Alex