Help Desk Software & Beyond
May 23, 2012, 06:19:39 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [MOD] Operator Performance Summary Report  (Read 1080 times)
arvin
Sr. Member
****

Karma: 10
Posts: 400


Yeah thats right !


View Profile
« on: November 28, 2008, 01:22:31 PM »

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 operprefsum

The module that needs to updated is TTXReports.pm

Just follow these step by step instructions and you should be fine

In TTXReports.pm under the main subroutine

You should see the following

Quote

    overview => 'Overview',
    operperf => 'Operator Performance',
    aging360 => 'Service Requests Aging',
    aging => 'Active Service Requests',
    slevel => 'Service Level',


Change it to this

Quote
   
   
    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

Code:

  foreach my $rtype ('overview', 'operperf', 'aging360', 'aging', 'slevel',) {


Change to .....

Code:

  foreach my $rtype ('overview', 'operperf', 'aging360', 'aging', 'slevel', 'operperfsum') {


Still under the main subroutine

you should see the following

Code:

  } elsif ($rtype eq 'operperf') {
    $cfg->set('_NOCOOKIE',1);
    operperf($cfg, $query, $data);


add the following code directly underneath

Code:

  } 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

Code:

# ===================================================================== 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 ! ! ! !
« Last Edit: December 02, 2008, 08:48:01 AM by arvin » Logged
arvin
Sr. Member
****

Karma: 10
Posts: 400


Yeah thats right !


View Profile
« Reply #1 on: December 02, 2008, 08:49:34 AM »

I noticed that I had spelt "Performance" as "Preformance"

Those who have used this ..i'm sorry for the typo .... and for those who want to use it ... the typo has been fixed

Take care, 
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 18 queries.