QueueMetrics > Scripting QueueMetrics

Wallboard Example script

<< < (5/10) > >>

kayodea:
Hi ALL,

Any clue on getting this resolved. 

Regards.

Bevort:
Hi kayodea

I work with the 2ns example from byronsmith because we like the layout.

I found some write errors in parts of the code

He uses
--- Code: ---$queue['All selected']['nagents']
--- End code ---
It must be
--- Code: ---$queue['all selected']['nagents']
--- End code ---

In the HTML part I replaced the $nagents wit $queue['all selected']['nagents'] to get some 1st results.
this workes but only with 1 queue
I made equal changes to the other 2 number parts

I am still working more on it but get results now

Hope this helps

scooby2:
Thanks Bevort. That helps the bottom part.

It appears at least with 1.4.6 that RTCallsBeingProc is not working or this script does not use it right. Anyone using one of these scripts and 1.4.6 with success?

moa:
RTCallsBeingProc is working just fine after the upgrade from 1.4.2 to 1.4.7 last night.  I did have to do Bevorts change with the "all selected" case.  Here's the code for RTCallsBeingProc:
Here's the call to it:

--- Code: ---$agentStatus = getCurrentCalls( "RealtimeDO.RTCallsBeingProc", $blocks_rt, $agent );

--- End code ---
And here is getCurrentCalls

--- Code: ---function getCurrentCalls( $blockname, $blocks, $agent ) {
    global $agent;
    $block = $blocks[$blockname];
     for ( $r = 1; $r < sizeof( $block ) ; $r++ ) {
       $agent[$block[$r][6]]['caller'] = $block[$r][2];
       $agent[$block[$r][6]]['entered'] = $block[$r][3];
       $agent[$block[$r][6]]['waiting'] = $block[$r][4];
       $agent[$block[$r][6]]['duration'] = $block[$r][5];
       $agent[$block[$r][6]]['queue'] = $block[$r][1];
      }
      $agentStatus = '';
      $rowcount=1;
      for  ( $r = 0; $r < sizeof( $agent ) ; $r++ ) {
        $agent = array_values($agent);
        if ($rowcount == 1){
          $rowcolor = "lightgray";
          $rowcount++;
        } elseif ($rowcount == 2) {
          $rowcolor = "white";
          $rowcount = 1;
        }
        if ($agent[$r]['duration'] != '') {
          $status =  $agent[$r]['entered'] . " Call " . " (" . $agent[$r]['duration'] . ")";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "maroon";
          $blinkon = '';
          $blinkoff = '';
        }
        elseif ($agent[$r]['onpause'] != '-') {
          $pauseTime=substr_replace($agent[$r]['onpause'],"",5);
          $pauseWhat=substr_replace($agent[$r]['onpause'],"",0,6);
          $pauseDuration = time() - strtotime($pauseTime);
          if($pauseWhat == "Break" && sec2hms($pauseDuration) > "0:10:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "Lunch" && sec2hms($pauseDuration) >= "0:60:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "ACW" && sec2hms($pauseDuration) >= "0:01:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }elseif($pauseWhat == "Meeting" && sec2hms($pauseDuration) >= "0:60:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "blue";
            $blinkon = '';
            $blinkoff = '';
          }elseif($pauseWhat == "Extra Duties" && sec2hms($pauseDuration) >= "0:10:00"){
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
            $fontcolor3 = "red";
            $blinkon = '<blink>';
            $blinkoff = '</blink>';
          }
          else{
          $status = $agent[$r]['onpause'] . " (". sec2hms($pauseDuration) .")";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "blue";
          $blinkon = '';
          $blinkoff = '';
        }
        }
       
       
         else {
          $status = "Available";
          $bgcolor3 = $rowcolor;
          $fontcolor3 = "black";
          $blinkon = '';
          $blinkoff = '';
        }
            $agentStatus .="<tr bgcolor=\"" . $rowcolor . "\" style=\"color:black; font-size: 30px;\"><td>&nbsp;</td><td style=\"color:" . $fontcolor3 . ";\" bgcolor=\"" . $bgcolor3 . "\" >".$blinkon."" . $agent[$r]['name'] . "".$blinkoff."</td><td style=\"color:" . $fontcolor3 . ";\" bgcolor=\"" . $bgcolor3 . "\" >".$blinkon."" . $status .  "".$blinkoff."</td><td>" . $agent[$r]['queue'] . "</td><td>" . substr_replace($agent[$r]['caller'],"",10) . "</td></tr>";
     
      }
     
    return $agentStatus;
}


--- End code ---


Most of it is the original code from Barry.  You might notice I added extra stuff to handle the techs on pause.  It makes the text start blinking if they take to long of a break.  I hope this helps.

QueueMetrics:
Cool man!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version