I was asked by a customer to exclude Sunday from "7 Day Stats" pane of the Dashboard, because their service doesn't manage tickets on Sundays, and they find it useless to see the curves at zero on this closed day.
If anybody is interested, here is how I succeeded to modify the graph.
First, I made a copy of otrs\OTRS\Kernel\Output\HTML\DashboardTicketStatsGeneric.pm into otrs\OTRS\Custom\Kernel\Output\HTML.
Then I modified the code of sub Run this way.
I had to redefine the %Axis table with no Sunday:
Code: Select all
my %Axis = (
'7Day' => {
0 => 'Mon',
1 => 'Tue',
2 => 'Wed',
3 => 'Thu',
4 => 'Fri',
5 => 'Sat',
},
);

Then I needed a new variable to adjust the $Key in order to skip the Sunday while counting from today until (today -6).
Code: Select all
my $AdjustKey = 0; #HvL
for my $Key ( 0 .. 6 ) {
my $TimeNow = $Self->{TimeObject}->SystemTime();
if ($Key) {
$TimeNow = $TimeNow - ( 60 * 60 * 24 * $Key );
}
my ( $Sec, $Min, $Hour, $Day, $Month, $Year, $WeekDay )
= $Self->{TimeObject}->SystemTime2Date(
SystemTime => $TimeNow,
);
# HvL Adjust $WeekDay
if ($WeekDay == 0) {
$AdjustKey = 1;
}
else {
$WeekDay -= 1;
unshift(
@TicketWeekdays,
#HvL [ 6 - $Key, $Self->{LayoutObject}->{LanguageObject}->Get( $Axis{'7Day'}->{$WeekDay} ) ]
[ 5 - $Key + $AdjustKey, $Self->{LayoutObject}->{LanguageObject}->Get( $Axis{'7Day'}->{$WeekDay} ) ]
);
Except naturally this:
Code: Select all
push @TicketsCreated, [ 5 - $Key + $AdjustKey, $CountCreated ];
Code: Select all
push @TicketsClosed, [ 5 - $Key + $AdjustKey, $CountClosed ];
And here is the result: Best regards,
HervE