The main purpose of the Operator Performance Summary Report is to provide a high level view of how a service rep/customer service agent is performing in their assigned depts.
To achieve this a new subroutine was created called
operprefsumThe module that needs to updated is
TTXReports.pmJust follow these step by step instructions and you should be fine
In TTXReports.pm under the
main subroutine
You should see the following
overview => 'Overview',
operperf => 'Operator Performance',
aging360 => 'Service Requests Aging',
aging => 'Active Service Requests',
slevel => 'Service Level',
Change it to this
overview => 'Overview',
operperf => 'Operator Performance',
aging360 => 'Service Requests Aging',
aging => 'Active Service Requests',
slevel => 'Service Level',
operperfsum =>'Operator Performance Summary',
Under the
main subroutine
You should see the following
foreach my $rtype ('overview', 'operperf', 'aging360', 'aging', 'slevel',) {
Change to .....
foreach my $rtype ('overview', 'operperf', 'aging360', 'aging', 'slevel', 'operperfsum') {
Still under the
main subroutine
you should see the following
} elsif ($rtype eq 'operperf') {
$cfg->set('_NOCOOKIE',1);
operperf($cfg, $query, $data);
add the following code directly underneath
} elsif ($rtype eq 'operperfsum') {
$cfg->set('_NOCOOKIE',1);
operperfsum($cfg, $query, $data);
And now for the final part ........add the new subroutine after "operpref" subroutine
# ===================================================================== operperfsum
sub operperfsum {
my ($cfg, $query, $data) = @_;
my $tmcuts = cuttimes($cfg);
my $img = $cfg->get('imgurl')."/dot.gif";
fltrcode($cfg, $query, $data, 1, 1);
my @fltr = mkfilter($cfg, $query);
my %drange = (
fld => 'updated',
stm => $tmcuts->{trail}->{months12}->{start},
etm => $tmcuts->{today}->{stop}
);
my $cond = {col => 'status', expr => '^(CLS|WFR)$'};
push @fltr, $cond;
$| = 1;
my $tickets = TTXCommon::dbtik();
my $tmp = $cfg->set('hideoldsolved', '');
my $browser = $tickets->list(0, 999999, 'open', 'A', \@fltr, \%drange);
$cfg->set('hideoldsolved', $tmp);
$tmcuts->{total}->{cnt} = $browser->{total};
my $grpname = {};
my $opercnts;
my $m12stop = $tmcuts->{trail}->{months12}->{stop};
my $w12stop = $tmcuts->{trail}->{weeks12}->{stop};
my $w12start = $tmcuts->{trail}->{weeks12}->{start};
my $d30stop = $tmcuts->{trail}->{days30}->{stop};
my $d30start = $tmcuts->{trail}->{days30}->{start};
my $tcnt = 0;
foreach my $tid (@{$browser->{list}}) {
if (!$tcnt) {
print "\n";
$tcnt = 100;
}
--$tcnt;
my $t = $tickets->ticket($tid, 1);
next if $t eq undef;
my $grp = $t->{grp};
next if $grp eq undef;
my $tm = $t->{updated};
if ($tm < $m12stop) {
++$grpname->{$grp}->{m12};
} else {
++$grpname->{$grp}->{thismonth};
}
if ($tm >= $w12start) {
if ($tm < $w12stop) {
++$grpname->{$grp}->{w12};
} else {
++$grpname->{$grp}->{thisweek};
}
}
if ($tm >= $d30start) {
if ($tm < $d30stop) {
++$grpname->{$grp}->{d30};
} else {
++$grpname->{$grp}->{today};
}
}
#
# Purge ticket out of memory
# This is pretty safe if using SQL Edition (both MySQL and SQL Server).
# If using Standard (palin text database) Edition the consequent
# $tickets->save would destroy the database.
#
delete $tickets->{TICKETS}->{$tid};
}
my $bars = [];
my @grplist = grep(/^group\d\d?$/, $cfg->vars());
my @grplist = sort @grplist;
my $i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{m12};
}
++$i;
}
my $chart = TTXBarChart::hbar($bars, 18, 125, 'red', 0.8);
$i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{w12};
}
++$i;
}
my $chart1 = TTXBarChart::hbar($bars, 18, 125, 'blue', 0.8);
$i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{d30};
}
++$i;
}
my $chartd30 = TTXBarChart::hbar($bars, 18, 125, 'green', 0.8);
$i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{today};
}
++$i;
}
my $charttoday = TTXBarChart::hbar($bars, 18, 125, 'green', 0.8);
$i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{thisweek};
}
++$i;
}
my $chartthisweek = TTXBarChart::hbar($bars, 18, 125, 'blue', 0.8);
$i = 0;
foreach my $grp (@grplist) {
$bars->[$i]->{lbl} = $cfg->get($grp);
$bars->[$i]->{val} = 0;
if ($grpname->{$grp} ne undef) {
$bars->[$i]->{val} = $grpname->{$grp}->{thismonth};
}
++$i;
}
my $chartthismonth = TTXBarChart::hbar($bars, 18, 125, 'red', 0.8);
$data->{REPORT} .=<<EOT;
<br>
<table cellpadding=0 cellspacing=0>
<tr>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, this month%]</b></center>
<br>
$chartthismonth
</td>
</tr>
</table>
</td>
<td><img src="$img" width=17 height=1 /></td>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, this week%]</b></center>
<br>
$chartthisweek
</td>
</tr>
</table>
</td>
<td><img src="$img" width=17 height=1 /></td>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, today%]</b></center>
<br>
$charttoday
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=5><img src="$img" width=1 height=10 /></td>
</tr>
<tr>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, last 12 months%]</b></center>
<br>
$chart
</td>
</tr>
</table>
</td>
<td><img src="$img" width=17 height=1 /></td>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, last 12 weeks%]</b></center>
<br>
$chart1
</td>
</tr>
</table>
</td>
<td><img src="$img" width=17 height=1 /></td>
<td align=center valign=top>
<table width="100%" cellpadding=10 style="border-style:solid;border-color:gray;border-width:1px;">
<tr>
<td align=left>
<center><b>[%Tickets Confirmed, last 30 days%]</b></center>
<br>
$chartd30
</td>
</tr>
</table>
</td>
</tr>
</table>
<br class=tiny />
EOT
}
It should work for anyone ......
This is kinda my 1st "mod" ... I wouldn't have been able to do this without help from Sparky and Alex ...thank you both ! ! ! !