diff --git a/LANG_www/agc/conf_exten_check.php b/LANG_www/agc/conf_exten_check.php index ea527e43..ae3b84b5 100644 --- a/LANG_www/agc/conf_exten_check.php +++ b/LANG_www/agc/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc/manager_send.php b/LANG_www/agc/manager_send.php index a82cc03f..94eff7b6 100644 --- a/LANG_www/agc/manager_send.php +++ b/LANG_www/agc/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc/vdc_db_query.php b/LANG_www/agc/vdc_db_query.php index 7d75cb1a..129af642 100644 --- a/LANG_www/agc/vdc_db_query.php +++ b/LANG_www/agc/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Invalid Username/Password: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid session_name: |$session_name|$server_ip|\n"; + echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Invalid session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pause Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc/vicidial.php b/LANG_www/agc/vicidial.php index 335422a3..ccd81ed1 100644 --- a/LANG_www/agc/vicidial.php +++ b/LANG_www/agc/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST on server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ if ($user_login_first == 1) echo "User Password: "; echo "\n"; echo "Campaign: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSION: $version       BUILD: $build\n"; echo "\n"; echo "\n\n"; @@ -397,7 +521,7 @@ if ($user_login_first == 1) echo "\n"; echo "\n"; echo "
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ if ($user_login_first == 1) echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
User Password:
Campaign: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Phone Login:
Phone Password:
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; echo "\n"; @@ -524,8 +650,9 @@ $VDloginDISPLAY=0; echo "\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ $VDloginDISPLAY=0; $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the statuses to be dialed for your campaign as well as other campaign settings - $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; + $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_seconds = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_seconds = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ $VDloginDISPLAY=0; ##### grab the inbound groups to choose from if campaign contains CLOSER $VARingroups="''"; - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { $VARingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 20;"; + $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 60;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ $VDloginDISPLAY=0; $VARingroups = substr("$VARingroups", 0, -1); } + ##### grab the allowable inbound groups to choose from for transfer options + $xfer_groups = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groups = preg_replace("/ /","','",$xfer_groups); + $xfer_groups = "'$xfer_groups'"; + $VARxfergroups="''"; + if ($allow_closers == 'Y') + { + $VARxfergroups=''; + $stmt="select group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) order by group_id limit 60;"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ $VDloginDISPLAY=0; echo "\n"; echo "\n"; echo "
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ $VDloginDISPLAY=0; echo "User Password: "; echo "\n"; echo "Campaign: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSION: $version       BUILD: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today on that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ else echo "\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "
\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ else echo "\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "LIVE CALLS IN THIS CONFERENCE:
"; - var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
#REMOTE CHANNELHANGUPXFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
#REMOTE CHANNELHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#REMOTE CHANNELHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + lead_dial_number + " UID: " + CIDcheck + "   Waiting for Ring... " + MD_ring_secondS + " seconds"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + CIDcheck + "   Waiting for Ring... " + MD_ring_secondS + " seconds"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Called: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Called: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Park"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + manDiaLonly_num + " UID: " + MDnextCID + "   Waiting for Ring..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   Waiting for Ring..."; document.getElementById("HangupControl").innerHTML = "\"Hangup"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Last Call: " + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comments:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Last Call: " + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comments:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Park"; + + document.getElementById("HangupControl").innerHTML = "\"Hangup"; + + document.getElementById("XferControl").innerHTML = "\"Transfer"; + + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Park"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Hangup"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transfer"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; document.getElementById("XferControl").innerHTML = "\"Transfer"; document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Show message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars on customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("You must choose a date");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Select a Date Below"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Select a Date Below"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Show conference call channel information"; + document.getElementById("busycallsdisplay").innerHTML = "Show conference call channel information

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transfer"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUS:
@@ -6292,7 +6709,7 @@ RECORD ID:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
diff --git a/LANG_www/agc_br/conf_exten_check.php b/LANG_www/agc_br/conf_exten_check.php index 243712bb..eee0f698 100644 --- a/LANG_www/agc_br/conf_exten_check.php +++ b/LANG_www/agc_br/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_br/manager_send.php b/LANG_www/agc_br/manager_send.php index 3dca483d..de1bac2b 100644 --- a/LANG_www/agc_br/manager_send.php +++ b/LANG_www/agc_br/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_br/vdc_db_query.php b/LANG_www/agc_br/vdc_db_query.php index f33704c0..bea93986 100644 --- a/LANG_www/agc_br/vdc_db_query.php +++ b/LANG_www/agc_br/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Usuário/Senha: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Inválido Usuário/Senha: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido session_name: |$session_name|$server_ip|\n"; + echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Inválido session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Escolha do Grupo $closer_choice foi registrado para o usuário $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then sendligadoto vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pausa Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_br/vicidial.php b/LANG_www/agc_br/vicidial.php index 19d06b8f..20997130 100644 --- a/LANG_www/agc_br/vicidial.php +++ b/LANG_www/agc_br/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DSTligadoserver for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DISCAR link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Senha do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Brazil \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Senha do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Brazil
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Login do Telefone:
Senha do Telefone:
  \n"; +echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "VICIDISCAR web client: VICIDISCAR Login da Campanha\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Login: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_segundos = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_segundos = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Brazil \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Senha do Usuário: "; echo "\n"; echo "Campanha: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSÃO: $version       CONFIGURAÇÃO: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Brazil
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_loginligadophone: $SIP_userpara a campanha: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls todayligadothat campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Login: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Login: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pausa\"
\"Início\""; var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Início\""; var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Início\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "CHAMADAS ATIVAS NESTA CONFERÊNCIA:
"; - var live_conf_HTML = "LIGAÇÕES ATIVAS NA SUA SESSÃO:
#CANAL REMOTODESLIGARTRANFERENCIA
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "LIGAÇÕES ATIVAS NA SUA SESSÃO:
#CANAL REMOTODESLIGARVOLUME
" + loop_ct + "" + channelfieldA + "DESLIGAR
" + loop_ct + "" + channelfieldA + "DESLIGAR          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#CANAL REMOTODESLIGARVOLUME
" + loop_ct + "" + channelfieldA + "DESLIGAR
" + loop_ct + "" + channelfieldA + "DESLIGAR          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + lead_dial_number + " UID: " + CIDcheck + "   Aguardando Atender... " + MD_ring_secondS + " segundos"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + CIDcheck + "   Aguardando Atender... " + MD_ring_secondS + " segundos"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Ligado: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Ligado: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Colocar"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIDISCAR_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + manDiaLonly_num + " UID: " + MDnextCID + "   Aguardando Atender..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Ligando: " + status_display_number + " UID: " + MDnextCID + "   Aguardando Atender..."; document.getElementById("HangupControl").innerHTML = "\"Desligar"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIDISCAR_LOG ENTRY FOR THIS CHAMADA PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIDISCAR_LOG ENTRY FOR THIS CHAMADA PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Colocar"; + + document.getElementById("HangupControl").innerHTML = "\"Desligar"; + + document.getElementById("XferControl").innerHTML = "\"Transferir"; + + document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Colocar"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Desligar"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transferir"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Desligar"; document.getElementById("XferControl").innerHTML = "\"Transferir"; document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Mostrar message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE SAIR LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out varsligadocustomer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Você deve selecionar uma data");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Selecione uma data abaixo"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Selecione uma data abaixo"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Mostrar informações de discagem do canal"; + document.getElementById("busycallsdisplay").innerHTML = "Mostrar informações de discagem do canal

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transferir"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -\n"; echo "\n"; echo "\n";echo "\n"; echo "
STATUS:
@@ -6292,7 +6709,7 @@ ID da gravação:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
VICIDISCAR web-client version:     CONFIGURAÇÃO:               Servidor:              
-Mostrar informações de discagem do canal
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -ATALHOS DE STATUS INATIVOS - -
- - - -
diff --git a/LANG_www/agc_de/active_list_refresh.php b/LANG_www/agc_de/active_list_refresh.php index 81379eb6..3cd974e6 100644 --- a/LANG_www/agc_de/active_list_refresh.php +++ b/LANG_www/agc_de/active_list_refresh.php @@ -159,7 +159,7 @@ if ($format=='table') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Liste Display: "; if ($ADD==1) {echo "Live Erweiterungen";} if ($ADD==2) {echo "Besetzte Erweiterungen";} diff --git a/LANG_www/agc_de/astguiclient.php b/LANG_www/agc_de/astguiclient.php index 26447854..7ac371a4 100644 --- a/LANG_www/agc_de/astguiclient.php +++ b/LANG_www/agc_de/astguiclient.php @@ -152,7 +152,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli echo "<FORM ACTION=\"$agcPAGE\" METHOD=POST>\n"; echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n"; echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>"; - echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>"; + echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" RAND=0></TD>"; echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Login </TD>"; echo "</TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1>   </TD></TR>\n"; @@ -165,7 +165,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli echo "<TR><TD ALIGN=RIGHT>Telefon Passwort: </TD>"; echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n"; echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ÜBERNEHMEN VALUE=ÜBERNEHMEN></TD></TR>\n"; - echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BAU: $build</TD></TR>\n"; + echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BUILD: $build</TD></TR>\n"; echo "</TABLE>\n"; echo "</FORM>\n\n"; echo "</body>\n\n"; @@ -204,7 +204,7 @@ header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 echo "<html>\n"; echo "<head>\n"; -echo "<!-- VERSION: $version BAU: $build ADD: $ADD-->\n"; +echo "<!-- VERSION: $version BUILD: $build ADD: $ADD-->\n"; if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) { @@ -219,7 +219,7 @@ echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n"; echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n"; echo "<INPUT TYPE=HIDDEN NAME=pass VALUE=\"$pass\">\n"; echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>"; -echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>"; +echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" RAND=0></TD>"; echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Telefon Login </TD>"; echo "</TR>\n"; echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1>   </TD></TR>\n"; @@ -228,7 +228,7 @@ echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALU echo "<TR><TD ALIGN=RIGHT>Telefon Passwort: </TD>"; echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n"; echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ÜBERNEHMEN VALUE=ÜBERNEHMEN></TD></TR>\n"; -echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BAU: $build</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BUILD: $build</TD></TR>\n"; echo "</TABLE>\n"; echo "</FORM>\n\n"; echo "</body>\n\n"; @@ -256,7 +256,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli echo "<INPUT TYPE=HIDDEN NAME=user VALUE=\"$user\">\n"; echo "<INPUT TYPE=HIDDEN NAME=pass VALUE=\"$pass\">\n"; echo "<BR><BR><BR><CENTER><TABLE WIDTH=360 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"#CCC2E0\"><TR BGCOLOR=WHITE>"; - echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" Border=0></TD>"; + echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/agc_tab_astguiclient.gif\" RAND=0></TD>"; echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Telefon Login </TD>"; echo "</TR>\n"; echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1>   <BR><FONT SIZE=3>Ihr Telefon Login ist nicht aktiv, bitte versuchen sie es noch einmal: <BR>   </TD></TR>\n"; @@ -265,7 +265,7 @@ echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/astguicli echo "<TR><TD ALIGN=RIGHT>Telefon Passwort: </TD>"; echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n"; echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ÜBERNEHMEN VALUE=ÜBERNEHMEN></TD></TR>\n"; - echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BAU: $build</TD></TR>\n"; + echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSION: $version       BUILD: $build</TD></TR>\n"; echo "</TABLE>\n"; echo "</FORM>\n\n"; echo "</body>\n\n"; @@ -1384,7 +1384,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=3; if (live_calls > 0) { - var live_calls_HTML = "<font face=\"Arial,Helvetica\"><B>LIVE ANRUFE AUF IESEM TELEFON:</B></font><BR><table width=100%><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">AGENTENLEITUNG</td><td><font class=\"log_title\">AMTSLEITUNG</td><td><font class=\"log_title\">AUFNAHME</td><td><font class=\"log_title\">AUFLEGEN</td><td><font class=\"log_title\">XFER</td><td><font class=\"log_title\">PARK</td></tr>"; + var live_calls_HTML = "<font face=\"Arial,Helvetica\"><B>LIVE ANRUFE AUF DIESEM TELEFON:</B></font><BR><table width=100%><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">KUNDEN LEITUNG</td><td><font class=\"log_title\">ENTFERNTE LEITUNG</td><td><font class=\"log_title\">AUFNAHME</td><td><font class=\"log_title\">AUFLEGEN</td><td><font class=\"log_title\"VERBINDEN</td><td><font class=\"log_title\">PARK</td></tr>"; if ( (LCAcount > live_calls) || (LCAcount < live_calls) ) { LCAe[0]=''; LCAe[1]=''; LCAe[2]=''; LCAe[3]=''; LCAe[4]=''; LCAe[5]=''; @@ -1414,7 +1414,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} else {live_calls_HTML = live_calls_HTML + "<span id=\"recordlive" + loop_ct + "\"><a href=\"#\" onclick=\"liverecording_send_recording('Monitor','" + channelfieldBtrunk_array[1] + "','recordlive" + loop_ct + "');return false;\">Aufzeichnung</span>";} - live_calls_HTML = live_calls_HTML + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldBtrunk_array[1] + "');return false;\">AUFLEGEN</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldBtrunk_array[1] + "','" + channelfieldA_array[1] + "');return false;\">XFER</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + channelfieldBtrunk_array[1] + "');return false;\">PARK</td></tr>"; + live_calls_HTML = live_calls_HTML + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldBtrunk_array[1] + "');return false;\">AUFLEGEN</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldBtrunk_array[1] + "','" + channelfieldA_array[1] + "');return false;\"VERBINDEN</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + channelfieldBtrunk_array[1] + "');return false;\">PARK</td></tr>"; if (LCAe[ARY_ct].length < 1) {LCAe[ARY_ct] = channelfieldA_array[1]; LCAcontent_change++; LCAalter++;} @@ -1531,7 +1531,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (out_calls > 0) { - var out_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> ANRUF DATUM/ZEIT</td><td><font class=\"log_title\">NUMMER</td><td align=right><font class=\"log_title\">LÄNGE (M:SS)</td><td><font class=\"log_title\"> </td></tr>" + var out_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> ANRUF DATUM\/ZEIT</td><td><font class=\"log_title\">NUMMER</td><td align=right><font class=\"log_title\">LÄNGE (M:SS)</td><td><font class=\"log_title\"> </td></tr>" while (loop_ct < out_calls) { loop_ct++; @@ -1559,7 +1559,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=0; if (in_calls > 0) { - var in_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> ANRUF DATUM/ZEIT</td><td><font class=\"log_title\">IN-NUMMER</td><td COLSPAN=2><font class=\"log_title\">ANRUFERID</td><td align=right><font class=\"log_title\">LÄNGE</td><td><font class=\"log_title\"> </td></tr>" + var in_log_HTML = "<table width=580><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> ANRUF DATUM\/ZEIT</td><td><font class=\"log_title\">IN-NUMMER</td><td COLSPAN=2><font class=\"log_title\">ANRUFERID</td><td align=right><font class=\"log_title\">LÄNGE</td><td><font class=\"log_title\"> </td></tr>" while (loop_ct < in_calls) { loop_ct++; @@ -1634,7 +1634,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var conv_start=-1; if (parked_count > 0) { - var park_HTML = "<table width=600><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CHANNEL<BR>  ANRUF ID</td><td><font class=\"log_title\">GEPARKT VON<BR>  GEPARKTE ZEIT</td><td><font class=\"log_title\">AUFLEGEN</td><td><font class=\"log_title\">XFER</td><td><font class=\"log_title\">ABNEHMEN</td></tr>" + var park_HTML = "<table width=600><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\">CHANNEL<BR>  ANRUF ID</td><td><font class=\"log_title\">GEPARKT VON<BR>  GEPARKTE ZEIT</td><td><font class=\"log_title\">AUFLEGEN</td><td><font class=\"log_title\"VERBINDEN</td><td><font class=\"log_title\">ABNEHMEN</td></tr>" while (loop_ct < parked_count) { loop_ct++; @@ -1650,7 +1650,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var park_call_id = park_array[1]; var parked_by = park_array[3]; var parked_time = park_array[4]; - park_HTML = park_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + park_channel + "<BR>  " + park_call_id + "</td><td><font class=\"log_text\">" + parked_by + "<BR>  " + parked_time + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + park_channel + "');return false;\">AUFLEGEN</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + park_channel + "');return false;\">XFER</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + park_channel + "');return false;\">ABNEHMEN</a></td></tr>"; + park_HTML = park_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + park_channel + "<BR>  " + park_call_id + "</td><td><font class=\"log_text\">" + parked_by + "<BR>  " + parked_time + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + park_channel + "');return false;\">AUFLEGEN</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + park_channel + "');return false;\"VERBINDEN</a></td><td><font class=\"log_text\"><a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + park_channel + "');return false;\">ABNEHMEN</a></td></tr>"; } park_HTML = park_HTML + "</table>"; @@ -1762,7 +1762,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} show_reglink=1; reglink = "<a href=\"#\" onclick=\"conf_register_room('" + head_conf + "');return false;\">Register</a>"; } - var conf_head_HTML = "<font class=\"sh_text\">KONFERENZ " + head_conf + "</b></font><font class=\"sb_text\">    Registriert bei: " + head_reg + "   " + reglink + "         <a href=\"#\" onclick=\"basic_originate_call('" + head_conf + "','NO','NO');return false;\">Konferenz betreten </a><BR><a href=\"#\" onclick=\"check_for_conf_calls('" + head_conf + "','1');return false;\">Aktualisieren </a>     <span id=\"conf_rec_link\"><a href=\"#\" onclick=\"conf_send_recording('MonitorConf','conf_rec_link','" + head_conf + "');return false;\">Aufzeichnung</a></span>         <input TYPE=TEXT SIZE=15 NAME=conf_dtmf STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendConfDTMF(" + head_conf + ");\">Senden Sie DTMF</A>         <input TYPE=TEXT SIZE=15 NAME=conf_dial STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendManualDial('YES'," + head_conf + ");\">Von Konferenz aus wählen</A><BR></font>"; + var conf_head_HTML = "<font class=\"sh_text\">KONFERENZ " + head_conf + "</b></font><font class=\"sb_text\">    Registriert bei: " + head_reg + "   " + reglink + "         <a href=\"#\" onclick=\"basic_originate_call('" + head_conf + "','NO','NO');return false;\">Betrete Konferenz </a><BR><a href=\"#\" onclick=\"check_for_conf_calls('" + head_conf + "','1');return false;\">Aktualisieren </a>     <span id=\"conf_rec_link\"><a href=\"#\" onclick=\"conf_send_recording('MonitorConf','conf_rec_link','" + head_conf + "');return false;\">Aufzeichnung</a></span>         <input TYPE=TEXT SIZE=15 NAME=conf_dtmf STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendConfDTMF(" + head_conf + ");\">Senden Sie DTMF</A>         <input TYPE=TEXT SIZE=15 NAME=conf_dial STYLE=\"font-family : sans-serif; font-size : 10px\"> <A HREF=\"#\" onclick=\"SendManualDial('YES'," + head_conf + ");\">Wählen aus Konferenz</A><BR></font>"; document.getElementById("ConfereNceHeaderContent").innerHTML = conf_head_HTML; check_for_conf_calls(head_conf,taskrefresh); @@ -1823,7 +1823,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var LMAcontent_change=0; var LMAcontent_match=0; var conv_start=-1; - var live_conf_HTML = "<font face=\"Arial,Helvetica\"><B>LIVE ANRUFE IN DIESER KONFERENZ:</B></font><BR><TABLE WIDTH=500><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</TD><TD><font class=\"log_title\">AMTSLEITUNG</TD><TD><font class=\"log_title\">AUFLEGEN</TD><TD><font class=\"log_title\">XFER</TD></TR>"; + var live_conf_HTML = "<font face=\"Arial,Helvetica\"><B>LIVE ANRUFE IN DIESER KONFERENZ:</B></font><BR><TABLE WIDTH=500><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</TD><TD><font class=\"log_title\">ENTFERNTE LEITUNG</TD><TD><font class=\"log_title\">AUFLEGEN</TD><TD><font class=\"log_title\"VERBINDEN</TD></TR>"; if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; @@ -1839,7 +1839,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} {var row_color = '#CCCCFF';} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; - live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">AUFLEGEN</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldA + "');return false;\">XFER</td></tr>"; + live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">AUFLEGEN</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"showMainXfeR('MainXfeRBox','" + channelfieldA + "');return false;\"VERBINDEN</td></tr>"; if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} @@ -2288,7 +2288,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} var VD_favlist_ct_half = parseInt(favlistCT / 2); if (VD_favlist_ct_half < 30) {VD_favlist_ct_half = 30;} var favlist_sec_col = 0; - var favedit_HTML = "<center><table cellpadding=5 cellspacing=5 width=750><tr><td colspan=2 align=center bgcolor=\"#DDDD99\"><B>VORHANDENE ERWEITERUNGEN</B></td><td align=center bgcolor=\"#CCCC99\"><B> FAVORITEN</B></td></tr><tr><td bgcolor=\"#DDDD99\" height=380 width=200 valign=top><font class=\"ss_text\"><span id=FavSelectA>"; + var favedit_HTML = "<center><table cellpadding=5 cellspacing=5 width=750><tr><td colspan=2 align=center bgcolor=\"#DDDD99\"><B>VORHANDENE EXTENSION</B></td><td align=center bgcolor=\"#CCCC99\"><B> FAVORITEN</B></td></tr><tr><td bgcolor=\"#DDDD99\" height=380 width=200 valign=top><font class=\"ss_text\"><span id=FavSelectA>"; loop_ct = 0; while (loop_ct < favlistCT) { @@ -2323,7 +2323,7 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} { if (loop_ct > 0) { - favedit_HTML = favedit_HTML + "<font class=\"sb_text\"><b><a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + " - " + loop_ct + "\" onclick=\"favorites_editor('UP','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/up.gif\" Border=0></a> <a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + " - " + loop_ct + "\" onclick=\"favorites_editor('DOWN','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/down.gif\" Border=0></a> " + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "   <a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "\" onclick=\"favorites_editor('REMOVE','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/remove.gif\" Border=0></a></b></font><BR>"; + favedit_HTML = favedit_HTML + "<font class=\"sb_text\"><b><a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + " - " + loop_ct + "\" onclick=\"favorites_editor('UP','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/up.gif\" RAND=0></a> <a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + " - " + loop_ct + "\" onclick=\"favorites_editor('DOWN','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/down.gif\" RAND=0></a> " + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "   <a href=\"#" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "\" onclick=\"favorites_editor('REMOVE','" + favoritesEDIT[loop_ct] + " - " + favorites_namesEDIT[loop_ct] + "','" + loop_ct + "');return false;\"><img src=\"../agc/images/remove.gif\" RAND=0></a></b></font><BR>"; } loop_ct++; } @@ -2487,13 +2487,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function activeext_order_asc() // changes order of activeext list to ascending { activeext_order="asc"; getactiveext(); - desc_order_HTML ='<a href="#" onclick="activeext_order_desc();return false;">AUFTRAG</a>'; + desc_order_HTML ='<a href="#" onclick="activeext_order_desc();return false;">BESTELLEN</a>'; document.getElementById("activeext_order").innerHTML = desc_order_HTML; } function activeext_order_desc() // changes order of activeext list to descending { activeext_order="desc"; getactiveext(); - asc_order_HTML ='<a href="#" onclick="activeext_order_asc();return false;">AUFTRAG</a>'; + asc_order_HTML ='<a href="#" onclick="activeext_order_asc();return false;">BESTELLEN</a>'; document.getElementById("activeext_order").innerHTML = asc_order_HTML; } @@ -2503,13 +2503,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function busytrunk_order_asc() // changes order of busytrunk list to ascending { busytrunk_order="asc"; getbusytrunk(); - desc_order_HTML ='<a href="#" onclick="busytrunk_order_desc();return false;">AUFTRAG</a>'; + desc_order_HTML ='<a href="#" onclick="busytrunk_order_desc();return false;">BESTELLEN</a>'; document.getElementById("busytrunk_order").innerHTML = desc_order_HTML; } function busytrunk_order_desc() // changes order of busytrunk list to descending { busytrunk_order="desc"; getbusytrunk(); - asc_order_HTML ='<a href="#" onclick="busytrunk_order_asc();return false;">AUFTRAG</a>'; + asc_order_HTML ='<a href="#" onclick="busytrunk_order_asc();return false;">BESTELLEN</a>'; document.getElementById("busytrunk_order").innerHTML = asc_order_HTML; } function busytrunkhangup_force_refresh() // forces immediate refresh of list content @@ -2521,13 +2521,13 @@ if ($enable_fast_refresh < 1) {echo "var refresh_interval = 1000;\n";} function busyext_order_asc() // changes order of busyext list to ascending { busyext_order="asc"; getbusyext(); - desc_order_HTML ='<a href="#" onclick="busyext_order_desc();return false;">AUFTRAG</a>'; + desc_order_HTML ='<a href="#" onclick="busyext_order_desc();return false;">BESTELLEN</a>'; document.getElementById("busyext_order").innerHTML = desc_order_HTML; } function busyext_order_desc() // changes order of busyext list to descending { busyext_order="desc"; getbusyext(); - asc_order_HTML ='<a href="#" onclick="busyext_order_asc();return false;">AUFTRAG</a>'; + asc_order_HTML ='<a href="#" onclick="busyext_order_asc();return false;">BESTELLEN</a>'; document.getElementById("busyext_order").innerHTML = asc_order_HTML; } function busylocalhangup_force_refresh() // forces immediate refresh of list content @@ -2712,18 +2712,18 @@ echo "</head>\n"; <BODY onload="all_refresh();"> <FORM name=extensions_list> <span style="position:absolute;left:0px;top:0px;z-index:1;" id="Header"> -<TABLE Border=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=white WIDTH=640 MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT> +<TABLE RAND=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=white WIDTH=640 MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT> <TR VALIGN=TOP ALIGN=LEFT><TD COLSPAN=5 VALIGN=TOP ALIGN=LEFT> <INPUT TYPE=HIDDEN NAME=extension> <font class="body_text"> -<? echo "Willkommen $LOGfullname, Ihr Telefon: $fullname - $protocol/$extension an $server_ip   <a href=\"#\" onclick=\"LogouT();return false;\">LOGOUT</a><BR>\n"; ?> +<? echo "Willkommen $LOGfullname, Sie sind mit diesem Telefon angemeldet: $fullname - $protocol/$extension an $server_ip   <a href=\"#\" onclick=\"LogouT();return false;\">LOGOUT</a><BR>\n"; ?> </TD></TR> <TR VALIGN=TOP ALIGN=LEFT> -<TD><A HREF="#" onclick="MainPanelToFront();"><IMG SRC="../agc/images/agc_tab_main.gif" ALT="Haupt Bedienfeld" WIDTH=83 HEIGHT=30 Border=0></A></TD> -<TD><A HREF="#" onclick="ActiveLinesPanelToFront();"><IMG SRC="../agc/images/agc_tab_active_lines.gif" ALT="Aktive Leitungen Bedienfeld" WIDTH=139 HEIGHT=30 Border=0></A></TD> -<TD><A HREF="#" onclick="ConfereNcesPanelToFront();"><IMG SRC="../agc/images/agc_tab_conferences.gif" ALT="Konferenz Bedienfeld" WIDTH=139 HEIGHT=30 Border=0></A></TD> -<TD><A HREF="#" onclick="SendCheckVoiceMail();"><IMG SRC="../agc/images/agc_check_voicemail_ON.gif" NAME=voicemail ALT="Checken Sie Ihre Voicemails" WIDTH=170 HEIGHT=30 Border=0></A></TD> -<TD><IMG SRC="../agc/images/agc_live_call_OFF.gif" NAME=livecall ALT="Live Anruf" WIDTH=109 HEIGHT=30 Border=0></TD> +<TD><A HREF="#" onclick="MainPanelToFront();"><IMG SRC="../agc/images/agc_tab_main.gif" ALT="Haupt Bedienfeld" WIDTH=83 HEIGHT=30 RAND=0></A></TD> +<TD><A HREF="#" onclick="ActiveLinesPanelToFront();"><IMG SRC="../agc/images/agc_tab_active_lines.gif" ALT="Aktive Leitungen Bedienfeld" WIDTH=139 HEIGHT=30 RAND=0></A></TD> +<TD><A HREF="#" onclick="ConfereNcesPanelToFront();"><IMG SRC="../agc/images/agc_tab_conferences.gif" ALT="Konferenz Bedienfeld" WIDTH=139 HEIGHT=30 RAND=0></A></TD> +<TD><A HREF="#" onclick="SendCheckVoiceMail();"><IMG SRC="../agc/images/agc_check_voicemail_ON.gif" NAME=voicemail ALT="Voicemail checken" WIDTH=170 HEIGHT=30 RAND=0></A></TD> +<TD><IMG SRC="../agc/images/agc_live_call_OFF.gif" NAME=livecall ALT="Live Anruf" WIDTH=109 HEIGHT=30 RAND=0></TD> </TR></TABLE> </SPAN> @@ -2756,26 +2756,26 @@ echo "</head>\n"; <span style="position:absolute;left:80px;top:12px;z-index:42;" id="MainXfeRBox"> <input type=hidden name=H_XfeR_channel> <input type=hidden name=M_XfeR_channel> - <table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> LIVE ANRUF WEITERLEITEN</b> <BR>Leitung, die übergeben werden soll: <span id="MainXfeRChanneL">Kanal</span><BR></tr> - <tr><td>Erweiterungen:<BR><span id="MainXfeRContent"> Erweiterungen Menü </span></td> + <table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> LIVE ANRUF WEITERLEITEN</b> <BR>Leitung, die verbunden werden soll: <span id="MainXfeRChanneL">Kanal</span><BR></tr> + <tr><td>Erweiterungen:<BR><span id="MainXfeRContent"> Extension Menü </span></td> <td> <BR> - <a href="#" onclick="mainxfer_send_redirect('XfeR');return false;">Senden Sie an ausgewählte Erweiterung</a> <BR><BR> + <a href="#" onclick="mainxfer_send_redirect('XfeR');return false;">Senden Sie an ausgewählte Extension</a> <BR><BR> <a href="#" onclick="mainxfer_send_redirect('VMAIL');return false;">Senden Sie an ausgewählte Voicemalbox</a> <BR><BR> - <a href="#" onclick="mainxfer_send_redirect('ENTRY');return false;">Senden Sie an diese Nummer</a>:<BR><input type=text name=extension_xfer_entry size=20 maxlength=50> <BR><BR> + <a href="#" onclick="mainxfer_send_redirect('ENTRY');return false;">Verbinden mit dieser Nummer</a>:<BR><input type=text name=extension_xfer_entry size=20 maxlength=50> <BR><BR> <a href="#" onclick="getactiveext('MainXfeRBox');return false;">Aktualisieren</a> <BR><BR><BR> <a href="#" onclick="hideMainXfeR('MainXfeRBox');">Zurück zu Hauptfenster</a> <BR><BR> </TD> - <TD>Konferenzen:<BR><font size=1>(Wählen sie eine Konferenznummer, um an diese Konferenz zu senden)<BR><input type=checkbox name=MainXfeRconfXTRA size=1 value="1"> Meine Leitung auch senden<div class="scroll_list" id="MainXfeRconfContent"> Konferenz Menü </div></td></TR></TABLE> + <TD>Konferenzen:<BR><font size=1>(Klicken Sie unten auf eine Nummer, um mit einer Konferenz zu verbinden)<BR><input type=checkbox name=MainXfeRconfXTRA size=1 value="1"> Meinen Kanal auch senden<div class="scroll_list" id="MainXfeRconfContent"> Konferenz Menü </div></td></TR></TABLE> </span> <span style="position:absolute;left:80px;top:12px;z-index:43;" id="LocalDialBox"> - <table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> LOKALER Anruf über Erweiterung</b> <BR>Telefon ruft an von: <span id="LocalDialChanneL">Kanal</span><BR></tr> - <tr><td>Erweiterungen:<BR><span id="LocalDialContent"> Erweiterungen Menü </span></td> + <table border=0 bgcolor="#FFFFCC" width=600 height=500 cellpadding=3><TR><TD COLSPAN=3 ALIGN=CENTER><b> LOKALER Anruf über Extension</b> <BR>Telefon ruft an von: <span id="LocalDialChanneL">Kanal</span><BR></tr> + <tr><td>Erweiterungen:<BR><span id="LocalDialContent"> Extension Menü </span></td> <td> <BR> - <a href="#" onclick="mainxfer_send_originate('DiaL','','');return false;">Ausgewählte Erweiterung für Anruf</a> <BR><BR> - <a href="#" onclick="mainxfer_send_originate('VMAIL');return false;">Ausgewählte Erweiterung für Voicemalbox</a> <BR><BR> + <a href="#" onclick="mainxfer_send_originate('DiaL','','');return false;">Rufe ausgewählte Extension an</a> <BR><BR> + <a href="#" onclick="mainxfer_send_originate('VMAIL');return false;">Rufe ausgewählte Voicemalbox an</a> <BR><BR> <a href="#" onclick="getactiveext('LocalDialBox');return false;">Aktualisieren</a> <BR><BR><BR> <a href="#" onclick="hideLocalDial('LocalDialBox');">Zurück zu Hauptfenster</a> <BR><BR> </TD> @@ -2796,13 +2796,13 @@ echo "</head>\n"; <tr><td><span id="busycallsdebug"></span></td></tr> <tr><td align=center><font face="Arial,Helvetica"><B>VOICEMAIL     </B></font> NEU: <span id="new_vmail_span"></span>     ALT: <span id="old_vmail_span"></span>             <font face="Arial,Helvetica"><B>MANUELLER ANRUF       </B></font><input TYPE=TEXT SIZE=20 NAME=manual_dial STYLE="font-family : sans-serif; font-size : 10px"> <A HREF="#" onclick="SendManualDial();">WÄHLEN</A></td></tr> -<tr><td align=center><a href="#" onclick="showParkDisplay('ParkDisplayBox');return false;"><font face="Arial,Helvetica"><B>GEPARKTE ANRUFE</B></a>: <span id="parked_calls_count">0</span>                <a href="#" onclick="showLocalDial('LocalDialBox');return false;"><font face="Arial,Helvetica"><B>LOKALE ANRUF ERWEITERUNG</a></td></tr> +<tr><td align=center><a href="#" onclick="showParkDisplay('ParkDisplayBox');return false;"><font face="Arial,Helvetica"><B>GEPARKTE ANRUFE</B></a>: <span id="parked_calls_count">0</span>                <a href="#" onclick="showLocalDial('LocalDialBox');return false;"><font face="Arial,Helvetica"><B>LOKALE ANRUF EXTENSIONS</a></td></tr> <tr><td align=center><font face="Arial,Helvetica"><B>OUTBOUND ANRUFE:</B></font></td></tr> <tr><td align=center><div class="scroll_log" id="outboundcallsspan"></div></td></tr> <tr><td align=center><font face="Arial,Helvetica"><B>INBOUND ANRUFE:</B></font></td></tr> <tr><td align=center><div class="scroll_log" id="inboundcallsspan"></div></td></tr> -<tr><td align=left><font face="Arial,Helvetica" size=1>astGUIclient Web-Client VERSION:<? echo $version ?> BAU:<? echo $build ?></font></td></tr> +<tr><td align=left><font face="Arial,Helvetica" size=1>astGUIclient Web-Client VERSION:<? echo $version ?> BUILD:<? echo $build ?></font></td></tr> </TABLE> <span style="position:absolute;left:640px;top:0px;z-index:33;" id="FavoriteSBox"> @@ -2842,17 +2842,17 @@ echo "</head>\n"; </td></tr> <tr><td>Aktive Erweiterung <BR> <a href="#" onclick="activeext_force_refresh();return false;">AKTUALISIEREN</a> | -<span id="activeext_order"><a href="#" onclick="activeext_order_desc();return false;">AUFTRAG</a> | </span> +<span id="activeext_order"><a href="#" onclick="activeext_order_desc();return false;">BESTELLEN</a> | </span> </td> <td>Amtsleitungen <BR> <a href="#" onclick="busytrunk_force_refresh();return false;">AKTUALISIEREN</a> | -<span id="busytrunk_order"><a href="#" onclick="busytrunk_order_desc();return false;">AUFTRAG</a> | </span> +<span id="busytrunk_order"><a href="#" onclick="busytrunk_order_desc();return false;">BESTELLEN</a> | </span> </td> <td>Lokale Erweiterungen <BR> <a href="#" onclick="busyext_force_refresh();return false;">AKTUALISIEREN</a> | -<span id="busyext_order"><a href="#" onclick="busyext_order_desc();return false;">AUFTRAG</a> | </span> +<span id="busyext_order"><a href="#" onclick="busyext_order_desc();return false;">BESTELLEN</a> | </span> </td></tr> <tr><td VALIGN=TOP> diff --git a/LANG_www/agc_de/call_log_display.php b/LANG_www/agc_de/call_log_display.php index 9150b85e..42b10ec2 100644 --- a/LANG_www/agc_de/call_log_display.php +++ b/LANG_www/agc_de/call_log_display.php @@ -107,8 +107,8 @@ if ($format=='debug') { echo "<html>\n"; echo "<head>\n"; -echo "<!-- VERSION: $version BAU: $build EXTEN: $exten server_ip: $server_ip-->\n"; -echo "<title>Anruf Log"; +echo "<!-- VERSION: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n"; +echo "<title>Anruf Log Anzeige"; echo "\n"; echo "\n"; echo "\n"; diff --git a/LANG_www/agc_de/conf_exten_check.php b/LANG_www/agc_de/conf_exten_check.php index ba8ee0c9..f6d2cb2b 100644 --- a/LANG_www/agc_de/conf_exten_check.php +++ b/LANG_www/agc_de/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -122,7 +123,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Konferenz Erweiterung überprüfen"; echo "\n"; echo "\n"; @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_de/inbound_popup.php b/LANG_www/agc_de/inbound_popup.php index 5f95f6a1..1d84f761 100644 --- a/LANG_www/agc_de/inbound_popup.php +++ b/LANG_www/agc_de/inbound_popup.php @@ -124,7 +124,7 @@ while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; ?> + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Deutsch
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; @@ -337,7 +460,7 @@ echo ""; echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "
Re-Login
 
Kampagne: $camp_form_code

VERSION: $version       BAU: $build

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -355,13 +478,13 @@ if ($user_login_first == 1) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; echo "

Benutzer Login

"; echo ""; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -370,9 +493,10 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
Kampagne Login
 
Benutzer Passwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -397,10 +521,10 @@ echo "
English Deutsch
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -413,9 +537,10 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
Login
 
Benutzer Passwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -434,10 +559,10 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Deutsch
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; -echo ""; +echo ""; echo ""; echo "\n"; echo "\n"; @@ -445,8 +570,9 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; echo "
Telefon Login
 
Telefon Login:
Telefon Passwort:

VERSION: $version       BAU: $build
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "VICIWÄHLEN web client: VICIWÄHLEN Kampagne Login\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Login: \n
"; echo "Passwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; + echo "Kampagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_Sekunden = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_Sekunden = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,13 +904,13 @@ echo "\n"; echo "\n"; echo "English \n";echo "Deutsch \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; echo ""; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -762,9 +919,10 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "
Kampagne Login
 
Benutzer Passwort:
Kampagne: $camp_form_code

VERSION: $version       BAU: $build
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -787,13 +945,13 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Deutsch
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "


"; - echo ""; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -802,7 +960,7 @@ echo ""; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "
Login Error
 
Ihr Telefon Login ist nicht aktiv, bitte versuchen sie es noch einmal:
 
Telefon Passwort:

VERSION: $version       BAU: $build

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; echo "\n\n"; @@ -910,12 +1068,12 @@ else if (strlen($web_form_address)>0) { $VICIDiaL_web_form_address = "$web_form_address"; - print "\n"; + print "\n"; } else { $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; + print "\n"; $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); } @@ -925,12 +1083,12 @@ else if ($allow_closers=="Y") { $VICIDiaL_allow_closers = 1; - print "\n"; + print "\n"; } else { $VICIDiaL_allow_closers = 0; - print "\n"; + print "\n"; } @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1018,7 +1176,14 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; + + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; # print "You have logged in as user: $VD_login an phone: $SIP_user zur Kampagne: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1068,15 +1233,39 @@ else if ($auto_dial_level > 0) { - print "\n"; + print "\n"; + ##### grab the campaign_weight and number of calls today an that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($enable_queuemetrics_logging > 0) { @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1116,7 +1305,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); - print "\n"; + print "\n"; if ($enable_queuemetrics_logging > 0) { @@ -1157,8 +1346,9 @@ echo "\n"; echo "Login: \n
"; echo "Passwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; + echo "Kampagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Login: \n
"; echo "Passwort:
\n"; - echo "Kampagne: $camp_form_code
\n"; - echo "\n"; + echo "Kampagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,17 +1812,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; - var DiaLControl_auto_HTML = "\"Pause\"
\"Zusammenfassung\""; - var DiaLControl_auto_HTML_ready = "\"Pause\"\"Zusammenfassung\""; - var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Zusammenfassung\""; + var HidEMonitoRSessionS = ''; + var DiaLControl_auto_HTML = "\"Pause\"\"WiederAufnehmen\""; + var DiaLControl_auto_HTML_ready = "\"Pause\"\"WiederAufnehmen\""; + var DiaLControl_auto_HTML_OFF = "\"Pause\"\"WiederAufnehmen\""; var DiaLControl_manual_HTML = "\"Nächste"; var image_blank = new Image(); image_blank.src="../agc/images/blank.gif"; @@ -1763,11 +1974,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (taskdirection=='MUTING') { - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } else { - document.getElementById("AgentMuteSpan").innerHTML = ""; + document.getElementById("AgentMuteSpan").innerHTML = ""; } } @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "LIVE ANRUFE IN DIESER KONFERENZ:
"; - var live_conf_HTML = "LIVE ANRUFE IN IHRER SESSION:
#AMTSLEITUNGAUFLEGENXFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "LIVE ANRUFE IN IHRER SESSION:
#AMTSLEITUNGAUFLEGENVOLUMEN
" + loop_ct + "" + channelfieldA + "AUFLEGEN
" + loop_ct + "" + channelfieldA + "AUFLEGEN          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#ENTFERNTE LEITUNGAUFLEGENLAUTSTÄRKE
" + loop_ct + "" + channelfieldA + "AUFLEGEN
" + loop_ct + "" + channelfieldA + "AUFLEGEN          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2260,7 +2493,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // filename = filedate + "_" + user_abb; var query_recording_exten = recording_exten; var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context; - var conf_rec_start_html = "\"Stoppe"; + var conf_rec_start_html = "\"Stope"; if (campaign_recording == 'ALLFORCE') { @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2543,7 +2776,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { reselect_alt_dial = 1; alt_dial_active = 1; - var man_status = "Wähle alternative Telefonnummer: HAUPT TELEFONNUMMER or ALTERNATIVES TELEFON or ADRESSE3 or ADRESSE ENDE"; + var man_status = "Wähle alternative Telefonnummer: TELEFONNUMMER or ALTERNATIVE TELEFONNUMMER or ADRESSE3 or ADRESSE BEENDEN"; document.getElementById("MainStatuSSpan").innerHTML = man_status; } } @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2666,7 +2899,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBcounT = xmlhttp.responseText; if (CBcounT == 0) {var CBprint = "NO";} else {var CBprint = CBcounT;} - document.getElementById("CBstatusSpan").innerHTML ="" + CBprint + " AKTIVE RÜCKRUFE"; + document.getElementById("CBstatusSpan").innerHTML ="" + CBprint + " AKTIVE WIEDERVORLAGEN"; } } @@ -2681,7 +2914,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("SIE MÜSSEN IM PAUSE MODUS SEIN, UM DIE RÜCKRUFLISTE IM AUTOMATISCHEM WÄHLMODUS EINZUSEHEN"); + alert("SIE MÜSSEN IM PAUSE MODUS SEIN, UM DIE WIEDERVORLAGEN IM AUTOMATISCHEM WÄHLMODUS EINZUSEHEN"); } else { @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2723,7 +2956,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = "" + var CB_HTML = "
# ANRUFBACK DATE/TIMENUMMERNAMESTATUSCAMPAIGNLAST ANRUF DATUM/ZEIT COMMENTS
" while (loop_ct < CB_calls) { loop_ct++; @@ -2849,7 +3082,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) ) { - alert("YOU MUST ENTER A PHONE NUMMER AND WÄHLEN CODE TO USE FAST WÄHLEN"); + alert("SIE MÜSSEN Eine TELEFONNUMMER UND Einen VORWAHLKNOPF-CODE EINGEBEN,UM SCHNELLEN VORWAHLKNOPF ZU BENUTZEN"); } else { @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + lead_dial_number + " UID: " + CIDcheck + "   Warte auf Freizeichen... " + MD_ring_secondS + " Sekunden"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + CIDcheck + "   Warte auf Freizeichen... " + MD_ring_secondS + " Sekunden"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Angerufen: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Angerufen: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Parke"; @@ -2991,16 +3230,14 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; - - document.getElementById("InternalCloser").innerHTML = "\"INTERNER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; // INSERT VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIWÄHLEN_web_QUERY_STRING =~ s/ /+/gi; @@ -3194,10 +3435,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS ANRUFBACK "; document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Letzter Anruf: " + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rückruf: " + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Anmerkungen:
" + CBcomments; + document.getElementById("CBcommentsBoxA").innerHTML = "Letzter Anruf:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Wiedervorlage:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Anmerkungen:
" + CBcomments; showDiv('CBcommentsBox'); } @@ -3207,7 +3448,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {web_form_vars = '?' + web_form_vars} - document.getElementById("WebFormSpan").innerHTML = "\"Web-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; if (document.vicidial_form.LeadPreview.checked==false) { @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + manDiaLonly_num + " UID: " + MDnextCID + "   Warte auf Freizeichen..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Telefonierend: " + status_display_number + " UID: " + MDnextCID + "   Warte auf Freizeichen..."; document.getElementById("HangupControl").innerHTML = "\"Kunden"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS ANRUFBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Letzter Anruf: " + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rückruf: " + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Anmerkungen:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIWÄHLEN_LOG ENTRY FOR THIS ANRUF PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS ANRUFBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Letzter Anruf:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Wiedervorlage:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Anmerkungen:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Eingehend: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Parke"; + + document.getElementById("HangupControl").innerHTML = "\"Kunden"; + + document.getElementById("XferControl").innerHTML = "\"Transfer"; + + document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Parke"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Kunden"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transfer"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"INTERNER"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web-Form\"\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3939,11 +4196,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (taskrefresh == 'OUT') { - document.getElementById("WebFormSpan").innerHTML = "\"Web-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } else { - document.getElementById("WebFormSpan").innerHTML = "\"Web-Form\"\n"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; } } @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4120,16 +4376,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} lastcustserverip=''; if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;} - document.getElementById("WebFormSpan").innerHTML = "\"Web-Form\""; + document.getElementById("WebFormSpan").innerHTML = "\"Web"; document.getElementById("ParkControl").innerHTML = "\"Parke"; document.getElementById("HangupControl").innerHTML = "\"Kunden"; document.getElementById("XferControl").innerHTML = "\"Transfer"; - document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNER"; + document.getElementById("LocalCloser").innerHTML = "\"LOKALER"; document.getElementById("DialBlindTransfer").innerHTML = "\"Wähle"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; document.vicidial_form.custdatetime.value = ''; @@ -4444,7 +4699,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) ) { - alert("YOU MUST BE PAUSED TO ENTER A PAUSE CODE IN AUTO-WÄHLEN MODE"); + alert("SIE MÜSSEN PAUSIERT WERDEN, UM Einen PAUSE CODE Im AUTO-WÄHLEN MODUSEINZUGEBEN"); } else { @@ -4473,7 +4728,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var DispoChoice = document.vicidial_form.DispoSelection.value; - if (DispoChoice.length < 1) {alert("Sie müssen eine Anordnung wählen");} + if (DispoChoice.length < 1) {alert("Sie müssen ein Gesprächsergebnis wählen");} else { document.getElementById("CusTInfOSpaN").innerHTML = ""; @@ -4497,7 +4752,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var DispoChoice = document.vicidial_form.DispoSelection.value; - if (DispoChoice.length < 1) {alert("Sie müssen eine Anordnung wählen");} + if (DispoChoice.length < 1) {alert("Sie müssen ein Gesprächsergebnis wählen");} else { document.getElementById("CusTInfOSpaN").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Zeigen message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,17 +5191,29 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() { if (MD_channel_look==1) - {alert("Sie können sich nicht während eines Anrufs abmelden. \nWarten Sie 50 Sekunden bis der Anruf beantwortet wird, oder fehlschlägt");} + {alert("Sie können sich nicht während eines Anrufs abmelden. \nWarten Sie 50 Sekunden bis der Anruf beantwortet wird oder fehlschlägt");} else { if (VD_live_customer_call==1) { - alert("NOCH Ein LIVE ANRUF! Beenden Sie ihn, dann können Sie sich abmelden.\n" + VD_live_customer_call); + alert("NOCH EIN LIVE ANRUF! Beenden Sie ihn, dann können Sie sich abmelden.\n" + VD_live_customer_call); } else { @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars an customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Sie müssen ein Datum wählen");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Wählen Sie unten ein Datum"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Wählen Sie unten ein Datum"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5411,11 +5784,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (agent_pause_codes_active=='Y') { - document.getElementById("PauseCodeLinkSpan").innerHTML = "ENTER A PAUSE CODE"; + document.getElementById("PauseCodeLinkSpan").innerHTML = "GEBEN Sie Einen PAUSE CODE Ein"; } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5685,13 +6058,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function activeext_order_asc() // changes order of activeext list to ascending { activeext_order="asc"; getactiveext(); - desc_order_HTML ='AUFTRAG'; + desc_order_HTML ='BESTELLEN'; document.getElementById("activeext_order").innerHTML = desc_order_HTML; } function activeext_order_desc() // changes order of activeext list to descending { activeext_order="desc"; getactiveext(); - asc_order_HTML ='AUFTRAG'; + asc_order_HTML ='BESTELLEN'; document.getElementById("activeext_order").innerHTML = asc_order_HTML; } @@ -5701,13 +6074,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function busytrunk_order_asc() // changes order of busytrunk list to ascending { busytrunk_order="asc"; getbusytrunk(); - desc_order_HTML ='AUFTRAG'; + desc_order_HTML ='BESTELLEN'; document.getElementById("busytrunk_order").innerHTML = desc_order_HTML; } function busytrunk_order_desc() // changes order of busytrunk list to descending { busytrunk_order="desc"; getbusytrunk(); - asc_order_HTML ='AUFTRAG'; + asc_order_HTML ='BESTELLEN'; document.getElementById("busytrunk_order").innerHTML = asc_order_HTML; } function busytrunkhangup_force_refresh() // forces immediate refresh of list content @@ -5719,13 +6092,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function busyext_order_asc() // changes order of busyext list to ascending { busyext_order="asc"; getbusyext(); - desc_order_HTML ='AUFTRAG'; + desc_order_HTML ='BESTELLEN'; document.getElementById("busyext_order").innerHTML = desc_order_HTML; } function busyext_order_desc() // changes order of busyext list to descending { busyext_order="desc"; getbusyext(); - asc_order_HTML ='AUFTRAG'; + asc_order_HTML ='BESTELLEN'; document.getElementById("busyext_order").innerHTML = asc_order_HTML; } function busylocalhangup_force_refresh() // forces immediate refresh of list content @@ -5756,12 +6129,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById(divvar).innerHTML = ''; if (divvar == 'DiaLLeaDPrevieW') { - var buildDivHTML = " PREVIEW ADRESSE
"; + var buildDivHTML = " ADRESSEN VORSCHAU
"; document.getElementById("DiaLLeaDPrevieWHide").innerHTML = buildDivHTML; } if (divvar == 'DiaLDiaLAltPhonE') { - var buildDivHTML = " ALTERNATIVE TELEFONNUMMER
"; + var buildDivHTML = " ALTERNATIVE TELEFONNUMMER WÄHLEN
"; document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML; } } @@ -5774,7 +6147,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (divvar == 'DiaLLeaDPrevieW') { document.getElementById("DiaLLeaDPrevieWHide").innerHTML = ''; - var buildDivHTML = " PREVIEW ADRESSE
"; + var buildDivHTML = " ADRESSEN VORSCHAU
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_preview_dial==1) {document.vicidial_form.LeadPreview.checked=true} @@ -5782,7 +6155,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (divvar == 'DiaLDiaLAltPhonE') { document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = ''; - var buildDivHTML = " ALTERNATIVE TELEFONNUMMER
"; + var buildDivHTML = " ALTERNATIVE TELEFONNUMMER WÄHLEN
"; document.getElementById(divvar).innerHTML = buildDivHTML; if (reselect_alt_dial==1) {document.vicidial_form.DiaLAltPhonE.checked=true} @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Konferenz Informationen zeigen"; + document.getElementById("busycallsdisplay").innerHTML = "Konferenz Informationen zeigen

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5821,7 +6194,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { hideDiv('HotKeyEntriesBox'); hot_keys_active = 0; - document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; + document.getElementById("hotkeysdisplay").innerHTML = "\"TASTATURKÜRZEL"; } } @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transfer"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} -
# ANRUFBACK DATE/TIMENUMMERNAMESTATUSCAMPAIGNLAST ANRUF DATUM\/ZEIT COMMENTS
+
id="MainTable"> - - + @@ -6321,16 +6738,16 @@ Aufzeichnugs ID:
- + - + - + + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUS:
Nächste Nummer wählen
- PREVIEW ADRESSE
- ALTERNATIVE TELEFONNUMMER
+ ADRESSEN VORSCHAU
+ ALTERNATIVE TELEFONNUMMER WÄHLEN
@@ -6281,7 +6698,7 @@ Aufzeichnugs ID:
Starte Aufnahme

-Web-Form
+Web Formular

Parke Anruf
Transfer - Konferenz
@@ -6292,7 +6709,7 @@ Aufzeichnugs ID:
+ align=left valign=top> @@ -6310,7 +6727,7 @@ Aufzeichnugs ID:
Kunden Information:
Titel:   Zuerst:   MI:  Letzte:   Vorname:   MI:  Nachname:
Adresse1: Stadt:   Bundesland:   Postleitzahl:
Provinz: Region:   Anbieter ID:
Telefon:   WahlCode:   Alternative Telefonnummer:   Vorwahl:   Alternative Telefonnummer:
Zeigen:   Email:
Anmerkungen: Anmerkungen:
> + 


  + 
- - - - -
VICIWÄHLEN Web-Client Version:     BAU:               Server:              
-Konferenz Informationen zeigen
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TASTATURKÜRZEL UNAKTIVIERT - -
- - - -
diff --git a/LANG_www/agc_de/voicemail_check.php b/LANG_www/agc_de/voicemail_check.php index 974475d0..6ddcee43 100644 --- a/LANG_www/agc_de/voicemail_check.php +++ b/LANG_www/agc_de/voicemail_check.php @@ -95,7 +95,7 @@ if ($format=='debug') { echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "Voicemail Check"; echo "\n"; echo "\n"; diff --git a/LANG_www/agc_el/conf_exten_check.php b/LANG_www/agc_el/conf_exten_check.php index 7ecdb8e9..9d5a9c1f 100644 --- a/LANG_www/agc_el/conf_exten_check.php +++ b/LANG_www/agc_el/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Κατάσταση: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Κατάσταση: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_el/manager_send.php b/LANG_www/agc_el/manager_send.php index 6e0cb014..a66018c8 100644 --- a/LANG_www/agc_el/manager_send.php +++ b/LANG_www/agc_el/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_el/vdc_db_query.php b/LANG_www/agc_el/vdc_db_query.php index 337b396b..d39f9fad 100644 --- a/LANG_www/agc_el/vdc_db_query.php +++ b/LANG_www/agc_el/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Ακυρο Όνομα χρήστη/Κωδικός πρόσβασης: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Ακυρο session_name: |$session_name|$server_ip|\n"; + echo "Ακυρο server_ip: |$server_ip| or Ακυρο session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Ακυρο session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Επιλογή ομάδας $closer_choice έχει καταχωρηθεί στο χρήστη $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send στο to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Παύση Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_el/vicidial.php b/LANG_www/agc_el/vicidial.php index 0e7f5366..4d71a6d7 100644 --- a/LANG_www/agc_el/vicidial.php +++ b/LANG_www/agc_el/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST στο server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a ΚΛΗΣΗ link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Ελληνικά
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code
$camp_form_code
  \n"; + echo "

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Ελληνικά \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Κωδικός πρόσβασης χρήστη:
Εκστρατεία: $camp_form_code
$camp_form_code
  \n"; + echo "

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Ελληνικά
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Σύνδεση Τηλεφώνου:
Κωδικός πρόσβασης Τηλεφώνου:
  \n"; +echo "

ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "χειριστής VICIΚΛΗΣΗ: VICIΚΛΗΣΗ Σύνδεση εκστρατείας\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Σύνδεση: \n
"; echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; + echo "Εκστρατεία: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_δευτερόλεπτα = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_δευτερόλεπτα = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Ελληνικά \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Κωδικός πρόσβασης χρήστη: "; echo "\n"; echo "Εκστρατεία: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
ΕΚΔΟΣΗ: $version       ΔΗΜΙΟΥΡΓΙΑ: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Ελληνικά
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login στο phone: $SIP_user στην εκστρατεία: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today στο that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Σύνδεση: \n
"; echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; + echo "Εκστρατεία: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Σύνδεση: \n
"; echo "Κωδικός πρόσβασης:
\n"; - echo "Εκστρατεία: $camp_form_code
\n"; - echo "\n"; + echo "Εκστρατεία: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Παύση\"
\"Επανάληψη\""; var DiaLControl_auto_HTML_ready = "\"Παύση\"\"Επανάληψη\""; var DiaLControl_auto_HTML_OFF = "\"Παύση\"\"Επανάληψη\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Κατάσταση: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentΚατάστασηΚατάσταση").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentΚατάστασηCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΕ ΑΥΤΗΝ ΤΗΝ ΔΙΑΣΚΕΨΗ:
"; - var live_conf_HTML = "ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΤΗ ΣΥΝΟΔΟ ΣΑΣ:
#ΑΠΟΜΑΚΡΟ ΚΑΝΑΛΙΚΛΕΙΣΙΜΟXFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentΚατάστασηΚατάσταση").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentΚατάστασηCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Κατάσταση: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "ΕΝΕΡΓΕΣ ΚΛΗΣΕΙΣ ΣΤΗ ΣΥΝΟΔΟ ΣΑΣ:
#ΑΠΟΜΑΚΡΟ ΚΑΝΑΛΙΚΛΕΙΣΙΜΟΟΓΚΟΣ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#ΑΠΟΜΑΚΡΟ ΚΑΝΑΛΙΚΛΕΙΣΙΜΟΟΓΚΟΣ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ
" + loop_ct + "" + channelfieldA + "ΚΛΕΙΣΙΜΟ          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + lead_dial_number + " UID: " + CIDcheck + "   Αναμονή για κουδούνισμα... " + MD_ring_secondS + " δευτερόλεπτα"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + CIDcheck + "   Αναμονή για κουδούνισμα... " + MD_ring_secondS + " δευτερόλεπτα"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Αποκαλούμενος: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Αποκαλούμενος: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Στάθμευση"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"ΤΟΠΙΚΟΣ"; - document.getElementById("InternalCloser").innerHTML = "\"ΕΣΩΤΕΡΙΚΟΣ"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Τυφλή"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIΚΛΗΣΗ_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + manDiaLonly_num + " UID: " + MDnextCID + "   Αναμονή για κουδούνισμα..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Σε Κλήση: " + status_display_number + " UID: " + MDnextCID + "   Αναμονή για κουδούνισμα..."; document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIΚΛΗΣΗ_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS ΚΛΗΣΗBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Στο τέλος καλέστε:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "CallBack:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Πράκτορας:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Σχολιάζει:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIΚΛΗΣΗ_LOG ENTRY FOR THIS ΚΛΗΣΗ PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS ΚΛΗΣΗBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Στο τέλος καλέστε:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "CallBack:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Πράκτορας:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Σχολιάζει:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Εισερχόμενο: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Στάθμευση"; + + document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; + + document.getElementById("XferControl").innerHTML = "\"Μεταφορά"; + + document.getElementById("LocalCloser").innerHTML = "\"ΤΟΠΙΚΟΣ"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Τυφλή"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Στάθμευση"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Μεταφορά"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"ΤΟΠΙΚΟΣ"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"ΕΣΩΤΕΡΙΚΟΣ"; + document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Τυφλή"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Σελίδα\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Κλείσιμο"; document.getElementById("XferControl").innerHTML = "\"Μεταφορά"; document.getElementById("LocalCloser").innerHTML = "\"ΤΟΠΙΚΟΣ"; - document.getElementById("InternalCloser").innerHTML = "\"ΕΣΩΤΕΡΙΚΟΣ"; document.getElementById("DialBlindTransfer").innerHTML = "\"Τυφλή"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Παρουσίαση message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE ΑΠΟΣΥΝΔΕΣΗ LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars στο customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Πρέπει να επιλέξετε μια ημερομηνία");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Επιλέξτε μια ημερομηνία κατωτέρω"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Επιλέξτε μια ημερομηνία κατωτέρω"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης"; + document.getElementById("busycallsdisplay").innerHTML = "Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Μεταφορά"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
ΚΑΤΑΣΤΑΣΗ:
@@ -6292,7 +6709,7 @@ if ( ($alt_phone_dialing) and ($auto_dial_level==0) ) + align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
Έκδοση VICIΚΛΗΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:               Κεντρικός υπολογιστής:              
-Παρουσίαση πληροφοριών κλήσης καναλιού διασκέψης
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -ΠΛΗΚΤΡΑ ΚΛΕΙΔΙΑ ΑΝΕΝΕΡΓΑ - -
- - - -
diff --git a/LANG_www/agc_en/conf_exten_check.php b/LANG_www/agc_en/conf_exten_check.php index ea527e43..ae3b84b5 100644 --- a/LANG_www/agc_en/conf_exten_check.php +++ b/LANG_www/agc_en/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_en/manager_send.php b/LANG_www/agc_en/manager_send.php index a82cc03f..94eff7b6 100644 --- a/LANG_www/agc_en/manager_send.php +++ b/LANG_www/agc_en/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_en/vdc_db_query.php b/LANG_www/agc_en/vdc_db_query.php index 7d75cb1a..129af642 100644 --- a/LANG_www/agc_en/vdc_db_query.php +++ b/LANG_www/agc_en/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalid Username/Password: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Invalid Username/Password: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalid session_name: |$session_name|$server_ip|\n"; + echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Invalid session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Group Choice $closer_choice has been registered to user $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send on to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pause Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_en/vicidial.php b/LANG_www/agc_en/vicidial.php index 3a307784..21a2c4e6 100644 --- a/LANG_www/agc_en/vicidial.php +++ b/LANG_www/agc_en/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST on server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
User Password:
Campaign: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Español \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
User Password:
Campaign: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Phone Login:
Phone Password:
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_seconds = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_seconds = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Español \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "User Password: "; echo "\n"; echo "Campaign: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSION: $version       BUILD: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today on that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Login: \n
"; echo "Password:
\n"; - echo "Campaign: $camp_form_code
\n"; - echo "\n"; + echo "Campaign: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pause\"
\"Resume\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Resume\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "LIVE CALLS IN THIS CONFERENCE:
"; - var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
#REMOTE CHANNELHANGUPXFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "LIVE CALLS IN YOUR SESSION:
#REMOTE CHANNELHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#REMOTE CHANNELHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + lead_dial_number + " UID: " + CIDcheck + "   Waiting for Ring... " + MD_ring_secondS + " seconds"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + CIDcheck + "   Waiting for Ring... " + MD_ring_secondS + " seconds"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Called: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Called: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Park"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + manDiaLonly_num + " UID: " + MDnextCID + "   Waiting for Ring..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Calling: " + status_display_number + " UID: " + MDnextCID + "   Waiting for Ring..."; document.getElementById("HangupControl").innerHTML = "\"Hangup"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Last Call: " + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comments:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIDIAL_LOG ENTRY FOR THIS CALL PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CALLBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Last Call: " + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comments:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Incoming: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Park"; + + document.getElementById("HangupControl").innerHTML = "\"Hangup"; + + document.getElementById("XferControl").innerHTML = "\"Transfer"; + + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Park"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Hangup"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transfer"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Hangup"; document.getElementById("XferControl").innerHTML = "\"Transfer"; document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNAL"; document.getElementById("DialBlindTransfer").innerHTML = "\"Dial"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Show message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars on customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("You must choose a date");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Select a Date Below"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Select a Date Below"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Show conference call channel information"; + document.getElementById("busycallsdisplay").innerHTML = "Show conference call channel information

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transfer"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUS:
@@ -6292,7 +6709,7 @@ RECORD ID:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
VICIDIAL web-client version:     BUILD:               Server:              
-Show conference call channel information
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -HOT KEYS INACTIVE - -
- - - -
diff --git a/LANG_www/agc_es/conf_exten_check.php b/LANG_www/agc_es/conf_exten_check.php index de75d295..e7fdc4ad 100644 --- a/LANG_www/agc_es/conf_exten_check.php +++ b/LANG_www/agc_es/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Estado: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_es/manager_send.php b/LANG_www/agc_es/manager_send.php index e28853d3..e56b8680 100644 --- a/LANG_www/agc_es/manager_send.php +++ b/LANG_www/agc_es/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_es/vdc_db_query.php b/LANG_www/agc_es/vdc_db_query.php index 62acf94f..a0cba6aa 100644 --- a/LANG_www/agc_es/vdc_db_query.php +++ b/LANG_www/agc_es/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido session_name: |$session_name|$server_ip|\n"; + echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Inválido session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Opción Del Grupo $closer_choice se ha registrado al usuario $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pausa Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_es/vicidial.php b/LANG_www/agc_es/vicidial.php index 177c376d..b7272b81 100644 --- a/LANG_www/agc_es/vicidial.php +++ b/LANG_www/agc_es/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST en server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a DIAL link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Contraseña Del Usuario:
Campaña: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Español \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Contraseña Del Usuario:
Campaña: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Español
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Conexión Del Teléfono:
Contraseña Del Teléfono:
  \n"; +echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "web client VICIDIAL: VICIDIAL Conexión en la Campaña\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Conexión: \n
"; echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; + echo "Campaña: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_segundos = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_segundos = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Español \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Contraseña Del Usuario: "; echo "\n"; echo "Campaña: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSIÓN: $version       CONSTRUCCION: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login en phone: $SIP_user a la campaña: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today en that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Conexión: \n
"; echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; + echo "Campaña: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Conexión: \n
"; echo "Contraseña:
\n"; - echo "Campaña: $camp_form_code
\n"; - echo "\n"; + echo "Campaña: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pausa\"
\"Comienzo\""; var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Comienzo\""; var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Comienzo\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Estado: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentEstadoEstado").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentEstadoCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "LLAMADAS ACTIVAS EN ESTA CONFERENCIA:
"; - var live_conf_HTML = "LLAMADAS ACTIVAS EN SU SESIÓN:
#CANAL REMOTOCOLGARTRANSFERENCIA
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentEstadoEstado").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentEstadoCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Estado: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "LLAMADAS ACTIVAS EN SU SESIÓN:
#CANAL REMOTOCOLGARVOLUMEN
" + loop_ct + "" + channelfieldA + "COLGAR
" + loop_ct + "" + channelfieldA + "COLGAR          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#CANAL REMOTOCOLGARVOLUMEN
" + loop_ct + "" + channelfieldA + "COLGAR
" + loop_ct + "" + channelfieldA + "COLGAR          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + lead_dial_number + " UID: " + CIDcheck + "   Espeerar al Ring... " + MD_ring_secondS + " segundos"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + CIDcheck + "   Espeerar al Ring... " + MD_ring_secondS + " segundos"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Llamado: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Llamado: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Aparcar"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Marcar"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIDIAL_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + manDiaLonly_num + " UID: " + MDnextCID + "   Espeerar al Ring..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + "   Espeerar al Ring..."; document.getElementById("HangupControl").innerHTML = "\"Colgar"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS LLAMADABACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Llamada Pasada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Servicio repetido:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comentarios:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS LLAMADABACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Llamada Pasada:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Servicio repetido:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comentarios:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Aparcar"; + + document.getElementById("HangupControl").innerHTML = "\"Colgar"; + + document.getElementById("XferControl").innerHTML = "\"Transferencia"; + + document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Marcar"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Aparcar"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Colgar"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transferencia"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Marcar"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Colgar"; document.getElementById("XferControl").innerHTML = "\"Transferencia"; document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; document.getElementById("DialBlindTransfer").innerHTML = "\"Marcar"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Demostración message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE SALIR LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars en customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Usted debe elegir una fecha");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Seleccione una fecha abajo"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Seleccione una fecha abajo"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Mostrar la información del canal Conferencia"; + document.getElementById("busycallsdisplay").innerHTML = "Mostrar la información del canal Conferencia

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transferencia"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
ESTADO:
@@ -6292,7 +6709,7 @@ GRABACIÓN ID:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
versión web client VICIDIAL:     CONSTRUCCION:               Servidor:              
-Mostrar la información del canal Conferencia
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TECLAS ACCESO RÁPIDO INACTIVAS - -
- - - -
diff --git a/LANG_www/agc_fr/conf_exten_check.php b/LANG_www/agc_fr/conf_exten_check.php index cce00698..415c0e14 100644 --- a/LANG_www/agc_fr/conf_exten_check.php +++ b/LANG_www/agc_fr/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Statut: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Statut: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_fr/manager_send.php b/LANG_www/agc_fr/manager_send.php index ef7c84b0..e0d38628 100644 --- a/LANG_www/agc_fr/manager_send.php +++ b/LANG_www/agc_fr/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_fr/vdc_db_query.php b/LANG_www/agc_fr/vdc_db_query.php index efb05a18..b9b7f19f 100644 --- a/LANG_www/agc_fr/vdc_db_query.php +++ b/LANG_www/agc_fr/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Invalide Utilisateurname/Mot de passe: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Invalide server_ip: |$server_ip| or Invalide session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Invalide Utilisateurname/Mot de passe: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Invalide session_name: |$session_name|$server_ip|\n"; + echo "Invalide server_ip: |$server_ip| or Invalide session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Invalide session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Selection De Groupe $closer_choice a été attribué à l'utilisateur $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send sur to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pause Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_fr/vicidial.php b/LANG_www/agc_fr/vicidial.php index 1877a624..16774d12 100644 --- a/LANG_www/agc_fr/vicidial.php +++ b/LANG_www/agc_fr/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST sur server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a COMPOSER link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Français
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Mot de passe Utilisateur:
Campagne: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Français \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Mot de passe Utilisateur:
Campagne: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Français
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Ouverture de Session téléphonique:
Mot de passe du Téléphone:
  \n"; +echo "

VERSION: $version       BUILD: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "VICICOMPOSER Client Web: VICICOMPOSER Ouverture de Campagne\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Ouverture de Session: \n
"; echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; + echo "Campagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_secondes = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_secondes = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Français \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Mot de passe Utilisateur: "; echo "\n"; echo "Campagne: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSION: $version       BUILD: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Français
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login sur phone: $SIP_user Campagne:: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today sur that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Ouverture de Session: \n
"; echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; + echo "Campagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Ouverture de Session: \n
"; echo "Mot de passe:
\n"; - echo "Campagne: $camp_form_code
\n"; - echo "\n"; + echo "Campagne: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pause\"
\"Résumé\""; var DiaLControl_auto_HTML_ready = "\"Pause\"\"Résumé\""; var DiaLControl_auto_HTML_OFF = "\"Pause\"\"Résumé\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Statut: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatutStatut").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatutCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "APPELS EN COURS DANS CETTE CONFÉRENCE:
"; - var live_conf_HTML = "IL Y A DES APPELS EN COURS SUR VOTRE SESSION:
#CANAL DISTANTRACCROCHERTRANSFERT
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatutStatut").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatutCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Statut: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "IL Y A DES APPELS EN COURS SUR VOTRE SESSION:
#CANAL DISTANTRACCROCHERVOLUME
" + loop_ct + "" + channelfieldA + "RACCROCHER
" + loop_ct + "" + channelfieldA + "RACCROCHER          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#CANAL DISTANTRACCROCHERVOLUME
" + loop_ct + "" + channelfieldA + "RACCROCHER
" + loop_ct + "" + channelfieldA + "RACCROCHER          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + lead_dial_number + " UID: " + CIDcheck + "   Attente... " + MD_ring_secondS + " secondes"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + CIDcheck + "   Attente... " + MD_ring_secondS + " secondes"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Appelé: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Appelé: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Mettre"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICICOMPOSER_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + manDiaLonly_num + " UID: " + MDnextCID + "   Attente..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Appeler: " + status_display_number + " UID: " + MDnextCID + "   Attente..."; document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICICOMPOSER_LOG ENTRY FOR THIS APPEL PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS APPELBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Dernier Appel :" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rappel :" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent :" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Commentaires:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICICOMPOSER_LOG ENTRY FOR THIS APPEL PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS APPELBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Dernier Appel :" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Rappel :" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent :" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Commentaires:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrant: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Mettre"; + + document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; + + document.getElementById("XferControl").innerHTML = "\"Transfert"; + + document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Mettre"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transfert"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulaire\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Raccrocher\""; document.getElementById("XferControl").innerHTML = "\"Transfert"; document.getElementById("LocalCloser").innerHTML = "\"CLOSER"; - document.getElementById("InternalCloser").innerHTML = "\"CLOSER"; document.getElementById("DialBlindTransfer").innerHTML = "\"Transfert"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Visualiser message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE DÉCONNEXION LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars sur customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Vous devez choisir une date");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Choisissez une date ci-dessous"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Choisissez une date ci-dessous"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Montrez les informations sur la conférence"; + document.getElementById("busycallsdisplay").innerHTML = "Montrez les informations sur la conférence

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transfert"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUT:
@@ -6292,7 +6709,7 @@ IDENTIFIANT:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
VICICOMPOSER Client Web:     BUILD:               Serveur:              
-Montrez les informations sur la conférence
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -RACCOURCIS INACTIFS - -
- - - -
diff --git a/LANG_www/agc_it/conf_exten_check.php b/LANG_www/agc_it/conf_exten_check.php index fbb2ec2a..b6175b03 100644 --- a/LANG_www/agc_it/conf_exten_check.php +++ b/LANG_www/agc_it/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_it/manager_send.php b/LANG_www/agc_it/manager_send.php index b690dcf2..9644e5dd 100644 --- a/LANG_www/agc_it/manager_send.php +++ b/LANG_www/agc_it/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_it/vdc_db_query.php b/LANG_www/agc_it/vdc_db_query.php index 94664276..91f09062 100644 --- a/LANG_www/agc_it/vdc_db_query.php +++ b/LANG_www/agc_it/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Non valido Utentename/Parola d`accesso: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Non valido session_name: |$session_name|$server_ip|\n"; + echo "Non valido server_ip: |$server_ip| or Non valido session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Non valido session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Scelta del Gruppo $closer_choice è stato registrato dall` utente $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send su to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pausa Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_it/vicidial.php b/LANG_www/agc_it/vicidial.php index d9f3435d..beba7617 100644 --- a/LANG_www/agc_it/vicidial.php +++ b/LANG_www/agc_it/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST su server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a CHIAMA link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Italiano
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Parola d`accesso Dell`Utente:
Campagna: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Italiano \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Parola d`accesso Dell`Utente:
Campagna: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Italiano
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Inizio attività Telefono:
Parola d`accesso del Telefono:
  \n"; +echo "

VERSIONE: $version       CONFIGURAZIONE: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "Web client di VICICHIAMA: VICICHIAMA Inizio attività della Campagna\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Inizio attività: \n
"; echo "Parola d`accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; + echo "Campagna: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_secondi = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_secondi = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Italiano \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Parola d`accesso Dell`Utente: "; echo "\n"; echo "Campagna: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSIONE: $version       CONFIGURAZIONE: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Italiano
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login su phone: $SIP_user vai alla campagna: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today su that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Inizio attività: \n
"; echo "Parola d`accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; + echo "Campagna: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Inizio attività: \n
"; echo "Parola d`accesso:
\n"; - echo "Campagna: $camp_form_code
\n"; - echo "\n"; + echo "Campagna: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pausa\"
\"Riprendi\""; var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Riprendi\""; var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Riprendi\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "CHIAMATE ATTIVE IN QUESTA CONFERENZA:
"; - var live_conf_HTML = "CHIAMATE ATTIVE NELLA VOSTRA SESSIONE:
#CANALE REMOTOATTACCATRASF
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "CHIAMATE ATTIVE NELLA VOSTRA SESSIONE:
#CANALE REMOTOATTACCAVOLUME
" + loop_ct + "" + channelfieldA + "ATTACCA
" + loop_ct + "" + channelfieldA + "ATTACCA          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#CANALE REMOTOATTACCAVOLUME
" + loop_ct + "" + channelfieldA + "ATTACCA
" + loop_ct + "" + channelfieldA + "ATTACCA          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + lead_dial_number + " UID: " + CIDcheck + "   Attendi lo squillo... " + MD_ring_secondS + " secondi"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + status_display_number + " UID: " + CIDcheck + "   Attendi lo squillo... " + MD_ring_secondS + " secondi"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Chiamato: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Chiamato: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICICHIAMA_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + manDiaLonly_num + " UID: " + MDnextCID + "   Attendi lo squillo..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " In Chiamata: " + status_display_number + " UID: " + MDnextCID + "   Attendi lo squillo..."; document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICICHIAMA_LOG ENTRY FOR THIS CHIAMATA PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " In entrata: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHIAMATABACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Ultima Chiamata:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Chiamata ripetuta:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Osservazioni:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICICHIAMA_LOG ENTRY FOR THIS CHIAMATA PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " In entrata: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHIAMATABACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Ultima Chiamata:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Chiamata ripetuta:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Osservazioni:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " In entrata: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " In entrata: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; + + document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + + document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + + document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Parcheggia"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; + document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Interfacccia\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Disconnetti"; document.getElementById("XferControl").innerHTML = "\"Trasferimento"; document.getElementById("LocalCloser").innerHTML = "\"LOCALE"; - document.getElementById("InternalCloser").innerHTML = "\"INTERNO"; document.getElementById("DialBlindTransfer").innerHTML = "\"Effettua"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Mostra message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars su customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Dovete scegliere una data");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Selezioni una data sotto"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Selezioni una data sotto"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Mostrate le informazioni sul canale della conferenza"; + document.getElementById("busycallsdisplay").innerHTML = "Mostrate le informazioni sul canale della conferenza

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Trasferimento"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUS:
@@ -6292,7 +6709,7 @@ IDENTIFICAZIONE Registrazione: + align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
Versione del webclient di VICICHIAMA:     CONFIGURAZIONE:               Server:              
-Mostrate le informazioni sul canale della conferenza
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -TASTI FUNZIONE INATTIVI - -
- - - -
diff --git a/LANG_www/agc_pl/conf_exten_check.php b/LANG_www/agc_pl/conf_exten_check.php index 3f4404c9..a27ec4cf 100644 --- a/LANG_www/agc_pl/conf_exten_check.php +++ b/LANG_www/agc_pl/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_pl/manager_send.php b/LANG_www/agc_pl/manager_send.php index 0a46adf8..8932ad9b 100644 --- a/LANG_www/agc_pl/manager_send.php +++ b/LANG_www/agc_pl/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_pl/vdc_db_query.php b/LANG_www/agc_pl/vdc_db_query.php index 2dfe7949..5c66d12a 100644 --- a/LANG_www/agc_pl/vdc_db_query.php +++ b/LANG_www/agc_pl/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Nieprawidłowy server_ip: |$server_ip| or Nieprawidłowy session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Nieprawidłowy NazwaUżytkownika/Hasło: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Nieprawidłowy session_name: |$session_name|$server_ip|\n"; + echo "Nieprawidłowy server_ip: |$server_ip| or Nieprawidłowy session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Nieprawidłowy session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Wybór grupowy $closer_choice został zarejestrowny dla użytkownika $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send na to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Przerwa Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_pl/vicidial.php b/LANG_www/agc_pl/vicidial.php index 53301443..82d9ef8d 100644 --- a/LANG_www/agc_pl/vicidial.php +++ b/LANG_www/agc_pl/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST na server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a WYBIERZ link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Polski
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Hasło użytkownika:
Kampania: $camp_form_code
$camp_form_code
  \n"; + echo "

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Polski \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Hasło użytkownika:
Kampania: $camp_form_code
$camp_form_code
  \n"; + echo "

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Polski
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Login telefonu:
Hasło telefonu:
  \n"; +echo "

WERSJA: $version       KOMPILACJA: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "klient VICIWYBIERZ: VICIWYBIERZ Logowanie do kampani\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Login: \n
"; echo "Hasło:
\n"; - echo "Kampania: $camp_form_code
\n"; - echo "\n"; + echo "Kampania: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_sekundy = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_sekundy = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Polski \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Hasło użytkownika: "; echo "\n"; echo "Kampania: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
WERSJA: $version       KOMPILACJA: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Polski
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login na phone: $SIP_user do kampani: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today na that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Login: \n
"; echo "Hasło:
\n"; - echo "Kampania: $camp_form_code
\n"; - echo "\n"; + echo "Kampania: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Login: \n
"; echo "Hasło:
\n"; - echo "Kampania: $camp_form_code
\n"; - echo "\n"; + echo "Kampania: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Przerwa\"
\"Ponów\""; var DiaLControl_auto_HTML_ready = "\"Przerwa\"\"Ponów\""; var DiaLControl_auto_HTML_OFF = "\"Przerwa\"\"Ponów\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "AKTYWNE ROZMOWY W TEJ KONFERENCJI:
"; - var live_conf_HTML = "AKTYWNE ROZMOWY W TWOJEJ SESJI:
#KANAŁ ZDALNYROZŁĄCZTRANSFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "AKTYWNE ROZMOWY W TWOJEJ SESJI:
#KANAŁ ZDALNYROZŁĄCZVOLUME
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#KANAŁ ZDALNYROZŁĄCZVOLUME
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ
" + loop_ct + "" + channelfieldA + "ROZŁĄCZ          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + lead_dial_number + " UID: " + CIDcheck + "   Czeka na dzwonek... " + MD_ring_secondS + " sekundy"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + CIDcheck + "   Czeka na dzwonek... " + MD_ring_secondS + " sekundy"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Zadzwoniono: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Zadzwoniono: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Zawieś"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; - document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICIWYBIERZ_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + manDiaLonly_num + " UID: " + MDnextCID + "   Czeka na dzwonek..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Dzwoni: " + status_display_number + " UID: " + MDnextCID + "   Czeka na dzwonek..."; document.getElementById("HangupControl").innerHTML = "\"Odłącz"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS RozmowaBACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Nazwisko Call: " + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Komentarz:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICIWYBIERZ_LOG ENTRY FOR THIS Rozmowa PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS RozmowaBACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Nazwisko Call: " + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "CallBack: " + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agent: " + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Komentarz:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Przychodząca: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Zawieś"; + + document.getElementById("HangupControl").innerHTML = "\"Odłącz"; + + document.getElementById("XferControl").innerHTML = "\"Transfer"; + + document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Zawieś"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Odłącz"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transfer"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; + document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Web\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Odłącz"; document.getElementById("XferControl").innerHTML = "\"Transfer"; document.getElementById("LocalCloser").innerHTML = "\"LOKALNY"; - document.getElementById("InternalCloser").innerHTML = "\"WEWNĘTRZNY"; document.getElementById("DialBlindTransfer").innerHTML = "\"Wybierz"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Pokaż message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE WYLOGUJ LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars na customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Musisz wybrać datę");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Wybierz datę poniżej"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Wybierz datę poniżej"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Pokaż informacje o kanałach konferencyjnych"; + document.getElementById("busycallsdisplay").innerHTML = "Pokaż informacje o kanałach konferencyjnych

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transfer"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
STATUS:
@@ -6292,7 +6709,7 @@ NUMER NAGRANIA:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
wersja klienta VICIWYBIERZ:     KOMPILACJA:               Serwer:              
-Pokaż informacje o kanałach konferencyjnych
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -KLAWISZE SKRÓTU NIEAKTYWNE - -
- - - -
diff --git a/LANG_www/agc_pt/conf_exten_check.php b/LANG_www/agc_pt/conf_exten_check.php index 5bc22d09..ed42c28f 100644 --- a/LANG_www/agc_pt/conf_exten_check.php +++ b/LANG_www/agc_pt/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -34,6 +34,7 @@ # 60619-1201 - Added variable filters to close security holes for login form # 61128-2255 - Added update for manual dial vicidial_live_agents # 70319-1542 - Added agent disabled display function +# 71122-0205 - Added vicidial_live_agent status output # require("dbconnect.php"); @@ -70,8 +71,8 @@ if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} -$version = '0.0.11'; -$build = '70319-1542'; +$version = '2.0.4-12'; +$build = '71122-0205'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -155,6 +156,14 @@ echo " $row=mysql_fetch_row($rslt); $Acount=$row[0]; + if ($Acount > 0) + { + $stmt="SELECT status from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Astatus=$row[0]; + } # ### find out if external table shows agent should be disabled # $stmt="SELECT count(*) from another_table where user='$user' and status='DEAD';"; # if ($DB) {echo "|$stmt|\n";} @@ -176,7 +185,7 @@ echo " if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $Astatus=$row[0]; + $Alogin=$row[0]; $Acampaign=$row[1]; ### grab the number of calls being placed from this server and campaign @@ -188,13 +197,13 @@ echo " } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; } } else { - $Astatus='N'; + $Alogin='N'; $RingCalls='N'; ### update the vicidial_live_agents every second with a new random number so it is shown to be alive @@ -204,10 +213,10 @@ echo " } - if ($Acount < 1) {$Astatus='DEAD_VLA';} - if ($AexternalDEAD > 0) {$Astatus='DEAD_EXTERNAL';} + if ($Acount < 1) {$Alogin='DEAD_VLA';} + if ($AexternalDEAD > 0) {$Alogin='DEAD_EXTERNAL';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Status: ' . $Astatus . '|CampCalls: ' . $RingCalls . "|\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Status: ' . $Astatus . "|\n"; } $total_conf=0; diff --git a/LANG_www/agc_pt/manager_send.php b/LANG_www/agc_pt/manager_send.php index 5a254944..0823f931 100644 --- a/LANG_www/agc_pt/manager_send.php +++ b/LANG_www/agc_pt/manager_send.php @@ -459,7 +459,11 @@ if ($ACTION=="RedirectVD") else { if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$secondS',status='XFER' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($format=='debug') {echo "\n";} diff --git a/LANG_www/agc_pt/vdc_db_query.php b/LANG_www/agc_pt/vdc_db_query.php index 03796a35..26896576 100644 --- a/LANG_www/agc_pt/vdc_db_query.php +++ b/LANG_www/agc_pt/vdc_db_query.php @@ -13,7 +13,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit') +# - $ACTION - ('regCLOSER','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCALL','manDiaLlogCALL','userLOGout','updateDISPO','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -130,10 +130,18 @@ # 70322-1545 - Added sipsak display ability # 70413-1253 - Fixed bug for outbound call time in CLOSER-type blended campaigns # 70424-1100 - Fixed bug for fronter/closer calls that would delete vdac records +# 70802-1729 - Fixed bugs with pause_sec and wait_sec under certain call handling +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71029-1855 - removed campaign_id naming restrictions for CLOSER-type campaigns +# 71030-2047 - added hopper priority for auto alt dial entries +# 71116-1011 - added calls_today count updating of the vicidial_live_agents upon INCALL +# 71120-1520 - added LogiNCamPaigns to show only allowed campaigns for agents upon login +# 71125-1751 - Added inbound-group default inbound group sending to vicidial.php +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.57'; -$build = '70424-1100'; +$version = '2.0.4-65'; +$build = '71129-2025'; require("dbconnect.php"); @@ -264,6 +272,8 @@ if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} $user=ereg_replace("[^0-9a-zA-Z]","",$user); @@ -287,40 +297,46 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} $MT[0]=''; $agents='@agents'; -$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); -$row=mysql_fetch_row($rslt); -$auth=$row[0]; - -if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) -{ -echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; -exit; -} -else -{ - -if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) +if ($ACTION == 'LogiNCamPaigns') { - echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; - exit; + $skip_user_validation=1; } else { - $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $SNauth=$row[0]; - if($SNauth==0) + $auth=$row[0]; + + if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Inválido Usuárioname/Senha: |$user|$pass|\n"; + exit; + } + else + { + if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) { - echo "Inválido session_name: |$session_name|$server_ip|\n"; + echo "Inválido server_ip: |$server_ip| or Inválido session_name: |$session_name|\n"; exit; } - else + else { - # do nothing for now + $stmt="SELECT count(*) from web_client_sessions where session_name='$session_name' and server_ip='$server_ip';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $SNauth=$row[0]; + if($SNauth==0) + { + echo "Inválido session_name: |$session_name|$server_ip|\n"; + exit; + } + else + { + # do nothing for now + } } } } @@ -337,6 +353,63 @@ echo " } + +################################################################################ +### LogiNCamPaigns - generates an HTML SELECT list of allowed campaigns for a +### specific agent on the login screen +################################################################################ +if ($ACTION == 'LogiNCamPaigns') +{ + if ( (strlen($user)<1) ) + { + echo "\n"; + exit; + } + else + { + echo "\n"; + exit; + } +} + + + ################################################################################ ### regCLOSER - update the vicidial_live_agents table to reflect the closer ### inbound choices made upon login @@ -375,6 +448,37 @@ if ($ACTION == 'regCLOSER') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } + + $in_groups_pre = preg_replace('/-$/','',$closer_choice); + $in_groups = explode(" ",$in_groups_pre); + $in_groups_ct = count($in_groups); + $k=1; + while ($k < $in_groups_ct) + { + if (strlen($in_groups[$k])>1) + { + $stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $viga_ct = mysql_num_rows($rslt); + if ($viga_ct > 0) + { + $row=mysql_fetch_row($rslt); + $group_weight = $row[0]; + $calls_today = $row[1]; + } + else + { + $group_weight = 0; + $calls_today = 0; + } + $stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + } + $k++; + } + } echo "Closer In Escolha Do Grupo $closer_choice foi registado ao usuário $user\n"; } @@ -399,6 +503,21 @@ if ($ACTION == 'manDiaLnextCaLL') } else { + + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### check if this is a callback, if it is, skip the grabbing of a new lead and mark the callback as INACTIVE if ( (strlen($callback_id)>0) and (strlen($lead_id)>0) ) { @@ -499,6 +618,7 @@ if ($ACTION == 'manDiaLnextCaLL') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -526,6 +646,26 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count++; + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|M + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|M\n"); + fclose($fp); + } + ##### if lead is a callback, grab the callback comments $CBentry_time = ''; $CBcallback_time = ''; @@ -604,7 +744,12 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + ### update calls_today count in vicidial_campaign_agents + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -646,6 +791,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $phone_number . "\n"; $LeaD_InfO .= "MAIN\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -706,6 +852,20 @@ if ($ACTION == 'manDiaLonly') } else { + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -743,7 +903,11 @@ if ($ACTION == 'manDiaLonly') $rslt=mysql_query($stmt, $link); ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -881,7 +1045,11 @@ if ($stage == "end") { if ($start_epoch < 1000) { - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ##### look for the start epoch in the vicidial_closer_log table $stmt="SELECT start_epoch FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; @@ -904,7 +1072,11 @@ if ($stage == "end") { $length_in_sec = 0; } - if ( ($length_in_sec < 1) and (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) ) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( ($length_in_sec < 1) and ($row[0] > 0) ) { ##### start epoch in the vicidial_log table, couldn't find one in vicidial_closer_log $stmt="SELECT start_epoch FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';"; @@ -925,7 +1097,11 @@ if ($stage == "end") } else {$length_in_sec = ($StarTtime - $start_epoch);} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec',status='DONE' where lead_id='$lead_id' order by start_epoch desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -998,8 +1174,8 @@ if ($stage == "end") else {$alt_phone = '';} if (strlen($alt_phone)>5) { - ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='';"; + ### insert record into vicidial_hopper for alt_phone call attempt + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ALT',user='',priority='25';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1022,7 +1198,7 @@ if ($stage == "end") if (strlen($address3)>5) { ### insert record into vicidial_hopper for address3 call attempt - $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='';"; + $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='HOLD',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='ADDR3',user='',priority='20';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } @@ -1338,6 +1514,7 @@ if ($ACTION == 'VDADREcheckINCOMING') ################################################################################ if ($ACTION == 'VDADcheckINCOMING') { + $Ctype = 'A'; $MT[0]=''; $row=''; $rowx=''; $channel_live=1; @@ -1367,8 +1544,26 @@ if ($ACTION == 'VDADcheckINCOMING') if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;} echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n"; + ##### grab number of calls today in this campaign and increment + $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vla_cc_ct = mysql_num_rows($rslt); + if ($vla_cc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $calls_today =$row[0]; + } + else + {$calls_today ='0';} + $calls_today++; + ### update the agent status to INCALL in vicidial_live_agents - $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO',calls_today='$calls_today' where user='$user' and server_ip='$server_ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + + $stmt = "UPDATE vicidial_campaign_agents set calls_today='$calls_today' where user='$user' and campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1384,6 +1579,7 @@ if ($ACTION == 'VDADcheckINCOMING') $dispo = trim("$row[3]"); $tsr = trim("$row[4]"); $vendor_id = trim("$row[5]"); + $source_id = trim("$row[6]"); $list_id = trim("$row[7]"); $gmt_offset_now = trim("$row[8]"); $phone_code = trim("$row[10]"); @@ -1450,7 +1646,11 @@ if ($ACTION == 'VDADcheckINCOMING') if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { ### update the vicidial_closer_log user to INCALL $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; @@ -1505,11 +1705,14 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_a_number = $row[11]; $VDCL_xferconf_b_dtmf = $row[12]; $VDCL_xferconf_b_number = $row[13]; + $VDCL_default_xfer_group= $row[28]; ### update the comments in vicidial_live_agents record $stmt = "UPDATE vicidial_live_agents set comments='INBOUND' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); + + $Ctype = 'I'; } else { @@ -1530,8 +1733,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send em to vicidial.php for override of WEB_FORM address - if (strlen($VDCL_group_web)>5) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} - else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} + else {echo "|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -1612,6 +1815,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $CBcomments . "\n"; $LeaD_InfO .= $dialed_number . "\n"; $LeaD_InfO .= $dialed_label . "\n"; + $LeaD_InfO .= $source_id . "\n"; echo $LeaD_InfO; @@ -1639,7 +1843,27 @@ if ($ACTION == 'VDADcheckINCOMING') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } - + + ##### check if system is set to generate logfile for transfers + $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $enable_agc_xfer_log_ct = mysql_num_rows($rslt); + if ($enable_agc_xfer_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_xfer_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) + { + # DATETIME|campaign|lead_id|phone_number|user|type + # 2007-08-22 11:11:11|TESTCAMP|65432|3125551212|1234|A + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|$Ctype\n"); + fclose($fp); + } + } else { @@ -1698,6 +1922,12 @@ else $rslt=mysql_query($stmt, $link); $vla_delete = mysql_affected_rows($link); + ##### Delete the vicidial_live_inbound_agents records for this session + $stmt="DELETE from vicidial_live_inbound_agents where user ='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $vlia_delete = mysql_affected_rows($link); + ##### Delete the web_client_sessions $stmt="DELETE from web_client_sessions where server_ip='$server_ip' and session_name ='$session_name';"; if ($DB) {echo "$stmt\n";} @@ -1801,7 +2031,7 @@ else } } - echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel\n"; + echo "$vul_insert|$vc_remove|$vla_delete|$wcs_delete|$agent_channel|$vlia_delete\n"; } } @@ -1829,7 +2059,11 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) + $stmt = "select count(*) from vicidial_campaigns where campaign_id='$campaign' and campaign_allow_inbound='Y';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) { $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -2096,14 +2330,23 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) else { $pause_sec=0; - $stmt = "select pause_epoch,pause_sec from vicidial_agent_log where agent_log_id='$agent_log_id';"; + $stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $VDpr_ct = mysql_num_rows($rslt); if ($VDpr_ct > 0) { $row=mysql_fetch_row($rslt); - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + $wait_sec=0; + if ($row[2] > 0) + { + $wait_sec = (($StarTtime - $row[2]) + $row[3]); + } + if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) ) + {$pause_sec = (($StarTtime - $row[0]) + $row[1]);} + else + {$pause_sec = (($row[4] - $row[0]) + $row[1]);} + } if ($ACTION == 'VDADready') { @@ -2113,7 +2356,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) } if ($ACTION == 'VDADpause') { - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',pause_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set pause_epoch='$StarTtime',wait_sec='$wait_sec' where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); } @@ -2229,7 +2472,7 @@ echo "Pausa Code has been updated to $status for $agent_log_id\n"; ################################################################################ if ($ACTION == 'CalLBacKLisT') { -$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; +$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD') order by callback_time;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($rslt) {$callbacks_count = mysql_num_rows($rslt);} @@ -2267,7 +2510,7 @@ $loop_count=0; ################################################################################ if ($ACTION == 'CalLBacKCounT') { -$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and status NOT IN('INACTIVE','DEAD');"; +$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' and campaign_id='$campaign' and status NOT IN('INACTIVE','DEAD');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); diff --git a/LANG_www/agc_pt/vicidial.php b/LANG_www/agc_pt/vicidial.php index baa6d7f8..fea99d54 100644 --- a/LANG_www/agc_pt/vicidial.php +++ b/LANG_www/agc_pt/vicidial.php @@ -158,10 +158,23 @@ # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability +# 70510-1319 - Added onUnload force Logout +# 70806-1530 - Added Presets Dial links above agent mute button +# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE +# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM +# 71022-1427 - Added formatting of the customer phone number in the main status bar +# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions +# 71101-1204 - Fixed bug in callback calendar with DST +# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion +# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login +# 71122-0256 - Added auto-pause notification +# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to +# 71127-0408 - Added height and width settings for easier modification of screen size +# 71129-2025 - restricted callbacks count and list to campaign only # -$version = '2.0.129'; -$build = '70322-1545'; +$version = '2.0.4-142'; +$build = '71129-2025'; require("dbconnect.php"); @@ -218,7 +231,7 @@ $NOW_TIME = date("Y-m-d H:i:s"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $CIDdate = date("ymdHis"); - $month_old = mktime(0, 0, 0, date("m"), date("d")-2, date("Y")); + $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); @@ -240,15 +253,48 @@ $local_consult_xfers = '1'; # set to 1 to send consultative transfers from origi $clientDST = '1'; # set to 1 to check for DST em server for agent time $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels +$PreseT_DiaL_LinKs = '1'; # set to 1 to show a SELETOR link for Dial Presets +$LogiNAJAX = '1'; # set to 1 to do lookups +$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen +$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 +$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 + + # options now set in DB: #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session +### SCREEN WIDTH AND HEIGHT CALCULATIONS ### +### DO NOT EDIT! ### +$MASTERwidth=($BROWSER_WIDTH - 340); +$MASTERheight=($BROWSER_HEIGHT - 200); +if ($MASTERwidth < 430) {$MASTERwidth = '430';} +if ($MASTERheight < 300) {$MASTERheight = '300';} + +$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) +$MNwidth = ($MASTERwidth + 330); # 760 - main frame +$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference +$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks +$AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links +$SSwidth = ($MASTERwidth + 176); # 606 - scroll script +$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session +$HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button +$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer + +$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button +$AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links +$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons +$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status +$SSheight = ($MASTERheight + 31); # 331 - script content +$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey +$BPheight = ($MASTERheight - 250); # 50 - bottom buffer + + $US='_'; $CL=':'; $AT='@'; @@ -275,10 +321,31 @@ echo "\n"; if ($campaign_login_list > 0) { -$camp_form_code = "\n"; $camp_form_code .= "\n"; -$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id"; +$LOGallowed_campaignsSQL=''; +if ($relogin == 'YES') +{ + $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $VU_user_group=$row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) + { + $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); + $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; + } +} + +$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); @@ -310,6 +377,62 @@ $camp_form_code = " 0) +{ +?> + + + +\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Português
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -355,7 +478,7 @@ if ($user_login_first == 1) echo "
\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; - echo "\n"; + echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; @@ -370,8 +493,9 @@ echo "
Senha Do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -397,7 +521,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Português \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "


"; echo ""; @@ -413,8 +537,9 @@ echo ""; echo "\n"; echo ""; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
Senha Do Usuário:
Campanha: $camp_form_code
$camp_form_code
  \n"; + echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -434,7 +559,7 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n";echo "\n";echo "
English Português
\n"; -echo "
\n"; +echo "\n"; echo "\n"; echo "


"; echo ""; @@ -445,7 +570,8 @@ echo ""; echo "\n"; echo ""; echo "\n"; -echo "\n"; +echo "\n"; echo "\n"; echo "
Início de uma sessão Do Telefone:
Senha Do Telefone:
  \n"; +echo "

VERSÃO: $version       CONFIGURAÇÃO: $build
\n"; echo "\n\n"; @@ -509,7 +635,7 @@ $VDloginDISPLAY=0; $row=mysql_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; - if ( (!eregi("$VD_campaign",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) + if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) { echo "Web client de VICISELETOR: VICISELETOR Início de uma sessão Da Campanha\n"; echo "\n"; @@ -524,8 +650,9 @@ echo "\n"; echo "Início de uma sessão: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -615,40 +742,44 @@ echo "
0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = $row[2]; - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = $row[14]; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_segundos = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; + $park_ext = $row[0]; + $park_file_name = $row[1]; + $web_form_address = $row[2]; + $allow_closers = $row[3]; + $auto_dial_level = $row[4]; + $dial_timeout = $row[5]; + $dial_prefix = $row[6]; + $campaign_cid = $row[7]; + $campaign_vdad_exten = $row[8]; + $campaign_rec_exten = $row[9]; + $campaign_recording = $row[10]; + $campaign_rec_filename = $row[11]; + $campaign_script = $row[12]; + $get_call_launch = $row[13]; + $campaign_am_message_exten = $row[14]; + $xferconf_a_dtmf = $row[15]; + $xferconf_a_number = $row[16]; + $xferconf_b_dtmf = $row[17]; + $xferconf_b_number = $row[18]; + $alt_number_dialing = $row[19]; + $VC_scheduled_callbacks = $row[20]; + $wrapup_segundos = $row[21]; + $wrapup_message = $row[22]; + $closer_campaigns = $row[23]; + $use_internal_dnc = $row[24]; + $allcalls_delay = $row[25]; + $omit_phone_code = $row[26]; + $agent_pause_codes_active = $row[27]; + $no_hopper_leads_logins = $row[28]; + $campaign_allow_inbound = $row[29]; + $manual_dial_list_id = $row[30]; + $default_xfer_group = $row[31]; + $xfer_groups = $row[32]; if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { @@ -693,10 +824,10 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -712,6 +843,32 @@ echo " 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $xfer_ct = mysql_num_rows($rslt); + $XFgrpCT=0; + while ($XFgrpCT < $xfer_ct) + { + $row=mysql_fetch_row($rslt); + $VARxfergroups = "$VARxfergroups'$row[0]',"; + $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; + if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} + $XFgrpCT++; + } + $VARxfergroups = substr("$VARxfergroups", 0, -1); + $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); + } + ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} @@ -747,7 +904,7 @@ echo "\n"; echo "\n"; echo "English \n";echo "Português \n"; echo "\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -762,8 +919,9 @@ echo "Senha Do Usuário: "; echo "\n"; echo "Campanha: "; - echo "$camp_form_code\n"; - echo "\n"; + echo "$camp_form_code\n"; + echo "   \n"; + echo "\n"; echo "
VERSÃO: $version       CONFIGURAÇÃO: $build\n"; echo "\n"; echo "\n\n"; @@ -787,7 +945,7 @@ if (!$authphone) echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Português
\n"; - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -954,7 +1112,7 @@ else if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); - if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) + if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) ) { ### insert an entry into the user log for the login event $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; @@ -1020,6 +1178,13 @@ else $affected_rows = mysql_affected_rows($link); print "\n"; + $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + # print "You have logged in as user: $VD_login em phone: $SIP_user à campanha: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1070,8 +1235,32 @@ else { print "\n"; + ##### grab the campaign_weight and number of calls today em that campaign for the agent + $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vca_ct = mysql_num_rows($rslt); + if ($vca_ct > 0) + { + $row=mysql_fetch_row($rslt); + $campaign_weight = $row[0]; + $calls_today = $row[1]; + $i++; + } + else + { + $campaign_weight = '0'; + $calls_today = '0'; + $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');"; + if ($DB) {echo "$stmt\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level');"; + $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today');"; if ($DB) {echo "$stmt\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -1102,7 +1291,7 @@ else } - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) + if ($campaign_allow_inbound == 'Y') { print "\n"; } @@ -1157,8 +1346,9 @@ echo "
\n"; echo "Início de uma sessão: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; @@ -1179,14 +1369,26 @@ echo "
\n"; echo "Início de uma sessão: \n
"; echo "Senha:
\n"; - echo "Campanha: $camp_form_code
\n"; - echo "\n"; + echo "Campanha: $camp_form_code
\n"; + echo "   \n"; + echo "\n"; echo "\n\n"; echo "\n\n"; echo "\n\n"; exit; } + if (ereg('MSIE',$browser)) + { + $useIE=1; + print "\n"; + } + else + { + $useIE=0; + print "\n"; + } + $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now @@ -1268,7 +1470,7 @@ if ($Cmonth > 12) $Cmonth = ($Cmonth - 12); $CYyear++; } -$Cstart= mktime(0,0,0,$Cmonth,1,$CYyear); +$Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); @@ -1399,6 +1601,12 @@ $CCAL_OUT .= ""; var VD_statuses_ct = ''; VARingroups = new Array(); var INgroupCOUNT = ''; + VARxfergroups = new Array(); + VARxfergroupsnames = new Array(); + var XFgroupCOUNT = ''; + var default_xfer_group = ''; + var default_xfer_group_name = ''; + var LIVE_default_xfer_group = ''; var HK_statuses_camp = ''; HKhotkeys = new Array(); HKstatuses = new Array(); @@ -1577,7 +1785,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var reselect_preview_dial = 0; var reselect_alt_dial = 0; var alt_dial_active = 0; - var mdnLisT_id = '999'; + var mdnLisT_id = ''; var VU_vicidial_transfers = ''; var agentonly_callbacks = ''; var agentcall_manual = ''; @@ -1604,14 +1812,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var manual_auto_hotkey = 0; var dialed_number = ''; var dialed_label = ''; + var source_id = ''; var DispO3waychannel = ''; var DispO3wayXtrAchannel = ''; var DispO3wayCalLserverip = ''; var DispO3wayCalLxfernumber = ''; var DispO3wayCalLcamptail = ''; + var PausENotifYCounTer = 0; var phone_ip = ''; var enable_sipsak_messages = ''; var allow_sipsak_messages = ''; + var HidEMonitoRSessionS = ''; var DiaLControl_auto_HTML = "\"Pausa\"
\"Resumo\""; var DiaLControl_auto_HTML_ready = "\"Pausa\"\"Resumo\""; var DiaLControl_auto_HTML_OFF = "\"Pausa\"\"Resumo\""; @@ -1855,8 +2066,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '990009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; - tasknum = Ctasknum + "*CL_" + campaign + '' + closerxfercamptail + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + var XfeRSelecT = document.getElementById("XfeRGrouP"); + tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; CustomerData_update(); @@ -1867,7 +2078,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = tasknum_string.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2002,215 +2213,237 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there are any channels live in the agent's conference meetme room function check_for_conf_calls(taskconfnum,taskforce) { - custchannellive--; - if (agentcallsstatus == '1') - { - campagentstatct++; - if (campagentstatct > campagentstatctmax) + if (typeof(xmlhttprequestcheckconf) == "undefined") { + //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + custchannellive--; + if (agentcallsstatus == '1') { - campagentstatct=0; - var campagentstdisp = 'YES'; + campagentstatct++; + if (campagentstatct > campagentstatctmax) + { + campagentstatct=0; + var campagentstdisp = 'YES'; + } + else + { + var campagentstdisp = 'NO'; + } } else { var campagentstdisp = 'NO'; } - } - else - { - var campagentstdisp = 'NO'; - } - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') - { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; - xmlhttp.open('POST', 'conf_exten_check.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkconf_query); - xmlhttp.onreadystatechange = function() + + xmlhttprequestcheckconf=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckconf = false; + } + } + @end @*/ + //alert ("1"); + if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckconf = new XMLHttpRequest(); + } + if (xmlhttprequestcheckconf) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_conf = null; - var LMAforce = taskforce; - check_conf = xmlhttp.responseText; - // alert(checkconf_query); - // alert(xmlhttp.responseText); - var check_ALL_array=check_conf.split("\n"); - var check_time_array=check_ALL_array[0].split("|"); - var Time_array = check_time_array[1].split("UnixTime: "); - UnixTime = Time_array[1]; - UnixTime = parseInt(UnixTime); - UnixTimeMS = (UnixTime * 1000); - t.setTime(UnixTimeMS); - if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) + checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp; + xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php'); + xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckconf.send(checkconf_query); + xmlhttprequestcheckconf.onreadystatechange = function() + { + if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { - var Astatus_array = check_time_array[2].split("Status: "); - var AGStatuS = Astatus_array[1]; - var CamPCalLs_array = check_time_array[3].split("CampCalls: "); - var CamPCalLs = CamPCalLs_array[1]; - if (AGStatuS != 'N') + var check_conf = null; + var LMAforce = taskforce; + check_conf = xmlhttprequestcheckconf.responseText; + // alert(checkconf_query); + // alert(xmlhttprequestcheckconf.responseText); + var check_ALL_array=check_conf.split("\n"); + var check_time_array=check_ALL_array[0].split("|"); + var Time_array = check_time_array[1].split("UnixTime: "); + UnixTime = Time_array[1]; + UnixTime = parseInt(UnixTime); + UnixTimeMS = (UnixTime * 1000); + t.setTime(UnixTimeMS); + if ( (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') ) { - document.getElementById("AgentStatusStatus").innerHTML = AGStatuS; - } - if (CamPCalLs != 'N') - { - document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; - } - if ( (AGStatuS == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - if ( (AGStatuS == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) - { - showDiv('AgenTDisablEBoX'); - } - } - var check_conf_array=check_ALL_array[1].split("|"); - var live_conf_calls = check_conf_array[0]; - var conf_chan_array = check_conf_array[1].split(" ~"); - if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) - { - if (live_conf_calls > 0) - { - var loop_ct=0; - var ARY_ct=0; - var LMAalter=0; - var LMAcontent_change=0; - var LMAcontent_match=0; - var conv_start=-1; - // var live_conf_HTML = "VIVEM AS CHAMADAS NCESTA CONFERÊNCIA:
"; - var live_conf_HTML = "VIVEM AS CHAMADAS EM SUA SESSÃO:
#CANALETA REMOTAHANGUPXFER
"; - if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) + var Alogin_array = check_time_array[2].split("Logged-in: "); + var AGLogiN = Alogin_array[1]; + var CamPCalLs_array = check_time_array[3].split("CampCalls: "); + var CamPCalLs = CamPCalLs_array[1]; + if (AGLogiN != 'N') { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; LMAcontent_change++; + document.getElementById("AgentStatusStatus").innerHTML = AGLogiN; } - while (loop_ct < live_conf_calls) + if (CamPCalLs != 'N') { - loop_ct++; - loop_s = loop_ct.toString(); - if (loop_s.match(/1$|3$|5$|7$|9$/)) - {var row_color = '#DDDDFF';} - else - {var row_color = '#CCCCFF';} - var conv_ct = (loop_ct + conv_start); - var channelfieldA = conf_chan_array[conv_ct]; - if (volumecontrol_active!=1) - { - live_conf_HTML = live_conf_HTML + ""; - } - else - { - live_conf_HTML = live_conf_HTML + ""; - } - // var debugspan = document.getElementById("debugbottomspan").innerHTML; + document.getElementById("AgentStatusCalls").innerHTML = CamPCalLs; + } + if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) ) + { + showDiv('AgenTDisablEBoX'); + } + } + var VLAStatuS_array = check_time_array[4].split("Status: "); + var VLAStatuS = VLAStatuS_array[1]; + if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) ) + { + if (PausENotifYCounTer > 10) + { + alert('Your session has been paused'); + AutoDial_ReSume_PauSe('VDADpause'); + PausENotifYCounTer=0; + } + else {PausENotifYCounTer++;} + } + else {PausENotifYCounTer=0;} - if (channelfieldA == lastcustchannel) {custchannellive++;} - else + var check_conf_array=check_ALL_array[1].split("|"); + var live_conf_calls = check_conf_array[0]; + var conf_chan_array = check_conf_array[1].split(" ~"); + if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) ) + { + if (live_conf_calls > 0) + { + var loop_ct=0; + var ARY_ct=0; + var LMAalter=0; + var LMAcontent_change=0; + var LMAcontent_match=0; + var conv_start=-1; + var live_conf_HTML = "VIVEM AS CHAMADAS EM SUA SESSÃO:
#CANALETA REMOTAHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
>"; + if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0)) { - if(customerparked == 1) - {custchannellive++;} - // allow for no customer hungup errors if call from another server - if(server_ip == lastcustserverip) - {var nothing='';} + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; LMAcontent_change++; + } + while (loop_ct < live_conf_calls) + { + loop_ct++; + loop_s = loop_ct.toString(); + if (loop_s.match(/1$|3$|5$|7$|9$/)) + {var row_color = '#DDDDFF';} else - {custchannellive++;} - } - - if (volumecontrol_active > 0) - { - if (protocol != 'EXTERNAL') + {var row_color = '#CCCCFF';} + var conv_ct = (loop_ct + conv_start); + var channelfieldA = conf_chan_array[conv_ct]; + if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/68600/)) ) { - var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); - if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) - { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; - } + var hide_channel=1; } else { - if (agentchannel.length < 3) + if (volumecontrol_active!=1) { - agentchannel = channelfieldA; - - document.getElementById("AgentMuteSpan").innerHTML = ""; + live_conf_HTML = live_conf_HTML + ""; + } + else + { + live_conf_HTML = live_conf_HTML + ""; } } - } + // var debugspan = document.getElementById("debugbottomspan").innerHTML; - // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + if (channelfieldA == lastcustchannel) {custchannellive++;} + else + { + if(customerparked == 1) + {custchannellive++;} + // allow for no customer hungup errors if call from another server + if(server_ip == lastcustserverip) + {var nothing='';} + else + {custchannellive++;} + } - if (!LMAe[ARY_ct]) - {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} - else - { - if (LMAe[ARY_ct].length < 1) + if (volumecontrol_active > 0) + { + if (protocol != 'EXTERNAL') + { + var regAGNTchan = new RegExp(protocol + '/' + extension,"g"); + if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) ) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + else + { + if (agentchannel.length < 3) + { + agentchannel = channelfieldA; + + document.getElementById("AgentMuteSpan").innerHTML = ""; + } + } + } + + // document.getElementById("debugbottomspan").innerHTML = debugspan + '
' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter; + + if (!LMAe[ARY_ct]) {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} else { - if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} - else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + if (LMAe[ARY_ct].length < 1) + {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;} + else + { + if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;} + else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;} + } } + if (LMAalter > 0) {LMAcount++;} + + ARY_ct++; } - if (LMAalter > 0) {LMAcount++;} - - ARY_ct++; + // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; + // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; + + live_conf_HTML = live_conf_HTML + "
#CANALETA REMOTAHANGUPVOLUME
" + loop_ct + "" + channelfieldA + "HANGUP
" + loop_ct + "" + channelfieldA + "HANGUP          
"; + + if (LMAcontent_change > 0) + { + if (conf_channels_xtra_display == 1) + {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} + } + nochannelinsession=0; } - // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5]; - // document.getElementById("confdebug").innerHTML = debug_LMA + "
"; - - live_conf_HTML = live_conf_HTML + ""; - - if (LMAcontent_change > 0) + else { + LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; + LMAcount=0; if (conf_channels_xtra_display == 1) { - // document.getElementById("MainPanel").style.overflow = 'visible'; - document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML; - // document.getElementById("MainPanel").style.overflow = 'auto'; + if (document.getElementById("outboundcallsspan").innerHTML.length > 2) + { + document.getElementById("outboundcallsspan").innerHTML = ''; + } } + custchannellive = -99; + nochannelinsession++; } - nochannelinsession=0; - } - else - { - LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; - LMAcount=0; - if (conf_channels_xtra_display == 1) - { - if (document.getElementById("outboundcallsspan").innerHTML.length > 2) - { - document.getElementById("outboundcallsspan").innerHTML = ''; - } - } - custchannellive = -99; - nochannelinsession++; } + xmlhttprequestcheckconf = undefined; + delete xmlhttprequestcheckconf; } } } - delete xmlhttp; } } @@ -2363,7 +2596,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var Ctasknum = blindxferdialstring.replace(regAXFvars, ''); if (Ctasknum.length < 2) {Ctasknum = '83009';} - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var closerxfercamptail = '_L'; if (closerxfercamptail.length < 3) {closerxfercamptail = 'IVR';} blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*'; @@ -2411,10 +2644,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (taskvar == 'XfeRLOCAL') { - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var queryCID = "XLvdcW" + epoch_sec + user_abb; - // "90009*CL_$campaign$park_exten_suffix**$lead_id**$phone_number*$user*"; - var redirectdestination = closerxferinternal + '90009*CL_' + campaign + '' + closerxfercamptail + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; + // "90009*$group**$lead_id**$phone_number*$user*"; + var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*'; xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS; } @@ -2444,7 +2677,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var redirectdestination = "NEXTAVAILABLE"; var redirectXTRAvalue = XDchannel; var redirecttype_test = document.vicidial_form.xfernumber.value; - var closerxfercamptail = '_L' + document.vicidial_form.xfercode.value; + var XfeRSelecT = document.getElementById("XfeRGrouP"); var regRXFvars = new RegExp("CXFER","g"); if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) ) {var redirecttype = 'RedirectXtraCX';} @@ -2454,9 +2687,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispO3wayXtrAchannel = redirectXTRAvalue; DispO3wayCalLserverip = redirectserverip; DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value; - DispO3wayCalLcamptail = document.vicidial_form.xfercode.value; + DispO3wayCalLcamptail = ''; - xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=CL_" + campaign + '' + closerxfercamptail; + xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value+ "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value; if (taskdebugnote == 'FIRST') { @@ -2654,7 +2887,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&format=text"; + CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBcount_query); @@ -2708,7 +2941,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&format=text"; + var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text"; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(CBlist_query); @@ -2918,7 +3151,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDlookCID == "NO") { MD_ring_secondS++; - document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + lead_dial_number + " UID: " + CIDcheck + "   Anel de espera... " + MD_ring_secondS + " segundos"; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + CIDcheck + "   Anel de espera... " + MD_ring_secondS + " segundos"; // alert("channel not found yet:\n" + campaign); } else @@ -2983,7 +3219,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} VD_live_call_secondS = 0; MD_channel_look=0; - document.getElementById("MainStatuSSpan").innerHTML = " Chamado: " + lead_dial_number + " UID: " + CIDcheck + "  "; + var dispnum = lead_dial_number; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Chamado: " + status_display_number + " UID: " + CIDcheck + "  "; document.getElementById("ParkControl").innerHTML ="\"Chamada"; @@ -2993,8 +3232,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; @@ -3128,7 +3365,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialed_label = MDnextResponse_array[33]; lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + document.vicidial_form.phone_number.value + " UID: " + MDnextCID + "   " + man_status; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + MDnextCID + "   " + man_status; if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} web_form_vars = @@ -3177,6 +3417,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; // $VICISELETOR_web_QUERY_STRING =~ s/ /+/gi; @@ -3428,7 +3669,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MD_channel_look=1; custchannellive=1; - document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + manDiaLonly_num + " UID: " + MDnextCID + "   Anel de espera..."; + var dispnum = manDiaLonly_num; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Chamada: " + status_display_number + " UID: " + MDnextCID + "   Anel de espera..."; document.getElementById("HangupControl").innerHTML = "\"Cliente"; @@ -3595,276 +3839,288 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Check to see if there is a call being sent from the auto-dialer to agent conf function check_for_auto_incoming() { - all_record = 'NO'; - all_record_count=0; - document.vicidial_form.lead_id.value = ''; - var xmlhttp=false; - /*@cc_on @*/ - /*@if (@_jscript_version >= 5) - // JScript gives us Conditional compilation, we can cope with old IE versions. - // and security blocked creation of the objects. - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (typeof(xmlhttprequestcheckauto) == "undefined") { - xmlhttp = new XMLHttpRequest(); - } - if (xmlhttp) - { - checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(checkVDAI_query); - xmlhttp.onreadystatechange = function() + all_record = 'NO'; + all_record_count=0; + document.vicidial_form.lead_id.value = ''; + var xmlhttprequestcheckauto=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttprequestcheckauto = false; + } + } + @end @*/ + if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined') + { + xmlhttprequestcheckauto = new XMLHttpRequest(); + } + if (xmlhttprequestcheckauto) { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - var check_incoming = null; - check_incoming = xmlhttp.responseText; - // alert(checkVDAI_query); - // alert(xmlhttp.responseText); - var check_VDIC_array=check_incoming.split("\n"); - if (check_VDIC_array[0] == '1') + checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id; + xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php'); + xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttprequestcheckauto.send(checkVDAI_query); + xmlhttprequestcheckauto.onreadystatechange = function() + { + if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200) { - // alert(xmlhttp.responseText); - AutoDialWaiting = 0; - - var VDIC_data_VDAC=check_VDIC_array[1].split("|"); - VDIC_web_form_address = VICIDiaL_web_form_address - var VDIC_fronter=''; - - var VDIC_data_VDIG=check_VDIC_array[2].split("|"); - if (VDIC_data_VDIG[0].length > 5) - {VDIC_web_form_address = VDIC_data_VDIG[0];} - var VDCL_group_name = VDIC_data_VDIG[1]; - var VDCL_group_color = VDIC_data_VDIG[2]; - var VDCL_fronter_display = VDIC_data_VDIG[3]; - VDCL_group_id = VDIC_data_VDIG[4]; - CalL_ScripT_id = VDIC_data_VDIG[5]; - CalL_AutO_LauncH = VDIC_data_VDIG[6]; - CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; - CalL_XC_a_NuMber = VDIC_data_VDIG[8]; - CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; - CalL_XC_b_NuMber = VDIC_data_VDIG[10]; - - var VDIC_data_VDFR=check_VDIC_array[3].split("|"); - if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) - {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} - - document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; - document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - CIDcheck = VDIC_data_VDAC[2]; - CalLCID = VDIC_data_VDAC[2]; - document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; - lastcustchannel = VDIC_data_VDAC[3]; - document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; - lastcustserverip = VDIC_data_VDAC[4]; - if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} - document.vicidial_form.SecondS.value = 0; - - VD_live_customer_call = 1; - VD_live_call_secondS = 0; - - // INSERT VICISELETOR_LOG ENTRY FOR THIS CHAMADA PROCESS - // DialLog("start"); - - custchannellive=1; - - LasTCID = check_VDIC_array[4]; - LeaDPreVDispO = check_VDIC_array[6]; - fronter = check_VDIC_array[7]; - document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; - document.vicidial_form.list_id.value = check_VDIC_array[9]; - document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; - document.vicidial_form.phone_code.value = check_VDIC_array[11]; - document.vicidial_form.phone_number.value = check_VDIC_array[12]; - document.vicidial_form.title.value = check_VDIC_array[13]; - document.vicidial_form.first_name.value = check_VDIC_array[14]; - document.vicidial_form.middle_initial.value = check_VDIC_array[15]; - document.vicidial_form.last_name.value = check_VDIC_array[16]; - document.vicidial_form.address1.value = check_VDIC_array[17]; - document.vicidial_form.address2.value = check_VDIC_array[18]; - document.vicidial_form.address3.value = check_VDIC_array[19]; - document.vicidial_form.city.value = check_VDIC_array[20]; - document.vicidial_form.state.value = check_VDIC_array[21]; - document.vicidial_form.province.value = check_VDIC_array[22]; - document.vicidial_form.postal_code.value = check_VDIC_array[23]; - document.vicidial_form.country_code.value = check_VDIC_array[24]; - document.vicidial_form.gender.value = check_VDIC_array[25]; - document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; - document.vicidial_form.alt_phone.value = check_VDIC_array[27]; - document.vicidial_form.email.value = check_VDIC_array[28]; - document.vicidial_form.security_phrase.value = check_VDIC_array[29]; - var REGcommentsNL = new RegExp("!N","g"); - check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); - document.vicidial_form.comments.value = check_VDIC_array[30]; - document.vicidial_form.called_count.value = check_VDIC_array[31]; - CBentry_time = check_VDIC_array[32]; - CBcallback_time = check_VDIC_array[33]; - CBuser = check_VDIC_array[34]; - CBcomments = check_VDIC_array[35]; - dialed_number = check_VDIC_array[36]; - dialed_label = check_VDIC_array[37]; - - lead_dial_number = document.vicidial_form.phone_number.value; - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " UID: " + CIDcheck + "   " + VDIC_fronter; - - if (LeaDPreVDispO == 'CALLBK') + var check_incoming = null; + check_incoming = xmlhttprequestcheckauto.responseText; + // alert(checkVDAI_query); + // alert(xmlhttprequestcheckauto.responseText); + var check_VDIC_array=check_incoming.split("\n"); + if (check_VDIC_array[0] == '1') { - document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; - document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; - document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; - document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; - document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; - document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; - showDiv('CBcommentsBox'); - } + // alert(xmlhttprequestcheckauto.responseText); + AutoDialWaiting = 0; - if (VDIC_data_VDIG[1].length > 0) - { - if (VDIC_data_VDIG[2].length > 2) + var VDIC_data_VDAC=check_VDIC_array[1].split("|"); + VDIC_web_form_address = VICIDiaL_web_form_address + var VDIC_fronter=''; + + var VDIC_data_VDIG=check_VDIC_array[2].split("|"); + if (VDIC_data_VDIG[0].length > 5) + {VDIC_web_form_address = VDIC_data_VDIG[0];} + var VDCL_group_name = VDIC_data_VDIG[1]; + var VDCL_group_color = VDIC_data_VDIG[2]; + var VDCL_fronter_display = VDIC_data_VDIG[3]; + VDCL_group_id = VDIC_data_VDIG[4]; + CalL_ScripT_id = VDIC_data_VDIG[5]; + CalL_AutO_LauncH = VDIC_data_VDIG[6]; + CalL_XC_a_Dtmf = VDIC_data_VDIG[7]; + CalL_XC_a_NuMber = VDIC_data_VDIG[8]; + CalL_XC_b_Dtmf = VDIC_data_VDIG[9]; + CalL_XC_b_NuMber = VDIC_data_VDIG[10]; + if (VDIC_data_VDIG[11].length > 0) + {LIVE_default_xfer_group = VDIC_data_VDIG[11];} + else + {LIVE_default_xfer_group = default_xfer_group;} + + var VDIC_data_VDFR=check_VDIC_array[3].split("|"); + if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) + {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} + + document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; + document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; + CIDcheck = VDIC_data_VDAC[2]; + CalLCID = VDIC_data_VDAC[2]; + document.vicidial_form.callchannel.value = VDIC_data_VDAC[3]; + lastcustchannel = VDIC_data_VDAC[3]; + document.vicidial_form.callserverip.value = VDIC_data_VDAC[4]; + lastcustserverip = VDIC_data_VDAC[4]; + if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} + document.vicidial_form.SecondS.value = 0; + + VD_live_customer_call = 1; + VD_live_call_secondS = 0; + + // INSERT VICISELETOR_LOG ENTRY FOR THIS CHAMADA PROCESS + // DialLog("start"); + + custchannellive=1; + + LasTCID = check_VDIC_array[4]; + LeaDPreVDispO = check_VDIC_array[6]; + fronter = check_VDIC_array[7]; + document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8]; + document.vicidial_form.list_id.value = check_VDIC_array[9]; + document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10]; + document.vicidial_form.phone_code.value = check_VDIC_array[11]; + document.vicidial_form.phone_number.value = check_VDIC_array[12]; + document.vicidial_form.title.value = check_VDIC_array[13]; + document.vicidial_form.first_name.value = check_VDIC_array[14]; + document.vicidial_form.middle_initial.value = check_VDIC_array[15]; + document.vicidial_form.last_name.value = check_VDIC_array[16]; + document.vicidial_form.address1.value = check_VDIC_array[17]; + document.vicidial_form.address2.value = check_VDIC_array[18]; + document.vicidial_form.address3.value = check_VDIC_array[19]; + document.vicidial_form.city.value = check_VDIC_array[20]; + document.vicidial_form.state.value = check_VDIC_array[21]; + document.vicidial_form.province.value = check_VDIC_array[22]; + document.vicidial_form.postal_code.value = check_VDIC_array[23]; + document.vicidial_form.country_code.value = check_VDIC_array[24]; + document.vicidial_form.gender.value = check_VDIC_array[25]; + document.vicidial_form.date_of_birth.value = check_VDIC_array[26]; + document.vicidial_form.alt_phone.value = check_VDIC_array[27]; + document.vicidial_form.email.value = check_VDIC_array[28]; + document.vicidial_form.security_phrase.value = check_VDIC_array[29]; + var REGcommentsNL = new RegExp("!N","g"); + check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n"); + document.vicidial_form.comments.value = check_VDIC_array[30]; + document.vicidial_form.called_count.value = check_VDIC_array[31]; + CBentry_time = check_VDIC_array[32]; + CBcallback_time = check_VDIC_array[33]; + CBuser = check_VDIC_array[34]; + CBcomments = check_VDIC_array[35]; + dialed_number = check_VDIC_array[36]; + dialed_label = check_VDIC_array[37]; + source_id = check_VDIC_array[38]; + + lead_dial_number = document.vicidial_form.phone_number.value; + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + + if (LeaDPreVDispO == 'CALLBK') { - document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + document.getElementById("CusTInfOSpaN").innerHTML = " PREVIOUS CHAMADABACK "; + document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor; + document.getElementById("CBcommentsBoxA").innerHTML = "Última Chamada:" + CBentry_time; + document.getElementById("CBcommentsBoxB").innerHTML = "Rechamada:" + CBcallback_time; + document.getElementById("CBcommentsBoxC").innerHTML = "Agente:" + CBuser; + document.getElementById("CBcommentsBoxD").innerHTML = "Comentários:
" + CBcomments; + showDiv('CBcommentsBox'); } - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + document.vicidial_form.phone_number.value + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + + if (VDIC_data_VDIG[1].length > 0) + { + if (VDIC_data_VDIG[2].length > 2) + { + document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2]; + } + var dispnum = document.vicidial_form.phone_number.value; + var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10); + + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + } + + document.getElementById("ParkControl").innerHTML ="\"Chamada"; + + document.getElementById("HangupControl").innerHTML = "\"Cliente"; + + document.getElementById("XferControl").innerHTML = "\"Transferência"; + + document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + + document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + + document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; + + if (lastcustserverip == server_ip) + { + document.getElementById("VolumeUpSpan").innerHTML = ""; + document.getElementById("VolumeDownSpan").innerHTML = ""; } - document.getElementById("ParkControl").innerHTML ="\"Chamada"; + document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; - document.getElementById("HangupControl").innerHTML = "\"Cliente"; + if (VDCL_group_id.length > 1) + {var group = VDCL_group_id;} + else + {var group = campaign;} + if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - document.getElementById("XferControl").innerHTML = "\"Transferência"; + web_form_vars = + "lead_id=" + document.vicidial_form.lead_id.value + + "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + + "&list_id=" + document.vicidial_form.list_id.value + + "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + + "&phone_code=" + document.vicidial_form.phone_code.value + + "&phone_number=" + document.vicidial_form.phone_number.value + + "&title=" + document.vicidial_form.title.value + + "&first_name=" + document.vicidial_form.first_name.value + + "&middle_initial=" + document.vicidial_form.middle_initial.value + + "&last_name=" + document.vicidial_form.last_name.value + + "&address1=" + document.vicidial_form.address1.value + + "&address2=" + document.vicidial_form.address2.value + + "&address3=" + document.vicidial_form.address3.value + + "&city=" + document.vicidial_form.city.value + + "&state=" + document.vicidial_form.state.value + + "&province=" + document.vicidial_form.province.value + + "&postal_code=" + document.vicidial_form.postal_code.value + + "&country_code=" + document.vicidial_form.country_code.value + + "&gender=" + document.vicidial_form.gender.value + + "&date_of_birth=" + document.vicidial_form.date_of_birth.value + + "&alt_phone=" + document.vicidial_form.alt_phone.value + + "&email=" + document.vicidial_form.email.value + + "&security_phrase=" + document.vicidial_form.security_phrase.value + + "&comments=" + document.vicidial_form.comments.value + + "&user=" + user + + "&pass=" + pass + + "&campaign=" + campaign + + "&phone_login=" + phone_login + + "&phone_pass=" + phone_pass + + "&fronter=" + fronter + + "&closer=" + user + + "&group=" + group + + "&channel_group=" + group + + "&SQLdate=" + SQLdate + + "&epoch=" + UnixTime + + "&uniqueid=" + document.vicidial_form.uniqueid.value + + "&customer_zap_channel=" + lastcustchannel + + "&customer_server_ip=" + lastcustserverip + + "&server_ip=" + server_ip + + "&SIPexten=" + extension + + "&session_id=" + session_id + + "&phone=" + document.vicidial_form.phone_number.value + + "&parked_by=" + document.vicidial_form.lead_id.value + + "&dispo=" + LeaDDispO + '' + + "&dialed_number=" + dialed_number + '' + + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + + webform_session; + + var regWFspace = new RegExp(" ","ig"); + web_form_vars = web_form_vars.replace(regWF, ''); + var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); + web_form_vars = web_form_vars.replace(regWFspace, '+'); + web_form_vars = web_form_vars.replace(regWF, ''); - document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; + var regWFAvars = new RegExp("\\?","ig"); + if (VDIC_web_form_address.match(regWFAvars)) + {web_form_vars = '&' + web_form_vars} + else + {web_form_vars = '?' + web_form_vars} - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; + document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; - document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; + if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) + {all_record = 'YES';} - document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - - if (lastcustserverip == server_ip) - { - document.getElementById("VolumeUpSpan").innerHTML = ""; - document.getElementById("VolumeDownSpan").innerHTML = ""; - } + if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) + { + // test code for scripts output + URLDecode(scriptnames[CalL_ScripT_id],'NO'); + var textname = decoded; + URLDecode(scripttexts[CalL_ScripT_id],'YES'); + var texttext = decoded; + var testscript = "" + textname + "\n\n

\n\n" + texttext; + document.getElementById("ScriptContents").innerHTML = testscript; + } - document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF; + if (CalL_AutO_LauncH == 'SCRIPT') + { + ScriptPanelToFront(); + } - if (VDCL_group_id.length > 1) - {var group = VDCL_group_id;} + if (CalL_AutO_LauncH == 'WEBFORM') + { + window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); + } + + } else - {var group = campaign;} - if ( (dialed_label.length < 3) || (dialed_label=='NONE') ) {dialed_label='MAIN';} - - web_form_vars = - "lead_id=" + document.vicidial_form.lead_id.value + - "&vendor_id=" + document.vicidial_form.vendor_lead_code.value + - "&list_id=" + document.vicidial_form.list_id.value + - "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value + - "&phone_code=" + document.vicidial_form.phone_code.value + - "&phone_number=" + document.vicidial_form.phone_number.value + - "&title=" + document.vicidial_form.title.value + - "&first_name=" + document.vicidial_form.first_name.value + - "&middle_initial=" + document.vicidial_form.middle_initial.value + - "&last_name=" + document.vicidial_form.last_name.value + - "&address1=" + document.vicidial_form.address1.value + - "&address2=" + document.vicidial_form.address2.value + - "&address3=" + document.vicidial_form.address3.value + - "&city=" + document.vicidial_form.city.value + - "&state=" + document.vicidial_form.state.value + - "&province=" + document.vicidial_form.province.value + - "&postal_code=" + document.vicidial_form.postal_code.value + - "&country_code=" + document.vicidial_form.country_code.value + - "&gender=" + document.vicidial_form.gender.value + - "&date_of_birth=" + document.vicidial_form.date_of_birth.value + - "&alt_phone=" + document.vicidial_form.alt_phone.value + - "&email=" + document.vicidial_form.email.value + - "&security_phrase=" + document.vicidial_form.security_phrase.value + - "&comments=" + document.vicidial_form.comments.value + - "&user=" + user + - "&pass=" + pass + - "&campaign=" + campaign + - "&phone_login=" + phone_login + - "&phone_pass=" + phone_pass + - "&fronter=" + fronter + - "&closer=" + user + - "&group=" + group + - "&channel_group=" + group + - "&SQLdate=" + SQLdate + - "&epoch=" + UnixTime + - "&uniqueid=" + document.vicidial_form.uniqueid.value + - "&customer_zap_channel=" + lastcustchannel + - "&customer_server_ip=" + lastcustserverip + - "&server_ip=" + server_ip + - "&SIPexten=" + extension + - "&session_id=" + session_id + - "&phone=" + document.vicidial_form.phone_number.value + - "&parked_by=" + document.vicidial_form.lead_id.value + - "&dispo=" + LeaDDispO + '' + - "&dialed_number=" + dialed_number + '' + - "&dialed_label=" + dialed_label + '' + - webform_session; - - var regWFspace = new RegExp(" ","ig"); - web_form_vars = web_form_vars.replace(regWF, ''); - var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig"); - web_form_vars = web_form_vars.replace(regWFspace, '+'); - web_form_vars = web_form_vars.replace(regWF, ''); - - var regWFAvars = new RegExp("\\?","ig"); - if (VDIC_web_form_address.match(regWFAvars)) - {web_form_vars = '&' + web_form_vars} - else - {web_form_vars = '?' + web_form_vars} - - document.getElementById("WebFormSpan").innerHTML = "\"Formulário\n"; - - if ( (campaign_recording == 'ALLCALLS') || (campaign_recording == 'ALLFORCE') ) - {all_record = 'YES';} - - if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) ) { - // test code for scripts output - URLDecode(scriptnames[CalL_ScripT_id],'NO'); - var textname = decoded; - URLDecode(scripttexts[CalL_ScripT_id],'YES'); - var texttext = decoded; - var testscript = "" + textname + "\n\n

\n\n" + texttext; - document.getElementById("ScriptContents").innerHTML = testscript; + // do nothing } - - if (CalL_AutO_LauncH == 'SCRIPT') - { - ScriptPanelToFront(); - } - - if (CalL_AutO_LauncH == 'WEBFORM') - { - window.open(VDIC_web_form_address + "" + web_form_vars, 'webform', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); - } - - - } - else - { - // do nothing + xmlhttprequestcheckauto = undefined; + delete xmlhttprequestcheckauto; } } } - delete xmlhttp; } } - // ################################################################################ // refresh the content of the web form URL function WebFormRefresH(taskrefresh) @@ -3922,6 +4178,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&dispo=" + LeaDDispO + '' + "&dialed_number=" + dialed_number + '' + "&dialed_label=" + dialed_label + '' + + "&source_id=" + source_id + '' + webform_session; var regWFspace = new RegExp(" ","ig"); @@ -3972,7 +4229,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { XDchannel = DispO3wayXtrAchannel; document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber; - document.vicidial_form.xfercode.value = DispO3wayCalLcamptail; MDchannel = DispO3waychannel; lastcustserverip = DispO3wayCalLserverip; @@ -4125,7 +4381,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("HangupControl").innerHTML = "\"Cliente"; document.getElementById("XferControl").innerHTML = "\"Transferência"; document.getElementById("LocalCloser").innerHTML = "\"LOCAL"; - document.getElementById("InternalCloser").innerHTML = "\"MAIS"; document.getElementById("DialBlindTransfer").innerHTML = "\"Transferência"; document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; document.getElementById("VolumeUpSpan").innerHTML = ""; @@ -4689,6 +4944,20 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; } + + function DtMf_PreSet_a_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber; + basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES'); + } + function DtMf_PreSet_b_DiaL() + { + document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf; + document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber; + basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES'); + } + // ################################################################################ // Mostra message that customer has hungup the call before agent has function CustomerChanneLGone() @@ -4922,6 +5191,18 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// Log the user out of the system when they close their browser while logged in + function BrowserCloseLogout() + { + if (logout_stop_timeouts < 1) + { + LogouT(); + alert("PLEASE CLICK THE LOGOUT LINK TO LOG OUT NEXT TIME.\n"); + } + } + + // ################################################################################ // Log the user out of the system, if active call or active dial is occuring, don't let them. function LogouT() @@ -4984,9 +5265,59 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } - + 0) +{ +?> // ################################################################################ -// hotkeypress function to bind hotkeys defined in the campaign to dispositions +// MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions + function hotkeypress(evt) + { + enter_disable(); + if ( (hot_keys_active==1) && (VD_live_customer_call==1) ) + { + var e = evt? evt : window.event; + if(!e) return; + var key = 0; + if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which' + else if (typeof(e.which)!= 'undefined') { key = e.which; } + + var HKdispo = hotkeys[String.fromCharCode(key)]; + // alert("|" + key + "|" + HKdispo + "|"); + if (HKdispo) + { + // document.vicidial_form.inert_button.focus(); + // document.vicidial_form.inert_button.blur(); + CustomerData_update(); + var HKdispo_ary = HKdispo.split(" ----- "); + if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') ) + { + if (document.vicidial_form.DiaLAltPhonE.checked==true) + { + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + else + { + HKdispo_display = 4; + HKfinish=1; + document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1]; + showDiv('HotKeyActionBox'); + hideDiv('HotKeyEntriesBox'); + document.vicidial_form.DispoSelection.value = HKdispo_ary[0]; + dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]); + } + } + } + } + + +// ################################################################################ +// W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions function hotkeypress(evt) { enter_disable(); @@ -5030,6 +5361,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + // ################################################################################ // disable enter/return keys to not clear out vars em customer info function enter_disable(evt) @@ -5060,7 +5395,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (scriptformat == 'YES') { var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value; - var SCsource_id = ""; + var SCsource_id = source_id; var SClist_id = document.vicidial_form.list_id.value; var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value; var SCcalled_since_last_reset = ""; @@ -5087,6 +5422,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var SCfullname = LOGfullname; var SCfronter = fronter; var SCuser = user; + var SCpass = pass; var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; @@ -5130,6 +5466,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} SCfullname = SCfullname.replace(RGplus,'+'); SCfronter = SCfronter.replace(RGplus,'+'); SCuser = SCuser.replace(RGplus,'+'); + SCpass = SCpass.replace(RGplus,'+'); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); @@ -5170,6 +5507,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var RGfullname = new RegExp("--A--fullname--B--","g"); var RGfronter = new RegExp("--A--fronter--B--","g"); var RGuser = new RegExp("--A--user--B--","g"); + var RGpass = new RegExp("--A--pass--B--","g"); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); @@ -5211,6 +5549,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} encoded = encoded.replace(RGfullname, SCfullname); encoded = encoded.replace(RGfronter, SCfronter); encoded = encoded.replace(RGuser, SCuser); + encoded = encoded.replace(RGpass, SCpass); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); @@ -5308,9 +5647,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {alert("Você deve escolher uma data");} else { + + 0) +{ +?> + + var CallBackTimEHouRFORM = document.getElementById('CBT_hour'); + var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text; + // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value; + + var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute'); + var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text; + // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value; + + var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm'); + var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text; + // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value; + + // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|"); + // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|"); + // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|"); + + CallBackTimEHouRFORM.selectedIndex = '0'; + CallBackTimEMinuteSFORM.selectedIndex = '0'; + CallBackTimEAmpMFORM.selectedIndex = '1'; + CallBackTimEHouR = document.vicidial_form.CBT_hour.value; CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value; CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value; + + document.vicidial_form.CBT_hour.value = '01'; + document.vicidial_form.CBT_minute.value = '00'; + document.vicidial_form.CBT_ampm.value = 'PM'; + + if (CallBackTimEHouR == '12') { if (CallBackTimEAmpM == 'AM') @@ -5328,13 +5705,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00"; - document.getElementById("CallBackDatEPrinT").innerHTML = "Selecione uma data abaixo"; - document.vicidial_form.CallBackDatESelectioN.value = ''; - document.vicidial_form.CallBackCommenTsField.value = ''; - document.vicidial_form.CBT_hour.value = '01'; - document.vicidial_form.CBT_minute.value = '00'; - document.vicidial_form.CBT_ampm.value = 'PM'; - if (document.vicidial_form.CallBackOnlyMe.checked==true) { CallBackrecipient = 'USERONLY'; @@ -5343,7 +5713,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { CallBackrecipient = 'ANYONE'; } + document.getElementById("CallBackDatEPrinT").innerHTML = "Selecione uma data abaixo"; document.vicidial_form.CallBackOnlyMe.checked=false; + document.vicidial_form.CallBackDatESelectioN.value = ''; + document.vicidial_form.CallBackCommenTsField.value = ''; // alert(CallBackDatETimE + "|" + CallBackCommenTs); @@ -5415,7 +5788,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (VICIDiaL_allow_closers < 1) { - document.getElementById("InternalCloser").style.visibility = 'hidden'; document.getElementById("LocalCloser").style.visibility = 'hidden'; } document.getElementById("sessionIDspan").innerHTML = session_id; @@ -5458,6 +5830,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} DispoSelectContent_create('','ReSET'); WaitingForNextStep=1; open_dispo_screen=0; + LIVE_default_xfer_group = default_xfer_group; document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value; if (auto_dial_level == 0) { @@ -5802,7 +6175,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else { conf_channels_xtra_display = 0; - document.getElementById("busycallsdisplay").innerHTML = "Mostre a informação da canaleta da chamada de conferência"; + document.getElementById("busycallsdisplay").innerHTML = "Mostre a informação da canaleta da chamada de conferência

 "; document.getElementById("outboundcallsspan").innerHTML = ''; LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]=''; LMAcount=0; @@ -5831,13 +6204,26 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (showxfervar == 'ON') { - var xfer_height = 310; + var xfer_height = ; if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);} if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);} document.getElementById("TransferMain").style.top = xfer_height; HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transferência"; + var loop_ct = 0; + var live_XfeR_HTML = ''; + var XfeR_SelecT = ''; + while (loop_ct < XFgroupCOUNT) + { + if (VARxfergroups[loop_ct] == LIVE_default_xfer_group) + {XfeR_SelecT = 'SELECTED ';} + else {XfeR_SelecT = '';} + live_XfeR_HTML = live_XfeR_HTML + "\n"; + loop_ct++; + } + + document.getElementById("XfeRGrouPLisT").innerHTML = ""; } else { @@ -5861,6 +6247,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function MainPanelToFront(resumevar) { document.getElementById("MainTable").style.backgroundColor="#E0C2D6"; + document.getElementById("MaiNfooter").style.backgroundColor="#E0C2D6"; hideDiv('ScriptPanel'); showDiv('MainPanel'); if (resumevar != 'NO') @@ -5897,6 +6284,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { showDiv('ScriptPanel'); document.getElementById("MainTable").style.backgroundColor="#FFE7D0"; + document.getElementById("MaiNfooter").style.backgroundColor="#FFE7D0"; panel_bgcolor='#FFE7D0'; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; } @@ -5908,7 +6296,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} - +
id="MainTable"> - + -"; echo ""; echo ""; -echo ""; +echo ""; + + + + echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo "
STATUS:
@@ -6292,7 +6709,7 @@ ID REGISTRO:
+ align=left valign=top> @@ -6348,26 +6765,13 @@ else
> + 


  + 
- - - - -
Versão do correia-cliente de VICISELETOR:     CONFIGURAÇÃO:               Usuário:              
-Mostre a informação da canaleta da chamada de conferência
- 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?> -CHAVES QUENTES INATIVAS - -
- - - -
diff --git a/LANG_www/vicidial/AST_CLOSERstats.php b/LANG_www/vicidial/AST_CLOSERstats.php index c2bea4d6..ec53f93f 100644 --- a/LANG_www/vicidial/AST_CLOSERstats.php +++ b/LANG_www/vicidial/AST_CLOSERstats.php @@ -8,6 +8,8 @@ # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown # require("dbconnect.php"); @@ -19,6 +21,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -27,6 +31,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -85,6 +91,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFY | REPORTS \n"; echo "\n\n"; @@ -100,14 +113,37 @@ echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n"; else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Closer Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -128,7 +164,7 @@ echo "Average Call Length for all Calls: $average_hold_seconds second echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -154,10 +190,90 @@ else echo "Total DROP Calls: $DROPcalls $DROPpercent%\n"; echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; + + +############################## +######### CALL STATUS STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL STATUS STATS\n"; +echo "+--------+----------------------+------------+\n"; +echo "| STATUS | DESCRIPTION | CALLS |\n"; +echo "+--------+----------------------+------------+\n"; + +$stmt="SELECT * from vicidial_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$statuses_to_print = mysql_num_rows($rslt); +$statuses_list=''; + +$o=0; +while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="SELECT * from vicidial_campaign_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$Cstatuses_to_print = mysql_num_rows($rslt); + +$o=0; +while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statuses_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} + $RAWstatus = $row[1]; + $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} + + if ($non_latin < 1) + { + $status_name = sprintf("%-20s", $statname_list[$RAWstatus]); + while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);} + } + else + { + $status_name = sprintf("%-60s", $statname_list[$RAWstatus]); + while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');} + } + + + echo "| $status | $status_name | $STATUScount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+--------+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+-------------------------------+------------+\n"; + + + + echo "\n"; echo "---------- QUEUE STATS\n"; -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -208,7 +324,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -234,7 +350,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); + $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); @@ -246,11 +362,12 @@ while ($i < $users_to_print) $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); diff --git a/LANG_www/vicidial/AST_VDADstats.php b/LANG_www/vicidial/AST_VDADstats.php index f747843b..d8afbdd6 100644 --- a/LANG_www/vicidial/AST_VDADstats.php +++ b/LANG_www/vicidial/AST_VDADstats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php # header ("Content-type: text/html; charset=utf-8"); @@ -21,6 +22,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -29,6 +32,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -87,6 +92,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFY | REPORTS \n"; echo "\n\n"; @@ -102,14 +114,37 @@ echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n"; else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -129,7 +164,7 @@ echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n"; echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -137,7 +172,7 @@ $DROPcalls = sprintf("%10s", $row[0]); $DROPcallsRAW = $row[0]; $DROPseconds = $row[1]; -$stmt="select count(*) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; +$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -175,7 +210,7 @@ echo "Average Length for DROP Calls in seconds: $average_hold_seconds\n"; echo "\n"; echo "---------- AUTO-DIAL NO ANSWERS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -238,7 +273,7 @@ while ($Cstatuses_to_print > $o) $o++; } -$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -281,10 +316,6 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) - {$vicidial_log = 'vicidial_closer_log';} -else - {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -296,7 +327,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select $vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from $vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; +$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -347,6 +378,7 @@ while ($i < $users_to_print) $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); @@ -374,7 +406,7 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date 00:00:01' and event_time <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php index dae17443..a30832be 100644 --- a/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial/AST_VICIDIAL_hopperlist.php @@ -8,7 +8,9 @@ # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# require("dbconnect.php"); @@ -123,11 +125,11 @@ echo "Total leads in hopper right now: $TOTALcalls\n"; echo "\n"; echo "---------- LEADS IN HOPPER\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; -echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; +echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;"; +$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -145,14 +147,16 @@ while ($i < $users_to_print) $gmt = sprintf("%-6s", $row[5]); $hopper_id = sprintf("%-6s", $row[6]); $alt_dial = sprintf("%-5s", $row[7]); + $list_id = sprintf("%-10s", $row[8]); + $priority = sprintf("%-6s", $row[9]); -if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} -else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} +if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} +else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} $i++; } -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; } diff --git a/LANG_www/vicidial/AST_agent_performance_detail.php b/LANG_www/vicidial/AST_agent_performance_detail.php index 72779f6e..5557d4dd 100644 --- a/LANG_www/vicidial/AST_agent_performance_detail.php +++ b/LANG_www/vicidial/AST_agent_performance_detail.php @@ -1,14 +1,13 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # -# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70118-1705 - Added user_group filtering option -# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars +# 71119-2359 - First build +# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one +# - Fixed zero division bug # require("dbconnect.php"); @@ -141,25 +140,25 @@ else { if ($shift == 'AM') { - $query_date_BEGIN = "$query_date 03:45:00"; - $query_date_END = "$query_date 15:15:00"; - $time_BEGIN = "03:45:00"; - $time_END = "15:15:00"; + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} } if ($shift == 'PM') { - $query_date_BEGIN = "$query_date 15:15:00"; - $query_date_END = "$query_date 23:15:00"; - $time_BEGIN = "15:15:00"; - $time_END = "23:15:00"; + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} } if ($shift == 'ALL') { - $query_date_BEGIN = "$query_date 00:00:00"; - $query_date_END = "$query_date 23:59:59"; - $time_BEGIN = "00:00:00"; - $time_END = "23:59:59"; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} else {$ugSQL='';} @@ -169,11 +168,22 @@ echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- AGENTS Details -------------\n\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; + + + +$statuses='-'; +$statusesTXT=''; +$statusesHEAD=''; +$statusesHTML=''; +$statusesARY[0]=''; +$j=0; +$users='-'; +$usersARY[0]=''; +$user_namesARY[0]=''; +$k=0; + +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -182,43 +192,123 @@ $i=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); - $TOTcalls=($TOTcalls + $row[0]); - $TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]); - $TOTtotTALK=($TOTtotTALK + $row[1]); - $TOTtotWAIT=($TOTtotWAIT + $row[7]); - $TOTtotPAUSE=($TOTtotPAUSE + $row[5]); - $TOTtotDISPO=($TOTtotDISPO + $row[9]); - $calls[$i] = sprintf("%-6s", $row[0]); + $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation + + $calls[$i] = $row[0]; + $talk_sec[$i] = $row[1]; + $full_name[$i] = $row[2]; + $user[$i] = $row[3]; + $pause_sec[$i] = $row[4]; + $wait_sec[$i] = $row[5]; + $dispo_sec[$i] = $row[6]; + $status[$i] = $row[7]; + if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) + { + $statusesTXT = sprintf("%8s", $status[$i]); + $statusesHEAD .= "----------+"; + $statusesHTML .= " $statusesTXT |"; + $statuses .= "$status[$i]-"; + $statusesARY[$j] = $status[$i]; + $j++; + } + if (!eregi("-$user[$i]-", $users)) + { + $users .= "$user[$i]-"; + $usersARY[$k] = $user[$i]; + $user_namesARY[$k] = $full_name[$i]; + $k++; + } + + $i++; + } + + +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +while ($m < $k) + { + $Suser=$usersARY[$m]; + $Sfull_name=$user_namesARY[$m]; + $Stime=0; + $Scalls=0; + $Stalk_sec=0; + $Spause_sec=0; + $Swait_sec=0; + $Sdispo_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) + { + $Scalls = ($Scalls + $calls[$i]); + $Stalk_sec = ($Stalk_sec + $talk_sec[$i]); + $Spause_sec = ($Spause_sec + $pause_sec[$i]); + $Swait_sec = ($Swait_sec + $wait_sec[$i]); + $Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]); + $SstatusTXT = sprintf("%8s", $calls[$i]); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + $TOTcalls=($TOTcalls + $Scalls); + $TOTtime=($TOTtime + $Stime); + $TOTtotTALK=($TOTtotTALK + $Stalk_sec); + $TOTtotWAIT=($TOTtotWAIT + $Swait_sec); + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec); + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);} + else {$Stalk_avg=0;} + if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);} + else {$Spause_avg=0;} + if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);} + else {$Swait_avg=0;} + if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} + else {$Sdispo_avg=0;} + + $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) { - $full_name[$i]= sprintf("%-15s", $row[2]); - while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);} - - $user[$i] = sprintf("%-6s", $row[3]); - while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);} + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} } else { - $full_name[$i]= sprintf("%-45s", $row[2]); - while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');} + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $user[$i] = sprintf("%-18s", $row[3]); - while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');} + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } - $user[$i] = sprintf("%-8s", $row[3]); - $USERtime = ($row[1] + $row[5] + $row[7] + $row[9]); - $USERtotTALK = $row[1]; - $USERavgTALK = $row[4]; - $USERtotPAUSE = $row[5]; - $USERavgPAUSE = $row[6]; - $USERtotWAIT = $row[7]; - $USERavgWAIT = $row[8]; - $USERtotDISPO = $row[9]; - $USERavgDISPO = $row[10]; - - $USERtime_M = ($USERtime / 60); + $USERtime_M = ($Stime / 60); $USERtime_M = round($USERtime_M, 2); $USERtime_M_int = intval("$USERtime_M"); $USERtime_S = ($USERtime_M - $USERtime_M_int); @@ -226,9 +316,9 @@ while ($i < $rows_to_print) $USERtime_S = round($USERtime_S, 0); if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";} $USERtime_MS = "$USERtime_M_int:$USERtime_S"; - $pfUSERtime_MS[$i] = sprintf("%7s", $USERtime_MS); + $pfUSERtime_MS = sprintf("%7s", $USERtime_MS); - $USERtotTALK_M = ($USERtotTALK / 60); + $USERtotTALK_M = ($Stalk_sec / 60); $USERtotTALK_M = round($USERtotTALK_M, 2); $USERtotTALK_M_int = intval("$USERtotTALK_M"); $USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int); @@ -236,9 +326,9 @@ while ($i < $rows_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS); + $pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); - $USERavgTALK_M = ($USERavgTALK / 60); + $USERavgTALK_M = ($Stalk_avg / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); $USERavgTALK_M_int = intval("$USERavgTALK_M"); $USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int); @@ -246,9 +336,9 @@ while ($i < $rows_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; - $pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS); + $pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - $USERtotPAUSE_M = ($USERtotPAUSE / 60); + $USERtotPAUSE_M = ($Spause_sec / 60); $USERtotPAUSE_M = round($USERtotPAUSE_M, 2); $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M"); $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); @@ -256,9 +346,9 @@ while ($i < $rows_to_print) $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; - $pfUSERtotPAUSE_MS[$i] = sprintf("%6s", $USERtotPAUSE_MS); + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); - $USERavgPAUSE_M = ($USERavgPAUSE / 60); + $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M = round($USERavgPAUSE_M, 2); $USERavgPAUSE_M_int = intval("$USERavgPAUSE_M"); $USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int); @@ -266,9 +356,9 @@ while ($i < $rows_to_print) $USERavgPAUSE_S = round($USERavgPAUSE_S, 0); if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";} $USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S"; - $pfUSERavgPAUSE_MS[$i] = sprintf("%6s", $USERavgPAUSE_MS); + $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS); - $USERtotWAIT_M = ($USERtotWAIT / 60); + $USERtotWAIT_M = ($Swait_sec / 60); $USERtotWAIT_M = round($USERtotWAIT_M, 2); $USERtotWAIT_M_int = intval("$USERtotWAIT_M"); $USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int); @@ -276,9 +366,9 @@ while ($i < $rows_to_print) $USERtotWAIT_S = round($USERtotWAIT_S, 0); if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";} $USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S"; - $pfUSERtotWAIT_MS[$i] = sprintf("%6s", $USERtotWAIT_MS); + $pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS); - $USERavgWAIT_M = ($USERavgWAIT / 60); + $USERavgWAIT_M = ($Swait_avg / 60); $USERavgWAIT_M = round($USERavgWAIT_M, 2); $USERavgWAIT_M_int = intval("$USERavgWAIT_M"); $USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int); @@ -286,9 +376,9 @@ while ($i < $rows_to_print) $USERavgWAIT_S = round($USERavgWAIT_S, 0); if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";} $USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S"; - $pfUSERavgWAIT_MS[$i] = sprintf("%6s", $USERavgWAIT_MS); + $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS); - $USERtotDISPO_M = ($USERtotDISPO / 60); + $USERtotDISPO_M = ($Sdispo_sec / 60); $USERtotDISPO_M = round($USERtotDISPO_M, 2); $USERtotDISPO_M_int = intval("$USERtotDISPO_M"); $USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int); @@ -296,9 +386,9 @@ while ($i < $rows_to_print) $USERtotDISPO_S = round($USERtotDISPO_S, 0); if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";} $USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S"; - $pfUSERtotDISPO_MS[$i] = sprintf("%6s", $USERtotDISPO_MS); + $pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS); - $USERavgDISPO_M = ($USERavgDISPO / 60); + $USERavgDISPO_M = ($Sdispo_avg / 60); $USERavgDISPO_M = round($USERavgDISPO_M, 2); $USERavgDISPO_M_int = intval("$USERavgDISPO_M"); $USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int); @@ -306,42 +396,51 @@ while ($i < $rows_to_print) $USERavgDISPO_S = round($USERavgDISPO_S, 0); if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";} $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; - $pfUSERavgDISPO_MS[$i] = sprintf("%6s", $USERavgDISPO_MS); + $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - $i++; + echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $m++; } +### END loop through each user ### -$k=0; -while($k < $i) + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$n=0; +while ($n < $j) { - $ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 "; - $stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rows_to_print = mysql_num_rows($rslt); - $m=0; - while ($m < $rows_to_print) + $Scalls=0; + $Sstatus=$statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) { - $row=mysql_fetch_row($rslt); - if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);} - if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);} - if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);} - if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);} - if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);} - if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);} - if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);} - if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]); $TOT_CB = ($TOT_CB + $row[0]);} - $m++; + if ($Sstatus=="$status[$i]") + { + $Scalls = ($Scalls + $calls[$i]); + $status_found++; + } + $i++; } - echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n"; - - - - $k++; + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $SUMstatusTXT = sprintf("%8s", $Scalls); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; } +### END loop through each status ### - $TOTcalls = sprintf("%-7s", $TOTcalls); + + $TOTcalls = sprintf("%7s", $TOTcalls); + $TOT_AGENTS = sprintf("%-4s", $m); $TOTtime_M = ($TOTtime / 60); $TOTtime_M = round($TOTtime_M, 2); @@ -351,8 +450,8 @@ while($k < $i) $TOTtime_S = round($TOTtime_S, 0); if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";} $TOTtime_MS = "$TOTtime_M_int:$TOTtime_S"; - $TOTtime_MS = sprintf("%7s", $TOTtime_MS); - while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} + $TOTtime_MS = sprintf("%8s", $TOTtime_MS); + while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} $TOTtotTALK_M = ($TOTtotTALK / 60); $TOTtotTALK_M = round($TOTtotTALK_M, 2); @@ -362,8 +461,8 @@ while($k < $i) $TOTtotTALK_S = round($TOTtotTALK_S, 0); if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";} $TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S"; - $TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS); - while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} + $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); + while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} $TOTtotDISPO_M = ($TOTtotDISPO / 60); $TOTtotDISPO_M = round($TOTtotDISPO_M, 2); @@ -373,8 +472,8 @@ while($k < $i) $TOTtotDISPO_S = round($TOTtotDISPO_S, 0); if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";} $TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S"; - $TOTtotDISPO_MS = sprintf("%7s", $TOTtotDISPO_MS); - while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} + $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); + while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); $TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2); @@ -384,8 +483,8 @@ while($k < $i) $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; - $TOTtotPAUSE_MS = sprintf("%7s", $TOTtotPAUSE_MS); - while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} $TOTtotWAIT_M = ($TOTtotWAIT / 60); $TOTtotWAIT_M = round($TOTtotWAIT_M, 2); @@ -395,8 +494,8 @@ while($k < $i) $TOTtotWAIT_S = round($TOTtotWAIT_S, 0); if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";} $TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S"; - $TOTtotWAIT_MS = sprintf("%7s", $TOTtotWAIT_MS); - while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} + $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); + while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); @@ -443,27 +542,16 @@ while($k < $i) $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} - - $TOT_A = sprintf("%-5s", $TOT_A); - $TOT_B = sprintf("%-5s", $TOT_B); - $TOT_DC = sprintf("%-5s", $TOT_DC); - $TOT_DNC = sprintf("%-5s", $TOT_DNC); - $TOT_N = sprintf("%-5s", $TOT_N); - $TOT_NI = sprintf("%-5s", $TOT_NI); - $TOT_CB = sprintf("%-5s", $TOT_CB); - $TOT_SALE = sprintf("%-5s", $TOT_SALE); - $TOT_AGENTS = sprintf("%-4s", $k); -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "\n"; } - ?> \ No newline at end of file diff --git a/LANG_www/vicidial/AST_server_performance.php b/LANG_www/vicidial/AST_server_performance.php index b5c39ba5..afa75bd3 100644 --- a/LANG_www/vicidial/AST_server_performance.php +++ b/LANG_www/vicidial/AST_server_performance.php @@ -147,12 +147,12 @@ $AVGcpuUSER = sprintf("%10s", $row[0]); $AVGcpuSYSTEM = sprintf("%10s", $row[1]); $AVGcpuIDLE = sprintf("%10s", $row[2]); -# $stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $TOTALcalls = sprintf("%10s", $row[0]); -# $OFFHOOKtime = sprintf("%10s", $row[1]); +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$row=mysql_fetch_row($rslt); +$TOTALcalls = sprintf("%10s", $row[0]); +$OFFHOOKtime = sprintf("%10s", $row[1]); echo "Total Calls in/out on this server: $TOTALcalls\n"; @@ -199,7 +199,7 @@ fclose($DATfp); $rows_to_max = ($rows_to_print + 100); -print "rows: $i\n"; +#print "rows: $i\n"; $time_scale_abb = '5 minutes'; $time_scale_tick = '1 minute'; diff --git a/LANG_www/vicidial/AST_timeonVDADall.php b/LANG_www/vicidial/AST_timeonVDADall.php index 5946b75a..ec8eb52a 100644 --- a/LANG_www/vicidial/AST_timeonVDADall.php +++ b/LANG_www/vicidial/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -26,7 +26,9 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) -# +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# header ("Content-type: text/html; charset=utf-8"); @@ -213,6 +215,10 @@ $F=''; $FG=''; $B=''; $BG=''; \n"; echo"\n"; @@ -311,10 +317,10 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;"; + $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } if ($non_latin > 0) { @@ -322,14 +328,23 @@ $rslt=mysql_query("SET NAMES 'UTF8'"); } $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -391,11 +406,31 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -436,7 +471,7 @@ echo "\n\n"; ################################################################################### ###### OUTBOUND CALLS ################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($non_latin > 0) @@ -493,7 +528,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} diff --git a/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php index 47e1d270..242b27a0 100644 --- a/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -11,6 +11,8 @@ # 61102-1616 - first build # 61215-1131 - added answered calls and drop percent taken from answered calls # 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction # header ("Content-type: text/html; charset=utf-8"); @@ -130,6 +132,12 @@ $group = $groups[$k]; echo "$group   -   "; echo "Modify\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -160,17 +168,26 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -224,11 +241,27 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -245,7 +278,7 @@ echo ""; ################################################################################ ###### OUTBOUND CALLS ################################################################################ -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); @@ -294,7 +327,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} diff --git a/LANG_www/vicidial/admin.php b/LANG_www/vicidial/admin.php index f82ea5f8..7fc0228a 100644 --- a/LANG_www/vicidial/admin.php +++ b/LANG_www/vicidial/admin.php @@ -8,10 +8,18 @@ require("dbconnect.php"); -$page_width='750'; -$section_width='700'; + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='720'; $header_font_size='3'; $subheader_font_size='2'; +$subcamp_font_size='2'; $header_selected_bold=''; $header_nonselected_bold=''; $users_color = '#FFFF99'; @@ -34,11 +42,12 @@ $reports_color = '#99FF33'; #$filters_color = '#FFFF99'; #$admin_color = '#FFFF99'; #$reports_color = '#FFFF99'; - $times_color = '#CCCC00'; - $phones_color = '#CCCC00'; - $conference_color = '#CCCC00'; - $server_color = '#CCCC00'; - $settings_color = '#CCCC00'; + $times_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -54,11 +63,21 @@ $reports_font = 'BLACK'; $conference_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; + $status_font = 'BLACK'; +$subcamp_color = '#FF9933'; +$subcamp_font = 'BLACK'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["active"])) {$active=$_GET["active"];} @@ -73,7 +92,9 @@ if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$ elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} @@ -303,6 +324,8 @@ if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} @@ -584,6 +607,68 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -595,7 +680,11 @@ if (strlen($dial_status) > 0) $status = $dial_status; } -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### if ($non_latin < 1) { @@ -714,6 +803,14 @@ $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); +$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); +$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); +$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); +$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + +### DIGITS and DASHES +$group_rank = ereg_replace("[^-0-9]","",$group_rank); +$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -736,6 +833,9 @@ $agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); +$human_answered = ereg_replace("[^NY]","",$human_answered); +$tovdad_display = ereg_replace("[^NY]","",$tovdad_display); +$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -754,6 +854,9 @@ $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); +$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); +$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); +$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -826,6 +929,17 @@ $dial_status = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status); $queuemetrics_eq_prepend = ereg_replace("[^-\_0-9a-zA-Z]","",$queuemetrics_eq_prepend); $vicidial_agent_disable = ereg_replace("[^-\_0-9a-zA-Z]","",$vicidial_agent_disable); $alter_custdata_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custdata_override); +$list_order_mix = ereg_replace("[^-\_0-9a-zA-Z]","",$list_order_mix); +$vcl_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vcl_id); +$mix_method = ereg_replace("[^-\_0-9a-zA-Z]","",$mix_method); +$category = ereg_replace("[^-\_0-9a-zA-Z]","",$category); +$vsc_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vsc_id); +$moh_context = ereg_replace("[^-\_0-9a-zA-Z]","",$moh_context); +$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); +$source_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_campaign_id); +$source_user_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_user_id); +$source_group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_group_id); +$default_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$default_xfer_group); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -860,6 +974,9 @@ $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); +$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); +$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); +$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -874,9 +991,13 @@ $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); +$after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after_hours_message_filename); +$welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); +$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); +$list_mix_container = ereg_replace(";","",$list_mix_container); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -994,15 +1115,48 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper # 70322-1455 - Added sipsak messages parameters # 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section - +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# +# # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.95'; -$build = '70402-1157'; +$admin_version = '2.0.4-119'; +$build = '71125-1751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); +$MT[0]=''; +$US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); if ($force_logout) { @@ -1095,6 +1249,13 @@ $browser = getenv("HTTP_USER_AGENT"); } } +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + header ("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n"; @@ -1103,11 +1264,14 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} +if ($ADD=="1") {$hh='users'; echo "Add New User";} +if ($ADD=="1A") {$hh='users'; echo "Copy User";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Add New Campaign";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Campaign";} if ($ADD==111) {$hh='lists'; echo "Add New List";} if ($ADD==121) {$hh='lists'; echo "Add New DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} +if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Group";} if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} @@ -1118,16 +1282,20 @@ if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==26) {$hh='campaigns'; echo "New Auto Alt Dial Status";} -if ($ADD==27) {$hh='campaigns'; echo "New Agent Pause Code";} -if ($ADD==28) {$hh='campaigns'; echo "Campaign Dial Status Added";} +if ($ADD=="2") {$hh='users'; echo "New User Addition";} +if ($ADD=="2A") {$hh='users'; echo "New Copied User Addition";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "New Copied Campaign Addition";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "New Campaign Addition";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "New Campaign Status Addition";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campaign HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "New Campaign Lead Recycle Addition";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "New Auto Alt Dial Status";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "New Agent Pause Code";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Added";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Added";} if ($ADD==211) {$hh='lists'; echo "New List Addition";} if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} +if ($ADD==2011) {$hh='ingroups'; echo "New Copied In-Group Addition";} if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} @@ -1139,10 +1307,28 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL SYSTEM STATUSES";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL STATUS CATEGORY";} if ($ADD==3) {$hh='users'; echo "Modify User";} if ($ADD==30) {$hh='campaigns'; echo "Campaign Not Allowed";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Modify Campaign - Detail - $campaign_id"; + if ($SUB==22) {echo " - Statuses";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " - Lead Recycle Entries";} + if ($SUB==26) {echo " - Auto Alt Dial Statuses";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==29) {echo " - List Mixes";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Campaign Statuses";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaign HotKeys";} +if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Campaign Lead Recycle Entries";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Campaign Auto Alt Dial Statuses";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Campaign Agent Pause Codes";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Statuses";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mixes";} if ($ADD==311) {$hh='lists'; echo "Modify List";} if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} @@ -1157,15 +1343,18 @@ if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORY";} if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";} -if ($ADD==47) {$hh='campaigns'; echo "Modify Agent Pause Code";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Modify Campaign";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Modify Campaign Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modify Campaign HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modify Campaign Lead Recycle";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modify Agent Pause Code";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modify Campaign List Mix";} if ($ADD==411) {$hh='lists'; echo "Modify List";} if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} @@ -1180,10 +1369,12 @@ if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER VICIDIAL if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORIES";} if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==53) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} if ($ADD==511) {$hh='lists'; echo "Delete List";} if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} @@ -1197,13 +1388,14 @@ if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==63) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";} -if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} -if ($ADD==66) {$hh='campaigns'; echo "Delete Auto Alt Dial Status";} -if ($ADD==67) {$hh='campaigns'; echo "Delete Agent Pause Code";} -if ($ADD==68) {$hh='campaigns'; echo "Campaign Dial Status Removed";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Delete Lead Recycle";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Delete Auto Alt Dial Status";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Delete Agent Pause Code";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Removed";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Removed";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} @@ -1221,10 +1413,10 @@ if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} if ($ADD==0) {$hh='users'; echo "Users List";} if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";} if ($ADD==811) {$hh='lists'; echo "CallBacks Within List";} if ($ADD==8111) {$hh='usergroups'; echo "CallBacks Within User Group";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campaigns";} if ($ADD==100) {$hh='lists'; echo "Lists";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} @@ -1308,29 +1500,142 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o++; } - ##### get campaigns listing for dynamic pulldown + ##### BEGIN get campaigns listing for rankings ##### + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysql_fetch_row($rslt); $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; $o++; } + $o=0; + while ($campaigns_to_print > $o) + { + $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; } if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) @@ -1358,28 +1663,103 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) { - if ($group_id_value == $groups[$p]) + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) { $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; } $p++; } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td></tr>\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} } ##### END get inbound groups listing for checkboxes ##### @@ -1395,7 +1775,6 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $campaigns = explode(" ", $allowed_campaigns); - echo "<!-- $allowed_campaigns -->"; } $campaigns_value=''; @@ -1464,6 +1843,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1522,11 +1910,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Agent Choose Ingroups -</B> This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page. -<BR> -<A NAME="vicidial_users-closer_campaigns"> -<BR> -<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - <BR> <A NAME="vicidial_users-scheduled_callbacks"> <BR> @@ -1562,6 +1945,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>VICIDIAL Recording Override -</B> This option will override whatever the option is in the campaign for recording. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load. +<BR> +<A NAME="vicidial_users-vicidial_users-campaign_ranks"> +<BR> +<B>Campaign Ranks -</B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank. + +<BR> +<A NAME="vicidial_users-closer_campaigns"> +<BR> +<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. You will also be able to set the rank, or skill level, in this section for each of the inbound groups as well as being able to see the number of calls received from each inbound group for this specific agent. Also in this section is the ability to give the agent a rank for each inbound group. These ranks can be used for preferred call routing when that option is selected in the in-group screen. + <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> @@ -1722,6 +2115,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Allow Closers -</B> This is where you can set whether the users of this campaign will have the option to send the call to a closer. +<BR> +<A NAME="vicidial_campaigns-default_xfer_group"> +<BR> +<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface. + +<BR> +<A NAME="vicidial_campaigns-xfer_groups"> +<BR> +<B>Allowed Transfer Groups -</B> With these checkbox listings you can select the groups that agents in this campaign can transfer calls to. Allow Closers must be enabled for this option to show up. + +<BR> +<A NAME="vicidial_campaigns-campaign_allow_inbound"> +<BR> +<B>Allow Inbound and Blended -</B> This is where you can set whether the users of this campaign will have the option to take inbound calls with this campaign. If you want to do blended inbound and outbound then this must be set to Y. If you only want to do outbound dialing on this campaign set this to N. Default is N. + <BR> <A NAME="vicidial_campaigns-dial_status"> <BR> @@ -1816,6 +2224,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. <BR>   - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. <BR>   - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. + <BR>   - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. + <BR>   - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. <BR> <A NAME="vicidial_campaigns-local_call_time"> @@ -1957,6 +2367,37 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Allow No-Hopper-Leads Logins -</B> If set to Y, allows agents to login to the campaign even if there are no leads loaded into the hopper for that campaign. This function is not needed in CLOSER-type campaigns. Default is N. +<BR> +<A NAME="vicidial_campaigns-list_order_mix"> +<BR> +<B>List Order Mix -</B> Overrides the Lead Order and Dial Status fields. Will use the List and status parameters for the selected List Mix entry in the List Mix sub section instead. Default is DISABLED. + +<BR> +<A NAME="vicidial_campaigns-vcl_id"> +<BR> +<B>List Mix ID -</B> ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation. + +<BR> +<A NAME="vicidial_campaigns-vcl_name"> +<BR> +<B>List Mix Name -</B> Descriptive name of the list mix. Must be from 2-50 characters in length. + +<BR> +<A NAME="vicidial_campaigns-list_mix_container"> +<BR> +<B>List Mix Detail -</B> The composition of the List Mix entry. Contains the List ID, mix order, percentages and statuses that make up this List Mix. The percentages always have to add up to 100, and the lists all have to be active and set to the campaign for the order mix entry to be Activated. + +<BR> +<A NAME="vicidial_campaigns-mix_method"> +<BR> +<B>List Mix Method -</B> The method of mixing all of the parts of the List Mix Detail together. EVEN_MIX will mix leads from each part interleaved with the other parts, like this 1,2,3,1,2,3,1,2,3. IN_ORDER will put the leads in the order in which they are listed in the List Mix Detail screen 1,1,1,2,2,2,3,3,3. RANDOM will put them in RANDOM order 1,3,2,1,1,3,2,1,3. Default is IN_ORDER. + +<BR> +<A NAME="vicidial_campaigns-manual_dial_list_id"> +<BR> +<B>Manual Dial List ID -</B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only. + + <BR><BR><BR><BR> @@ -2043,7 +2484,10 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. <BR>   - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. <BR>   - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - + <BR>   - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest. + <BR>   - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. + <BR>   - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. + <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> <A NAME="vicidial_inbound_groups-fronter_display"> <BR> @@ -2084,6 +2528,66 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Drop Exten -</B> This is the dial plan extension that the desired Dropped call audio file is located at on your server. +<BR> +<A NAME="vicidial_inbound_groups-call_time_id"> +<BR> +<B>Call Time -</B> This is the call time scheme to use for this inbound group. Keep in mind that the time is based on the server time. Default is 24hours. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_action"> +<BR> +<B>After Hours Action -</B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field. Default is MESSAGE. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_message_filename"> +<BR> +<B>After Hours Message Filename -</B> The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_exten"> +<BR> +<B>After Hours Extension -</B> The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_voicemail"> +<BR> +<B>After Hours Voicemail -</B> The voicemail box to send the call to if the Action is set to VOICEMAIL. + +<BR> +<A NAME="vicidial_inbound_groups-welcome_message_filename"> +<BR> +<B>Welcome Message Filename -</B> The audio file located on the server to be played when the call comes in. If set to ---NONE--- then no message will be played. Default is ---NONE--- + +<BR> +<A NAME="vicidial_inbound_groups-moh_context"> +<BR> +<B>Music On Hold Context -</B> The music on hold context to use when the customer is placed on hold. Default is default. + +<BR> +<A NAME="vicidial_inbound_groups-onhold_prompt_filename"> +<BR> +<B>On Hold Prompt Filename -</B> The audio file located on the server to be played at a regular interval when the customer is on hold. Default is generic_hold. This audio file MUST be 9 seconds or less in length. + +<BR> +<A NAME="vicidial_inbound_groups-prompt_interval"> +<BR> +<B>On Hold Prompt Interval -</B> The length of time in seconds to wait before playing the on hold prompt. Default is 60. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_exten"> +<BR> +<B>Agent Alert Extension -</B> The extension to send into the agent session to announce that a call is coming to the agent. This extension should have a Playback of an audio file. To not use this function set this to X. Default is X. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_delay"> +<BR> +<B>Agent Alert Delay -</B> The length of time in milliseconds to wait before sending the call to the agent after playing the on Agent Alert Extension. Default is 1000. + +<BR> +<A NAME="vicidial_inbound_groups-default_xfer_group"> +<BR> +<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface. + <BR><BR><BR><BR> @@ -2137,7 +2641,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSES TABLE</FONT></B><BR><BR> <A NAME="vicidial_campaign_statuses"> <BR> -<B>Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition.</B> +<B>Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.</B> @@ -2226,7 +2730,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Script Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> -<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290"> +<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> @@ -2301,7 +2805,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL LIST LOADER FUNCTIONALITY</FONT></B><BR><BR> <A NAME="vicidial_list_loader"> <BR> -The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation, but it does allow you to check for duplicates in itself, within the campaign or within the entire system. Also, make sure that you have created the list that these leads are to be under so that you can use them. Here is a list of the fields in their proper order for the lead files: <OL> <LI>Vendor Lead Code - shows up in the Vendor ID field of the GUI <LI>Source Code - internal use only for admins and DBAs @@ -2328,7 +2832,7 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file <LI>Comments </OL> -<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. +<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads. @@ -2882,6 +3386,30 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file <BR> <B>Admin Home URL -</B> This is the URL or web site address that you will go to if you click on the HOME link at the top of the admin.php page. +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Enable Agent Transfer Logfile -</B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUSES TABLE</FONT></B><BR><BR> +<A NAME="vicidial_statuses"> +<BR> +<B>Through the use of system statuses, you can have statuses that exist for campaign and in-group. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.</B> + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES TABLE</FONT></B><BR><BR> +<A NAME="vicidial_status_categories"> +<BR> +<B>Through the use of system status categories, you can group together statuses to allow for statistical analysis on a group of statuses. The Category ID must be 2-20 characters in length with no spaces, the name must be 2-50 characters in length, the description is optional and TimeonVDAD Display defines whether that status will be one of the upto 4 statuses that can be calculated and displayed on the Time On VDAD Real-Time report.</B> + @@ -2896,6 +3424,12 @@ exit; } +###################################################################################################### +###################################################################################################### +####### 7 series, filter count preview and script preview +###################################################################################################### +###################################################################################################### + @@ -3156,9 +3690,119 @@ if ($hh=='reports') {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} +echo "\n"; +echo " -VICIDIAL ADMIN: Super Lead Loader +VICIDIAL ADMIN: Lead Loader
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - +
@@ -299,13 +303,22 @@ function ParseFileName() { + + + + - + @@ -314,15 +327,14 @@ function ParseFileName() { - - +
Load leads from this file: List ID Override: (numbers only or leave blank for values in the file)
Phone Code Override: (numbers only or leave blank for values in the file)
File layout to use: Standard VICIDIAL    Custom layout
Lead Duplicate Check:
Lead Time Zone Lookup:
        
CLICK HERE TO GO TO THE BASIC LEAD LOADER         BACK TO ADMIN
SUPER LIST LOADER-     VERSION:     BUILD:
        BACK TO ADMINLIST LOADER-     VERSION:     BUILD:    
document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + print ""; flush(); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -350,6 +362,11 @@ function ParseFileName() { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } + while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -396,9 +413,78 @@ function ParseFileName() { # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -408,6 +494,7 @@ function ParseFileName() { { $row=mysql_fetch_row($rslt); $dup_lead = $row[0]; + $dup_lead_list = $list_id; } if ($dup_lead < 1) { @@ -441,7 +528,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -473,11 +560,17 @@ function ParseFileName() { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + } # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); @@ -491,6 +584,11 @@ function ParseFileName() { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } + while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -528,12 +626,80 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -577,7 +743,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -637,6 +803,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + } while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -680,12 +850,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -729,7 +967,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -768,9 +1006,11 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else @@ -795,6 +1035,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -832,12 +1076,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -881,7 +1193,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -906,7 +1218,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
"; flush(); - print "\r\n"; + print "
\r\n"; print " \r\n"; print " \r\n"; print " \r\n"; @@ -945,6 +1257,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); @@ -1016,7 +1332,9 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } @@ -1043,6 +1361,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); @@ -1102,6 +1424,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print "
VICIDIAL ColumnFile data        
\r\n"; diff --git a/LANG_www/vicidial/user_stats.php b/LANG_www/vicidial/user_stats.php index eb6ee8da..ecd457f8 100644 --- a/LANG_www/vicidial/user_stats.php +++ b/LANG_www/vicidial/user_stats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit # 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation # header ("Content-type: text/html; charset=utf-8"); @@ -263,7 +264,7 @@ echo "

\n"; echo "
\n"; -echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; echo "\n"; @@ -298,9 +299,45 @@ echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD


\n"; +echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "\n"; +echo "\n"; + + $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + } + + +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; + + + + echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; -echo "\n"; +echo "\n"; $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -315,16 +352,25 @@ echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $location = $row[11]; + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } diff --git a/LANG_www/vicidial_de/AST_CLOSERstats.php b/LANG_www/vicidial_de/AST_CLOSERstats.php index 60611f3f..35c1298b 100644 --- a/LANG_www/vicidial_de/AST_CLOSERstats.php +++ b/LANG_www/vicidial_de/AST_CLOSERstats.php @@ -8,6 +8,8 @@ # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown # require("dbconnect.php"); @@ -19,6 +21,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -27,6 +31,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -85,6 +91,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           ÄNDERN Sie | REPORTS \n"; echo "\n\n"; @@ -100,14 +113,37 @@ echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Automobil-Vorwahlknopf Genauerer Notfall $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -128,7 +164,7 @@ echo "Average Call Length for all Calls: $average_hold_seconds second echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -154,10 +190,90 @@ else echo "Gesamt-TROPFEN Anrufe: $DROPcalls $DROPpercent%\n"; echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; + + +############################## +######### CALL STATUS STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL STATUS STATS\n"; +echo "+--------+----------------------+------------+\n"; +echo "| STATUS | DESCRIPTION | CALLS |\n"; +echo "+--------+----------------------+------------+\n"; + +$stmt="SELECT * from vicidial_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$statuses_to_print = mysql_num_rows($rslt); +$statuses_list=''; + +$o=0; +while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="SELECT * from vicidial_campaign_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$Cstatuses_to_print = mysql_num_rows($rslt); + +$o=0; +while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statuses_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} + $RAWstatus = $row[1]; + $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} + + if ($non_latin < 1) + { + $status_name = sprintf("%-20s", $statname_list[$RAWstatus]); + while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);} + } + else + { + $status_name = sprintf("%-60s", $statname_list[$RAWstatus]); + while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');} + } + + + echo "| $status | $status_name | $STATUScount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+--------+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+-------------------------------+------------+\n"; + + + + echo "\n"; echo "---------- QUEUE STATS\n"; -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -208,7 +324,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| MITTEL | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -234,7 +350,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); + $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); @@ -246,11 +362,12 @@ while ($i < $users_to_print) $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); diff --git a/LANG_www/vicidial_de/AST_VDADstats.php b/LANG_www/vicidial_de/AST_VDADstats.php index 9c3adca8..323c167b 100644 --- a/LANG_www/vicidial_de/AST_VDADstats.php +++ b/LANG_www/vicidial_de/AST_VDADstats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php # header ("Content-type: text/html; charset=utf-8"); @@ -21,6 +22,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -29,6 +32,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -87,6 +92,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           ÄNDERN Sie | REPORTS \n"; echo "\n\n"; @@ -102,14 +114,37 @@ echo "WÄHLEN Sie BITTE Eine KAMPAGNE Vor UND DATUM OBEN UND KLICKEN REICHTEin\n else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -129,7 +164,7 @@ echo "Durchschnittliche Anruf-Länge für alle benennt in den Sekunden: $average echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -137,7 +172,7 @@ $DROPcalls = sprintf("%10s", $row[0]); $DROPcallsRAW = $row[0]; $DROPseconds = $row[1]; -$stmt="select count(*) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; +$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -175,7 +210,7 @@ echo "Durchschnittliche Länge für TROPFEN Anrufe in den Sekunden: $average echo "\n"; echo "----------AUTO-DIAL KEINE ANTWORTEN\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -238,7 +273,7 @@ while ($Cstatuses_to_print > $o) $o++; } -$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -281,10 +316,6 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) - {$vicidial_log = 'vicidial_closer_log';} -else - {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -296,7 +327,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| MITTEL | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select $vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from $vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; +$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -347,6 +378,7 @@ while ($i < $users_to_print) $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); @@ -374,7 +406,7 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date 00:00:01' and event_time <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php index d0a73e6b..0e9147e8 100644 --- a/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_de/AST_VICIDIAL_hopperlist.php @@ -8,7 +8,9 @@ # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# require("dbconnect.php"); @@ -123,11 +125,11 @@ echo "Gesamtleitungen im Zufuhrbehälter im Augenblick: $TOTALcalls\n"; echo "\n"; echo "---------- LEADS IN HOPPER\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; -echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; +echo "|ORDER |PRIORITY| LEAD ID | LISTE IDENTIFIKATION | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;"; +$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -145,14 +147,16 @@ while ($i < $users_to_print) $gmt = sprintf("%-6s", $row[5]); $hopper_id = sprintf("%-6s", $row[6]); $alt_dial = sprintf("%-5s", $row[7]); + $list_id = sprintf("%-10s", $row[8]); + $priority = sprintf("%-6s", $row[9]); -if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} -else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} +if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} +else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} $i++; } -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; } diff --git a/LANG_www/vicidial_de/AST_agent_performance_detail.php b/LANG_www/vicidial_de/AST_agent_performance_detail.php index 658dcba3..d860d02c 100644 --- a/LANG_www/vicidial_de/AST_agent_performance_detail.php +++ b/LANG_www/vicidial_de/AST_agent_performance_detail.php @@ -1,14 +1,13 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # -# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70118-1705 - Added user_group filtering option -# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars +# 71119-2359 - First build +# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one +# - Fixed zero division bug # require("dbconnect.php"); @@ -141,25 +140,25 @@ else { if ($shift == 'AM') { - $query_date_BEGIN = "$query_date 03:45:00"; - $query_date_END = "$query_date 15:15:00"; - $time_BEGIN = "03:45:00"; - $time_END = "15:15:00"; + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} } if ($shift == 'PM') { - $query_date_BEGIN = "$query_date 15:15:00"; - $query_date_END = "$query_date 23:15:00"; - $time_BEGIN = "15:15:00"; - $time_END = "23:15:00"; + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} } if ($shift == 'ALL') { - $query_date_BEGIN = "$query_date 00:00:00"; - $query_date_END = "$query_date 23:59:59"; - $time_BEGIN = "00:00:00"; - $time_END = "23:59:59"; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} else {$ugSQL='';} @@ -169,11 +168,22 @@ echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- AGENTS Details -------------\n\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; + + + +$statuses='-'; +$statusesTXT=''; +$statusesHEAD=''; +$statusesHTML=''; +$statusesARY[0]=''; +$j=0; +$users='-'; +$usersARY[0]=''; +$user_namesARY[0]=''; +$k=0; + +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -182,43 +192,123 @@ $i=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); - $TOTcalls=($TOTcalls + $row[0]); - $TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]); - $TOTtotTALK=($TOTtotTALK + $row[1]); - $TOTtotWAIT=($TOTtotWAIT + $row[7]); - $TOTtotPAUSE=($TOTtotPAUSE + $row[5]); - $TOTtotDISPO=($TOTtotDISPO + $row[9]); - $calls[$i] = sprintf("%-6s", $row[0]); + $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation + + $calls[$i] = $row[0]; + $talk_sec[$i] = $row[1]; + $full_name[$i] = $row[2]; + $user[$i] = $row[3]; + $pause_sec[$i] = $row[4]; + $wait_sec[$i] = $row[5]; + $dispo_sec[$i] = $row[6]; + $status[$i] = $row[7]; + if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) + { + $statusesTXT = sprintf("%8s", $status[$i]); + $statusesHEAD .= "----------+"; + $statusesHTML .= " $statusesTXT |"; + $statuses .= "$status[$i]-"; + $statusesARY[$j] = $status[$i]; + $j++; + } + if (!eregi("-$user[$i]-", $users)) + { + $users .= "$user[$i]-"; + $usersARY[$k] = $user[$i]; + $user_namesARY[$k] = $full_name[$i]; + $k++; + } + + $i++; + } + + +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +while ($m < $k) + { + $Suser=$usersARY[$m]; + $Sfull_name=$user_namesARY[$m]; + $Stime=0; + $Scalls=0; + $Stalk_sec=0; + $Spause_sec=0; + $Swait_sec=0; + $Sdispo_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) + { + $Scalls = ($Scalls + $calls[$i]); + $Stalk_sec = ($Stalk_sec + $talk_sec[$i]); + $Spause_sec = ($Spause_sec + $pause_sec[$i]); + $Swait_sec = ($Swait_sec + $wait_sec[$i]); + $Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]); + $SstatusTXT = sprintf("%8s", $calls[$i]); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + $TOTcalls=($TOTcalls + $Scalls); + $TOTtime=($TOTtime + $Stime); + $TOTtotTALK=($TOTtotTALK + $Stalk_sec); + $TOTtotWAIT=($TOTtotWAIT + $Swait_sec); + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec); + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);} + else {$Stalk_avg=0;} + if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);} + else {$Spause_avg=0;} + if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);} + else {$Swait_avg=0;} + if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} + else {$Sdispo_avg=0;} + + $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) { - $full_name[$i]= sprintf("%-15s", $row[2]); - while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);} - - $user[$i] = sprintf("%-6s", $row[3]); - while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);} + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} } else { - $full_name[$i]= sprintf("%-45s", $row[2]); - while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');} + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $user[$i] = sprintf("%-18s", $row[3]); - while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');} + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } - $user[$i] = sprintf("%-8s", $row[3]); - $USERtime = ($row[1] + $row[5] + $row[7] + $row[9]); - $USERtotTALK = $row[1]; - $USERavgTALK = $row[4]; - $USERtotPAUSE = $row[5]; - $USERavgPAUSE = $row[6]; - $USERtotWAIT = $row[7]; - $USERavgWAIT = $row[8]; - $USERtotDISPO = $row[9]; - $USERavgDISPO = $row[10]; - - $USERtime_M = ($USERtime / 60); + $USERtime_M = ($Stime / 60); $USERtime_M = round($USERtime_M, 2); $USERtime_M_int = intval("$USERtime_M"); $USERtime_S = ($USERtime_M - $USERtime_M_int); @@ -226,9 +316,9 @@ while ($i < $rows_to_print) $USERtime_S = round($USERtime_S, 0); if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";} $USERtime_MS = "$USERtime_M_int:$USERtime_S"; - $pfUSERtime_MS[$i] = sprintf("%7s", $USERtime_MS); + $pfUSERtime_MS = sprintf("%7s", $USERtime_MS); - $USERtotTALK_M = ($USERtotTALK / 60); + $USERtotTALK_M = ($Stalk_sec / 60); $USERtotTALK_M = round($USERtotTALK_M, 2); $USERtotTALK_M_int = intval("$USERtotTALK_M"); $USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int); @@ -236,9 +326,9 @@ while ($i < $rows_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS); + $pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); - $USERavgTALK_M = ($USERavgTALK / 60); + $USERavgTALK_M = ($Stalk_avg / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); $USERavgTALK_M_int = intval("$USERavgTALK_M"); $USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int); @@ -246,9 +336,9 @@ while ($i < $rows_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; - $pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS); + $pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - $USERtotPAUSE_M = ($USERtotPAUSE / 60); + $USERtotPAUSE_M = ($Spause_sec / 60); $USERtotPAUSE_M = round($USERtotPAUSE_M, 2); $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M"); $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); @@ -256,9 +346,9 @@ while ($i < $rows_to_print) $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; - $pfUSERtotPAUSE_MS[$i] = sprintf("%6s", $USERtotPAUSE_MS); + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); - $USERavgPAUSE_M = ($USERavgPAUSE / 60); + $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M = round($USERavgPAUSE_M, 2); $USERavgPAUSE_M_int = intval("$USERavgPAUSE_M"); $USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int); @@ -266,9 +356,9 @@ while ($i < $rows_to_print) $USERavgPAUSE_S = round($USERavgPAUSE_S, 0); if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";} $USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S"; - $pfUSERavgPAUSE_MS[$i] = sprintf("%6s", $USERavgPAUSE_MS); + $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS); - $USERtotWAIT_M = ($USERtotWAIT / 60); + $USERtotWAIT_M = ($Swait_sec / 60); $USERtotWAIT_M = round($USERtotWAIT_M, 2); $USERtotWAIT_M_int = intval("$USERtotWAIT_M"); $USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int); @@ -276,9 +366,9 @@ while ($i < $rows_to_print) $USERtotWAIT_S = round($USERtotWAIT_S, 0); if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";} $USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S"; - $pfUSERtotWAIT_MS[$i] = sprintf("%6s", $USERtotWAIT_MS); + $pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS); - $USERavgWAIT_M = ($USERavgWAIT / 60); + $USERavgWAIT_M = ($Swait_avg / 60); $USERavgWAIT_M = round($USERavgWAIT_M, 2); $USERavgWAIT_M_int = intval("$USERavgWAIT_M"); $USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int); @@ -286,9 +376,9 @@ while ($i < $rows_to_print) $USERavgWAIT_S = round($USERavgWAIT_S, 0); if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";} $USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S"; - $pfUSERavgWAIT_MS[$i] = sprintf("%6s", $USERavgWAIT_MS); + $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS); - $USERtotDISPO_M = ($USERtotDISPO / 60); + $USERtotDISPO_M = ($Sdispo_sec / 60); $USERtotDISPO_M = round($USERtotDISPO_M, 2); $USERtotDISPO_M_int = intval("$USERtotDISPO_M"); $USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int); @@ -296,9 +386,9 @@ while ($i < $rows_to_print) $USERtotDISPO_S = round($USERtotDISPO_S, 0); if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";} $USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S"; - $pfUSERtotDISPO_MS[$i] = sprintf("%6s", $USERtotDISPO_MS); + $pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS); - $USERavgDISPO_M = ($USERavgDISPO / 60); + $USERavgDISPO_M = ($Sdispo_avg / 60); $USERavgDISPO_M = round($USERavgDISPO_M, 2); $USERavgDISPO_M_int = intval("$USERavgDISPO_M"); $USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int); @@ -306,42 +396,51 @@ while ($i < $rows_to_print) $USERavgDISPO_S = round($USERavgDISPO_S, 0); if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";} $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; - $pfUSERavgDISPO_MS[$i] = sprintf("%6s", $USERavgDISPO_MS); + $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - $i++; + echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $m++; } +### END loop through each user ### -$k=0; -while($k < $i) + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$n=0; +while ($n < $j) { - $ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 "; - $stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rows_to_print = mysql_num_rows($rslt); - $m=0; - while ($m < $rows_to_print) + $Scalls=0; + $Sstatus=$statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) { - $row=mysql_fetch_row($rslt); - if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);} - if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);} - if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);} - if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);} - if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);} - if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);} - if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);} - if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]); $TOT_CB = ($TOT_CB + $row[0]);} - $m++; + if ($Sstatus=="$status[$i]") + { + $Scalls = ($Scalls + $calls[$i]); + $status_found++; + } + $i++; } - echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n"; - - - - $k++; + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $SUMstatusTXT = sprintf("%8s", $Scalls); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; } +### END loop through each status ### - $TOTcalls = sprintf("%-7s", $TOTcalls); + + $TOTcalls = sprintf("%7s", $TOTcalls); + $TOT_AGENTS = sprintf("%-4s", $m); $TOTtime_M = ($TOTtime / 60); $TOTtime_M = round($TOTtime_M, 2); @@ -351,8 +450,8 @@ while($k < $i) $TOTtime_S = round($TOTtime_S, 0); if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";} $TOTtime_MS = "$TOTtime_M_int:$TOTtime_S"; - $TOTtime_MS = sprintf("%7s", $TOTtime_MS); - while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} + $TOTtime_MS = sprintf("%8s", $TOTtime_MS); + while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} $TOTtotTALK_M = ($TOTtotTALK / 60); $TOTtotTALK_M = round($TOTtotTALK_M, 2); @@ -362,8 +461,8 @@ while($k < $i) $TOTtotTALK_S = round($TOTtotTALK_S, 0); if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";} $TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S"; - $TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS); - while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} + $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); + while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} $TOTtotDISPO_M = ($TOTtotDISPO / 60); $TOTtotDISPO_M = round($TOTtotDISPO_M, 2); @@ -373,8 +472,8 @@ while($k < $i) $TOTtotDISPO_S = round($TOTtotDISPO_S, 0); if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";} $TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S"; - $TOTtotDISPO_MS = sprintf("%7s", $TOTtotDISPO_MS); - while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} + $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); + while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); $TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2); @@ -384,8 +483,8 @@ while($k < $i) $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; - $TOTtotPAUSE_MS = sprintf("%7s", $TOTtotPAUSE_MS); - while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} $TOTtotWAIT_M = ($TOTtotWAIT / 60); $TOTtotWAIT_M = round($TOTtotWAIT_M, 2); @@ -395,8 +494,8 @@ while($k < $i) $TOTtotWAIT_S = round($TOTtotWAIT_S, 0); if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";} $TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S"; - $TOTtotWAIT_MS = sprintf("%7s", $TOTtotWAIT_MS); - while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} + $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); + while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); @@ -443,27 +542,16 @@ while($k < $i) $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} - - $TOT_A = sprintf("%-5s", $TOT_A); - $TOT_B = sprintf("%-5s", $TOT_B); - $TOT_DC = sprintf("%-5s", $TOT_DC); - $TOT_DNC = sprintf("%-5s", $TOT_DNC); - $TOT_N = sprintf("%-5s", $TOT_N); - $TOT_NI = sprintf("%-5s", $TOT_NI); - $TOT_CB = sprintf("%-5s", $TOT_CB); - $TOT_SALE = sprintf("%-5s", $TOT_SALE); - $TOT_AGENTS = sprintf("%-4s", $k); -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "\n"; } - ?> \ No newline at end of file diff --git a/LANG_www/vicidial_de/AST_server_performance.php b/LANG_www/vicidial_de/AST_server_performance.php index e7f63add..d727c21a 100644 --- a/LANG_www/vicidial_de/AST_server_performance.php +++ b/LANG_www/vicidial_de/AST_server_performance.php @@ -147,12 +147,12 @@ $AVGcpuUSER = sprintf("%10s", $row[0]); $AVGcpuSYSTEM = sprintf("%10s", $row[1]); $AVGcpuIDLE = sprintf("%10s", $row[2]); -# $stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $TOTALcalls = sprintf("%10s", $row[0]); -# $OFFHOOKtime = sprintf("%10s", $row[1]); +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$row=mysql_fetch_row($rslt); +$TOTALcalls = sprintf("%10s", $row[0]); +$OFFHOOKtime = sprintf("%10s", $row[1]); echo "Total Calls in/out on this server: $TOTALcalls\n"; @@ -199,7 +199,7 @@ fclose($DATfp); $rows_to_max = ($rows_to_print + 100); -print "rows: $i\n"; +#print "rows: $i\n"; $time_scale_abb = '5 minutes'; $time_scale_tick = '1 minute'; diff --git a/LANG_www/vicidial_de/AST_timeonVDADall.php b/LANG_www/vicidial_de/AST_timeonVDADall.php index 964306c8..f74eda63 100644 --- a/LANG_www/vicidial_de/AST_timeonVDADall.php +++ b/LANG_www/vicidial_de/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -26,7 +26,9 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) -# +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# header ("Content-type: text/html; charset=utf-8"); @@ -213,6 +215,10 @@ $F=''; $FG=''; $B=''; $BG=''; \n"; echo"\n"; @@ -311,10 +317,10 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;"; + $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } if ($non_latin > 0) { @@ -322,14 +328,23 @@ $rslt=mysql_query("SET NAMES 'UTF8'"); } $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -391,11 +406,31 @@ echo ""; echo ""; echo ""; -echo ""; +echo ""; + + + + echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
# LEAD"; - echo "$u $row[12] $row[4] $row[8] $row[0] $row[10] $row[11]
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location  
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -436,7 +471,7 @@ echo "\n\n"; ################################################################################### ###### OUTBOUND CALLS ################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($non_latin > 0) @@ -493,7 +528,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -614,7 +649,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php index 7c675ea6..44368875 100644 --- a/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_de/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -11,6 +11,8 @@ # 61102-1616 - first build # 61215-1131 - added answered calls and drop percent taken from answered calls # 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction # header ("Content-type: text/html; charset=utf-8"); @@ -130,6 +132,12 @@ $group = $groups[$k]; echo "$group   -   "; echo "Modify\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -160,17 +168,26 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -224,11 +241,27 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -245,7 +278,7 @@ echo ""; ################################################################################ ###### OUTBOUND CALLS ################################################################################ -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); @@ -294,7 +327,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -328,7 +361,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_de/admin.php b/LANG_www/vicidial_de/admin.php index 6e223821..b4f3166a 100644 --- a/LANG_www/vicidial_de/admin.php +++ b/LANG_www/vicidial_de/admin.php @@ -8,10 +8,18 @@ require("dbconnect.php"); -$page_width='750'; -$section_width='700'; + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='720'; $header_font_size='3'; $subheader_font_size='2'; +$subcamp_font_size='2'; $header_selected_bold=''; $header_nonselected_bold=''; $users_color = '#FFFF99'; @@ -34,11 +42,12 @@ $reports_color = '#99FF33'; #$filters_color = '#FFFF99'; #$admin_color = '#FFFF99'; #$reports_color = '#FFFF99'; - $times_color = '#CCCC00'; - $phones_color = '#CCCC00'; - $conference_color = '#CCCC00'; - $server_color = '#CCCC00'; - $settings_color = '#CCCC00'; + $times_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -54,11 +63,21 @@ $reports_font = 'BLACK'; $conference_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; + $status_font = 'BLACK'; +$subcamp_color = '#FF9933'; +$subcamp_font = 'BLACK'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["active"])) {$active=$_GET["active"];} @@ -73,7 +92,9 @@ if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$ elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} @@ -303,6 +324,8 @@ if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} @@ -584,6 +607,68 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -595,7 +680,11 @@ if (strlen($dial_status) > 0) $status = $dial_status; } -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### if ($non_latin < 1) { @@ -714,6 +803,14 @@ $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); +$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); +$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); +$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); +$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + +### DIGITS and DASHES +$group_rank = ereg_replace("[^-0-9]","",$group_rank); +$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -736,6 +833,9 @@ $agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); +$human_answered = ereg_replace("[^NY]","",$human_answered); +$tovdad_display = ereg_replace("[^NY]","",$tovdad_display); +$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -754,6 +854,9 @@ $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); +$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); +$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); +$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -826,6 +929,17 @@ $dial_status = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status); $queuemetrics_eq_prepend = ereg_replace("[^-\_0-9a-zA-Z]","",$queuemetrics_eq_prepend); $vicidial_agent_disable = ereg_replace("[^-\_0-9a-zA-Z]","",$vicidial_agent_disable); $alter_custdata_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custdata_override); +$list_order_mix = ereg_replace("[^-\_0-9a-zA-Z]","",$list_order_mix); +$vcl_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vcl_id); +$mix_method = ereg_replace("[^-\_0-9a-zA-Z]","",$mix_method); +$category = ereg_replace("[^-\_0-9a-zA-Z]","",$category); +$vsc_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vsc_id); +$moh_context = ereg_replace("[^-\_0-9a-zA-Z]","",$moh_context); +$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); +$source_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_campaign_id); +$source_user_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_user_id); +$source_group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_group_id); +$default_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$default_xfer_group); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -860,6 +974,9 @@ $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); +$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); +$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); +$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -874,9 +991,13 @@ $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); +$after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after_hours_message_filename); +$welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); +$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); +$list_mix_container = ereg_replace(";","",$list_mix_container); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -994,15 +1115,48 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper # 70322-1455 - Added sipsak messages parameters # 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section - +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# +# # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.95'; -$build = '70402-1157'; +$admin_version = '2.0.4-119'; +$build = '71125-1751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); +$MT[0]=''; +$US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); if ($force_logout) { @@ -1095,6 +1249,13 @@ $browser = getenv("HTTP_USER_AGENT"); } } +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + header ("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n"; @@ -1103,11 +1264,14 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Addieren Sie Neuen Benutzer";} -if ($ADD==11) {$hh='campaigns'; echo "Addieren Sie Neue Kampagne";} +if ($ADD=="1") {$hh='users'; echo "Addieren Sie Neuen Benutzer";} +if ($ADD=="1A") {$hh='users'; echo "Copy Benutzer";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Addieren Sie Neue Kampagne";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Kampagne";} if ($ADD==111) {$hh='lists'; echo "Addieren Sie Neue Liste";} if ($ADD==121) {$hh='lists'; echo "Addieren Sie Neues DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Addieren Sie Neue In-Gruppe";} +if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Gruppe";} if ($ADD==11111) {$hh='remoteagent'; echo "Addieren Sie Neue Remotemittel";} if ($ADD==111111) {$hh='usergroups'; echo "Addieren Sie Neue Benutzer-Gruppe";} if ($ADD==1111111) {$hh='scripts'; echo "Addieren Sie Neuen Index";} @@ -1118,16 +1282,20 @@ if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADDIEREN SIE NEUES TELE if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN SIE NEUEN BEDIENER";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN SIE NEUE KONFERENZ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD==2) {$hh='users'; echo "Neue Benutzer-Hinzufügung";} -if ($ADD==21) {$hh='campaigns'; echo "Neue Kampagne Hinzufügung";} -if ($ADD==22) {$hh='campaigns'; echo "Neue Kampagne Status-Hinzufügung";} -if ($ADD==23) {$hh='campaigns'; echo "New Kampagne HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "Neue Kampagne Leitung Bereiten Hinzufügung Auf";} -if ($ADD==26) {$hh='campaigns'; echo "Neuer Vorwahlknopf-Status Des Automobil-Alt";} -if ($ADD==27) {$hh='campaigns'; echo "Neuer Mittel-Pause Code";} -if ($ADD==28) {$hh='campaigns'; echo "Kampagne Vorwahlknopf-Status Addiert";} +if ($ADD=="2") {$hh='users'; echo "Neue Benutzer-Hinzufügung";} +if ($ADD=="2A") {$hh='users'; echo "Neue Kopierte Benutzer-Hinzufügung";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Neue Kopierte Kampagne Hinzufügung";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Neue Kampagne Hinzufügung";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Neue Kampagne Status-Hinzufügung";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Kampagne HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "Neue Kampagne Leitung Bereiten Hinzufügung Auf";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Neuer Vorwahlknopf-Status Des Automobil-Alt";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Neuer Mittel-Pause Code";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status Addiert";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung Fügte Hinzu";} if ($ADD==211) {$hh='lists'; echo "Neue Liste Hinzufügung";} if ($ADD==2111) {$hh='ingroups'; echo "Neue In-Gruppe Hinzufügung";} +if ($ADD==2011) {$hh='ingroups'; echo "Neue Kopierte In-Gruppe Hinzufügung";} if ($ADD==21111) {$hh='remoteagent'; echo "Neue Remotemittel-Hinzufügung";} if ($ADD==211111) {$hh='usergroups'; echo "Neue Benutzer-Gruppe Hinzufügung";} if ($ADD==2111111) {$hh='scripts'; echo "Neue Index-Hinzufügung";} @@ -1139,10 +1307,28 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN BED if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDIEREN DES NEUEN STAMM-SATZES DES BEDIENER-VICIDIAL";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDIEREN DER NEUEN KONFERENZ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDIEREN VON VON VICIDIAL SYSTEMSTATUS";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDIEREN VON VON VICIDIAL STATUS-KATEGORIE";} if ($ADD==3) {$hh='users'; echo "Ändern Sie Benutzer";} if ($ADD==30) {$hh='campaigns'; echo "Kampagne Nicht Erlaubt";} -if ($ADD==31) {$hh='campaigns'; echo "Ändern Sie Kampagne";} -if ($ADD==34) {$hh='campaigns'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Ändern Sie Kampagne - Detail - $campaign_id"; + if ($SUB==22) {echo " - Statuses";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Leitung Bereiten AufEntries";} + if ($SUB==26) {echo " - Auto Alt Dial Statuses";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==29) {echo " - List Mixes";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Kampagne Status";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Kampagne HotKeys";} +if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Kampagne Leitung Bereiten Eintragungen Auf";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Kampagne Selbstalt Vorwahlknopf-Status";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Kampagne Mittel-Pause Codes";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischungen";} if ($ADD==311) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==3111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} if ($ADD==31111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} @@ -1157,15 +1343,18 @@ if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "ÄNDERN SIE BEDIENER"; if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL SYSTEMSTATUS";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL STATUS-KATEGORIE";} if ($ADD=="4A") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} if ($ADD=="4B") {$hh='users'; echo "Ändern Sie Benutzer - Admin";} if ($ADD==4) {$hh='users'; echo "Ändern Sie Benutzer";} -if ($ADD==41) {$hh='campaigns'; echo "Ändern Sie Kampagne";} -if ($ADD==42) {$hh='campaigns'; echo "Ändern Sie Kampagne Status";} -if ($ADD==43) {$hh='campaigns'; echo "Ändern Sie Kampagne HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} -if ($ADD==45) {$hh='campaigns'; echo "Ändern Sie Kampagne Leitung Aufbereiten";} -if ($ADD==47) {$hh='campaigns'; echo "Ändern Sie Mittel-Pause Code";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Ändern Sie Kampagne";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Ändern Sie Kampagne Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Ändern Sie Kampagne HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Ändern Sie Kampagne - Grundlegende Ansicht";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Ändern Sie Kampagne Leitung Aufbereiten";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Ändern Sie Mittel-Pause Code";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Ändern Sie Kampagne Liste Mischung";} if ($ADD==411) {$hh='lists'; echo "Ändern Sie Liste";} if ($ADD==4111) {$hh='ingroups'; echo "Ändern Sie In-Gruppe";} if ($ADD==41111) {$hh='remoteagent'; echo "Ändern Sie Remotemittel";} @@ -1180,10 +1369,12 @@ if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "ÄNDERN SIE STAMM-SATZ if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ÄNDERN SIE KONFERENZ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ÄNDERN SIE VICIDIAL SYSTEM EINSTELLUNGEN";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL SYSTEMSTATUS";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "ÄNDERN SIE VICIDIAL STATUS-KATEGORIEN";} if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Kampagne";} -if ($ADD==52) {$hh='campaigns'; echo "Logout-Mittel";} -if ($ADD==53) {$hh='campaigns'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Kampagne";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout-Mittel";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} if ($ADD==511) {$hh='lists'; echo "Delete List";} if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} @@ -1197,13 +1388,14 @@ if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Kampagne";} -if ($ADD==62) {$hh='campaigns'; echo "Logout-Mittel";} -if ($ADD==63) {$hh='campaigns'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} -if ($ADD==65) {$hh='campaigns'; echo "Löschung-Leitung Bereiten Auf";} -if ($ADD==66) {$hh='campaigns'; echo "Selbstalt Vorwahlknopf-Status Der Löschung-";} -if ($ADD==67) {$hh='campaigns'; echo "Löschung-Mittel-Pause Code";} -if ($ADD==68) {$hh='campaigns'; echo "Kampagne Vorwahlknopf-Status Entfernt";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Kampagne";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout-Mittel";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Dringlichkeits-VDAC Stau-Freier Raum";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Löschung-Leitung Bereiten Auf";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Selbstalt Vorwahlknopf-Status Der Löschung-";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Löschung-Mittel-Pause Code";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Kampagne Vorwahlknopf-Status Entfernt";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Kampagne Liste Mischung Entfernte";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Löschung-Direktübertragung Mittel";} @@ -1221,10 +1413,10 @@ if ($ADD==73) {$hh='campaigns'; echo "Anzahl anrufbarer Anschlüsse";} if ($ADD==7111111) {$hh='scripts'; echo "Vorbetrachtung-Index";} if ($ADD==0) {$hh='users'; echo "Benutzer-Liste";} if ($ADD==8) {$hh='users'; echo "Wiederholungsbesuche Innerhalb Des Mittels";} -if ($ADD==81) {$hh='campaigns'; echo "Wiederholungsbesuche Innerhalb Der Kampagne";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Wiederholungsbesuche Innerhalb Der Kampagne";} if ($ADD==811) {$hh='lists'; echo "Wiederholungsbesuche Innerhalb Der Liste";} if ($ADD==8111) {$hh='usergroups'; echo "Wiederholungsbesuche Innerhalb Der Benutzer-Gruppe";} -if ($ADD==10) {$hh='campaigns'; echo "Kampagnen";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Kampagnen";} if ($ADD==100) {$hh='lists'; echo "Listen";} if ($ADD==1000) {$hh='ingroups'; echo "In-Gruppen";} if ($ADD==10000) {$hh='remoteagent'; echo "Remotemittel";} @@ -1308,29 +1500,142 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o++; } - ##### get campaigns listing for dynamic pulldown + ##### BEGIN get campaigns listing for rankings ##### + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysql_fetch_row($rslt); $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; $o++; } + $o=0; + while ($campaigns_to_print > $o) + { + $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; } if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) @@ -1358,28 +1663,103 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) { - if ($group_id_value == $groups[$p]) + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) { $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; } $p++; } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td></tr>\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} } ##### END get inbound groups listing for checkboxes ##### @@ -1395,7 +1775,6 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $campaigns = explode(" ", $allowed_campaigns); - echo "<!-- $allowed_campaigns -->"; } $campaigns_value=''; @@ -1464,6 +1843,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"HILFE\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1522,11 +1910,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Mittel wählen Ingroups -</B> Diese Wahl, wenn Satz bis 1 dem Benutzererlaubt, die ingroups zu wählen, denen sie Anrufe von wenn sie LOGONzu einer GENAUEREN oder INBOUND Kampagne empfangen. Andernfalls mußder Manager dieses auf ihrem Benutzersonderkommandoschirm der adminSeite einstellen. -<BR> -<A NAME="vicidial_users-closer_campaigns"> -<BR> -<B>Inbound Gruppen -</B> Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. - <BR> <A NAME="vicidial_users-scheduled_callbacks"> <BR> @@ -1562,6 +1945,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>VICIDIAL Aufnahme-Übersteuerung -</B> diese Wahl läuft über, was auchimmer die Wahl in der Kampagne für Aufnahme ist. UNTAUGLICH läuftnicht die Kampagne Aufnahmeeinstellung über. NIE sperrt Aufnahme aufdem Klienten. ONDEMAND ist die Rückstellung und erlaubt dem Vertreterzu notieren zu beginnen und, zu stoppen, wie gebraucht. ALLCALLSbeginnt Aufnahme auf dem Klienten, wann immer ein Anruf zu einemMittel geschickt wird. ALLFORCE beginnt Aufnahme auf dem Klienten,wann immer ein Anruf zu einem Mittel geschickt wird, das dem Mittelkeine Wahl gibt, um zu notieren zu stoppen. Für ALLCALLS und ALLFORCEgibt es eine Wahl, zum der Aufnahme zu benutzen verzögert, um untenauf sehr kurze Aufnahmen und recude Anlagen-Belastung zu schneiden. +<BR> +<A NAME="vicidial_users-vicidial_users-campaign_ranks"> +<BR> +<B>Kampagne ordnet - in diesem Abschnitt können Sie den Rank definieren,den ein Mittel für jede Kampagne hat. Diese Rank können gewohntSEIN,bevorzugte Anrufwegewahl zuzulassen, wenn folgender Vertreter-Anrufauf campaign_rank eingestellt wird. + +<BR> +<A NAME="vicidial_users-closer_campaigns"> +<BR> +<B>Inbound Gruppen -</B> Ist hier, wo Sie die inbound Gruppen vorwählen,die Sie Anrufe von empfangen möchten, wenn Sie die GENAUERE Kampagnevorgewählt haben. SieSIND auch in der Lage, den Rank oder Fähigkeit Niveaueinzustellen, in diesem Abschnitt für jede der inbound Gruppen sowieIn der LageSEIN, die Zahl den Anrufen zu sehen, die von jeder inboundGruppe für dieses spezifische Mittel empfangen werden. Auch in diesem Abschnitt ist die Fähigkeit, dem Mittel einen Rankfür jede inbound Gruppe zu geben. Diese Rank können für bevorzugteAnrufwegewahl verwendet werden, wenn diese Wahl auf dem IngruppeSchirm vorgewählt wird. + <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> @@ -1722,6 +2115,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Erlauben Sie Closers -</B> Dieses ist, wo Sie einstellen können, obdie Benutzer dieser Kampagne die Wahl haben, zum des Anrufs zu einemgenauerem zu schicken. +<BR> +<A NAME="vicidial_campaigns-default_xfer_group"> +<BR> +<B>Rückstellung Übergangsgruppe - dieses fangen ist dieRückstellung In-Gruppe auf, die automatisch vorgewählt wird, wenndas Mittel zum Bringenkonferenz Rahmen in ihrer Mittelschnittstellegeht. + +<BR> +<A NAME="vicidial_campaigns-xfer_groups"> +<BR> +<B>Gewährte Übergangsgruppen - mit diesen checkbox Auflistungen könnenSie die Gruppen vorwählen, denen Mittel in dieser Kampagne bringenkönnen Anrufe zu. Erlauben Sie Closers muß ermöglicht werden, damitdiese Wahl oben darstellt. + +<BR> +<A NAME="vicidial_campaigns-campaign_allow_inbound"> +<BR> +<B>Erlauben Sie Inbound und gemischt - dieses ist, wo Sie einstellenkönnen, ob die Benutzer dieser Kampagne die Wahl haben, zum von voninbound Anrufen mit dieser Kampagne zu nehmen. Wenn Sie gemischtesinbound und outbound tun möchten dann, muß dieses auf Y eingestelltwerden. Wenn Sie nur das outbound Wählen auf dieser Kampagne tunmöchten einstellten dieses auf N. Default sind N. + <BR> <A NAME="vicidial_campaigns-dial_status"> <BR> @@ -1816,6 +2224,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: Aufträge bis zum dem letzten Mal ein Mittel wurden einem Anrufgeschickt. Resultate in den Mitteln, die insgesamt ungefähr gleicheZahl von Anrufen empfangen. <BR>   - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. <BR>   - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. + <BR>   - campaign_rank: Aufträge durch den Rank gegeben zum Mittel für dieKampagne. Stark zu am niedrigsten. + <BR>   - fewest_calls: Aufträge durch die Zahl den Anrufen empfangen durch einMittel für diese spezifische inbound Gruppe. Wenige Anrufe zuerst. <BR> <A NAME="vicidial_campaigns-local_call_time"> @@ -1957,6 +2367,37 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Gewähren Sie Kein-Zufuhrbehälter-Führt LOGON -</B> wenn Satz zu Y,Mittel zum LOGON zur Kampagne erlaubt, selbst wenn es keine Leitungengibt, die in den Zufuhrbehälter für diese Kampagne geladen werden.Diese Funktion wird nicht in den CLOSER-type Kampagnen benötigt.Rückstellung ist N. +<BR> +<A NAME="vicidial_campaigns-list_order_mix"> +<BR> +<B>Liste Auftrag Mischung - läuft den Leitung Auftrag über undVorwahlknopf-Status fängt auf. Verwendet die Liste undStatusparameter für die vorgewählte Liste Mischung Eintragung imListe Mischung Unterseebootabschnitt anstatt. Rückstellung istUNTAUGLICH. + +<BR> +<A NAME="vicidial_campaigns-vcl_id"> +<BR> +<B>Liste Mischung Identifikation - Identifikation der Liste Mischung.Muß von 2-20 Buchstaben lang ohne Räume oder andere spezielleInterpunktion sein. + +<BR> +<A NAME="vicidial_campaigns-vcl_name"> +<BR> +<B>Liste Mischung Name - beschreibender Name der Liste Mischung. Muß von2-50 Buchstaben lang sein. + +<BR> +<A NAME="vicidial_campaigns-list_mix_container"> +<BR> +<B>Liste Mischung Detail - der Aufbau der Liste Mischung Eintragung.Enthält die Liste Identifikation, Mischung Auftrag, Prozentsätze undStatus, die diese Liste Mischung bilden. Die Prozentsätze müssen bis100 immer addieren, und alle Listen müssen aktiv und eingestellt aufdie Kampagne sein, damit die Auftrag Mischung Eintragung aktiviertwerden kann. + +<BR> +<A NAME="vicidial_campaigns-mix_method"> +<BR> +<B>Liste Mischung Methode - die Methode von alle Teile des Liste MischungDetails zusammen mischen. EVEN_MIX mischt Leitungen von jedem Teil,das mit den anderen Teilen, wie diese 1.2.3.1.2.3.1.2.3 durchgeschobenwird. IN_ORDER setzt die Leitungen in den Auftrag ein, in dem sie aufdem Liste Mischung Detailschirm 1.1.1.2.2.2.3.3.3 verzeichnet werden.GELEGENTLICHER Wille setzte sie in GELEGENTLICHEN Auftrag1.3.2.1.1.3.2.1.3 ein. Rückstellung ist IN_ORDER. + +<BR> +<A NAME="vicidial_campaigns-manual_dial_list_id"> +<BR> +<B>Manuelle Vorwahlknopf-Liste Identifikation - das verwendet zu werdenRückstellung list_id, wenn ein Mittel placces ein manueller Anruf undeine neue Leitung Aufzeichnung im vicidial_list verursacht wird.Rückstellung ist 999. Dieses fangen kann nur Stellenenthalten auf. + + <BR><BR><BR><BR> @@ -2043,7 +2484,10 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: Aufträge bis zum dem letzten Mal ein Mittel wurden einem Anrufgeschickt. Resultate in den Mitteln, die insgesamt ungefähr gleicheZahl von Anrufen empfangen. <BR>   - oldest_call_finish: Aufträge bis zum dem letzten Mal ein Mittel beendeten einen Anruf.Das AKA Mittel, das am längsten wartet, empfängt ersten Anruf. <BR>   - overall_user_level: Aufträge durch das user_level des Mittels, wie inden vicidial_users definiert legen ein höheres user_level empfangenmehr Anrufe ver. - + <BR>   - inbound_group_rank: Aufträge durch den Rank gegeben zum Mittel fürdie spezifische inbound Gruppe. Stark zu am niedrigsten. + <BR>   - fewest_calls: Aufträge durch die Zahl den Anrufen empfangen durch einMittel für diese spezifische inbound Gruppe. Wenige Anrufe zuerst. + <BR>   - campaign_rank: Aufträge durch den Rank gegeben zum Mittel für dieKampagne. Stark zu am niedrigsten. + <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> <A NAME="vicidial_inbound_groups-fronter_display"> <BR> @@ -2084,6 +2528,66 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Verbindungs-Nebenstelle -</B> Dies ist die Wählplan-Nebenstelle, wo sich die gewünschte Audiodatei für die aufgebaute Verbindung auf Ihrem Server befindet. +<BR> +<A NAME="vicidial_inbound_groups-call_time_id"> +<BR> +<B>Anruf-Zeit - dieses ist der für diese inbound Gruppe zu verwendenAnrufzeitentwurf. Halten Sie im Verstand, daß die Zeit auf derBedienerzeit basiert. Rückstellung ist 24hours. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_action"> +<BR> +<B>Nach Stunden Tätigkeit - die Tätigkeit zum durchzuführen, wenn sienach Stunden ist, wie in der Anrufzeit für diese inbound Gruppedefiniert. HÄNGEZUSTAND-Willenssofort Hängezustand der Anruf,MESSASGE spielt die Akte in nach Stunden Anzeige Filenamauffangen, schickt VERLÄNGERUNG den Anruf zu nach StundenVerlängerung im dialplan und VOICEMAIL schickt den Anruf zumvoicemail Kasten, der in nach Stunden Voicemail verzeichnet wird,auffangen. Rückstellung ist ANZEIGE. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_message_filename"> +<BR> +<B>Nach Stunden Anzeige Dateinamen - die Audioakte gelegen auf demgespielt zu werden Bediener, wenn die Tätigkeit auf ANZEIGEeingestellt wird. Rückstellung ist VM-Auf Wiedersehen + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_exten"> +<BR> +<B>Nach Stunden Verlängerung - die dialplan Verlängerung, zum desAnrufs zu senden, wenn die Tätigkeit auf VERLÄNGERUNG eingestelltwird. Rückstellung ist 8300. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_voicemail"> +<BR> +<B>Nach Stunden Voicemail - der voicemail Kasten, zum des Anrufs zusenden, wenn die Tätigkeit auf VOICEMAIL eingestellt wird. + +<BR> +<A NAME="vicidial_inbound_groups-welcome_message_filename"> +<BR> +<B>Willkommener Anzeige Dateiname - die Audioakte gelegen auf demgespielt zu werden Bediener, wenn der Anruf hereinkommt. Wenn Satz zu---NONE --- dann wird keine Anzeige gespielt. Rückstellung ist---NONE --- + +<BR> +<A NAME="vicidial_inbound_groups-moh_context"> +<BR> +<B>Musik auf Einfluß-Kontext - die Musik auf dem Einflußkontext, zum zuverwenden, wann der Kunde auf Einfluß gesetzt wird. Rückstellung istRückstellung. + +<BR> +<A NAME="vicidial_inbound_groups-onhold_prompt_filename"> +<BR> +<B>Auf Einfluß-Aufforderung Dateinamen - die Audioakte gelegen auf demin einem regelmäßigen Abstand gespielt zu werden Bediener, wenn derKunde auf Einfluß ist. Rückstellung ist generic_hold. DieseAudioakte MUSS 9 Sekunden oder kleiner in der Länge sein. + +<BR> +<A NAME="vicidial_inbound_groups-prompt_interval"> +<BR> +<B>Auf Einfluß-Aufforderung Abstand - die Zeitspanne in den Sekunden, zuwarten, bevor an die haltenaufforderung gespielt wird. Rückstellungist 60. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_exten"> +<BR> +<B>Mittel-Alarmverlängerung - die, um zu verkünden, daß in denVertreterlernabschnitt zu senden Verlängerung, ein Anruf zum Mittelkommt. Diese Verlängerung sollte ein Playback einer Audioakte haben.Diese Funktion nicht zu verwenden stellte dieses auf X. Default ist Xein. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_delay"> +<BR> +<B>Mittel-Alarm verzögert - die Zeitspanne in den Millisekunden, zuwarten, bevor er den Anruf zum Mittel schickt, nachdem er an dieMittel-Alarmverlängerung gespielt hat. Rückstellung ist 1000. + +<BR> +<A NAME="vicidial_inbound_groups-default_xfer_group"> +<BR> +<B>Rückstellung Übergangsgruppe - dieses fangen ist dieRückstellung In-Gruppe auf, die automatisch vorgewählt wird, wenndas Mittel zum Bringenkonferenz Rahmen in ihrer Mittelschnittstellegeht. + <BR><BR><BR><BR> @@ -2137,7 +2641,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSESTABELLE</FONT></B><BR><BR> <A NAME="vicidial_campaign_statuses"> <BR> -<B>Durch den Gebrauch von kundenspezifischen Kampagne Status, können SieStatus haben, die nur für eine spezifische Kampagne bestehen. DerStatus muß 1-8 Buchstaben lang sein, muß die Beschreibung 2-30Buchstaben lang sein und auswählbar definiert, ob es oben in VICIDIALals Einteilung zeigt.</B> +<B>Durch den Gebrauch von kundenspezifischen Kampagne Status, können SieStatus haben, die nur für eine spezifische Kampagne bestehen. DerStatus muß 1-8 Buchstaben lang sein, muß die Beschreibung 2-30Buchstaben lang sein und auswählbar definiert, ob es oben in VICIDIALals Einteilung zeigt. Human_answered auffangen wird verwendet, als, denTropfenprozentsatz oder Ungezwungenheit Rate errechnend. Einstellunghuman_answered zu Y verwendet diesen Status, als, diemenschlich-geantworteten Anrufe zählend. Die Kategorie Wahl erlaubt Ihnen, einige Status in ein catogy zugruppieren, das für statistische Analyse verwendet werden kann.</B> @@ -2226,7 +2730,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Index-Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> -<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290"> +<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> @@ -2301,7 +2805,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL LISTE LADEVORRICHTUNG FUNKTIONALITÄT</FONT></B><BR><BR> <A NAME="vicidial_list_loader"> <BR> -Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach entworfen, um eine Leitung Akte zu nehmen - bis zu 8MB in derGröße - die entweder Vorsprung oder das abgegrenzte Rohr und es indie vicidial_list Tabelle zu laden ist. Es gibt auch eine neueBetaversionsuperleitung Ladevorrichtung, das auffangen dasWählen zuläßt und TXT- deutlich Text, CSV- Komma getrennte Werteund XLS- übertreffen Akte Formate. Die Leitung Ladevorrichtung tutnicht Datenprüfung, oder Überprüfung auf Duplikate in sich oder inanderen Listen, damit etwas Sie ist, muß vor Ihnen Last tun dieLeitungen. Auch überprüfen Sie, ob Sie die Liste erstellt haben,daß diese Leitungen darunter sein sollen, damit Sie sie benutzenkönnen. Es gibt auch die Angelegenheit der Zeit-Zone-Kodierung dieseLeitungen. Sie können die Frequenz erhöhen wünschen, daß dasADMIN_adjust_GMTnow_on_leads.pl in das cron auf IhremSternchenbediener gelaufen wird, damit alle mögliche geladenenLeitungen schneller kodiert werden können. Ist hier eine Liste vonauffängt in ihrem korrekten Auftrag für die Leitung Akten: +Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach entworfen, um eine Leitung Akte zu nehmen - bis zu 8MB in derGröße - die entweder Vorsprung oder das abgegrenzte Rohr und es indie vicidial_list Tabelle zu laden ist. Die Leitung Ladevorrichtungläßt auffangen das Wählen zu und TXT- deutlich Text, CSV-Komma getrennte Werte und XLS- übertreffen Akte Formate. Die LeitungLadevorrichtung tut nicht Datenprüfung, aber sie erlaubt Ihnen, aufDuplikate in sich, innerhalb der Kampagne oder innerhalb des gesamtenSystems zu überprüfen. Auch überprüfen Sie, ob Sie die Listeerstellt haben, daß diese Leitungen darunter sein sollen, damit Siesie benutzen können. Ist hier eine Liste von auffängt inihrem korrekten Auftrag für die Leitung Akten: <OL> <LI>Verkäufer-Leitung Code - zeigt oben im Verkäufer, den Identifikationvom GUI auffangen <LI>Quellenprogramm - interner Gebrauch nur für admins und DBAs @@ -2328,7 +2832,7 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <LI>Anmerkungen </OL> -<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. +<BR>ANMERKUNGEN: Die übertreffenleitung Ladevorrichtung Funktionalitätwird durch eine Reihe Perl Indexe ermöglicht und muß eine richtigzusammengebaute /etc/astguiclient.conf Akte im Platz auf dem webserver haben. Auch ein Paarperl Module müssen für sie, um außerdemzu arbeiten - OLE-Storage_Lite-Storage_Lite undVerteilungsbogen-ParseExcel geladen werden. Sie können aufLaufzeitfehler in diesen überprüfen, indem Sie Ihre Apache error_logAkte betrachten. Auch für Doppelprüfungen gegen gampaignverzeichnet, die Liste, die neue Leitungen hat, in es einzusteigenmuß im System verursacht werden, bevor Sie beginnen, die Leitungen zuladen. @@ -2882,6 +3386,30 @@ Die VICIDIAL grundlegende Netz-gegründete Leitung Ladevorrichtung isteinfach en <BR> <B>Admin Haupt-URL -</B> dieses ist die URL oder Web site Adresse, daß Siegehen, wenn Sie an die HAUPTVERBINDUNG an der Oberseite der admin.phpSeite klicken. +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Ermöglichen Sie Vertreter-Übergangsprotokolldatei - diese Wahlprotokolliert in einer Textprotokolldatei auf dem webserver, jedesmalwenn ein Anruf auf ein Mittel gebracht wird. Rückstellung ist 0,gesperrt. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUSESTABELLE</FONT></B><BR><BR> +<A NAME="vicidial_statuses"> +<BR> +<B>Durch den Gebrauch von Systemstatus, können Sie Status haben, diefür Kampagne und Ingruppe bestehen. Der Status muß 1-6 Buchstabenlang sein, muß die Beschreibung 2-30 Buchstaben lang sein undauswählbar definiert, ob es oben in VICIDIAL als Mitteleinteilungzeigt. Human_answered auffangen wird verwendet, als, denTropfenprozentsatz oder Ungezwungenheit Rate errechnend. Einstellunghuman_answered zu Y verwendet diesen Status, als, diemenschlich-geantworteten Anrufe zählend. Die Kategorie Wahl erlaubtIhnen, einige Status in ein catogy zu gruppieren, das fürstatistische Analyse verwendet werden kann.</B> + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIESTABELLE</FONT></B><BR><BR> +<A NAME="vicidial_status_categories"> +<BR> +<B>Durch den Gebrauch von Systemstatuskategorien, können Sie diezusammen gruppieren Status, um statistische Analyse auf einer GruppeStatus zuzulassen. Die Kategorie Identifikation muß 2-20 Buchstabenlang ohne Räume sein, muß der Name 2-50 Buchstaben lang sein, istdie Beschreibung wahlweise freigestellt und TimeonVDAD Anzeigedefiniert, ob dieser Status einer von bis zu 4 Status ist, die auf derZeit auf VDAD Realzeitreport errechnet werden und angezeigt werdenkönnen.</B> + @@ -2896,6 +3424,12 @@ exit; } +###################################################################################################### +###################################################################################################### +####### 7 series, filter count preview and script preview +###################################################################################################### +###################################################################################################### + @@ -3156,9 +3690,119 @@ if ($hh=='reports') {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} +echo "\n"; +echo " -VICIDIAL ADMIN: Super Lead Loader +VICIDIAL ADMIN: Lead Loader
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - +
@@ -299,13 +303,22 @@ function ParseFileName() { + + + + - + @@ -314,15 +327,14 @@ function ParseFileName() { - - +
Last Leitungen von dieser Akte: Liste Identifikation Override: (nur Zahlen or leave blank for values in the file)
Phone Code Override: (nur Zahlen or leave blank for values in the file)
Zu verwenden Dateiaufbau: Standard-VICIDIAL    Kundenspezifischer Plan
Leitung Duplikat-Überprüfung:
Vorbereitungs- und Anlaufzeit Zone Nachschlagen:
        
KLICKEN SIE HIER, UM ZUR BASIC LEITUNG LADEVORRICHTUNG ZU GEHEN         ZURÜCK ZU ADMIN
SUPERLISTE LADEVORRICHTUNG-     VERSION:     BAU:
        ZURÜCK ZU ADMINLIST LOADER-     VERSION:     BAU:    
document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + print ""; flush(); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -350,6 +362,11 @@ function ParseFileName() { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

"; + } + while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -396,9 +413,78 @@ function ParseFileName() { # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -408,6 +494,7 @@ function ParseFileName() { { $row=mysql_fetch_row($rslt); $dup_lead = $row[0]; + $dup_lead_list = $list_id; } if ($dup_lead < 1) { @@ -441,7 +528,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -473,11 +560,17 @@ function ParseFileName() { { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

\n"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

\n"; + } # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); @@ -491,6 +584,11 @@ function ParseFileName() { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

"; + } + while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -528,12 +626,80 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -577,7 +743,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -637,6 +803,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

\n"; + } while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -680,12 +850,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -729,7 +967,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -768,9 +1006,11 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else @@ -795,6 +1035,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

"; + } while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -832,12 +1076,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -881,7 +1193,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -906,7 +1218,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
"; flush(); - print "\r\n"; + print "
\r\n"; print " \r\n"; print " \r\n"; print " \r\n"; @@ -945,6 +1257,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

"; + } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); @@ -1016,7 +1332,9 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } @@ -1043,6 +1361,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LISTE IDENTIFIKATION OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

TELEFON-CODE-ÜBERSTEUERUNG FÜR DIESE AKTE: $phone_code_override

"; + } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); @@ -1102,6 +1424,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print "
VICIDIAL SpalteAkte Daten        
\r\n"; diff --git a/LANG_www/vicidial_de/user_stats.php b/LANG_www/vicidial_de/user_stats.php index 5f4a8e7e..8b7ac6eb 100644 --- a/LANG_www/vicidial_de/user_stats.php +++ b/LANG_www/vicidial_de/user_stats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit # 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation # header ("Content-type: text/html; charset=utf-8"); @@ -263,7 +264,7 @@ echo "

\n"; echo "
\n"; -echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; echo "\n"; @@ -298,9 +299,45 @@ echo "
# DATE/TIME LENGTH STATUS PHONE KAMPAGNE GROUP LIST LEAD


\n"; +echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "\n"; +echo "\n"; + + $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + } + + +echo "
# DATE/TIME LENGTH STATUS PHONE KAMPAGNE WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; + + + + echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; -echo "\n"; +echo "\n"; $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -315,16 +352,25 @@ echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $location = $row[11]; + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } diff --git a/LANG_www/vicidial_el/AST_CLOSERstats.php b/LANG_www/vicidial_el/AST_CLOSERstats.php index 5dbd7fbb..b10caf49 100644 --- a/LANG_www/vicidial_el/AST_CLOSERstats.php +++ b/LANG_www/vicidial_el/AST_CLOSERstats.php @@ -8,6 +8,8 @@ # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown # require("dbconnect.php"); @@ -19,6 +21,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} @@ -27,6 +31,8 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -85,6 +91,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; echo "\n\n"; @@ -100,14 +113,37 @@ echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙ else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Στατιστικά αυτόματης κλήσης Closer $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -128,7 +164,7 @@ echo "Average Call Length for all Calls: $average_hold_seconds second echo "\n"; echo "---------- ΕΓΚΑΤΑΛ\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -154,10 +190,90 @@ else echo "Συνολικά ΕΓΚΑΤΑΛΕΙΜΕΝΕΣ κλήσεις: $DROPcalls $DROPpercent%\n"; echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; + + +############################## +######### CALL STATUS STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL STATUS STATS\n"; +echo "+--------+----------------------+------------+\n"; +echo "| STATUS | DESCRIPTION | CALLS |\n"; +echo "+--------+----------------------+------------+\n"; + +$stmt="SELECT * from vicidial_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$statuses_to_print = mysql_num_rows($rslt); +$statuses_list=''; + +$o=0; +while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="SELECT * from vicidial_campaign_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$Cstatuses_to_print = mysql_num_rows($rslt); + +$o=0; +while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statuses_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} + $RAWstatus = $row[1]; + $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} + + if ($non_latin < 1) + { + $status_name = sprintf("%-20s", $statname_list[$RAWstatus]); + while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);} + } + else + { + $status_name = sprintf("%-60s", $statname_list[$RAWstatus]); + while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');} + } + + + echo "| $status | $status_name | $STATUScount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+--------+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+-------------------------------+------------+\n"; + + + + echo "\n"; echo "---------- QUEUE STATS\n"; -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -208,7 +324,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| ΧΕΙΡΙΣΤΗΣ | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -234,7 +350,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); + $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); @@ -246,11 +362,12 @@ while ($i < $users_to_print) $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); diff --git a/LANG_www/vicidial_el/AST_VDADstats.php b/LANG_www/vicidial_el/AST_VDADstats.php index 9daaeed9..d37410dd 100644 --- a/LANG_www/vicidial_el/AST_VDADstats.php +++ b/LANG_www/vicidial_el/AST_VDADstats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php # header ("Content-type: text/html; charset=utf-8"); @@ -21,6 +22,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET["ΕΠΙΒΕΒΑΙΩΣΗ"];} @@ -29,6 +32,8 @@ if (isset($_GET["ΕΠΙΒΕΒΑΙΩΣΗ"])) {$ΕΠΙΒΕΒΑΙΩΣΗ=$_GET[" $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -87,6 +92,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           ΤΡΟΠΟΠΟΙΗΣΗ | ΑΝΑΦΟΡΕΣ \n"; echo "\n\n"; @@ -102,14 +114,37 @@ echo "ΠΑΡΑΚΑΛΩ ΕΠΙΛΕΞΤΕ ΜΙΑ ΕΚΣΤΡΑΤΕΙΑ ΚΑΙ ΜΙ else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -129,7 +164,7 @@ echo "Μέσος όρος σε δευτερόλεπτα για όλες τις echo "\n"; echo "---------- ΕΓΚΑΤΑΛ\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -137,7 +172,7 @@ $DROPcalls = sprintf("%10s", $row[0]); $DROPcallsRAW = $row[0]; $DROPseconds = $row[1]; -$stmt="select count(*) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; +$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -175,7 +210,7 @@ echo "Μέσος όρος σε δευτερόλεπτα για ΕΓΚΑΤΑΕΙ echo "\n"; echo "---------- ΜΗ ΑΠΑΝΤ ΑΥΤ ΚΛΗΣΕΙΣ\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -238,7 +273,7 @@ while ($Cstatuses_to_print > $o) $o++; } -$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -281,10 +316,6 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) - {$vicidial_log = 'vicidial_closer_log';} -else - {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -296,7 +327,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| ΧΕΙΡΙΣΤΗΣ | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select $vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from $vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; +$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -347,6 +378,7 @@ while ($i < $users_to_print) $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); @@ -374,7 +406,7 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date 00:00:01' and event_time <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php index 2356614a..538d8534 100644 --- a/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_el/AST_VICIDIAL_hopperlist.php @@ -8,7 +8,9 @@ # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# require("dbconnect.php"); @@ -123,11 +125,11 @@ echo "Αριθμός οδηγών στον hopper τώρα:: $TOTALcalls\n echo "\n"; echo "---------- LEADS IN HOPPER\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; -echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; +echo "|ORDER |PRIORITY| LEAD ID | ID ΛΙΣΤΑΣ | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;"; +$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -145,14 +147,16 @@ while ($i < $users_to_print) $gmt = sprintf("%-6s", $row[5]); $hopper_id = sprintf("%-6s", $row[6]); $alt_dial = sprintf("%-5s", $row[7]); + $list_id = sprintf("%-10s", $row[8]); + $priority = sprintf("%-6s", $row[9]); -if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} -else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} +if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} +else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} $i++; } -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; } diff --git a/LANG_www/vicidial_el/AST_agent_performance_detail.php b/LANG_www/vicidial_el/AST_agent_performance_detail.php index 8021fdae..0bbb9d35 100644 --- a/LANG_www/vicidial_el/AST_agent_performance_detail.php +++ b/LANG_www/vicidial_el/AST_agent_performance_detail.php @@ -1,14 +1,13 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # -# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70118-1705 - Added user_group filtering option -# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars +# 71119-2359 - First build +# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one +# - Fixed zero division bug # require("dbconnect.php"); @@ -141,25 +140,25 @@ else { if ($shift == 'AM') { - $query_date_BEGIN = "$query_date 03:45:00"; - $query_date_END = "$query_date 15:15:00"; - $time_BEGIN = "03:45:00"; - $time_END = "15:15:00"; + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} } if ($shift == 'PM') { - $query_date_BEGIN = "$query_date 15:15:00"; - $query_date_END = "$query_date 23:15:00"; - $time_BEGIN = "15:15:00"; - $time_END = "23:15:00"; + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} } if ($shift == 'ALL') { - $query_date_BEGIN = "$query_date 00:00:00"; - $query_date_END = "$query_date 23:59:59"; - $time_BEGIN = "00:00:00"; - $time_END = "23:59:59"; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} else {$ugSQL='';} @@ -169,11 +168,22 @@ echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- AGENTS Details -------------\n\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; + + + +$statuses='-'; +$statusesTXT=''; +$statusesHEAD=''; +$statusesHTML=''; +$statusesARY[0]=''; +$j=0; +$users='-'; +$usersARY[0]=''; +$user_namesARY[0]=''; +$k=0; + +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -182,43 +192,123 @@ $i=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); - $TOTcalls=($TOTcalls + $row[0]); - $TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]); - $TOTtotTALK=($TOTtotTALK + $row[1]); - $TOTtotWAIT=($TOTtotWAIT + $row[7]); - $TOTtotPAUSE=($TOTtotPAUSE + $row[5]); - $TOTtotDISPO=($TOTtotDISPO + $row[9]); - $calls[$i] = sprintf("%-6s", $row[0]); + $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation + + $calls[$i] = $row[0]; + $talk_sec[$i] = $row[1]; + $full_name[$i] = $row[2]; + $user[$i] = $row[3]; + $pause_sec[$i] = $row[4]; + $wait_sec[$i] = $row[5]; + $dispo_sec[$i] = $row[6]; + $status[$i] = $row[7]; + if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) + { + $statusesTXT = sprintf("%8s", $status[$i]); + $statusesHEAD .= "----------+"; + $statusesHTML .= " $statusesTXT |"; + $statuses .= "$status[$i]-"; + $statusesARY[$j] = $status[$i]; + $j++; + } + if (!eregi("-$user[$i]-", $users)) + { + $users .= "$user[$i]-"; + $usersARY[$k] = $user[$i]; + $user_namesARY[$k] = $full_name[$i]; + $k++; + } + + $i++; + } + + +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +while ($m < $k) + { + $Suser=$usersARY[$m]; + $Sfull_name=$user_namesARY[$m]; + $Stime=0; + $Scalls=0; + $Stalk_sec=0; + $Spause_sec=0; + $Swait_sec=0; + $Sdispo_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) + { + $Scalls = ($Scalls + $calls[$i]); + $Stalk_sec = ($Stalk_sec + $talk_sec[$i]); + $Spause_sec = ($Spause_sec + $pause_sec[$i]); + $Swait_sec = ($Swait_sec + $wait_sec[$i]); + $Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]); + $SstatusTXT = sprintf("%8s", $calls[$i]); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + $TOTcalls=($TOTcalls + $Scalls); + $TOTtime=($TOTtime + $Stime); + $TOTtotTALK=($TOTtotTALK + $Stalk_sec); + $TOTtotWAIT=($TOTtotWAIT + $Swait_sec); + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec); + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);} + else {$Stalk_avg=0;} + if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);} + else {$Spause_avg=0;} + if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);} + else {$Swait_avg=0;} + if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} + else {$Sdispo_avg=0;} + + $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) { - $full_name[$i]= sprintf("%-15s", $row[2]); - while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);} - - $user[$i] = sprintf("%-6s", $row[3]); - while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);} + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} } else { - $full_name[$i]= sprintf("%-45s", $row[2]); - while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');} + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $user[$i] = sprintf("%-18s", $row[3]); - while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');} + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } - $user[$i] = sprintf("%-8s", $row[3]); - $USERtime = ($row[1] + $row[5] + $row[7] + $row[9]); - $USERtotTALK = $row[1]; - $USERavgTALK = $row[4]; - $USERtotPAUSE = $row[5]; - $USERavgPAUSE = $row[6]; - $USERtotWAIT = $row[7]; - $USERavgWAIT = $row[8]; - $USERtotDISPO = $row[9]; - $USERavgDISPO = $row[10]; - - $USERtime_M = ($USERtime / 60); + $USERtime_M = ($Stime / 60); $USERtime_M = round($USERtime_M, 2); $USERtime_M_int = intval("$USERtime_M"); $USERtime_S = ($USERtime_M - $USERtime_M_int); @@ -226,9 +316,9 @@ while ($i < $rows_to_print) $USERtime_S = round($USERtime_S, 0); if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";} $USERtime_MS = "$USERtime_M_int:$USERtime_S"; - $pfUSERtime_MS[$i] = sprintf("%7s", $USERtime_MS); + $pfUSERtime_MS = sprintf("%7s", $USERtime_MS); - $USERtotTALK_M = ($USERtotTALK / 60); + $USERtotTALK_M = ($Stalk_sec / 60); $USERtotTALK_M = round($USERtotTALK_M, 2); $USERtotTALK_M_int = intval("$USERtotTALK_M"); $USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int); @@ -236,9 +326,9 @@ while ($i < $rows_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS); + $pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); - $USERavgTALK_M = ($USERavgTALK / 60); + $USERavgTALK_M = ($Stalk_avg / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); $USERavgTALK_M_int = intval("$USERavgTALK_M"); $USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int); @@ -246,9 +336,9 @@ while ($i < $rows_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; - $pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS); + $pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - $USERtotPAUSE_M = ($USERtotPAUSE / 60); + $USERtotPAUSE_M = ($Spause_sec / 60); $USERtotPAUSE_M = round($USERtotPAUSE_M, 2); $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M"); $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); @@ -256,9 +346,9 @@ while ($i < $rows_to_print) $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; - $pfUSERtotPAUSE_MS[$i] = sprintf("%6s", $USERtotPAUSE_MS); + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); - $USERavgPAUSE_M = ($USERavgPAUSE / 60); + $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M = round($USERavgPAUSE_M, 2); $USERavgPAUSE_M_int = intval("$USERavgPAUSE_M"); $USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int); @@ -266,9 +356,9 @@ while ($i < $rows_to_print) $USERavgPAUSE_S = round($USERavgPAUSE_S, 0); if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";} $USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S"; - $pfUSERavgPAUSE_MS[$i] = sprintf("%6s", $USERavgPAUSE_MS); + $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS); - $USERtotWAIT_M = ($USERtotWAIT / 60); + $USERtotWAIT_M = ($Swait_sec / 60); $USERtotWAIT_M = round($USERtotWAIT_M, 2); $USERtotWAIT_M_int = intval("$USERtotWAIT_M"); $USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int); @@ -276,9 +366,9 @@ while ($i < $rows_to_print) $USERtotWAIT_S = round($USERtotWAIT_S, 0); if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";} $USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S"; - $pfUSERtotWAIT_MS[$i] = sprintf("%6s", $USERtotWAIT_MS); + $pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS); - $USERavgWAIT_M = ($USERavgWAIT / 60); + $USERavgWAIT_M = ($Swait_avg / 60); $USERavgWAIT_M = round($USERavgWAIT_M, 2); $USERavgWAIT_M_int = intval("$USERavgWAIT_M"); $USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int); @@ -286,9 +376,9 @@ while ($i < $rows_to_print) $USERavgWAIT_S = round($USERavgWAIT_S, 0); if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";} $USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S"; - $pfUSERavgWAIT_MS[$i] = sprintf("%6s", $USERavgWAIT_MS); + $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS); - $USERtotDISPO_M = ($USERtotDISPO / 60); + $USERtotDISPO_M = ($Sdispo_sec / 60); $USERtotDISPO_M = round($USERtotDISPO_M, 2); $USERtotDISPO_M_int = intval("$USERtotDISPO_M"); $USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int); @@ -296,9 +386,9 @@ while ($i < $rows_to_print) $USERtotDISPO_S = round($USERtotDISPO_S, 0); if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";} $USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S"; - $pfUSERtotDISPO_MS[$i] = sprintf("%6s", $USERtotDISPO_MS); + $pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS); - $USERavgDISPO_M = ($USERavgDISPO / 60); + $USERavgDISPO_M = ($Sdispo_avg / 60); $USERavgDISPO_M = round($USERavgDISPO_M, 2); $USERavgDISPO_M_int = intval("$USERavgDISPO_M"); $USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int); @@ -306,42 +396,51 @@ while ($i < $rows_to_print) $USERavgDISPO_S = round($USERavgDISPO_S, 0); if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";} $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; - $pfUSERavgDISPO_MS[$i] = sprintf("%6s", $USERavgDISPO_MS); + $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - $i++; + echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $m++; } +### END loop through each user ### -$k=0; -while($k < $i) + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$n=0; +while ($n < $j) { - $ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 "; - $stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rows_to_print = mysql_num_rows($rslt); - $m=0; - while ($m < $rows_to_print) + $Scalls=0; + $Sstatus=$statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) { - $row=mysql_fetch_row($rslt); - if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);} - if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);} - if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);} - if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);} - if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);} - if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);} - if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);} - if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]); $TOT_CB = ($TOT_CB + $row[0]);} - $m++; + if ($Sstatus=="$status[$i]") + { + $Scalls = ($Scalls + $calls[$i]); + $status_found++; + } + $i++; } - echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n"; - - - - $k++; + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $SUMstatusTXT = sprintf("%8s", $Scalls); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; } +### END loop through each status ### - $TOTcalls = sprintf("%-7s", $TOTcalls); + + $TOTcalls = sprintf("%7s", $TOTcalls); + $TOT_AGENTS = sprintf("%-4s", $m); $TOTtime_M = ($TOTtime / 60); $TOTtime_M = round($TOTtime_M, 2); @@ -351,8 +450,8 @@ while($k < $i) $TOTtime_S = round($TOTtime_S, 0); if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";} $TOTtime_MS = "$TOTtime_M_int:$TOTtime_S"; - $TOTtime_MS = sprintf("%7s", $TOTtime_MS); - while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} + $TOTtime_MS = sprintf("%8s", $TOTtime_MS); + while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} $TOTtotTALK_M = ($TOTtotTALK / 60); $TOTtotTALK_M = round($TOTtotTALK_M, 2); @@ -362,8 +461,8 @@ while($k < $i) $TOTtotTALK_S = round($TOTtotTALK_S, 0); if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";} $TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S"; - $TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS); - while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} + $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); + while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} $TOTtotDISPO_M = ($TOTtotDISPO / 60); $TOTtotDISPO_M = round($TOTtotDISPO_M, 2); @@ -373,8 +472,8 @@ while($k < $i) $TOTtotDISPO_S = round($TOTtotDISPO_S, 0); if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";} $TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S"; - $TOTtotDISPO_MS = sprintf("%7s", $TOTtotDISPO_MS); - while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} + $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); + while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); $TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2); @@ -384,8 +483,8 @@ while($k < $i) $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; - $TOTtotPAUSE_MS = sprintf("%7s", $TOTtotPAUSE_MS); - while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} $TOTtotWAIT_M = ($TOTtotWAIT / 60); $TOTtotWAIT_M = round($TOTtotWAIT_M, 2); @@ -395,8 +494,8 @@ while($k < $i) $TOTtotWAIT_S = round($TOTtotWAIT_S, 0); if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";} $TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S"; - $TOTtotWAIT_MS = sprintf("%7s", $TOTtotWAIT_MS); - while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} + $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); + while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); @@ -443,27 +542,16 @@ while($k < $i) $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} - - $TOT_A = sprintf("%-5s", $TOT_A); - $TOT_B = sprintf("%-5s", $TOT_B); - $TOT_DC = sprintf("%-5s", $TOT_DC); - $TOT_DNC = sprintf("%-5s", $TOT_DNC); - $TOT_N = sprintf("%-5s", $TOT_N); - $TOT_NI = sprintf("%-5s", $TOT_NI); - $TOT_CB = sprintf("%-5s", $TOT_CB); - $TOT_SALE = sprintf("%-5s", $TOT_SALE); - $TOT_AGENTS = sprintf("%-4s", $k); -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "\n"; } - ?> \ No newline at end of file diff --git a/LANG_www/vicidial_el/AST_server_performance.php b/LANG_www/vicidial_el/AST_server_performance.php index c23212c1..01c91c40 100644 --- a/LANG_www/vicidial_el/AST_server_performance.php +++ b/LANG_www/vicidial_el/AST_server_performance.php @@ -147,12 +147,12 @@ $AVGcpuUSER = sprintf("%10s", $row[0]); $AVGcpuSYSTEM = sprintf("%10s", $row[1]); $AVGcpuIDLE = sprintf("%10s", $row[2]); -# $stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $TOTALcalls = sprintf("%10s", $row[0]); -# $OFFHOOKtime = sprintf("%10s", $row[1]); +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$row=mysql_fetch_row($rslt); +$TOTALcalls = sprintf("%10s", $row[0]); +$OFFHOOKtime = sprintf("%10s", $row[1]); echo "Total Calls in/out on this server: $TOTALcalls\n"; @@ -199,7 +199,7 @@ fclose($DATfp); $rows_to_max = ($rows_to_print + 100); -print "rows: $i\n"; +#print "rows: $i\n"; $time_scale_abb = '5 minutes'; $time_scale_tick = '1 minute'; diff --git a/LANG_www/vicidial_el/AST_timeonVDADall.php b/LANG_www/vicidial_el/AST_timeonVDADall.php index 9137c9e5..808205af 100644 --- a/LANG_www/vicidial_el/AST_timeonVDADall.php +++ b/LANG_www/vicidial_el/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -26,7 +26,9 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) -# +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# header ("Content-type: text/html; charset=utf-8"); @@ -213,6 +215,10 @@ $F=''; $FG=''; $B=''; $BG=''; \n"; echo"\n"; @@ -311,10 +317,10 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;"; + $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } if ($non_latin > 0) { @@ -322,14 +328,23 @@ $rslt=mysql_query("SET NAMES 'UTF8'"); } $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -391,11 +406,31 @@ echo ""; echo ""; echo ""; -echo ""; +echo ""; + + + + echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
# LEAD"; - echo "$u $row[12] $row[4] $row[8] $row[0] $row[10] $row[11]
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location  
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -436,7 +471,7 @@ echo "\n\n"; ################################################################################### ###### OUTBOUND CALLS ################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($non_latin > 0) @@ -493,7 +528,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -614,7 +649,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php index 7d4a6c02..0fe755a0 100644 --- a/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_el/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -11,6 +11,8 @@ # 61102-1616 - first build # 61215-1131 - added answered calls and drop percent taken from answered calls # 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction # header ("Content-type: text/html; charset=utf-8"); @@ -130,6 +132,12 @@ $group = $groups[$k]; echo "$group   -   "; echo "Modify\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -160,17 +168,26 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -224,11 +241,27 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -245,7 +278,7 @@ echo ""; ################################################################################ ###### OUTBOUND CALLS ################################################################################ -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); @@ -294,7 +327,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -328,7 +361,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_el/admin.php b/LANG_www/vicidial_el/admin.php index a998556d..0c2f9dbf 100644 --- a/LANG_www/vicidial_el/admin.php +++ b/LANG_www/vicidial_el/admin.php @@ -8,10 +8,18 @@ require("dbconnect.php"); -$page_width='750'; -$section_width='700'; + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='720'; $header_font_size='3'; $subheader_font_size='2'; +$subcamp_font_size='2'; $header_selected_bold=''; $header_nonselected_bold=''; $users_color = '#FFFF99'; @@ -34,11 +42,12 @@ $reports_color = '#99FF33'; #$filters_color = '#FFFF99'; #$admin_color = '#FFFF99'; #$reports_color = '#FFFF99'; - $times_color = '#CCCC00'; - $phones_color = '#CCCC00'; - $conference_color = '#CCCC00'; - $server_color = '#CCCC00'; - $settings_color = '#CCCC00'; + $times_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -54,11 +63,21 @@ $reports_font = 'BLACK'; $conference_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; + $status_font = 'BLACK'; +$subcamp_color = '#FF9933'; +$subcamp_font = 'BLACK'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["active"])) {$active=$_GET["active"];} @@ -73,7 +92,9 @@ if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$ elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} @@ -303,6 +324,8 @@ if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} @@ -584,6 +607,68 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -595,7 +680,11 @@ if (strlen($dial_status) > 0) $status = $dial_status; } -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### if ($non_latin < 1) { @@ -714,6 +803,14 @@ $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); +$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); +$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); +$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); +$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + +### DIGITS and DASHES +$group_rank = ereg_replace("[^-0-9]","",$group_rank); +$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -736,6 +833,9 @@ $agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); +$human_answered = ereg_replace("[^NY]","",$human_answered); +$tovdad_display = ereg_replace("[^NY]","",$tovdad_display); +$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -754,6 +854,9 @@ $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); +$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); +$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); +$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -826,6 +929,17 @@ $dial_status = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status); $queuemetrics_eq_prepend = ereg_replace("[^-\_0-9a-zA-Z]","",$queuemetrics_eq_prepend); $vicidial_agent_disable = ereg_replace("[^-\_0-9a-zA-Z]","",$vicidial_agent_disable); $alter_custdata_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custdata_override); +$list_order_mix = ereg_replace("[^-\_0-9a-zA-Z]","",$list_order_mix); +$vcl_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vcl_id); +$mix_method = ereg_replace("[^-\_0-9a-zA-Z]","",$mix_method); +$category = ereg_replace("[^-\_0-9a-zA-Z]","",$category); +$vsc_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vsc_id); +$moh_context = ereg_replace("[^-\_0-9a-zA-Z]","",$moh_context); +$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); +$source_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_campaign_id); +$source_user_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_user_id); +$source_group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_group_id); +$default_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$default_xfer_group); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -860,6 +974,9 @@ $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); +$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); +$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); +$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -874,9 +991,13 @@ $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); +$after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after_hours_message_filename); +$welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); +$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); +$list_mix_container = ereg_replace(";","",$list_mix_container); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -994,15 +1115,48 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper # 70322-1455 - Added sipsak messages parameters # 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section - +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# +# # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.95'; -$build = '70402-1157'; +$admin_version = '2.0.4-119'; +$build = '71125-1751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); +$MT[0]=''; +$US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); if ($force_logout) { @@ -1095,6 +1249,13 @@ $browser = getenv("HTTP_USER_AGENT"); } } +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + header ("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n"; @@ -1103,11 +1264,14 @@ echo "ΔΙΑΧΕΙΡΙΣΗ: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Πρόσθεσε Νέο Χρήστη";} -if ($ADD==11) {$hh='campaigns'; echo "Πρόσθεσε Νέα Εκστρατεία";} +if ($ADD=="1") {$hh='users'; echo "Πρόσθεσε Νέο Χρήστη";} +if ($ADD=="1A") {$hh='users'; echo "Χρήστης αντιγράφων";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Πρόσθεσε Νέα Εκστρατεία";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Εκστρατεία αντιγράφων";} if ($ADD==111) {$hh='lists'; echo "Πρόσθεσε Νέα Λίστα";} if ($ADD==121) {$hh='lists'; echo "Προσθέστε νέο DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Πρόσθεσε Νέα Εισ-Ομάδα";} +if ($ADD==1211) {$hh='ingroups'; echo "$$$-ΟΜΑΔΑ αντιγράφων";} if ($ADD==11111) {$hh='remoteagent'; echo "Πρόσθεσε Νέους Απομακρυσμένους Χειριστές";} if ($ADD==111111) {$hh='usergroups'; echo "Πρόσθεσε Νέα Ομάδα Χρηστών";} if ($ADD==1111111) {$hh='scripts'; echo "Πρόσθεσε Νέο Βοηθό";} @@ -1118,16 +1282,20 @@ if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ΠΡΟΣΘΕΣΕ ΝΕΟ if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΣΕ ΝΕΟ ΔΙΑΚΟΜΙΣΤΗ";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΕΣΕ ΝΕΑ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD==2) {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} -if ($ADD==21) {$hh='campaigns'; echo "Προσθήκη Νέας Εκστρατείας";} -if ($ADD==22) {$hh='campaigns'; echo "Προσθήκη Νέας Κατάστασης Εκστρατείας";} -if ($ADD==23) {$hh='campaigns'; echo "New Εκστρατεία HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "Νέα προσθήκη οδηγού ανακύκλωσης εκστρατείας";} -if ($ADD==26) {$hh='campaigns'; echo "Νέα αυτόματη θέση πινάκων ALT";} -if ($ADD==27) {$hh='campaigns'; echo "Νέος κώδικας μικρής διακοπής πρακτόρων";} -if ($ADD==28) {$hh='campaigns'; echo "Θέση πινάκων εκστρατείας προστιθέμενη";} +if ($ADD=="2") {$hh='users'; echo "Προσθήκη Νέου Χρήστη";} +if ($ADD=="2A") {$hh='users'; echo "Νέα αντιγραμμένη προσθήκη χρηστών";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Νέα αντιγραμμένη προσθήκη εκστρατείας";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Προσθήκη Νέας Εκστρατείας";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Προσθήκη Νέας Κατάστασης Εκστρατείας";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Εκστρατεία HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "Νέα προσθήκη οδηγού ανακύκλωσης εκστρατείας";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Νέα αυτόματη θέση πινάκων ALT";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Νέος κώδικας μικρής διακοπής πρακτόρων";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Θέση πινάκων εκστρατείας προστιθέμενη";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγων εκστρατείας προστιθέμενο";} if ($ADD==211) {$hh='lists'; echo "Προσθήκη Νέας Λίστας";} if ($ADD==2111) {$hh='ingroups'; echo "Προσθήκη Νέας Εισ-Ομάδας";} +if ($ADD==2011) {$hh='ingroups'; echo "Νέα αντιγραμμένη προσθήκη-ΟΜΑΔΑΣ";} if ($ADD==21111) {$hh='remoteagent'; echo "Προσθήκη Νέων Απομακρυσμένων Χειριστών";} if ($ADD==211111) {$hh='usergroups'; echo "Προσθήκη Νέας Ομάδας Χρηστών";} if ($ADD==2111111) {$hh='scripts'; echo "Νέα προσθήκη Βοηθού";} @@ -1139,10 +1307,28 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΗΚΗ ΝΕ if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ΠΡΟΣΘΕΤΕΙ ΝΕΑ ΕΓΓΡΑΦΗ ΕΞΥΠΗΡΕΤΗΤΗ ΚΟΡΜΟΥ";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ΠΡΟΣΘΗΚΗ ΝΕΑΣ ΣΥΝΔΙΑΛΕΞΗΣ";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ΠΡΟΣΘΗΚΗ ΤΩΝ ΘΈΣΕΩΝ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ΠΡΟΣΘΗΚΗ ΤΗΣ ΚΑΤΗΓΟΡΊΑΣ ΘΈΣΗΣ VICIDIAL";} if ($ADD==3) {$hh='users'; echo "Τροποποίηση Χρήστη";} if ($ADD==30) {$hh='campaigns'; echo "Εκστρατεία δεν επιτρέπεται";} -if ($ADD==31) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας";} -if ($ADD==34) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Τροποποίηση Εκστρατείας - Detail - $campaign_id"; + if ($SUB==22) {echo " - Statuses";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -Μόλυβδος ανακύκλωσηςEntries";} + if ($SUB==26) {echo " - Auto Alt Dial Statuses";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==29) {echo " - List Mixes";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Θέσεις εκστρατείας";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Εκστρατεία HotKeys";} +if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Ανακύκλωσης καταχωρήσεις μολύβδου εκστρατείας";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Αυτόματες ALT θέσεις πινάκων εκστρατείας";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Κώδικες μικρής διακοπής πρακτόρων εκστρατείας";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Θέσεις πινάκων εκστρατείας";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Μίγματα καταλόγων εκστρατείας";} if ($ADD==311) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==3111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} if ($ADD==31111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} @@ -1157,15 +1343,18 @@ if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "ΤΡΟΠΟΠΟΙΗΣΕ if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΘΈΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΗΝ ΚΑΤΗΓΟΡΊΑ ΘΈΣΗΣ VICIDIAL";} if ($ADD=="4A") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} if ($ADD=="4B") {$hh='users'; echo "Τροποποίηση Χρήστη - Admin";} if ($ADD==4) {$hh='users'; echo "Τροποποίηση Χρήστη";} -if ($ADD==41) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας";} -if ($ADD==42) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας Status";} -if ($ADD==43) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} -if ($ADD==45) {$hh='campaigns'; echo "Τροποποιήστε τον οδηγό εκστρατείας ανακύκλωσης";} -if ($ADD==47) {$hh='campaigns'; echo "Τροποποιήστε τον κώδικα μικρής διακοπής πρακτόρων";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Τροποποίηση Εκστρατείας";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Τροποποίηση Εκστρατείας Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Τροποποίηση Εκστρατείας HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Τροποποίηση Εκστρατείας - Βασική Επισκόπηση";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Τροποποιήστε τον οδηγό εκστρατείας ανακύκλωσης";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Τροποποιήστε τον κώδικα μικρής διακοπής πρακτόρων";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Τροποποιήστε το μίγμα καταλόγων εκστρατείας";} if ($ADD==411) {$hh='lists'; echo "Τροποποίηση Λίστας";} if ($ADD==4111) {$hh='ingroups'; echo "Τροποποίηση Εισ-Ομάδων";} if ($ADD==41111) {$hh='remoteagent'; echo "Τροποποίηση Απομακρυσμένων Χειριστών";} @@ -1180,10 +1369,12 @@ if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "ΤΡΟΠΟΠΟΙΗΣΗ if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "ΤΡΟΠΟΠΟΙΗΣΕ ΣΥΝΔΙΑΛΕΞΗ";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΤΟΠΟΘΕΤΉΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΘΈΣΕΙΣ ΣΥΣΤΗΜΑΤΩΝ VICIDIAL";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "ΤΡΟΠΟΠΟΙΗΣΤΕ ΤΙΣ ΚΑΤΗΓΟΡΊΕΣ ΘΈΣΗΣ VICIDIAL";} if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Εκστρατεία";} -if ($ADD==52) {$hh='campaigns'; echo "Αποσυνδεμένοι Χειριστές";} -if ($ADD==53) {$hh='campaigns'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Εκστρατεία";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Αποσυνδεμένοι Χειριστές";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} if ($ADD==511) {$hh='lists'; echo "Delete List";} if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} @@ -1197,13 +1388,14 @@ if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Εκστρατεία";} -if ($ADD==62) {$hh='campaigns'; echo "Αποσυνδεμένοι Χειριστές";} -if ($ADD==63) {$hh='campaigns'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} -if ($ADD==65) {$hh='campaigns'; echo "Διαγράψτε τον οδηγό ανακύκλωσης";} -if ($ADD==66) {$hh='campaigns'; echo "Διαγράψτε την αυτόματη θέση πινάκων ALT";} -if ($ADD==67) {$hh='campaigns'; echo "Διαγράψτε τον κώδικα μικρής διακοπής πρακτόρων";} -if ($ADD==68) {$hh='campaigns'; echo "Θέση πινάκων εκστρατείας αφαιρούμενη";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Εκστρατεία";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Αποσυνδεμένοι Χειριστές";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "έκτακτης ανάγκης καθαρισμού VDAC";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Διαγράψτε τον οδηγό ανακύκλωσης";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Διαγράψτε την αυτόματη θέση πινάκων ALT";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Διαγράψτε τον κώδικα μικρής διακοπής πρακτόρων";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Θέση πινάκων εκστρατείας αφαιρούμενη";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Μίγμα καταλόγων εκστρατείας αφαιρούμενο";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Διάγραψε τους Απομακρυσμένους Χειριστές";} @@ -1221,10 +1413,10 @@ if ($ADD==73) {$hh='campaigns'; echo "Μετρητής Κληθέντων Οδ if ($ADD==7111111) {$hh='scripts'; echo "Προεπισκόπιση Βοηθού";} if ($ADD==0) {$hh='users'; echo "Λίστα Χρηστών";} if ($ADD==8) {$hh='users'; echo "Επανακλήσεις μέσα στον χειριστή";} -if ($ADD==81) {$hh='campaigns'; echo "Επανακλήσεις μέσα στην εκστρατεία";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Επανακλήσεις μέσα στην εκστρατεία";} if ($ADD==811) {$hh='lists'; echo "Επανακλήσεις μέσα στην λίστα";} if ($ADD==8111) {$hh='usergroups'; echo "CallBacks μέσα στην ομάδα χρηστών ";} -if ($ADD==10) {$hh='campaigns'; echo "Εκστρατείες";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Εκστρατείες";} if ($ADD==100) {$hh='lists'; echo "Λίστες";} if ($ADD==1000) {$hh='ingroups'; echo "Εισ-Ομάδες";} if ($ADD==10000) {$hh='remoteagent'; echo "Απομακρυσμένοι Χειριστές";} @@ -1308,29 +1500,142 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o++; } - ##### get campaigns listing for dynamic pulldown + ##### BEGIN get campaigns listing for rankings ##### + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysql_fetch_row($rslt); $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; $o++; } + $o=0; + while ($campaigns_to_print > $o) + { + $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; } if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) @@ -1358,28 +1663,103 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) { - if ($group_id_value == $groups[$p]) + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) { $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; } $p++; } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td></tr>\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} } ##### END get inbound groups listing for checkboxes ##### @@ -1395,7 +1775,6 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $campaigns = explode(" ", $allowed_campaigns); - echo "<!-- $allowed_campaigns -->"; } $campaigns_value=''; @@ -1464,6 +1843,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"ΒΟΗΘΕΙΑ\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1522,11 +1910,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Ο πράκτορας επιλέγει Ingroups -</B> εάν θέσετε σε 1 αυτή την επιλογή επιτρέπει στο χρήστη να επιλέξει τις εισ-ομάδες που θα λάβουν τις κλήσεις. Διαφορετικά ο Manager θα πρέπει να το θέσει αυτό στην σελίδα διαχείρισης. -<BR> -<A NAME="vicidial_users-closer_campaigns"> -<BR> -<B>Εισερχόμενες Ομάδες -</B> Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. - <BR> <A NAME="vicidial_users-scheduled_callbacks"> <BR> @@ -1562,6 +1945,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>VICIDIAL συμπληρωματική προμήθεια καταγραφής -</B> αυτή η επιλογήθα αγνοήσει οποιο δήποτε η επιλογή είναι στην εκστρατεία για τηνκαταγραφή. Τα ΑΤΟΜΑ ΜΕ ΕΙΔΙΚΈΣ ΑΝΑΓΚΕΣ δεν θα αγνοήσουν τηρύθμιση καταγραφής εκστρατείας. Δεν θα θέσει εκτός λειτουργίαςΠΟΤΕ την καταγραφή στον πελάτη. ONDEMAND είναι η προεπιλογήκαι επιτρέπει στον πράκτορα για να αρχίσει και να σταματήσει όπωςαπαιτείται. ALLCALLS θα αρχίσει την καταγραφή στον πελάτηόποτε μια κλήση στέλνεται σε έναν πράκτορα. ALLFORCE θααρχίσει την καταγραφή στον πελάτη όποτε μια κλήση στέλνεται σεέναν πράκτορα που δεν δίνει στον πράκτορα καμία επιλογή νασταματήσει. Για ALLCALLS και ALLFORCE υπάρχει μια επιλογή ναχρησιμοποιηθεί η καθυστέρηση καταγραφής για να περικόψει στιςπολύ σύντομα καταγραφές και recude το φορτίο συστημάτων. +<BR> +<A NAME="vicidial_users-vicidial_users-campaign_ranks"> +<BR> +<B>Τάξεις εκστρατείας - σε αυτό το τμήμα μπορείτε να καθορίσετε τηντάξη που ένας πράκτορας θα έχει για κάθε εκστρατεία. Αυτές οιτάξεις μπορούν να χρησιμοποιηθούν για να επιτρέψουν τηνπροτιμημένη κλήση καθοδηγώντας όταν τίθεται η επόμενη κλήσηπρακτόρων campaign_rank. + +<BR> +<A NAME="vicidial_users-closer_campaigns"> +<BR> +<B>Εισερχόμενες Ομάδες -</B> Εδώ μπορείτε να επιλέξετε τις εισερχόμενες ομάδες που θέλετε να λαμβάνουν τις κλήσεις , εάν έχετε επιλέξει την εκστρατεία CLOSER. Θα είστε σε θέση επίσης να θέσετε την τάξη, ή το επίπεδοικανότητας, σε αυτό το τμήμα κάθε μιας από τις εισερχόμενεςομάδες καθώς επίσης και όντας σε θέση να δείτε τοναριθμό κλήσεων που παραλαμβάνονται από κάθε εισερχόμενη ομάδαγια αυτόν τον συγκεκριμένο πράκτορα. Επίσης σε αυτό το τμήμα είναι η δυνατότητα να δοθεί στονπράκτορα μια τάξη για κάθε εισερχόμενη ομάδα. Αυτές οι τάξειςμπορούν να χρησιμοποιηθούν για την προτιμημένη κλήση καθοδηγώνταςόταν επιλέγεται εκείνη η επιλογή στην οθόνη-ΟΜΑΔΑΣ. + <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> @@ -1722,6 +2115,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Επιτρέπει τους Closers -</B> Εδώ ορίζετε εάν οι χρήστες της εκστρατείας θα έχουν την επιλογή να στείλουν την κλήση σε έναν closer. +<BR> +<A NAME="vicidial_campaigns-default_xfer_group"> +<BR> +<B>Ομάδα μεταφοράς προεπιλογής - αυτός ο τομέας είναι η-ΟΜΑΔΑπροεπιλογής που θα επιλεχτεί αυτόματα όταν πηγαίνει ο πράκτοραςστο πλαίσιο μεταφορά-διασκέψεων στη διεπαφή πρακτόρων τους. + +<BR> +<A NAME="vicidial_campaigns-xfer_groups"> +<BR> +<B>Ομάδες μεταφοράς - με αυτές τις λίστες τετραγωνιδίου μπορείτε ναεπιλέξετε τις ομάδες ότι οι πράκτορες σε αυτήν την εκστρατείαμπορούν να μεταφέρουν τις κλήσεις. Επιτρέψτε ότι Closersπρέπει να επιτραπεί για αυτήν την επιλογή να παρουσιάσει. + +<BR> +<A NAME="vicidial_campaigns-campaign_allow_inbound"> +<BR> +<B>Επιτρέψτε πλησίον και συνδύασε - αυτό είναι όπου μπορείτε ναθέσετε εάν οι χρήστες αυτής της εκστρατείας θα έχουν τηνεπιλογή να πάρουν τις εισερχόμενες κλήσεις με αυτήν τηνεκστρατεία. Εάν θέλετε να κάνετε συνδυασμένων εισερχόμενος καιεξερχόμενος έπειτα αυτό πρέπει να τεθεί το Υ. Εάν θέλετε μόνονα κάνετε τον εξερχόμενο σχηματισμό σε αυτήν την εκστρατείαθέστε αυτό σε Ν. Default είναι ν. + <BR> <A NAME="vicidial_campaigns-dial_status"> <BR> @@ -1819,6 +2227,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: ταξινομημένο με την τελευταία φορά που σε ένα χρήστη στάλθηκε μία κλήση. Με αποτέλεσμα, ο χρήστης να λαμβάνει συνολικά το ίδιο αριθό κλήσεων. <BR>   - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. <BR>   - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. + <BR>   - campaign_rank: διαταγές από την τάξη που δίνεται στον πράκτοραγια την εκστρατεία. Ο υψηλότερος σε χαμηλότερο. + <BR>   - fewest_calls: διαταγές από τον αριθμό κλήσεων πουπαραλαμβάνονται από έναν πράκτορα για εκείνη την συγκεκριμένηεισερχόμενη ομάδα. Λιγότερες κλήσεις πρώτα. <BR> <A NAME="vicidial_campaigns-local_call_time"> @@ -1960,6 +2370,37 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Επιτρέψτε τους κανένας-χοάνη-μολύβδους Logins -</B> εάν θέστε τοΥ, επιτρέπει στους πράκτορες στη σύνδεση στην εκστρατεία ακόμα κιαν δεν υπάρχει κανένας μόλυβδος που φορτώνεται στη χοάνη γιαεκείνη την εκστρατεία. Αυτή η λειτουργία δεν απαιτείται στιςεκστρατείες στενός-τύπων. Η προεπιλογή είναι ν. +<BR> +<A NAME="vicidial_campaigns-list_order_mix"> +<BR> +<B>Μίγμα διαταγής καταλόγων - αγνοεί τους τομείς θέσης διαταγήςκαι πινάκων μολύβδου. Θα χρησιμοποιήσει τις παραμέτρους καταλόγωνκαι θέσης για την επιλεγμένη είσοδο μιγμάτων καταλόγων στο υπο-τμήμα μιγμάτων καταλόγων αντ' αυτού. Η προεπιλογή είναι ΕΚΤΟΣΛΕΙΤΟΥΡΓΊΑΣ. + +<BR> +<A NAME="vicidial_campaigns-vcl_id"> +<BR> +<B>Ταυτότητα μιγμάτων καταλόγων - ταυτότητα του μίγματος καταλόγων.Πρέπει να είστε από 2-20 χαρακτήρες στο μήκος χωρίς ταδιαστήματα ή άλλη ειδική στίξη. + +<BR> +<A NAME="vicidial_campaigns-vcl_name"> +<BR> +<B>Όνομα μιγμάτων καταλόγων - περιγραφικό όνομα του μίγματοςκαταλόγων. Πρέπει να είστε από 2-50 χαρακτήρες στο μήκος. + +<BR> +<A NAME="vicidial_campaigns-list_mix_container"> +<BR> +<B>Λεπτομέρεια μιγμάτων καταλόγων - η σύνθεση της εισόδου μιγμάτωνκαταλόγων. Περιέχει τον κατάλογο ταυτότητα, τη διαταγή μιγμάτων,τα ποσοστά και τις θέσεις που αποτελούν αυτό το μίγμα καταλόγων.Τα ποσοστά πρέπει πάντα να προσθέσουν μέχρι 100, και οικατάλογοι όλοι πρέπει να είναι ενεργοί και καθορισμένοι τηνεκστρατεία για την είσοδο μιγμάτων διαταγής που ενεργοποιείται. + +<BR> +<A NAME="vicidial_campaigns-mix_method"> +<BR> +<B>Μέθοδος μιγμάτων καταλόγων - η μέθοδος όλα τα μέρη τηςλεπτομέρειας μιγμάτων καταλόγων από κοινού. EVEN_MIX θααναμίξει τους μολύβδους από κάθε μέρος που παρεμβάλλεται λευκέςσελίδες με τα άλλα μέρη, όπως αυτό το 1,2,3,1,2,3,1,2,3.IN_ORDER θα βάλει τους μολύβδους στη διαταγή στην οποίαπαρατίθενται στην οθόνη λεπτομέρειας μιγμάτων καταλόγων1,1,1,2,2,2,3,3,3. ΤΥΧΑΊΑ θα τους βάλουν στην ΤΥΧΑΊΑ προεπιλογήδιαταγής 1,3,2,1,1,3,2,1,3. είναι IN_ORDER. + +<BR> +<A NAME="vicidial_campaigns-manual_dial_list_id"> +<BR> +<B>Χειρωνακτικός κατάλογος ταυτότητα πινάκων - η προεπιλογήlist_id για να χρησιμοποιηθεί όταν δημιουργείται έναςπράκτορας placces μια χειρωνακτική κλήση και ένα νέο αρχείομολύβδου στο vicidial_list. Η προεπιλογή είναι 999. Αυτός οτομέας μπορεί να περιέχει τα ψηφία μόνο. + + <BR><BR><BR><BR> @@ -2046,7 +2487,10 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: ταξινομημένο με την τελευταία φορά που σε ένα χρήστη στάλθηκε μία κλήση. Με αποτέλεσμα, ο χρήστης να λαμβάνει συνολικά το ίδιο αριθό κλήσεων. <BR>   - oldest_call_finish: ταξινομημένο με την τελευταία φορά που ένας χρήστης τελείωσε μία κλήση. Ο χρήστης που περιμένει περισσότερο λαμβάνει την πρώτη κλήση. <BR>   - overall_user_level: οι διαταγές από το user_level του χειριστή όπως καθορίζεται στα vicidial_users παρουσιάζουν ένα υψηλότερο user_level θα άβουν περισσότερες κλήσεις. - + <BR>   - inbound_group_rank: διαταγές από την τάξη που δίνεται στονπράκτορα για τη συγκεκριμένη εισερχόμενη ομάδα. Ο υψηλότερος σεχαμηλότερο. + <BR>   - fewest_calls: διαταγές από τον αριθμό κλήσεων πουπαραλαμβάνονται από έναν πράκτορα για εκείνη την συγκεκριμένηεισερχόμενη ομάδα. Λιγότερες κλήσεις πρώτα. + <BR>   - campaign_rank: διαταγές από την τάξη που δίνεται στον πράκτοραγια την εκστρατεία. Ο υψηλότερος σε χαμηλότερο. + <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> <A NAME="vicidial_inbound_groups-fronter_display"> <BR> @@ -2087,6 +2531,66 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Εσωτ.Σύνδεση Εγκατάλειψης -</B> Αυτή είναι η εσωτ.σύνδεση του πλάνου κλήσεων, όπου βρίσκεται το ηχητικό αρχείο της Εγκατάλειψης στον διακομιστή. +<BR> +<A NAME="vicidial_inbound_groups-call_time_id"> +<BR> +<B>Χρόνος κλήσης - αυτό είναι το χρονικό σχέδιο κλήσης ναχρησιμοποιήσει για αυτήν την εισερχόμενη ομάδα. Λάβετε υπόψηότι ο χρόνος είναι βασισμένος στο χρόνο κεντρικών υπολογιστών.Η προεπιλογή είναι 24hours. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_action"> +<BR> +<B>Μετά από τη δράση ωρών - η δράση για να εκτελέσει εάν είναιμετά από τις ώρες όπως καθορίζεται στο χρόνο πρόσκλησης γιααυτήν την εισερχόμενη ομάδα. HANGUP hangup αμέσως η κλήση,MESSASGE θα παίξει το αρχείο στο μετέπειτα τομέα Filenamμηνυμάτων ωρών, η ΕΠΈΚΤΑΣΗ θα στείλει την κλήση στη μετέπειταπαράταση ωρών στον dialplan και το ΦΩΝΗΤΙΚΌ ΤΑΧΥΔΡΟΜΕΊΟ θαστείλει την κλήση στο παράθυρο φωνητικού ταχυδρομείου πουαπαριθμείται στο μετέπειτα τομέα φωνητικού ταχυδρομείου ωρών. Ηπροεπιλογή είναι ΜΗΝΥΜΑ. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_message_filename"> +<BR> +<B>Μετά από το όνομα αρχείου μηνυμάτων ωρών - το ακουστικό αρχείοπου βρίσκεται στον κεντρικό υπολογιστή που παίζεται εάν η δράσητίθεται το ΜΗΝΥΜΑ. Η προεπιλογή είναι VM-ANTJ'O + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_exten"> +<BR> +<B>Μετά από την παράταση ωρών - η dialplan επέκταση για ναστείλει την πρόσκληση εάν η δράση τίθεται την ΕΠΕΚΤΑΣΗ. Ηπροεπιλογή είναι 8300. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_voicemail"> +<BR> +<B>Μετά από το φωνητικό ταχυδρομείο ωρών - το κιβώτιο φωνητικούταχυδρομείου για να στείλει την πρόσκληση εάν η δράση τίθεται τοΦΩΝΗΤΙΚΟ ΤΑΧΥΔΡΟΜΕΊΟ. + +<BR> +<A NAME="vicidial_inbound_groups-welcome_message_filename"> +<BR> +<B>Ευπρόσδεκτο όνομα αρχείου μηνυμάτων - το ακουστικό αρχείο πουβρίσκεται στον κεντρικό υπολογιστή που παίζεται όταν μπαίνει ηκλήση. Εάν θέστε ΚΑΝΕΝΑΣ --- έπειτα κανένα μήνυμα δεν θαπαιχτεί. Η προεπιλογή είναι ΚΑΜΙΑ --- + +<BR> +<A NAME="vicidial_inbound_groups-moh_context"> +<BR> +<B>Μουσική στο πλαίσιο λαβής - η μουσική στο πλαίσιο λαβής στηχρήση όταν τοποθετείται ο πελάτης στη λαβή. Η προεπιλογή είναιπροεπιλογή. + +<BR> +<A NAME="vicidial_inbound_groups-onhold_prompt_filename"> +<BR> +<B>Στο γρήγορο όνομα αρχείου λαβής - το ακουστικό αρχείο πουβρίσκεται στον κεντρικό υπολογιστή που παίζεται σε ένα τακτόχρονικό διάστημα όταν είναι ο πελάτης στη λαβή. Η προεπιλογήείναι generic_hold. Αυτό το ακουστικό αρχείο ΠΡΕΠΕΙ να είναι 9δευτερόλεπτα ή λιγότεροι στο μήκος. + +<BR> +<A NAME="vicidial_inbound_groups-prompt_interval"> +<BR> +<B>Στο γρήγορο διάστημα λαβής - το χρονικό διάστημα σταδευτερόλεπτα για να περιμένει πρίν παίζει επάνω κρατά γρήγορος.Η προεπιλογή είναι 60. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_exten"> +<BR> +<B>Αγρυπνη επέκταση πρακτόρων - η επέκταση που στέλνει στη σύνοδοπρακτόρων για να αναγγείλει ότι μια κλήση έρχεται στον πράκτορα.Αυτή η επέκταση πρέπει να έχει μια αναπαραγωγή ήχου ενόςακουστικού αρχείου. Για να μην χρησιμοποιήσετε αυτήν τηνλειτουργία θέστε αυτό σε Χ. Default είναι Χ. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_delay"> +<BR> +<B>Αγρυπνη καθυστέρηση πρακτόρων - το χρονικό διάστημα στα χιλιοστάτου δευτερολέπτου για να περιμένει πρίν στέλνει την κλήση στονπράκτορα μετά από να παίξει την επάνω άγρυπνη επέκτασηπρακτόρων. Η προεπιλογή είναι 1000. + +<BR> +<A NAME="vicidial_inbound_groups-default_xfer_group"> +<BR> +<B>Ομάδα μεταφοράς προεπιλογής - αυτός ο τομέας είναι η-ΟΜΑΔΑπροεπιλογής που θα επιλεχτεί αυτόματα όταν πηγαίνει ο πράκτοραςστο πλαίσιο μεταφορά-διασκέψεων στη διεπαφή πρακτόρων τους. + <BR><BR><BR><BR> @@ -2140,7 +2644,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSES ΠΙΝΑΚΑΣ</FONT></B><BR><BR> <A NAME="vicidial_campaign_statuses"> <BR> -<B>Με την χρήση προσαρμοσμένων καταστάσεων εκστρατείας, μπορείτε να έχετε καταστάσεις μόνο για συγκεκριμένες εκστρατείες. Η κατάσταση πρέπει να είναι 1-8 χαρακτήρες, η περιγραφή 2-30 χαρακτήρες και Επιλέξιμα καθορίζεται αν εμφανίζεται στο VICIDIAL ως τερματισμός.</B> +<B>Με την χρήση προσαρμοσμένων καταστάσεων εκστρατείας, μπορείτε να έχετε καταστάσεις μόνο για συγκεκριμένες εκστρατείες. Η κατάσταση πρέπει να είναι 1-8 χαρακτήρες, η περιγραφή 2-30 χαρακτήρες και Επιλέξιμα καθορίζεται αν εμφανίζεται στο VICIDIAL ως τερματισμός. Ο τομέας χρησιμοποιείται κατά τον υπολογισμό του ποσοστούπτώσης, ή εγκαταλείπει το ποσοστό. Η ρύθμιση την στο Υ θαχρησιμοποιήσει αυτήν την θέση κατά υπολογισμό τωνανθρώπινος-απαντημένων κλήσεων. Η επιλογή κατηγορίας επιτρέπει σε σας για να ομαδοποιήσειδιάφορες θέσεις σε ένα catogy που μπορεί να χρησιμοποιηθεί γιατη στατιστική ανάλυση.</B> @@ -2229,7 +2733,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Κείμενο χειρόγραφου -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> -<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290"> +<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> @@ -2305,7 +2809,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>ΛΕΙΤΟΥΡΓΙΑ ΕΙΣΑΓΩΓΗΣ ΛΙΣΤΑΣ</FONT></B><BR><BR> <A NAME="vicidial_list_loader"> <BR> -Ο VICIDIAL εισαγωγέας οδηγών είναι απλά σχεδιασμένος, ώστε να παίρνι ένα αρχείο - μέχρι 8ΜΒ - που είναι διαχωρισμένο με tab ή pipe και να το φορτώνει στον πίνακα vicidial_list. Υπάρχει επίσης ένας νέος βήτα φορτωτής οδηγών έκδοσης έξοχος που επιτρέπει τον τομέα επιλέγοντας και TXT - σαφές κείμενο, CSV - κόμμα χώρισε τις τιμέ και XLS - σχήματα αρχείων Excel. Ο φορτωτής δεν κάνει εξακρίβωση δεδομένων ή έλεγχο σε διπλές καταχωρήσεις, το οποί είναι κάτι που πρέπει να κάνετε πριν την φόρτωση. Επίσης, διευκρινίστε ότι έχετε δημιουργήσει την λίστα όπου οι οδηγοί θα είναι από κάτω, ώστε να τους χρησιμοποιήστε.Υπάρχει επίσης το θέμα με τις ζώνες κωδικοποίησης χρόνου των οδηγών. Μπορεί να θέλετε να αυξήσετε την συχνότητα όπου το ADMIN_adjust_GMTnow_on_leads.pl τρέχει στον cron, ώστε οποιαδήποτε φόρτωση οδηγών να κωδικοποιείται πιο γρήγορα. Εδώ είναι μία λίστα από πεδία στην πρέπουσα ταξινόμηση για τα αρχεία καθοδήγησης.: +Ο βασικός βασισμένος στο WEB φορτωτής μολύβδου VICIDIALσχεδιάζεται απλά για να πάρει ένα αρχείο μολύβδου - μέχρι8MB στο μέγεθος - που είναι είτε ετικέττα είτε σωλήνας πουοριοθετείται και τον φορτώνει στον πίνακα vicidial_list. Οφορτωτής μολύβδου επιτρέπει τον τομέα επιλέγοντας και TXT -σαφές κείμενο, CSV - κόμμα χώρισε τις τιμές και XLS -σχήματα αρχείων Excel. Ο φορτωτής μολύβδου δεν κάνει τηνεπικύρωση στοιχείων, αλλά επιτρέπει σε σας για να ελέγξει για τααντίγραφα σε το, μέσα στην εκστρατεία ή μέσα το σε ολόκληροσύστημα. Επίσης, σιγουρευτείτε ότι έχετε δημιουργήσει τονκατάλογο ότι αυτοί οι μόλυβδοι πρόκειται να κάτω έτσι ώστεμπορείτε να τους χρησιμοποιήσετε. Εδώ είναι ένας κατάλογος τωντομέων στην κατάλληλη διαταγή τους για τα αρχεία μολύβδου: <OL> <LI>Κωδικός Οδηγού Προμηθευτού <LI>Πηγαίος Κώδικας - εσωτερική χρήση μόνο από διαχειριστές και DBAs @@ -2332,7 +2836,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <LI>Σχόλια </OL> -<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. +<BR>ΣΗΜΕΙΩΣΕΙΣ: Η λειτουργία φορτωτών μολύβδου Excel επιτρέπεταιαπό μια σειρά χειρογράφων perl και πρέπει να έχει κατάλληλαδιαμορφωμένη/ένα αρχείο κ.λπ.../astguiclient.conf σε ισχύ στονκεντρικό υπολογιστή δικτύου. Επίσης, οι ενότητες ζευγών perlπρέπει να φορτωθούν για το για να εργαστούν επίσης - ολε-Storage_Lite και υπολογισμός με λογιστικό φύλλο(spreadsheet)- ParseExcel. Μπορείτε να ελέγξετε για τα λάθηχρόνου εκτέλεσης σε αυτοί με την εξέταση το αρχείο apache σαςerror_log. Επίσης, για τους ελέγχους διπλασιασμού ενάντια στουςκαταλόγους gampaign, ο κατάλογος που έχει τα νέα προβαδίσματαπου πηγαίνουν σε το πρέπει να δημιουργηθεί στο σύστημα προτού νααρχίσετε να φορτώνετε τους μολύβδους. @@ -2886,6 +3390,30 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Σπίτι URL Admin -</B> αυτό είναι η διεύθυνση URL ήιστοχώρων ότι θα πάτε εάν χτυπήσετε στην ΕΓΧΏΡΙΑ σύνδεση στηνκορυφή της σελίδας admin.php. +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Επιτρέψτε το αρχείο ημερολογίου μεταφοράς πρακτόρων - αυτή ηεπιλογή θα καταγράψει σε ένα αρχείο ημερολογίου κειμένων στοwebserver κάθε φορά που μεταφέρεται μια κλήση σε ένανπράκτορα. Η προεπιλογή είναι 0, άτομα με ειδικές ανάγκες. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUSES ΠΙΝΑΚΑΣ</FONT></B><BR><BR> +<A NAME="vicidial_statuses"> +<BR> +<B>Μέσω της χρήσης των θέσεων συστημάτων, μπορείτε να έχετε τιςθέσεις που υπάρχουν για την εκστρατεία και την-ΟΜΑΔΑ. Η θέσηπρέπει να είναι 1-6 χαρακτήρες στο μήκος, η περιγραφή πρέπεινα είναι 2-30 χαρακτήρες στο μήκος και επιλέξιμος καθορίζειεάν παρουσιάζει σε VICIDIAL ως διάθεση πρακτόρων. Ο τομέαςχρησιμοποιείται κατά τον υπολογισμό του ποσοστού πτώσης, ήεγκαταλείπει το ποσοστό. Η ρύθμιση την στο Υ θα χρησιμοποιήσειαυτήν την θέση κατά υπολογισμό των ανθρώπινος-απαντημένωνκλήσεων. Η επιλογή κατηγορίας επιτρέπει σε σας για ναομαδοποιήσει διάφορες θέσεις σε ένα catogy που μπορεί ναχρησιμοποιηθεί για τη στατιστική ανάλυση.</B> + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES ΠΙΝΑΚΑΣ</FONT></B><BR><BR> +<A NAME="vicidial_status_categories"> +<BR> +<B>Μέσω της χρήσης των κατηγοριών θέσης συστημάτων, μπορείτε νασυγκεντρώσετε τις θέσεις για να επιτρέψετε τη στατιστική ανάλυσησε μια ομάδα θέσεων. Η ταυτότητα κατηγορίας πρέπει να είναι2-20 χαρακτήρες στο μήκος χωρίς τα διαστήματα, το όνομαπρέπει να είναι 2-50 χαρακτήρες στο μήκος, η περιγραφή είναιπροαιρετική και η επίδειξη TimeonVDAD καθορίζει εάν εκείνη ηθέση θα είναι ενός θέσης από μέχρι 4 θέσεις που μπορούν ναυπολογιστούν και να επιδειχθούν στο χρόνο στη σε πραγματικό χρόνοέκθεση VDAD.</B> + @@ -2900,6 +3428,12 @@ exit; } +###################################################################################################### +###################################################################################################### +####### 7 series, filter count preview and script preview +###################################################################################################### +###################################################################################################### + @@ -3160,9 +3694,119 @@ if ($hh=='reports') {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} +echo "\n"; +echo " -ΔΙΑΧΕΙΡΙΣΗ: Super Lead Loader +ΔΙΑΧΕΙΡΙΣΗ: Lead Loader
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - +
@@ -299,13 +303,22 @@ function ParseFileName() { + + + + - + @@ -314,15 +327,14 @@ function ParseFileName() { - - +
Εισαγωγή οδηγών από αυτό το αρχείο: ID Λίστας Override: (μόνο αριθμοί or leave blank for values in the file)
Phone Code Override: (μόνο αριθμοί or leave blank for values in the file)
Μορφή αρχείων για χρήση: Τυποποιημένο VICIDIAL    Εμφάνιση συνήθειας
Διπλός έλεγχος μολύβδου:
Συμβούλευση ζώνης χρονικής ανοχής:
        
ΕΠΙΛΕΞΤΕ ΕΔΩ ΓΙΑ ΝΑ ΠΑΤΕ ΣΤΟ ΒΑΣΙΚΟ ΕΙΣΑΓΩΓΕΑ ΟΔΗΓΩΝ         ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗ
ΠΡΟΗΓΜΕΝΟΣ ΕΙΣΑΓΩΓΕΑΣ ΛΙΣΤΩΝ-     ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:
        ΠΙΣΩ ΣΤΗ ΔΙΑΧΕΙΡΙΣΗLIST LOADER-     ΕΚΔΟΣΗ:     ΔΗΜΙΟΥΡΓΙΑ:    
document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + print ""; flush(); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -350,6 +362,11 @@ function ParseFileName() { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

"; + } + while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -396,9 +413,78 @@ function ParseFileName() { # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -408,6 +494,7 @@ function ParseFileName() { { $row=mysql_fetch_row($rslt); $dup_lead = $row[0]; + $dup_lead_list = $list_id; } if ($dup_lead < 1) { @@ -441,7 +528,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -473,11 +560,17 @@ function ParseFileName() { { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

\n"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

\n"; + } # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); @@ -491,6 +584,11 @@ function ParseFileName() { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

"; + } + while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -528,12 +626,80 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -577,7 +743,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -637,6 +803,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

\n"; + } while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -680,12 +850,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -729,7 +967,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -768,9 +1006,11 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else @@ -795,6 +1035,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

"; + } while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -832,12 +1076,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -881,7 +1193,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -906,7 +1218,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
"; flush(); - print "\r\n"; + print "
\r\n"; print " \r\n"; print " \r\n"; print " \r\n"; @@ -945,6 +1257,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

"; + } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); @@ -1016,7 +1332,9 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } @@ -1043,6 +1361,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID ΛΙΣΤΑΣ OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

ΣΥΜΠΛΗΡΩΜΑΤΙΚΗ ΠΡΟΜΉΘΕΙΑ ΤΗΛΕΦΩΝΙΚΟΥ ΚΩΔΙΚΑ ΓΙΑ ΑΥΤΟ ΤΟ ΑΡΧΕΙΟ: $phone_code_override

"; + } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); @@ -1102,6 +1424,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print "
VICIDIAL ΣτήληΑρχεία δεδομένων        
\r\n"; diff --git a/LANG_www/vicidial_el/user_stats.php b/LANG_www/vicidial_el/user_stats.php index 26f4fe19..d03abe1d 100644 --- a/LANG_www/vicidial_el/user_stats.php +++ b/LANG_www/vicidial_el/user_stats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit # 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation # header ("Content-type: text/html; charset=utf-8"); @@ -263,7 +264,7 @@ echo "

\n"; echo "
\n"; -echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; echo "\n"; @@ -298,9 +299,45 @@ echo "
# DATE/TIME LENGTH STATUS PHONEΕΚΣΤΡΑΤΕΙΑ GROUP LIST LEAD


\n"; +echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "\n"; +echo "\n"; + + $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + } + + +echo "
# DATE/TIME LENGTH STATUS PHONEΕΚΣΤΡΑΤΕΙΑ WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; + + + + echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; -echo "\n"; +echo "\n"; $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -315,16 +352,25 @@ echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $location = $row[11]; + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } diff --git a/LANG_www/vicidial_en/AST_CLOSERstats.php b/LANG_www/vicidial_en/AST_CLOSERstats.php index c2bea4d6..ec53f93f 100644 --- a/LANG_www/vicidial_en/AST_CLOSERstats.php +++ b/LANG_www/vicidial_en/AST_CLOSERstats.php @@ -8,6 +8,8 @@ # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown # require("dbconnect.php"); @@ -19,6 +21,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -27,6 +31,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -85,6 +91,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFY | REPORTS \n"; echo "\n\n"; @@ -100,14 +113,37 @@ echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n"; else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Closer Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -128,7 +164,7 @@ echo "Average Call Length for all Calls: $average_hold_seconds second echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -154,10 +190,90 @@ else echo "Total DROP Calls: $DROPcalls $DROPpercent%\n"; echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; + + +############################## +######### CALL STATUS STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL STATUS STATS\n"; +echo "+--------+----------------------+------------+\n"; +echo "| STATUS | DESCRIPTION | CALLS |\n"; +echo "+--------+----------------------+------------+\n"; + +$stmt="SELECT * from vicidial_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$statuses_to_print = mysql_num_rows($rslt); +$statuses_list=''; + +$o=0; +while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="SELECT * from vicidial_campaign_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$Cstatuses_to_print = mysql_num_rows($rslt); + +$o=0; +while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statuses_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} + $RAWstatus = $row[1]; + $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} + + if ($non_latin < 1) + { + $status_name = sprintf("%-20s", $statname_list[$RAWstatus]); + while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);} + } + else + { + $status_name = sprintf("%-60s", $statname_list[$RAWstatus]); + while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');} + } + + + echo "| $status | $status_name | $STATUScount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+--------+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+-------------------------------+------------+\n"; + + + + echo "\n"; echo "---------- QUEUE STATS\n"; -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -208,7 +324,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -234,7 +350,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); + $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); @@ -246,11 +362,12 @@ while ($i < $users_to_print) $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); diff --git a/LANG_www/vicidial_en/AST_VDADstats.php b/LANG_www/vicidial_en/AST_VDADstats.php index f747843b..d8afbdd6 100644 --- a/LANG_www/vicidial_en/AST_VDADstats.php +++ b/LANG_www/vicidial_en/AST_VDADstats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php # header ("Content-type: text/html; charset=utf-8"); @@ -21,6 +22,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -29,6 +32,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -87,6 +92,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFY | REPORTS \n"; echo "\n\n"; @@ -102,14 +114,37 @@ echo "PLEASE SELECT A CAMPAIGN AND DATE ABOVE AND CLICK SUBMIT\n"; else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -129,7 +164,7 @@ echo "Average Call Length for all Calls in seconds: $average_hold_seconds\n"; echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -137,7 +172,7 @@ $DROPcalls = sprintf("%10s", $row[0]); $DROPcallsRAW = $row[0]; $DROPseconds = $row[1]; -$stmt="select count(*) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; +$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -175,7 +210,7 @@ echo "Average Length for DROP Calls in seconds: $average_hold_seconds\n"; echo "\n"; echo "---------- AUTO-DIAL NO ANSWERS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -238,7 +273,7 @@ while ($Cstatuses_to_print > $o) $o++; } -$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -281,10 +316,6 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) - {$vicidial_log = 'vicidial_closer_log';} -else - {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -296,7 +327,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENT | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select $vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from $vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; +$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -347,6 +378,7 @@ while ($i < $users_to_print) $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); @@ -374,7 +406,7 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date 00:00:01' and event_time <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php index dae17443..a30832be 100644 --- a/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_en/AST_VICIDIAL_hopperlist.php @@ -8,7 +8,9 @@ # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# require("dbconnect.php"); @@ -123,11 +125,11 @@ echo "Total leads in hopper right now: $TOTALcalls\n"; echo "\n"; echo "---------- LEADS IN HOPPER\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; -echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; +echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;"; +$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -145,14 +147,16 @@ while ($i < $users_to_print) $gmt = sprintf("%-6s", $row[5]); $hopper_id = sprintf("%-6s", $row[6]); $alt_dial = sprintf("%-5s", $row[7]); + $list_id = sprintf("%-10s", $row[8]); + $priority = sprintf("%-6s", $row[9]); -if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} -else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} +if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} +else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} $i++; } -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; } diff --git a/LANG_www/vicidial_en/AST_agent_performance_detail.php b/LANG_www/vicidial_en/AST_agent_performance_detail.php index 72779f6e..5557d4dd 100644 --- a/LANG_www/vicidial_en/AST_agent_performance_detail.php +++ b/LANG_www/vicidial_en/AST_agent_performance_detail.php @@ -1,14 +1,13 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # -# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70118-1705 - Added user_group filtering option -# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars +# 71119-2359 - First build +# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one +# - Fixed zero division bug # require("dbconnect.php"); @@ -141,25 +140,25 @@ else { if ($shift == 'AM') { - $query_date_BEGIN = "$query_date 03:45:00"; - $query_date_END = "$query_date 15:15:00"; - $time_BEGIN = "03:45:00"; - $time_END = "15:15:00"; + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} } if ($shift == 'PM') { - $query_date_BEGIN = "$query_date 15:15:00"; - $query_date_END = "$query_date 23:15:00"; - $time_BEGIN = "15:15:00"; - $time_END = "23:15:00"; + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} } if ($shift == 'ALL') { - $query_date_BEGIN = "$query_date 00:00:00"; - $query_date_END = "$query_date 23:59:59"; - $time_BEGIN = "00:00:00"; - $time_END = "23:59:59"; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} else {$ugSQL='';} @@ -169,11 +168,22 @@ echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- AGENTS Details -------------\n\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; + + + +$statuses='-'; +$statusesTXT=''; +$statusesHEAD=''; +$statusesHTML=''; +$statusesARY[0]=''; +$j=0; +$users='-'; +$usersARY[0]=''; +$user_namesARY[0]=''; +$k=0; + +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -182,43 +192,123 @@ $i=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); - $TOTcalls=($TOTcalls + $row[0]); - $TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]); - $TOTtotTALK=($TOTtotTALK + $row[1]); - $TOTtotWAIT=($TOTtotWAIT + $row[7]); - $TOTtotPAUSE=($TOTtotPAUSE + $row[5]); - $TOTtotDISPO=($TOTtotDISPO + $row[9]); - $calls[$i] = sprintf("%-6s", $row[0]); + $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation + + $calls[$i] = $row[0]; + $talk_sec[$i] = $row[1]; + $full_name[$i] = $row[2]; + $user[$i] = $row[3]; + $pause_sec[$i] = $row[4]; + $wait_sec[$i] = $row[5]; + $dispo_sec[$i] = $row[6]; + $status[$i] = $row[7]; + if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) + { + $statusesTXT = sprintf("%8s", $status[$i]); + $statusesHEAD .= "----------+"; + $statusesHTML .= " $statusesTXT |"; + $statuses .= "$status[$i]-"; + $statusesARY[$j] = $status[$i]; + $j++; + } + if (!eregi("-$user[$i]-", $users)) + { + $users .= "$user[$i]-"; + $usersARY[$k] = $user[$i]; + $user_namesARY[$k] = $full_name[$i]; + $k++; + } + + $i++; + } + + +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +while ($m < $k) + { + $Suser=$usersARY[$m]; + $Sfull_name=$user_namesARY[$m]; + $Stime=0; + $Scalls=0; + $Stalk_sec=0; + $Spause_sec=0; + $Swait_sec=0; + $Sdispo_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) + { + $Scalls = ($Scalls + $calls[$i]); + $Stalk_sec = ($Stalk_sec + $talk_sec[$i]); + $Spause_sec = ($Spause_sec + $pause_sec[$i]); + $Swait_sec = ($Swait_sec + $wait_sec[$i]); + $Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]); + $SstatusTXT = sprintf("%8s", $calls[$i]); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + $TOTcalls=($TOTcalls + $Scalls); + $TOTtime=($TOTtime + $Stime); + $TOTtotTALK=($TOTtotTALK + $Stalk_sec); + $TOTtotWAIT=($TOTtotWAIT + $Swait_sec); + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec); + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);} + else {$Stalk_avg=0;} + if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);} + else {$Spause_avg=0;} + if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);} + else {$Swait_avg=0;} + if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} + else {$Sdispo_avg=0;} + + $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) { - $full_name[$i]= sprintf("%-15s", $row[2]); - while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);} - - $user[$i] = sprintf("%-6s", $row[3]); - while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);} + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} } else { - $full_name[$i]= sprintf("%-45s", $row[2]); - while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');} + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $user[$i] = sprintf("%-18s", $row[3]); - while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');} + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } - $user[$i] = sprintf("%-8s", $row[3]); - $USERtime = ($row[1] + $row[5] + $row[7] + $row[9]); - $USERtotTALK = $row[1]; - $USERavgTALK = $row[4]; - $USERtotPAUSE = $row[5]; - $USERavgPAUSE = $row[6]; - $USERtotWAIT = $row[7]; - $USERavgWAIT = $row[8]; - $USERtotDISPO = $row[9]; - $USERavgDISPO = $row[10]; - - $USERtime_M = ($USERtime / 60); + $USERtime_M = ($Stime / 60); $USERtime_M = round($USERtime_M, 2); $USERtime_M_int = intval("$USERtime_M"); $USERtime_S = ($USERtime_M - $USERtime_M_int); @@ -226,9 +316,9 @@ while ($i < $rows_to_print) $USERtime_S = round($USERtime_S, 0); if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";} $USERtime_MS = "$USERtime_M_int:$USERtime_S"; - $pfUSERtime_MS[$i] = sprintf("%7s", $USERtime_MS); + $pfUSERtime_MS = sprintf("%7s", $USERtime_MS); - $USERtotTALK_M = ($USERtotTALK / 60); + $USERtotTALK_M = ($Stalk_sec / 60); $USERtotTALK_M = round($USERtotTALK_M, 2); $USERtotTALK_M_int = intval("$USERtotTALK_M"); $USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int); @@ -236,9 +326,9 @@ while ($i < $rows_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS); + $pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); - $USERavgTALK_M = ($USERavgTALK / 60); + $USERavgTALK_M = ($Stalk_avg / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); $USERavgTALK_M_int = intval("$USERavgTALK_M"); $USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int); @@ -246,9 +336,9 @@ while ($i < $rows_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; - $pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS); + $pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - $USERtotPAUSE_M = ($USERtotPAUSE / 60); + $USERtotPAUSE_M = ($Spause_sec / 60); $USERtotPAUSE_M = round($USERtotPAUSE_M, 2); $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M"); $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); @@ -256,9 +346,9 @@ while ($i < $rows_to_print) $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; - $pfUSERtotPAUSE_MS[$i] = sprintf("%6s", $USERtotPAUSE_MS); + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); - $USERavgPAUSE_M = ($USERavgPAUSE / 60); + $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M = round($USERavgPAUSE_M, 2); $USERavgPAUSE_M_int = intval("$USERavgPAUSE_M"); $USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int); @@ -266,9 +356,9 @@ while ($i < $rows_to_print) $USERavgPAUSE_S = round($USERavgPAUSE_S, 0); if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";} $USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S"; - $pfUSERavgPAUSE_MS[$i] = sprintf("%6s", $USERavgPAUSE_MS); + $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS); - $USERtotWAIT_M = ($USERtotWAIT / 60); + $USERtotWAIT_M = ($Swait_sec / 60); $USERtotWAIT_M = round($USERtotWAIT_M, 2); $USERtotWAIT_M_int = intval("$USERtotWAIT_M"); $USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int); @@ -276,9 +366,9 @@ while ($i < $rows_to_print) $USERtotWAIT_S = round($USERtotWAIT_S, 0); if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";} $USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S"; - $pfUSERtotWAIT_MS[$i] = sprintf("%6s", $USERtotWAIT_MS); + $pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS); - $USERavgWAIT_M = ($USERavgWAIT / 60); + $USERavgWAIT_M = ($Swait_avg / 60); $USERavgWAIT_M = round($USERavgWAIT_M, 2); $USERavgWAIT_M_int = intval("$USERavgWAIT_M"); $USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int); @@ -286,9 +376,9 @@ while ($i < $rows_to_print) $USERavgWAIT_S = round($USERavgWAIT_S, 0); if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";} $USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S"; - $pfUSERavgWAIT_MS[$i] = sprintf("%6s", $USERavgWAIT_MS); + $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS); - $USERtotDISPO_M = ($USERtotDISPO / 60); + $USERtotDISPO_M = ($Sdispo_sec / 60); $USERtotDISPO_M = round($USERtotDISPO_M, 2); $USERtotDISPO_M_int = intval("$USERtotDISPO_M"); $USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int); @@ -296,9 +386,9 @@ while ($i < $rows_to_print) $USERtotDISPO_S = round($USERtotDISPO_S, 0); if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";} $USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S"; - $pfUSERtotDISPO_MS[$i] = sprintf("%6s", $USERtotDISPO_MS); + $pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS); - $USERavgDISPO_M = ($USERavgDISPO / 60); + $USERavgDISPO_M = ($Sdispo_avg / 60); $USERavgDISPO_M = round($USERavgDISPO_M, 2); $USERavgDISPO_M_int = intval("$USERavgDISPO_M"); $USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int); @@ -306,42 +396,51 @@ while ($i < $rows_to_print) $USERavgDISPO_S = round($USERavgDISPO_S, 0); if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";} $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; - $pfUSERavgDISPO_MS[$i] = sprintf("%6s", $USERavgDISPO_MS); + $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - $i++; + echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $m++; } +### END loop through each user ### -$k=0; -while($k < $i) + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$n=0; +while ($n < $j) { - $ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 "; - $stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rows_to_print = mysql_num_rows($rslt); - $m=0; - while ($m < $rows_to_print) + $Scalls=0; + $Sstatus=$statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) { - $row=mysql_fetch_row($rslt); - if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);} - if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);} - if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);} - if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);} - if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);} - if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);} - if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);} - if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]); $TOT_CB = ($TOT_CB + $row[0]);} - $m++; + if ($Sstatus=="$status[$i]") + { + $Scalls = ($Scalls + $calls[$i]); + $status_found++; + } + $i++; } - echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n"; - - - - $k++; + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $SUMstatusTXT = sprintf("%8s", $Scalls); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; } +### END loop through each status ### - $TOTcalls = sprintf("%-7s", $TOTcalls); + + $TOTcalls = sprintf("%7s", $TOTcalls); + $TOT_AGENTS = sprintf("%-4s", $m); $TOTtime_M = ($TOTtime / 60); $TOTtime_M = round($TOTtime_M, 2); @@ -351,8 +450,8 @@ while($k < $i) $TOTtime_S = round($TOTtime_S, 0); if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";} $TOTtime_MS = "$TOTtime_M_int:$TOTtime_S"; - $TOTtime_MS = sprintf("%7s", $TOTtime_MS); - while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} + $TOTtime_MS = sprintf("%8s", $TOTtime_MS); + while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} $TOTtotTALK_M = ($TOTtotTALK / 60); $TOTtotTALK_M = round($TOTtotTALK_M, 2); @@ -362,8 +461,8 @@ while($k < $i) $TOTtotTALK_S = round($TOTtotTALK_S, 0); if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";} $TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S"; - $TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS); - while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} + $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); + while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} $TOTtotDISPO_M = ($TOTtotDISPO / 60); $TOTtotDISPO_M = round($TOTtotDISPO_M, 2); @@ -373,8 +472,8 @@ while($k < $i) $TOTtotDISPO_S = round($TOTtotDISPO_S, 0); if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";} $TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S"; - $TOTtotDISPO_MS = sprintf("%7s", $TOTtotDISPO_MS); - while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} + $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); + while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); $TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2); @@ -384,8 +483,8 @@ while($k < $i) $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; - $TOTtotPAUSE_MS = sprintf("%7s", $TOTtotPAUSE_MS); - while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} $TOTtotWAIT_M = ($TOTtotWAIT / 60); $TOTtotWAIT_M = round($TOTtotWAIT_M, 2); @@ -395,8 +494,8 @@ while($k < $i) $TOTtotWAIT_S = round($TOTtotWAIT_S, 0); if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";} $TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S"; - $TOTtotWAIT_MS = sprintf("%7s", $TOTtotWAIT_MS); - while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} + $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); + while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); @@ -443,27 +542,16 @@ while($k < $i) $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} - - $TOT_A = sprintf("%-5s", $TOT_A); - $TOT_B = sprintf("%-5s", $TOT_B); - $TOT_DC = sprintf("%-5s", $TOT_DC); - $TOT_DNC = sprintf("%-5s", $TOT_DNC); - $TOT_N = sprintf("%-5s", $TOT_N); - $TOT_NI = sprintf("%-5s", $TOT_NI); - $TOT_CB = sprintf("%-5s", $TOT_CB); - $TOT_SALE = sprintf("%-5s", $TOT_SALE); - $TOT_AGENTS = sprintf("%-4s", $k); -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "\n"; } - ?> \ No newline at end of file diff --git a/LANG_www/vicidial_en/AST_server_performance.php b/LANG_www/vicidial_en/AST_server_performance.php index b5c39ba5..afa75bd3 100644 --- a/LANG_www/vicidial_en/AST_server_performance.php +++ b/LANG_www/vicidial_en/AST_server_performance.php @@ -147,12 +147,12 @@ $AVGcpuUSER = sprintf("%10s", $row[0]); $AVGcpuSYSTEM = sprintf("%10s", $row[1]); $AVGcpuIDLE = sprintf("%10s", $row[2]); -# $stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $TOTALcalls = sprintf("%10s", $row[0]); -# $OFFHOOKtime = sprintf("%10s", $row[1]); +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$row=mysql_fetch_row($rslt); +$TOTALcalls = sprintf("%10s", $row[0]); +$OFFHOOKtime = sprintf("%10s", $row[1]); echo "Total Calls in/out on this server: $TOTALcalls\n"; @@ -199,7 +199,7 @@ fclose($DATfp); $rows_to_max = ($rows_to_print + 100); -print "rows: $i\n"; +#print "rows: $i\n"; $time_scale_abb = '5 minutes'; $time_scale_tick = '1 minute'; diff --git a/LANG_www/vicidial_en/AST_timeonVDADall.php b/LANG_www/vicidial_en/AST_timeonVDADall.php index 5946b75a..ec8eb52a 100644 --- a/LANG_www/vicidial_en/AST_timeonVDADall.php +++ b/LANG_www/vicidial_en/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -26,7 +26,9 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) -# +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# header ("Content-type: text/html; charset=utf-8"); @@ -213,6 +215,10 @@ $F=''; $FG=''; $B=''; $BG=''; \n"; echo"\n"; @@ -311,10 +317,10 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;"; + $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } if ($non_latin > 0) { @@ -322,14 +328,23 @@ $rslt=mysql_query("SET NAMES 'UTF8'"); } $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -391,11 +406,31 @@ echo ""; echo ""; echo ""; -echo ""; +echo ""; + + + + echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
# LEAD"; - echo "$u $row[12] $row[4] $row[8] $row[0] $row[10] $row[11]
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location  
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -436,7 +471,7 @@ echo "\n\n"; ################################################################################### ###### OUTBOUND CALLS ################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($non_latin > 0) @@ -493,7 +528,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} diff --git a/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php index 47e1d270..242b27a0 100644 --- a/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_en/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -11,6 +11,8 @@ # 61102-1616 - first build # 61215-1131 - added answered calls and drop percent taken from answered calls # 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction # header ("Content-type: text/html; charset=utf-8"); @@ -130,6 +132,12 @@ $group = $groups[$k]; echo "$group   -   "; echo "Modify\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -160,17 +168,26 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -224,11 +241,27 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -245,7 +278,7 @@ echo ""; ################################################################################ ###### OUTBOUND CALLS ################################################################################ -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); @@ -294,7 +327,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} diff --git a/LANG_www/vicidial_en/admin.php b/LANG_www/vicidial_en/admin.php index f82ea5f8..7fc0228a 100644 --- a/LANG_www/vicidial_en/admin.php +++ b/LANG_www/vicidial_en/admin.php @@ -8,10 +8,18 @@ require("dbconnect.php"); -$page_width='750'; -$section_width='700'; + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='720'; $header_font_size='3'; $subheader_font_size='2'; +$subcamp_font_size='2'; $header_selected_bold=''; $header_nonselected_bold=''; $users_color = '#FFFF99'; @@ -34,11 +42,12 @@ $reports_color = '#99FF33'; #$filters_color = '#FFFF99'; #$admin_color = '#FFFF99'; #$reports_color = '#FFFF99'; - $times_color = '#CCCC00'; - $phones_color = '#CCCC00'; - $conference_color = '#CCCC00'; - $server_color = '#CCCC00'; - $settings_color = '#CCCC00'; + $times_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -54,11 +63,21 @@ $reports_font = 'BLACK'; $conference_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; + $status_font = 'BLACK'; +$subcamp_color = '#FF9933'; +$subcamp_font = 'BLACK'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["active"])) {$active=$_GET["active"];} @@ -73,7 +92,9 @@ if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$ elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} @@ -303,6 +324,8 @@ if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} @@ -584,6 +607,68 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -595,7 +680,11 @@ if (strlen($dial_status) > 0) $status = $dial_status; } -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### if ($non_latin < 1) { @@ -714,6 +803,14 @@ $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); +$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); +$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); +$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); +$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + +### DIGITS and DASHES +$group_rank = ereg_replace("[^-0-9]","",$group_rank); +$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -736,6 +833,9 @@ $agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); +$human_answered = ereg_replace("[^NY]","",$human_answered); +$tovdad_display = ereg_replace("[^NY]","",$tovdad_display); +$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -754,6 +854,9 @@ $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); +$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); +$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); +$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -826,6 +929,17 @@ $dial_status = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status); $queuemetrics_eq_prepend = ereg_replace("[^-\_0-9a-zA-Z]","",$queuemetrics_eq_prepend); $vicidial_agent_disable = ereg_replace("[^-\_0-9a-zA-Z]","",$vicidial_agent_disable); $alter_custdata_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custdata_override); +$list_order_mix = ereg_replace("[^-\_0-9a-zA-Z]","",$list_order_mix); +$vcl_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vcl_id); +$mix_method = ereg_replace("[^-\_0-9a-zA-Z]","",$mix_method); +$category = ereg_replace("[^-\_0-9a-zA-Z]","",$category); +$vsc_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vsc_id); +$moh_context = ereg_replace("[^-\_0-9a-zA-Z]","",$moh_context); +$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); +$source_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_campaign_id); +$source_user_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_user_id); +$source_group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_group_id); +$default_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$default_xfer_group); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -860,6 +974,9 @@ $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); +$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); +$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); +$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -874,9 +991,13 @@ $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); +$after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after_hours_message_filename); +$welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); +$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); +$list_mix_container = ereg_replace(";","",$list_mix_container); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -994,15 +1115,48 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper # 70322-1455 - Added sipsak messages parameters # 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section - +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# +# # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.95'; -$build = '70402-1157'; +$admin_version = '2.0.4-119'; +$build = '71125-1751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); +$MT[0]=''; +$US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); if ($force_logout) { @@ -1095,6 +1249,13 @@ $browser = getenv("HTTP_USER_AGENT"); } } +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + header ("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n"; @@ -1103,11 +1264,14 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} +if ($ADD=="1") {$hh='users'; echo "Add New User";} +if ($ADD=="1A") {$hh='users'; echo "Copy User";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Add New Campaign";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copy Campaign";} if ($ADD==111) {$hh='lists'; echo "Add New List";} if ($ADD==121) {$hh='lists'; echo "Add New DNC";} if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} +if ($ADD==1211) {$hh='ingroups'; echo "Copy In-Group";} if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} @@ -1118,16 +1282,20 @@ if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW CONFERENCE";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";} -if ($ADD==26) {$hh='campaigns'; echo "New Auto Alt Dial Status";} -if ($ADD==27) {$hh='campaigns'; echo "New Agent Pause Code";} -if ($ADD==28) {$hh='campaigns'; echo "Campaign Dial Status Added";} +if ($ADD=="2") {$hh='users'; echo "New User Addition";} +if ($ADD=="2A") {$hh='users'; echo "New Copied User Addition";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "New Copied Campaign Addition";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "New Campaign Addition";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "New Campaign Status Addition";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campaign HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "New Campaign Lead Recycle Addition";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "New Auto Alt Dial Status";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "New Agent Pause Code";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Added";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Added";} if ($ADD==211) {$hh='lists'; echo "New List Addition";} if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";} +if ($ADD==2011) {$hh='ingroups'; echo "New Copied In-Group Addition";} if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";} if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} @@ -1139,10 +1307,28 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW CONFERENCE";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL SYSTEM STATUSES";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADDING VICIDIAL STATUS CATEGORY";} if ($ADD==3) {$hh='users'; echo "Modify User";} if ($ADD==30) {$hh='campaigns'; echo "Campaign Not Allowed";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Modify Campaign - Detail - $campaign_id"; + if ($SUB==22) {echo " - Statuses";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " - Lead Recycle Entries";} + if ($SUB==26) {echo " - Auto Alt Dial Statuses";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==29) {echo " - List Mixes";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Campaign Statuses";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaign HotKeys";} +if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "Campaign Lead Recycle Entries";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Campaign Auto Alt Dial Statuses";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Campaign Agent Pause Codes";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Statuses";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mixes";} if ($ADD==311) {$hh='lists'; echo "Modify List";} if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} @@ -1157,15 +1343,18 @@ if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER";} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORY";} if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";} -if ($ADD==47) {$hh='campaigns'; echo "Modify Agent Pause Code";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Modify Campaign";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Modify Campaign Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modify Campaign HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modify Campaign - Basic View";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modify Campaign Lead Recycle";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modify Agent Pause Code";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modify Campaign List Mix";} if ($ADD==411) {$hh='lists'; echo "Modify List";} if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} @@ -1180,10 +1369,12 @@ if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFY SERVER VICIDIAL if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY CONFERENCE";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFY VICIDIAL SYSTEM SETTINGS";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL SYSTEM STATUSES";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFY VICIDIAL STATUS CATEGORIES";} if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==53) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} if ($ADD==511) {$hh='lists'; echo "Delete List";} if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} @@ -1197,13 +1388,14 @@ if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==63) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";} -if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";} -if ($ADD==66) {$hh='campaigns'; echo "Delete Auto Alt Dial Status";} -if ($ADD==67) {$hh='campaigns'; echo "Delete Agent Pause Code";} -if ($ADD==68) {$hh='campaigns'; echo "Campaign Dial Status Removed";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaign";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Logout Agents";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Emergency VDAC Jam Clear";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "Delete Lead Recycle";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Delete Auto Alt Dial Status";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Delete Agent Pause Code";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Campaign Dial Status Removed";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "Campaign List Mix Removed";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";} @@ -1221,10 +1413,10 @@ if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} if ($ADD==0) {$hh='users'; echo "Users List";} if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "CallBacks Within Campaign";} if ($ADD==811) {$hh='lists'; echo "CallBacks Within List";} if ($ADD==8111) {$hh='usergroups'; echo "CallBacks Within User Group";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campaigns";} if ($ADD==100) {$hh='lists'; echo "Lists";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} @@ -1308,29 +1500,142 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o++; } - ##### get campaigns listing for dynamic pulldown + ##### BEGIN get campaigns listing for rankings ##### + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysql_fetch_row($rslt); $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; $o++; } + $o=0; + while ($campaigns_to_print > $o) + { + $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; } if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) @@ -1358,28 +1663,103 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) { - if ($group_id_value == $groups[$p]) + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) { $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; } $p++; } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td></tr>\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} } ##### END get inbound groups listing for checkboxes ##### @@ -1395,7 +1775,6 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $campaigns = explode(" ", $allowed_campaigns); - echo "<!-- $allowed_campaigns -->"; } $campaigns_value=''; @@ -1464,6 +1843,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1522,11 +1910,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Agent Choose Ingroups -</B> This option if set to 1 allows the user to choose the ingroups that they will receive calls from when they login to a CLOSER or INBOUND campaign. Otherwise the Manager will need to set this in their user detail screen of the admin page. -<BR> -<A NAME="vicidial_users-closer_campaigns"> -<BR> -<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. - <BR> <A NAME="vicidial_users-scheduled_callbacks"> <BR> @@ -1562,6 +1945,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>VICIDIAL Recording Override -</B> This option will override whatever the option is in the campaign for recording. DISABLED will not override the campaign recording setting. NEVER will disable recording on the client. ONDEMAND is the default and allows the agent to start and stop recording as needed. ALLCALLS will start recording on the client whenever a call is sent to an agent. ALLFORCE will start recording on the client whenever a call is sent to an agent giving the agent no option to stop recording. For ALLCALLS and ALLFORCE there is an option to use the Recording Delay to cut down on very short recordings and recude system load. +<BR> +<A NAME="vicidial_users-vicidial_users-campaign_ranks"> +<BR> +<B>Campaign Ranks -</B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank. + +<BR> +<A NAME="vicidial_users-closer_campaigns"> +<BR> +<B>Inbound Groups -</B> Here is where you select the inbound groups you want to receive calls from if you have selected the CLOSER campaign. You will also be able to set the rank, or skill level, in this section for each of the inbound groups as well as being able to see the number of calls received from each inbound group for this specific agent. Also in this section is the ability to give the agent a rank for each inbound group. These ranks can be used for preferred call routing when that option is selected in the in-group screen. + <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> @@ -1722,6 +2115,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Allow Closers -</B> This is where you can set whether the users of this campaign will have the option to send the call to a closer. +<BR> +<A NAME="vicidial_campaigns-default_xfer_group"> +<BR> +<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface. + +<BR> +<A NAME="vicidial_campaigns-xfer_groups"> +<BR> +<B>Allowed Transfer Groups -</B> With these checkbox listings you can select the groups that agents in this campaign can transfer calls to. Allow Closers must be enabled for this option to show up. + +<BR> +<A NAME="vicidial_campaigns-campaign_allow_inbound"> +<BR> +<B>Allow Inbound and Blended -</B> This is where you can set whether the users of this campaign will have the option to take inbound calls with this campaign. If you want to do blended inbound and outbound then this must be set to Y. If you only want to do outbound dialing on this campaign set this to N. Default is N. + <BR> <A NAME="vicidial_campaigns-dial_status"> <BR> @@ -1816,6 +2224,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. <BR>   - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. <BR>   - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. + <BR>   - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. + <BR>   - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. <BR> <A NAME="vicidial_campaigns-local_call_time"> @@ -1957,6 +2367,37 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Allow No-Hopper-Leads Logins -</B> If set to Y, allows agents to login to the campaign even if there are no leads loaded into the hopper for that campaign. This function is not needed in CLOSER-type campaigns. Default is N. +<BR> +<A NAME="vicidial_campaigns-list_order_mix"> +<BR> +<B>List Order Mix -</B> Overrides the Lead Order and Dial Status fields. Will use the List and status parameters for the selected List Mix entry in the List Mix sub section instead. Default is DISABLED. + +<BR> +<A NAME="vicidial_campaigns-vcl_id"> +<BR> +<B>List Mix ID -</B> ID of the list mix. Must be from 2-20 characters in length with no spaces or other special punctuation. + +<BR> +<A NAME="vicidial_campaigns-vcl_name"> +<BR> +<B>List Mix Name -</B> Descriptive name of the list mix. Must be from 2-50 characters in length. + +<BR> +<A NAME="vicidial_campaigns-list_mix_container"> +<BR> +<B>List Mix Detail -</B> The composition of the List Mix entry. Contains the List ID, mix order, percentages and statuses that make up this List Mix. The percentages always have to add up to 100, and the lists all have to be active and set to the campaign for the order mix entry to be Activated. + +<BR> +<A NAME="vicidial_campaigns-mix_method"> +<BR> +<B>List Mix Method -</B> The method of mixing all of the parts of the List Mix Detail together. EVEN_MIX will mix leads from each part interleaved with the other parts, like this 1,2,3,1,2,3,1,2,3. IN_ORDER will put the leads in the order in which they are listed in the List Mix Detail screen 1,1,1,2,2,2,3,3,3. RANDOM will put them in RANDOM order 1,3,2,1,1,3,2,1,3. Default is IN_ORDER. + +<BR> +<A NAME="vicidial_campaigns-manual_dial_list_id"> +<BR> +<B>Manual Dial List ID -</B> The default list_id to be used when an agent placces a manual call and a new lead record is created in vicidial_list. Default is 999. This field can contain digits only. + + <BR><BR><BR><BR> @@ -2043,7 +2484,10 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: orders by the last time an agent was sent a call. Results in agents receiving about the same number of calls overall. <BR>   - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call. <BR>   - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls. - + <BR>   - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest. + <BR>   - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first. + <BR>   - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest. + <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> <A NAME="vicidial_inbound_groups-fronter_display"> <BR> @@ -2084,6 +2528,66 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Drop Exten -</B> This is the dial plan extension that the desired Dropped call audio file is located at on your server. +<BR> +<A NAME="vicidial_inbound_groups-call_time_id"> +<BR> +<B>Call Time -</B> This is the call time scheme to use for this inbound group. Keep in mind that the time is based on the server time. Default is 24hours. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_action"> +<BR> +<B>After Hours Action -</B> The action to perform if it is after hours as defined in the call time for this inbound group. HANGUP will immediately hangup the call, MESSASGE will play the file in the After Hours Message Filenam field, EXTENSION will send the call to the After Hours Extension in the dialplan and VOICEMAIL will send the call to the voicemail box listed in the After Hours Voicemail field. Default is MESSAGE. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_message_filename"> +<BR> +<B>After Hours Message Filename -</B> The audio file located on the server to be played if the Action is set to MESSAGE. Default is vm-goodbye + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_exten"> +<BR> +<B>After Hours Extension -</B> The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_voicemail"> +<BR> +<B>After Hours Voicemail -</B> The voicemail box to send the call to if the Action is set to VOICEMAIL. + +<BR> +<A NAME="vicidial_inbound_groups-welcome_message_filename"> +<BR> +<B>Welcome Message Filename -</B> The audio file located on the server to be played when the call comes in. If set to ---NONE--- then no message will be played. Default is ---NONE--- + +<BR> +<A NAME="vicidial_inbound_groups-moh_context"> +<BR> +<B>Music On Hold Context -</B> The music on hold context to use when the customer is placed on hold. Default is default. + +<BR> +<A NAME="vicidial_inbound_groups-onhold_prompt_filename"> +<BR> +<B>On Hold Prompt Filename -</B> The audio file located on the server to be played at a regular interval when the customer is on hold. Default is generic_hold. This audio file MUST be 9 seconds or less in length. + +<BR> +<A NAME="vicidial_inbound_groups-prompt_interval"> +<BR> +<B>On Hold Prompt Interval -</B> The length of time in seconds to wait before playing the on hold prompt. Default is 60. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_exten"> +<BR> +<B>Agent Alert Extension -</B> The extension to send into the agent session to announce that a call is coming to the agent. This extension should have a Playback of an audio file. To not use this function set this to X. Default is X. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_delay"> +<BR> +<B>Agent Alert Delay -</B> The length of time in milliseconds to wait before sending the call to the agent after playing the on Agent Alert Extension. Default is 1000. + +<BR> +<A NAME="vicidial_inbound_groups-default_xfer_group"> +<BR> +<B>Default Transfer Group -</B> This field is the default In-Group that will be automatically selected when the agent goes to the transfer-conference frame in their agent interface. + <BR><BR><BR><BR> @@ -2137,7 +2641,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSES TABLE</FONT></B><BR><BR> <A NAME="vicidial_campaign_statuses"> <BR> -<B>Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition.</B> +<B>Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as a disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.</B> @@ -2226,7 +2730,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Script Text -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> -<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290"> +<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> @@ -2301,7 +2805,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL LIST LOADER FUNCTIONALITY</FONT></B><BR><BR> <A NAME="vicidial_list_loader"> <BR> -The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. There is also a new beta version super lead loader that allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation or check for duplicates in itself or other lists, so that is something you need to do before you load the leads. Also, make sure that you have created the list that these leads are to be under so that you can use them. There is also the matter of time-zone-coding these leads. You may want to increase the frequency that the ADMIN_adjust_GMTnow_on_leads.pl is being run in the cron on your Asterisk server so that any loaded leads can be coded faster. Here is a list of the fields in their proper order for the lead files: +The VICIDIAL basic web-based lead loader is designed simply to take a lead file - up to 8MB in size - that is either tab or pipe delimited and load it into the vicidial_list table. The lead loader allows for field choosing and TXT- Plain Text, CSV- Comma Separated Values and XLS- Excel file formats. The lead loader does not do data validation, but it does allow you to check for duplicates in itself, within the campaign or within the entire system. Also, make sure that you have created the list that these leads are to be under so that you can use them. Here is a list of the fields in their proper order for the lead files: <OL> <LI>Vendor Lead Code - shows up in the Vendor ID field of the GUI <LI>Source Code - internal use only for admins and DBAs @@ -2328,7 +2832,7 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file <LI>Comments </OL> -<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. +<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads. @@ -2882,6 +3386,30 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file <BR> <B>Admin Home URL -</B> This is the URL or web site address that you will go to if you click on the HOME link at the top of the admin.php page. +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Enable Agent Transfer Logfile -</B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUSES TABLE</FONT></B><BR><BR> +<A NAME="vicidial_statuses"> +<BR> +<B>Through the use of system statuses, you can have statuses that exist for campaign and in-group. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in VICIDIAL as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.</B> + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES TABLE</FONT></B><BR><BR> +<A NAME="vicidial_status_categories"> +<BR> +<B>Through the use of system status categories, you can group together statuses to allow for statistical analysis on a group of statuses. The Category ID must be 2-20 characters in length with no spaces, the name must be 2-50 characters in length, the description is optional and TimeonVDAD Display defines whether that status will be one of the upto 4 statuses that can be calculated and displayed on the Time On VDAD Real-Time report.</B> + @@ -2896,6 +3424,12 @@ exit; } +###################################################################################################### +###################################################################################################### +####### 7 series, filter count preview and script preview +###################################################################################################### +###################################################################################################### + @@ -3156,9 +3690,119 @@ if ($hh=='reports') {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} +echo "\n"; +echo " -VICIDIAL ADMIN: Super Lead Loader +VICIDIAL ADMIN: Lead Loader
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - +
@@ -299,13 +303,22 @@ function ParseFileName() { + + + + - + @@ -314,15 +327,14 @@ function ParseFileName() { - - +
Load leads from this file: List ID Override: (numbers only or leave blank for values in the file)
Phone Code Override: (numbers only or leave blank for values in the file)
File layout to use: Standard VICIDIAL    Custom layout
Lead Duplicate Check:
Lead Time Zone Lookup:
        
CLICK HERE TO GO TO THE BASIC LEAD LOADER         BACK TO ADMIN
SUPER LIST LOADER-     VERSION:     BUILD:
        BACK TO ADMINLIST LOADER-     VERSION:     BUILD:    
document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + print ""; flush(); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -350,6 +362,11 @@ function ParseFileName() { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } + while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -396,9 +413,78 @@ function ParseFileName() { # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -408,6 +494,7 @@ function ParseFileName() { { $row=mysql_fetch_row($rslt); $dup_lead = $row[0]; + $dup_lead_list = $list_id; } if ($dup_lead < 1) { @@ -441,7 +528,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -473,11 +560,17 @@ function ParseFileName() { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

\n"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + } # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); @@ -491,6 +584,11 @@ function ParseFileName() { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } + while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -528,12 +626,80 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -577,7 +743,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -637,6 +803,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

\n"; + } while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -680,12 +850,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -729,7 +967,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -768,9 +1006,11 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else @@ -795,6 +1035,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -832,12 +1076,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -881,7 +1193,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -906,7 +1218,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
"; flush(); - print "\r\n"; + print "
\r\n"; print " \r\n"; print " \r\n"; print " \r\n"; @@ -945,6 +1257,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); @@ -1016,7 +1332,9 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } @@ -1043,6 +1361,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

LIST ID OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

PHONE CODE OVERRIDE FOR THIS FILE: $phone_code_override

"; + } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); @@ -1102,6 +1424,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print "
VICIDIAL ColumnFile data        
\r\n"; diff --git a/LANG_www/vicidial_en/user_stats.php b/LANG_www/vicidial_en/user_stats.php index eb6ee8da..ecd457f8 100644 --- a/LANG_www/vicidial_en/user_stats.php +++ b/LANG_www/vicidial_en/user_stats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit # 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation # header ("Content-type: text/html; charset=utf-8"); @@ -263,7 +264,7 @@ echo "

\n"; echo "
\n"; -echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; echo "\n"; @@ -298,9 +299,45 @@ echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD


\n"; +echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "\n"; +echo "\n"; + + $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + } + + +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; + + + + echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; -echo "\n"; +echo "\n"; $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -315,16 +352,25 @@ echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $location = $row[11]; + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; } diff --git a/LANG_www/vicidial_es/AST_CLOSERstats.php b/LANG_www/vicidial_es/AST_CLOSERstats.php index 23e40c69..93a7bc05 100644 --- a/LANG_www/vicidial_es/AST_CLOSERstats.php +++ b/LANG_www/vicidial_es/AST_CLOSERstats.php @@ -8,6 +8,8 @@ # 60619-1714 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 60905-1326 - Added queue time stats +# 71008-1436 - Added shift to be defined in dbconnect.php +# 71025-0021 - Added status breakdown # require("dbconnect.php"); @@ -19,6 +21,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} @@ -27,6 +31,8 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -85,6 +91,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFICAR | INFORMES \n"; echo "\n\n"; @@ -100,14 +113,37 @@ echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n" else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Estadísticas de Auto-dial en CLOSER $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -128,7 +164,7 @@ echo "Average Call Length for all Calls: $average_hold_seconds second echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 999 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -154,10 +190,90 @@ else echo "Total DROP Calls: $DROPcalls $DROPpercent%\n"; echo "Average hold time for DROP Calls: $average_hold_seconds seconds\n"; + + +############################## +######### CALL STATUS STATS + +$TOTALcalls = 0; + +echo "\n"; +echo "---------- CALL STATUS STATS\n"; +echo "+--------+----------------------+------------+\n"; +echo "| STATUS | DESCRIPTION | CALLS |\n"; +echo "+--------+----------------------+------------+\n"; + +$stmt="SELECT * from vicidial_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$statuses_to_print = mysql_num_rows($rslt); +$statuses_list=''; + +$o=0; +while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="SELECT * from vicidial_campaign_statuses order by status"; +$rslt=mysql_query($stmt, $link); +$Cstatuses_to_print = mysql_num_rows($rslt); + +$o=0; +while ($Cstatuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $statname_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } + +$stmt="select count(*),status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$statuses_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $statuses_to_print) + { + $row=mysql_fetch_row($rslt); + + $TOTALcalls = ($TOTALcalls + $row[0]); + + $STATUScount = sprintf("%10s", $row[0]);while(strlen($STATUScount)>10) {$STATUScount = substr("$STATUScount", 0, -1);} + $RAWstatus = $row[1]; + $status = sprintf("%-6s", $row[1]);while(strlen($status)>6) {$status = substr("$status", 0, -1);} + + if ($non_latin < 1) + { + $status_name = sprintf("%-20s", $statname_list[$RAWstatus]); + while(strlen($status_name)>20) {$status_name = substr("$status_name", 0, -1);} + } + else + { + $status_name = sprintf("%-60s", $statname_list[$RAWstatus]); + while(mb_strlen($status_name,'utf-8')>20) {$status_name = mb_substr("$status_name", 0, -1,'utf-8');} + } + + + echo "| $status | $status_name | $STATUScount |\n"; + + $i++; + } + +$TOTALcalls = sprintf("%10s", $TOTALcalls); + +echo "+--------+----------------------+------------+\n"; +echo "| TOTAL: | $TOTALcalls |\n"; +echo "+-------------------------------+------------+\n"; + + + + echo "\n"; echo "---------- QUEUE STATS\n"; -$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; +$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and (queue_seconds > 0);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -208,7 +324,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENTE | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; +$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -234,7 +350,7 @@ while ($i < $users_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $USERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); + $USERtotTALK_MS = sprintf("%8s", $USERtotTALK_MS); $USERavgTALK_M = ($USERavgTALK / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); @@ -246,11 +362,12 @@ while ($i < $users_to_print) $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; $USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; + echo "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n"; $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); diff --git a/LANG_www/vicidial_es/AST_VDADstats.php b/LANG_www/vicidial_es/AST_VDADstats.php index 916fe2a5..c8a5109c 100644 --- a/LANG_www/vicidial_es/AST_VDADstats.php +++ b/LANG_www/vicidial_es/AST_VDADstats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1718 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 61215-1139 - Added drop percentage of answered and round-2 decimal +# 71008-1436 - Added shift to be defined in dbconnect.php # header ("Content-type: text/html; charset=utf-8"); @@ -21,6 +22,8 @@ if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} +if (isset($_GET["shift"])) {$shift=$_GET["shift"];} + elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} @@ -29,6 +32,8 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +if (strlen($shift)<2) {$shift='ALL';} + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -87,6 +92,13 @@ echo "\n"; +echo "\n"; echo "\n"; echo "           MODIFICAR | INFORMES \n"; echo "\n\n"; @@ -102,14 +114,37 @@ echo "SELECCIONE POR FAVOR Una CAMPAÚA Y La FECHA ARRIBA Y El TECLEO SOMETEN\n" else { +if ($shift == 'AM') + { + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} + } +if ($shift == 'PM') + { + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} + } +if ($shift == 'ALL') + { + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} + } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; + echo "VICIDIAL: Auto-dial Stats $NOW_TIME\n"; echo "\n"; +echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- TOTALS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -129,7 +164,7 @@ echo "Longitud media para las llamadas en segundos: $average_hold_seconds\n"; echo "\n"; echo "---------- DROPS\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status='DROP' and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -137,7 +172,7 @@ $DROPcalls = sprintf("%10s", $row[0]); $DROPcallsRAW = $row[0]; $DROPseconds = $row[1]; -$stmt="select count(*) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; +$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status NOT IN('NA','B');"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -175,7 +210,7 @@ echo "Longitud media para las llamadas DROP en segundos: $average_hold_second echo "\n"; echo "---------- AUTO-DIAL SIN RESPUESTA\n"; -$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; +$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status IN('NA','B') and (length_in_sec <= 60 or length_in_sec is null);"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); @@ -238,7 +273,7 @@ while ($Cstatuses_to_print > $o) $o++; } -$stmt="select count(*),status from vicidial_log where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; +$stmt="select count(*),status from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -281,10 +316,6 @@ echo "+-------------------------------+------------+\n"; ############################## ######### USER STATS -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id)) - {$vicidial_log = 'vicidial_closer_log';} -else - {$vicidial_log = 'vicidial_log';} $TOTagents=0; $TOTcalls=0; $TOTtime=0; @@ -296,7 +327,7 @@ echo "+--------------------------+------------+----------+--------+\n"; echo "| AGENTE | CALLS | TIME M | AVRG M |\n"; echo "+--------------------------+------------+----------+--------+\n"; -$stmt="select $vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from $vicidial_log,vicidial_users where call_date >= '$query_date 00:00:01' and call_date <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "' and $vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and $vicidial_log.user=vicidial_users.user group by $vicidial_log.user;"; +$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 4 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -347,6 +378,7 @@ while ($i < $users_to_print) $i++; } +if (!$TOTcalls) {$TOTcalls = 1;} $TOTavg = ($TOTtime / $TOTcalls); $TOTavg = round($TOTavg, 0); $TOTavg_M = ($TOTavg / 60); @@ -374,7 +406,7 @@ $TOTcalls = sprintf("%10s", $TOTcalls); $TOTtime = sprintf("%8s", $TOTtime); $TOTavg = sprintf("%6s", $TOTavg); -$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date 00:00:01' and event_time <= '$query_date 23:59:59' and campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $row=mysql_fetch_row($rslt); diff --git a/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php b/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php index cee75bf5..5969cfd1 100644 --- a/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php +++ b/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php @@ -8,7 +8,9 @@ # 60619-1654 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page # 70115-1614 - Added ALT field for vicidial_hopper alt_dial column -# +# 71029-0852 - Added list_id to the output +# 71030-2118 - Added priority to display +# require("dbconnect.php"); @@ -123,11 +125,11 @@ echo "Total de Leads en el hopper ahora mismo: $TOTALcalls\n"; echo "\n"; echo "---------- LEADS IN HOPPER\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; -echo "| | LEAD_ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; +echo "|ORDER |PRIORITY| LEAD ID | ID DE LA LISTA | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; -$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by hopper_id limit 2000;"; +$stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -145,14 +147,16 @@ while ($i < $users_to_print) $gmt = sprintf("%-6s", $row[5]); $hopper_id = sprintf("%-6s", $row[6]); $alt_dial = sprintf("%-5s", $row[7]); + $list_id = sprintf("%-10s", $row[8]); + $priority = sprintf("%-6s", $row[9]); -if ($DB) {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} -else {echo "| $FMT_i | $lead_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} +if ($DB) {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $hopper_id |\n";} +else {echo "| $FMT_i | $priority | $lead_id | $list_id | $phone_number | $state | $status | $count | $gmt | $alt_dial |\n";} $i++; } -echo "+------+-----------+------------+-------+--------+-------+--------+-------+\n"; +echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; } diff --git a/LANG_www/vicidial_es/AST_agent_performance_detail.php b/LANG_www/vicidial_es/AST_agent_performance_detail.php index a5e8988a..bce7e506 100644 --- a/LANG_www/vicidial_es/AST_agent_performance_detail.php +++ b/LANG_www/vicidial_es/AST_agent_performance_detail.php @@ -1,14 +1,13 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # -# 60619-1712 - Added variable filtering to eliminate SQL injection attack threat -# - Added required user/pass to gain access to this page -# 70118-1705 - Added user_group filtering option -# 70201-1207 - Added non_latin UTF8 output code, widened USER ID to 8 chars +# 71119-2359 - First build +# 71121-0144 - Replace existing AST_agent_performance_detail.php script with this one +# - Fixed zero division bug # require("dbconnect.php"); @@ -141,25 +140,25 @@ else { if ($shift == 'AM') { - $query_date_BEGIN = "$query_date 03:45:00"; - $query_date_END = "$query_date 15:15:00"; - $time_BEGIN = "03:45:00"; - $time_END = "15:15:00"; + $time_BEGIN=$AM_shift_BEGIN; + $time_END=$AM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "03:45:00";} + if (strlen($time_END) < 6) {$time_END = "15:15:00";} } if ($shift == 'PM') { - $query_date_BEGIN = "$query_date 15:15:00"; - $query_date_END = "$query_date 23:15:00"; - $time_BEGIN = "15:15:00"; - $time_END = "23:15:00"; + $time_BEGIN=$PM_shift_BEGIN; + $time_END=$PM_shift_END; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "15:15:00";} + if (strlen($time_END) < 6) {$time_END = "23:15:00";} } if ($shift == 'ALL') { - $query_date_BEGIN = "$query_date 00:00:00"; - $query_date_END = "$query_date 23:59:59"; - $time_BEGIN = "00:00:00"; - $time_END = "23:59:59"; + if (strlen($time_BEGIN) < 6) {$time_BEGIN = "00:00:00";} + if (strlen($time_END) < 6) {$time_END = "23:59:59";} } +$query_date_BEGIN = "$query_date $time_BEGIN"; +$query_date_END = "$query_date $time_END"; if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} else {$ugSQL='';} @@ -169,11 +168,22 @@ echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; echo "Time range: $query_date_BEGIN to $query_date_END\n\n"; echo "---------- AGENTS Details -------------\n\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; + + + +$statuses='-'; +$statusesTXT=''; +$statusesHEAD=''; +$statusesHTML=''; +$statusesARY[0]=''; +$j=0; +$users='-'; +$usersARY[0]=''; +$user_namesARY[0]=''; +$k=0; + +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<36000 and wait_sec<36000 and talk_sec<36000 and dispo_sec<36000 $ugSQL group by full_name,status order by status desc,full_name limit 100000;"; if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -182,43 +192,123 @@ $i=0; while ($i < $rows_to_print) { $row=mysql_fetch_row($rslt); - $TOTcalls=($TOTcalls + $row[0]); - $TOTtime=($TOTtime + $row[1] + $row[5] + $row[7] + $row[9]); - $TOTtotTALK=($TOTtotTALK + $row[1]); - $TOTtotWAIT=($TOTtotWAIT + $row[7]); - $TOTtotPAUSE=($TOTtotPAUSE + $row[5]); - $TOTtotDISPO=($TOTtotDISPO + $row[9]); - $calls[$i] = sprintf("%-6s", $row[0]); + $row[0] = ($row[0] - 1); # subtract 1 for login/logout event compensation + + $calls[$i] = $row[0]; + $talk_sec[$i] = $row[1]; + $full_name[$i] = $row[2]; + $user[$i] = $row[3]; + $pause_sec[$i] = $row[4]; + $wait_sec[$i] = $row[5]; + $dispo_sec[$i] = $row[6]; + $status[$i] = $row[7]; + if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) + { + $statusesTXT = sprintf("%8s", $status[$i]); + $statusesHEAD .= "----------+"; + $statusesHTML .= " $statusesTXT |"; + $statuses .= "$status[$i]-"; + $statusesARY[$j] = $status[$i]; + $j++; + } + if (!eregi("-$user[$i]-", $users)) + { + $users .= "$user[$i]-"; + $usersARY[$k] = $user[$i]; + $user_namesARY[$k] = $full_name[$i]; + $k++; + } + + $i++; + } + + +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG|$statusesHTML\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; + + +### BEGIN loop through each user ### +$m=0; +while ($m < $k) + { + $Suser=$usersARY[$m]; + $Sfull_name=$user_namesARY[$m]; + $Stime=0; + $Scalls=0; + $Stalk_sec=0; + $Spause_sec=0; + $Swait_sec=0; + $Sdispo_sec=0; + $SstatusesHTML=''; + + ### BEGIN loop through each status ### + $n=0; + while ($n < $j) + { + $Sstatus=$statusesARY[$n]; + $SstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) + { + if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) + { + $Scalls = ($Scalls + $calls[$i]); + $Stalk_sec = ($Stalk_sec + $talk_sec[$i]); + $Spause_sec = ($Spause_sec + $pause_sec[$i]); + $Swait_sec = ($Swait_sec + $wait_sec[$i]); + $Sdispo_sec = ($Sdispo_sec + $dispo_sec[$i]); + $SstatusTXT = sprintf("%8s", $calls[$i]); + $SstatusesHTML .= " $SstatusTXT |"; + $status_found++; + } + $i++; + } + if ($status_found < 1) + { + $SstatusesHTML .= " 0 |"; + } + ### END loop through each stat line ### + $n++; + } + ### END loop through each status ### + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + $TOTcalls=($TOTcalls + $Scalls); + $TOTtime=($TOTtime + $Stime); + $TOTtotTALK=($TOTtotTALK + $Stalk_sec); + $TOTtotWAIT=($TOTtotWAIT + $Swait_sec); + $TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec); + $TOTtotDISPO=($TOTtotDISPO + $Sdispo_sec); + $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec); + if ( ($Scalls > 0) and ($Stalk_sec > 0) ) {$Stalk_avg = ($Stalk_sec/$Scalls);} + else {$Stalk_avg=0;} + if ( ($Scalls > 0) and ($Spause_sec > 0) ) {$Spause_avg = ($Spause_sec/$Scalls);} + else {$Spause_avg=0;} + if ( ($Scalls > 0) and ($Swait_sec > 0) ) {$Swait_avg = ($Swait_sec/$Scalls);} + else {$Swait_avg=0;} + if ( ($Scalls > 0) and ($Sdispo_sec > 0) ) {$Sdispo_avg = ($Sdispo_sec/$Scalls);} + else {$Sdispo_avg=0;} + + $Scalls = sprintf("%6s", $Scalls); if ($non_latin < 1) { - $full_name[$i]= sprintf("%-15s", $row[2]); - while(strlen($full_name[$i])>15) {$full_name[$i] = substr("$full_name[$i]", 0, -1);} - - $user[$i] = sprintf("%-6s", $row[3]); - while(strlen($user[$i])>6) {$user[$i] = substr("$user[$i]", 0, -1);} + $Sfull_name= sprintf("%-15s", $Sfull_name); + while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);} + $Suser = sprintf("%-8s", $Suser); + while(strlen($Suser)>8) {$Suser = substr("$Suser", 0, -1);} } else { - $full_name[$i]= sprintf("%-45s", $row[2]); - while(mb_strlen($full_name[$i],'utf-8')>15) {$full_name[$i] = mb_substr("$full_name[$i]", 0, -1,'utf-8');} + $Sfull_name= sprintf("%-45s", $Sfull_name); + while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');} - $user[$i] = sprintf("%-18s", $row[3]); - while(mb_strlen($user[$i],'utf-8')>6) {$user[$i] = mb_substr("$user[$i]", 0, -1,'utf-8');} + $Suser = sprintf("%-24s", $Suser); + while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');} } - $user[$i] = sprintf("%-8s", $row[3]); - $USERtime = ($row[1] + $row[5] + $row[7] + $row[9]); - $USERtotTALK = $row[1]; - $USERavgTALK = $row[4]; - $USERtotPAUSE = $row[5]; - $USERavgPAUSE = $row[6]; - $USERtotWAIT = $row[7]; - $USERavgWAIT = $row[8]; - $USERtotDISPO = $row[9]; - $USERavgDISPO = $row[10]; - - $USERtime_M = ($USERtime / 60); + $USERtime_M = ($Stime / 60); $USERtime_M = round($USERtime_M, 2); $USERtime_M_int = intval("$USERtime_M"); $USERtime_S = ($USERtime_M - $USERtime_M_int); @@ -226,9 +316,9 @@ while ($i < $rows_to_print) $USERtime_S = round($USERtime_S, 0); if ($USERtime_S < 10) {$USERtime_S = "0$USERtime_S";} $USERtime_MS = "$USERtime_M_int:$USERtime_S"; - $pfUSERtime_MS[$i] = sprintf("%7s", $USERtime_MS); + $pfUSERtime_MS = sprintf("%7s", $USERtime_MS); - $USERtotTALK_M = ($USERtotTALK / 60); + $USERtotTALK_M = ($Stalk_sec / 60); $USERtotTALK_M = round($USERtotTALK_M, 2); $USERtotTALK_M_int = intval("$USERtotTALK_M"); $USERtotTALK_S = ($USERtotTALK_M - $USERtotTALK_M_int); @@ -236,9 +326,9 @@ while ($i < $rows_to_print) $USERtotTALK_S = round($USERtotTALK_S, 0); if ($USERtotTALK_S < 10) {$USERtotTALK_S = "0$USERtotTALK_S";} $USERtotTALK_MS = "$USERtotTALK_M_int:$USERtotTALK_S"; - $pfUSERtotTALK_MS[$i] = sprintf("%6s", $USERtotTALK_MS); + $pfUSERtotTALK_MS = sprintf("%6s", $USERtotTALK_MS); - $USERavgTALK_M = ($USERavgTALK / 60); + $USERavgTALK_M = ($Stalk_avg / 60); $USERavgTALK_M = round($USERavgTALK_M, 2); $USERavgTALK_M_int = intval("$USERavgTALK_M"); $USERavgTALK_S = ($USERavgTALK_M - $USERavgTALK_M_int); @@ -246,9 +336,9 @@ while ($i < $rows_to_print) $USERavgTALK_S = round($USERavgTALK_S, 0); if ($USERavgTALK_S < 10) {$USERavgTALK_S = "0$USERavgTALK_S";} $USERavgTALK_MS = "$USERavgTALK_M_int:$USERavgTALK_S"; - $pfUSERavgTALK_MS[$i] = sprintf("%6s", $USERavgTALK_MS); + $pfUSERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS); - $USERtotPAUSE_M = ($USERtotPAUSE / 60); + $USERtotPAUSE_M = ($Spause_sec / 60); $USERtotPAUSE_M = round($USERtotPAUSE_M, 2); $USERtotPAUSE_M_int = intval("$USERtotPAUSE_M"); $USERtotPAUSE_S = ($USERtotPAUSE_M - $USERtotPAUSE_M_int); @@ -256,9 +346,9 @@ while ($i < $rows_to_print) $USERtotPAUSE_S = round($USERtotPAUSE_S, 0); if ($USERtotPAUSE_S < 10) {$USERtotPAUSE_S = "0$USERtotPAUSE_S";} $USERtotPAUSE_MS = "$USERtotPAUSE_M_int:$USERtotPAUSE_S"; - $pfUSERtotPAUSE_MS[$i] = sprintf("%6s", $USERtotPAUSE_MS); + $pfUSERtotPAUSE_MS = sprintf("%6s", $USERtotPAUSE_MS); - $USERavgPAUSE_M = ($USERavgPAUSE / 60); + $USERavgPAUSE_M = ($Spause_avg / 60); $USERavgPAUSE_M = round($USERavgPAUSE_M, 2); $USERavgPAUSE_M_int = intval("$USERavgPAUSE_M"); $USERavgPAUSE_S = ($USERavgPAUSE_M - $USERavgPAUSE_M_int); @@ -266,9 +356,9 @@ while ($i < $rows_to_print) $USERavgPAUSE_S = round($USERavgPAUSE_S, 0); if ($USERavgPAUSE_S < 10) {$USERavgPAUSE_S = "0$USERavgPAUSE_S";} $USERavgPAUSE_MS = "$USERavgPAUSE_M_int:$USERavgPAUSE_S"; - $pfUSERavgPAUSE_MS[$i] = sprintf("%6s", $USERavgPAUSE_MS); + $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS); - $USERtotWAIT_M = ($USERtotWAIT / 60); + $USERtotWAIT_M = ($Swait_sec / 60); $USERtotWAIT_M = round($USERtotWAIT_M, 2); $USERtotWAIT_M_int = intval("$USERtotWAIT_M"); $USERtotWAIT_S = ($USERtotWAIT_M - $USERtotWAIT_M_int); @@ -276,9 +366,9 @@ while ($i < $rows_to_print) $USERtotWAIT_S = round($USERtotWAIT_S, 0); if ($USERtotWAIT_S < 10) {$USERtotWAIT_S = "0$USERtotWAIT_S";} $USERtotWAIT_MS = "$USERtotWAIT_M_int:$USERtotWAIT_S"; - $pfUSERtotWAIT_MS[$i] = sprintf("%6s", $USERtotWAIT_MS); + $pfUSERtotWAIT_MS = sprintf("%6s", $USERtotWAIT_MS); - $USERavgWAIT_M = ($USERavgWAIT / 60); + $USERavgWAIT_M = ($Swait_avg / 60); $USERavgWAIT_M = round($USERavgWAIT_M, 2); $USERavgWAIT_M_int = intval("$USERavgWAIT_M"); $USERavgWAIT_S = ($USERavgWAIT_M - $USERavgWAIT_M_int); @@ -286,9 +376,9 @@ while ($i < $rows_to_print) $USERavgWAIT_S = round($USERavgWAIT_S, 0); if ($USERavgWAIT_S < 10) {$USERavgWAIT_S = "0$USERavgWAIT_S";} $USERavgWAIT_MS = "$USERavgWAIT_M_int:$USERavgWAIT_S"; - $pfUSERavgWAIT_MS[$i] = sprintf("%6s", $USERavgWAIT_MS); + $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS); - $USERtotDISPO_M = ($USERtotDISPO / 60); + $USERtotDISPO_M = ($Sdispo_sec / 60); $USERtotDISPO_M = round($USERtotDISPO_M, 2); $USERtotDISPO_M_int = intval("$USERtotDISPO_M"); $USERtotDISPO_S = ($USERtotDISPO_M - $USERtotDISPO_M_int); @@ -296,9 +386,9 @@ while ($i < $rows_to_print) $USERtotDISPO_S = round($USERtotDISPO_S, 0); if ($USERtotDISPO_S < 10) {$USERtotDISPO_S = "0$USERtotDISPO_S";} $USERtotDISPO_MS = "$USERtotDISPO_M_int:$USERtotDISPO_S"; - $pfUSERtotDISPO_MS[$i] = sprintf("%6s", $USERtotDISPO_MS); + $pfUSERtotDISPO_MS = sprintf("%6s", $USERtotDISPO_MS); - $USERavgDISPO_M = ($USERavgDISPO / 60); + $USERavgDISPO_M = ($Sdispo_avg / 60); $USERavgDISPO_M = round($USERavgDISPO_M, 2); $USERavgDISPO_M_int = intval("$USERavgDISPO_M"); $USERavgDISPO_S = ($USERavgDISPO_M - $USERavgDISPO_M_int); @@ -306,42 +396,51 @@ while ($i < $rows_to_print) $USERavgDISPO_S = round($USERavgDISPO_S, 0); if ($USERavgDISPO_S < 10) {$USERavgDISPO_S = "0$USERavgDISPO_S";} $USERavgDISPO_MS = "$USERavgDISPO_M_int:$USERavgDISPO_S"; - $pfUSERavgDISPO_MS[$i] = sprintf("%6s", $USERavgDISPO_MS); + $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS); - $i++; + echo "| $Sfull_name | $Suser | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS |$SstatusesHTML\n"; + $m++; } +### END loop through each user ### -$k=0; -while($k < $i) + +###### LAST LINE FORMATTING ########## +### BEGIN loop through each status ### +$SUMstatusesHTML=''; +$n=0; +while ($n < $j) { - $ctA[$k]="0 "; $ctB[$k]="0 "; $ctDC[$k]="0 "; $ctDNC[$k]="0 "; $ctN[$k]="0 "; $ctNI[$k]="0 "; $ctSALE[$k]="0 "; $ctCB[$k]="0 "; - $stmt="select count(*),status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$user[$k]' and campaign_id='" . mysql_real_escape_string($group) . "' group by status;"; - if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $rows_to_print = mysql_num_rows($rslt); - $m=0; - while ($m < $rows_to_print) + $Scalls=0; + $Sstatus=$statusesARY[$n]; + $SUMstatusTXT=''; + ### BEGIN loop through each stat line ### + $i=0; $status_found=0; + while ($i < $rows_to_print) { - $row=mysql_fetch_row($rslt); - if ($row[1] == 'A') {$ctA[$k]=sprintf("%-4s", $row[0]); $TOT_A = ($TOT_A + $row[0]);} - if ($row[1] == 'B') {$ctB[$k]=sprintf("%-4s", $row[0]); $TOT_B = ($TOT_B + $row[0]);} - if ($row[1] == 'DC') {$ctDC[$k]=sprintf("%-4s", $row[0]); $TOT_DC = ($TOT_DC + $row[0]);} - if ($row[1] == 'DNC') {$ctDNC[$k]=sprintf("%-4s", $row[0]); $TOT_DNC = ($TOT_DNC + $row[0]);} - if ($row[1] == 'N') {$ctN[$k]=sprintf("%-4s", $row[0]); $TOT_N = ($TOT_N + $row[0]);} - if ($row[1] == 'NI') {$ctNI[$k]=sprintf("%-4s", $row[0]); $TOT_NI = ($TOT_NI + $row[0]);} - if (($row[1] == 'SALE') || ($row[1] == 'XFER') ) {$ctSALE[$k]=sprintf("%-4s", $row[0]); $TOT_SALE = ($TOT_SALE + $row[0]);} - if (($row[1] == 'CALLBK') || ($row[1] == 'CBHOLD') ) {$ctCB[$k]=sprintf("%-4s", $row[0]); $TOT_CB = ($TOT_CB + $row[0]);} - $m++; + if ($Sstatus=="$status[$i]") + { + $Scalls = ($Scalls + $calls[$i]); + $status_found++; + } + $i++; } - echo "| $full_name[$k] | $user[$k] | $calls[$k] | $pfUSERtime_MS[$k]| $pfUSERtotPAUSE_MS[$k] | $pfUSERavgPAUSE_MS[$k] | $pfUSERtotWAIT_MS[$k] | $pfUSERavgWAIT_MS[$k] | $pfUSERtotTALK_MS[$k] | $pfUSERavgTALK_MS[$k] | $pfUSERtotDISPO_MS[$k] | $pfUSERavgDISPO_MS[$k] | $ctA[$k] | $ctB[$k] | $ctDC[$k] | $ctDNC[$k] | $ctN[$k] | $ctNI[$k] | $ctCB[$k] | $ctSALE[$k] |\n"; - - - - $k++; + ### END loop through each stat line ### + if ($status_found < 1) + { + $SUMstatusesHTML .= " 0 |"; + } + else + { + $SUMstatusTXT = sprintf("%8s", $Scalls); + $SUMstatusesHTML .= " $SUMstatusTXT |"; + } + $n++; } +### END loop through each status ### - $TOTcalls = sprintf("%-7s", $TOTcalls); + + $TOTcalls = sprintf("%7s", $TOTcalls); + $TOT_AGENTS = sprintf("%-4s", $m); $TOTtime_M = ($TOTtime / 60); $TOTtime_M = round($TOTtime_M, 2); @@ -351,8 +450,8 @@ while($k < $i) $TOTtime_S = round($TOTtime_S, 0); if ($TOTtime_S < 10) {$TOTtime_S = "0$TOTtime_S";} $TOTtime_MS = "$TOTtime_M_int:$TOTtime_S"; - $TOTtime_MS = sprintf("%7s", $TOTtime_MS); - while(strlen($TOTtime_MS)>7) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} + $TOTtime_MS = sprintf("%8s", $TOTtime_MS); + while(strlen($TOTtime_MS)>8) {$TOTtime_MS = substr("$TOTtime_MS", 0, -1);} $TOTtotTALK_M = ($TOTtotTALK / 60); $TOTtotTALK_M = round($TOTtotTALK_M, 2); @@ -362,8 +461,8 @@ while($k < $i) $TOTtotTALK_S = round($TOTtotTALK_S, 0); if ($TOTtotTALK_S < 10) {$TOTtotTALK_S = "0$TOTtotTALK_S";} $TOTtotTALK_MS = "$TOTtotTALK_M_int:$TOTtotTALK_S"; - $TOTtotTALK_MS = sprintf("%7s", $TOTtotTALK_MS); - while(strlen($TOTtotTALK_MS)>7) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} + $TOTtotTALK_MS = sprintf("%8s", $TOTtotTALK_MS); + while(strlen($TOTtotTALK_MS)>8) {$TOTtotTALK_MS = substr("$TOTtotTALK_MS", 0, -1);} $TOTtotDISPO_M = ($TOTtotDISPO / 60); $TOTtotDISPO_M = round($TOTtotDISPO_M, 2); @@ -373,8 +472,8 @@ while($k < $i) $TOTtotDISPO_S = round($TOTtotDISPO_S, 0); if ($TOTtotDISPO_S < 10) {$TOTtotDISPO_S = "0$TOTtotDISPO_S";} $TOTtotDISPO_MS = "$TOTtotDISPO_M_int:$TOTtotDISPO_S"; - $TOTtotDISPO_MS = sprintf("%7s", $TOTtotDISPO_MS); - while(strlen($TOTtotDISPO_MS)>7) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} + $TOTtotDISPO_MS = sprintf("%8s", $TOTtotDISPO_MS); + while(strlen($TOTtotDISPO_MS)>8) {$TOTtotDISPO_MS = substr("$TOTtotDISPO_MS", 0, -1);} $TOTtotPAUSE_M = ($TOTtotPAUSE / 60); $TOTtotPAUSE_M = round($TOTtotPAUSE_M, 2); @@ -384,8 +483,8 @@ while($k < $i) $TOTtotPAUSE_S = round($TOTtotPAUSE_S, 0); if ($TOTtotPAUSE_S < 10) {$TOTtotPAUSE_S = "0$TOTtotPAUSE_S";} $TOTtotPAUSE_MS = "$TOTtotPAUSE_M_int:$TOTtotPAUSE_S"; - $TOTtotPAUSE_MS = sprintf("%7s", $TOTtotPAUSE_MS); - while(strlen($TOTtotPAUSE_MS)>7) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} + $TOTtotPAUSE_MS = sprintf("%8s", $TOTtotPAUSE_MS); + while(strlen($TOTtotPAUSE_MS)>8) {$TOTtotPAUSE_MS = substr("$TOTtotPAUSE_MS", 0, -1);} $TOTtotWAIT_M = ($TOTtotWAIT / 60); $TOTtotWAIT_M = round($TOTtotWAIT_M, 2); @@ -395,8 +494,8 @@ while($k < $i) $TOTtotWAIT_S = round($TOTtotWAIT_S, 0); if ($TOTtotWAIT_S < 10) {$TOTtotWAIT_S = "0$TOTtotWAIT_S";} $TOTtotWAIT_MS = "$TOTtotWAIT_M_int:$TOTtotWAIT_S"; - $TOTtotWAIT_MS = sprintf("%7s", $TOTtotWAIT_MS); - while(strlen($TOTtotWAIT_MS)>7) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} + $TOTtotWAIT_MS = sprintf("%8s", $TOTtotWAIT_MS); + while(strlen($TOTtotWAIT_MS)>8) {$TOTtotWAIT_MS = substr("$TOTtotWAIT_MS", 0, -1);} $TOTavgTALK_M = ( ($TOTtotTALK / $TOTcalls) / 60); @@ -443,27 +542,16 @@ while($k < $i) $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} - - $TOT_A = sprintf("%-5s", $TOT_A); - $TOT_B = sprintf("%-5s", $TOT_B); - $TOT_DC = sprintf("%-5s", $TOT_DC); - $TOT_DNC = sprintf("%-5s", $TOT_DNC); - $TOT_N = sprintf("%-5s", $TOT_N); - $TOT_NI = sprintf("%-5s", $TOT_NI); - $TOT_CB = sprintf("%-5s", $TOT_CB); - $TOT_SALE = sprintf("%-5s", $TOT_SALE); - $TOT_AGENTS = sprintf("%-4s", $k); -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; -echo "+-----------------+----------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; +echo "+-----------------+----------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$SUMstatusesHTML\n"; +echo "+----------------------------+--------+---------+--------+--------+--------+--------+--------+--------+--------+--------+$statusesHEAD\n"; echo "\n"; } - ?> \ No newline at end of file diff --git a/LANG_www/vicidial_es/AST_server_performance.php b/LANG_www/vicidial_es/AST_server_performance.php index 5d0e286a..064b65f4 100644 --- a/LANG_www/vicidial_es/AST_server_performance.php +++ b/LANG_www/vicidial_es/AST_server_performance.php @@ -147,12 +147,12 @@ $AVGcpuUSER = sprintf("%10s", $row[0]); $AVGcpuSYSTEM = sprintf("%10s", $row[1]); $AVGcpuIDLE = sprintf("%10s", $row[2]); -# $stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; -# $rslt=mysql_query($stmt, $link); -# if ($DB) {echo "$stmt\n";} -# $row=mysql_fetch_row($rslt); -# $TOTALcalls = sprintf("%10s", $row[0]); -# $OFFHOOKtime = sprintf("%10s", $row[1]); +$stmt="select count(*),SUM(length_in_min) from call_log where extension NOT IN('8365','8366','8367') and start_time <= '" . mysql_real_escape_string($query_date_END) . "' and start_time >= '" . mysql_real_escape_string($query_date_BEGIN) . "' and server_ip='" . mysql_real_escape_string($group) . "';"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$row=mysql_fetch_row($rslt); +$TOTALcalls = sprintf("%10s", $row[0]); +$OFFHOOKtime = sprintf("%10s", $row[1]); echo "Total Calls in/out on this server: $TOTALcalls\n"; @@ -199,7 +199,7 @@ fclose($DATfp); $rows_to_max = ($rows_to_print + 100); -print "rows: $i\n"; +#print "rows: $i\n"; $time_scale_abb = '5 minutes'; $time_scale_tick = '1 minute'; diff --git a/LANG_www/vicidial_es/AST_timeonVDADall.php b/LANG_www/vicidial_es/AST_timeonVDADall.php index 7765f3d9..c625746e 100644 --- a/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -26,7 +26,9 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) -# +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction +# header ("Content-type: text/html; charset=utf-8"); @@ -213,6 +215,10 @@ $F=''; $FG=''; $B=''; $BG=''; \n"; echo"\n"; @@ -311,10 +317,10 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($group=='XXXX-ALL-ACTIVE-XXXX') { - $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today) from vicidial_campaign_stats;"; + $stmt="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),min(status_category_1),sum(status_category_count_1),min(status_category_2),sum(status_category_count_2),min(status_category_3),sum(status_category_count_3),min(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats;"; } if ($non_latin > 0) { @@ -322,14 +328,23 @@ $rslt=mysql_query("SET NAMES 'UTF8'"); } $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -391,11 +406,31 @@ echo ""; echo ""; echo ""; -echo ""; +echo ""; + + + + echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo ""; echo ""; echo ""; -echo ""; +echo ""; echo ""; echo ""; echo ""; +echo ""; +echo ""; echo ""; echo "
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
# LEAD"; - echo "$u $row[12] $row[4] $row[8] $row[0] $row[10] $row[11]
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location  
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -436,7 +471,7 @@ echo "\n\n"; ################################################################################### ###### OUTBOUND CALLS ################################################################################### -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; if ($non_latin > 0) @@ -493,7 +528,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -614,7 +649,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php b/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php index c4335ec5..4a45a5b6 100644 --- a/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php +++ b/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: GPLv2 +# Copyright (C) 2007 Matt Florell LICENSE: GPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -11,6 +11,8 @@ # 61102-1616 - first build # 61215-1131 - added answered calls and drop percent taken from answered calls # 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70619-1339 - Added Status Category tally display +# 71029-1900 - Changed CLOSER-type to not require campaign_id restriction # header ("Content-type: text/html; charset=utf-8"); @@ -130,6 +132,12 @@ $group = $groups[$k]; echo "$group   -   "; echo "Modify\n"; + +$stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; +$rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_allow_inbound = $row[0]; + $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -160,17 +168,26 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $VDhop = $row[0]; -$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; +$stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4 from vicidial_campaign_stats where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$DAleads = $row[0]; -$callsTODAY = $row[1]; -$dropsTODAY = $row[2]; -$drpctTODAY = $row[3]; -$diffONEMIN = $row[4]; +$DAleads = $row[0]; +$callsTODAY = $row[1]; +$dropsTODAY = $row[2]; +$drpctTODAY = $row[3]; +$diffONEMIN = $row[4]; $agentsONEMIN = $row[5]; -$balanceFILL = $row[6]; +$balanceFILL = $row[6]; $answersTODAY = $row[7]; +$VSCcat1 = $row[8]; +$VSCcat1tally = $row[9]; +$VSCcat2 = $row[10]; +$VSCcat2tally = $row[11]; +$VSCcat3 = $row[12]; +$VSCcat3tally = $row[13]; +$VSCcat4 = $row[14]; +$VSCcat4tally = $row[15]; + if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { $diffpctONEMIN = ( ($diffONEMIN / $agentsONEMIN) * 100); @@ -224,11 +241,27 @@ echo "
LEADS IN HOPPER:  $VDhop     DROPPED PERCENT:  $drpctTODAY%    DROPPED PERCENT:  "; +if ($drpctTODAY >= $DROPmax) + {echo "$drpctTODAY%";} +else + {echo "$drpctTODAY%";} +echo "    DIFF:  $diffpctONEMIN%     ORDER:  $DIALorder    
"; +if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) + {echo "$VSCcat1:   $VSCcat1tally       \n";} +if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) + {echo "$VSCcat2:   $VSCcat2tally       \n";} +if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) + {echo "$VSCcat3:   $VSCcat3tally       \n";} +if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) + {echo "$VSCcat4:   $VSCcat4tally       \n";} +echo "
"; @@ -245,7 +278,7 @@ echo ""; ################################################################################ ###### OUTBOUND CALLS ################################################################################ -if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) +if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $rslt=mysql_query($stmt, $link); @@ -294,7 +327,7 @@ $parked_to_print = mysql_num_rows($rslt); if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} - if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) + if ($campaign_allow_inbound > 0) {echo "$NFB$out_total$NFE current active calls      \n";} else {echo "$NFB$out_total$NFE calls being placed       \n";} @@ -328,7 +361,7 @@ $talking_to_print = mysql_num_rows($rslt); while ($i < $talking_to_print) { $row=mysql_fetch_row($rslt); - if (eregi("READY|PAUSED",$row[4])) + if (eregi("READY|PAUSED",$row[3])) { $row[5]=$row[6]; } diff --git a/LANG_www/vicidial_es/admin.php b/LANG_www/vicidial_es/admin.php index 755a83a5..5fa5509c 100644 --- a/LANG_www/vicidial_es/admin.php +++ b/LANG_www/vicidial_es/admin.php @@ -8,10 +8,18 @@ require("dbconnect.php"); -$page_width='750'; -$section_width='700'; + +###################################################################################################### +###################################################################################################### +####### static variable settings for display options +###################################################################################################### +###################################################################################################### + +$page_width='770'; +$section_width='720'; $header_font_size='3'; $subheader_font_size='2'; +$subcamp_font_size='2'; $header_selected_bold=''; $header_nonselected_bold=''; $users_color = '#FFFF99'; @@ -34,11 +42,12 @@ $reports_color = '#99FF33'; #$filters_color = '#FFFF99'; #$admin_color = '#FFFF99'; #$reports_color = '#FFFF99'; - $times_color = '#CCCC00'; - $phones_color = '#CCCC00'; - $conference_color = '#CCCC00'; - $server_color = '#CCCC00'; - $settings_color = '#CCCC00'; + $times_color = '#FF33FF'; + $phones_color = '#FF33FF'; + $conference_color = '#FF33FF'; + $server_color = '#FF33FF'; + $settings_color = '#FF33FF'; + $status_color = '#FF33FF'; $users_font = 'BLACK'; $campaigns_font = 'BLACK'; $lists_font = 'BLACK'; @@ -54,11 +63,21 @@ $reports_font = 'BLACK'; $conference_font = 'BLACK'; $server_font = 'BLACK'; $settings_font = 'BLACK'; + $status_font = 'BLACK'; +$subcamp_color = '#FF9933'; +$subcamp_font = 'BLACK'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +###################################################################################################### +###################################################################################################### +####### Form variable declaration +###################################################################################################### +###################################################################################################### + + if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["active"])) {$active=$_GET["active"];} @@ -73,7 +92,9 @@ if (isset($_GET["adaptive_latest_server_time"])) {$adaptive_latest_server_time=$ elseif (isset($_POST["adaptive_latest_server_time"])){$adaptive_latest_server_time=$_POST["adaptive_latest_server_time"];} if (isset($_GET["adaptive_maximum_level"])) {$adaptive_maximum_level=$_GET["adaptive_maximum_level"];} elseif (isset($_POST["adaptive_maximum_level"])) {$adaptive_maximum_level=$_POST["adaptive_maximum_level"];} -if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} +if (isset($_GET["SUB"])) {$SUB=$_GET["SUB"];} + elseif (isset($_POST["SUB"])) {$SUB=$_POST["SUB"];} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} if (isset($_GET["admin_hangup_enabled"])) {$admin_hangup_enabled=$_GET["admin_hangup_enabled"];} elseif (isset($_POST["admin_hangup_enabled"])) {$admin_hangup_enabled=$_POST["admin_hangup_enabled"];} @@ -303,6 +324,8 @@ if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} +if (isset($_GET["XFERgroups"])) {$XFERgroups=$_GET["XFERgroups"];} + elseif (isset($_POST["XFERgroups"])) {$XFERgroups=$_POST["XFERgroups"];} if (isset($_GET["HKstatus"])) {$HKstatus=$_GET["HKstatus"];} elseif (isset($_POST["HKstatus"])) {$HKstatus=$_POST["HKstatus"];} if (isset($_GET["hopper_level"])) {$hopper_level=$_GET["hopper_level"];} @@ -584,6 +607,68 @@ if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["all elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} if (isset($_GET["admin_home_url"])) {$admin_home_url=$_GET["admin_home_url"];} elseif (isset($_POST["admin_home_url"])) {$admin_home_url=$_POST["admin_home_url"];} +if (isset($_GET["list_order_mix"])) {$list_order_mix=$_GET["list_order_mix"];} + elseif (isset($_POST["list_order_mix"])) {$list_order_mix=$_POST["list_order_mix"];} +if (isset($_GET["vcl_id"])) {$vcl_id=$_GET["vcl_id"];} + elseif (isset($_POST["vcl_id"])) {$vcl_id=$_POST["vcl_id"];} +if (isset($_GET["vcl_name"])) {$vcl_name=$_GET["vcl_name"];} + elseif (isset($_POST["vcl_name"])) {$vcl_name=$_POST["vcl_name"];} +if (isset($_GET["list_mix_container"])) {$list_mix_container=$_GET["list_mix_container"];} + elseif (isset($_POST["list_mix_container"])) {$list_mix_container=$_POST["list_mix_container"];} +if (isset($_GET["mix_method"])) {$mix_method=$_GET["mix_method"];} + elseif (isset($_POST["mix_method"])) {$mix_method=$_POST["mix_method"];} +if (isset($_GET["human_answered"])) {$human_answered=$_GET["human_answered"];} + elseif (isset($_POST["human_answered"])) {$human_answered=$_POST["human_answered"];} +if (isset($_GET["category"])) {$category=$_GET["category"];} + elseif (isset($_POST["category"])) {$category=$_POST["category"];} +if (isset($_GET["vsc_id"])) {$vsc_id=$_GET["vsc_id"];} + elseif (isset($_POST["vsc_id"])) {$vsc_id=$_POST["vsc_id"];} +if (isset($_GET["vsc_name"])) {$vsc_name=$_GET["vsc_name"];} + elseif (isset($_POST["vsc_name"])) {$vsc_name=$_POST["vsc_name"];} +if (isset($_GET["vsc_description"])) {$vsc_description=$_GET["vsc_description"];} + elseif (isset($_POST["vsc_description"])) {$vsc_description=$_POST["vsc_description"];} +if (isset($_GET["tovdad_display"])) {$tovdad_display=$_GET["tovdad_display"];} + elseif (isset($_POST["tovdad_display"])) {$tovdad_display=$_POST["tovdad_display"];} +if (isset($_GET["mix_container_item"])) {$mix_container_item=$_GET["mix_container_item"];} + elseif (isset($_POST["mix_container_item"])) {$mix_container_item=$_POST["mix_container_item"];} +if (isset($_GET["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_GET["enable_agc_xfer_log"];} + elseif (isset($_POST["enable_agc_xfer_log"])) {$enable_agc_xfer_log=$_POST["enable_agc_xfer_log"];} +if (isset($_GET["after_hours_action"])) {$after_hours_action=$_GET["after_hours_action"];} + elseif (isset($_POST["after_hours_action"])) {$after_hours_action=$_POST["after_hours_action"];} +if (isset($_GET["after_hours_message_filename"])) {$after_hours_message_filename=$_GET["after_hours_message_filename"];} + elseif (isset($_POST["after_hours_message_filename"])) {$after_hours_message_filename=$_POST["after_hours_message_filename"];} +if (isset($_GET["after_hours_exten"])) {$after_hours_exten=$_GET["after_hours_exten"];} + elseif (isset($_POST["after_hours_exten"])) {$after_hours_exten=$_POST["after_hours_exten"];} +if (isset($_GET["after_hours_voicemail"])) {$after_hours_voicemail=$_GET["after_hours_voicemail"];} + elseif (isset($_POST["after_hours_voicemail"])) {$after_hours_voicemail=$_POST["after_hours_voicemail"];} +if (isset($_GET["welcome_message_filename"])) {$welcome_message_filename=$_GET["welcome_message_filename"];} + elseif (isset($_POST["welcome_message_filename"])) {$welcome_message_filename=$_POST["welcome_message_filename"];} +if (isset($_GET["moh_context"])) {$moh_context=$_GET["moh_context"];} + elseif (isset($_POST["moh_context"])) {$moh_context=$_POST["moh_context"];} +if (isset($_GET["onhold_prompt_filename"])) {$onhold_prompt_filename=$_GET["onhold_prompt_filename"];} + elseif (isset($_POST["onhold_prompt_filename"])) {$onhold_prompt_filename=$_POST["onhold_prompt_filename"];} +if (isset($_GET["prompt_interval"])) {$prompt_interval=$_GET["prompt_interval"];} + elseif (isset($_POST["prompt_interval"])) {$prompt_interval=$_POST["prompt_interval"];} +if (isset($_GET["agent_alert_exten"])) {$agent_alert_exten=$_GET["agent_alert_exten"];} + elseif (isset($_POST["agent_alert_exten"])) {$agent_alert_exten=$_POST["agent_alert_exten"];} +if (isset($_GET["agent_alert_delay"])) {$agent_alert_delay=$_GET["agent_alert_delay"];} + elseif (isset($_POST["agent_alert_delay"])) {$agent_alert_delay=$_POST["agent_alert_delay"];} +if (isset($_GET["group_rank"])) {$group_rank=$_GET["group_rank"];} + elseif (isset($_POST["group_rank"])) {$group_rank=$_POST["group_rank"];} +if (isset($_GET["campaign_allow_inbound"])) {$campaign_allow_inbound=$_GET["campaign_allow_inbound"];} + elseif (isset($_POST["campaign_allow_inbound"])) {$campaign_allow_inbound=$_POST["campaign_allow_inbound"];} +if (isset($_GET["manual_dial_list_id"])) {$manual_dial_list_id=$_GET["manual_dial_list_id"];} + elseif (isset($_POST["manual_dial_list_id"])) {$manual_dial_list_id=$_POST["manual_dial_list_id"];} +if (isset($_GET["campaign_rank"])) {$campaign_rank=$_GET["campaign_rank"];} + elseif (isset($_POST["campaign_rank"])) {$campaign_rank=$_POST["campaign_rank"];} +if (isset($_GET["source_campaign_id"])) {$source_campaign_id=$_GET["source_campaign_id"];} + elseif (isset($_POST["source_campaign_id"])) {$source_campaign_id=$_POST["source_campaign_id"];} +if (isset($_GET["source_user_id"])) {$source_user_id=$_GET["source_user_id"];} + elseif (isset($_POST["source_user_id"])) {$source_user_id=$_POST["source_user_id"];} +if (isset($_GET["source_group_id"])) {$source_group_id=$_GET["source_group_id"];} + elseif (isset($_POST["source_group_id"])) {$source_group_id=$_POST["source_group_id"];} +if (isset($_GET["default_xfer_group"])) {$default_xfer_group=$_GET["default_xfer_group"];} + elseif (isset($_POST["default_xfer_group"])) {$default_xfer_group=$_POST["default_xfer_group"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -595,7 +680,11 @@ if (strlen($dial_status) > 0) $status = $dial_status; } -##### BEGIN VARIABLE FILTERING FOR SECURITY ##### +###################################################################################################### +###################################################################################################### +####### Form variable filtering for security and data integrity +###################################################################################################### +###################################################################################################### if ($non_latin < 1) { @@ -714,6 +803,14 @@ $webroot_writable = ereg_replace("[^0-9]","",$webroot_writable); $enable_queuemetrics_logging = ereg_replace("[^0-9]","",$enable_queuemetrics_logging); $enable_sipsak_messages = ereg_replace("[^0-9]","",$enable_sipsak_messages); $allow_sipsak_messages = ereg_replace("[^0-9]","",$allow_sipsak_messages); +$mix_container_item = ereg_replace("[^0-9]","",$mix_container_item); +$prompt_interval = ereg_replace("[^0-9]","",$prompt_interval); +$agent_alert_delay = ereg_replace("[^0-9]","",$agent_alert_delay); +$manual_dial_list_id = ereg_replace("[^0-9]","",$manual_dial_list_id); + +### DIGITS and DASHES +$group_rank = ereg_replace("[^-0-9]","",$group_rank); +$campaign_rank = ereg_replace("[^-0-9]","",$campaign_rank); ### Y or N ONLY ### $active = ereg_replace("[^NY]","",$active); @@ -736,6 +833,9 @@ $agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active); $campaign_stats_refresh = ereg_replace("[^NY]","",$campaign_stats_refresh); $disable_alter_custdata = ereg_replace("[^NY]","",$disable_alter_custdata); $no_hopper_leads_logins = ereg_replace("[^NY]","",$no_hopper_leads_logins); +$human_answered = ereg_replace("[^NY]","",$human_answered); +$tovdad_display = ereg_replace("[^NY]","",$tovdad_display); +$campaign_allow_inbound = ereg_replace("[^NY]","",$campaign_allow_inbound); ### ALPHA-NUMERIC ONLY ### $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -754,6 +854,9 @@ $billable = ereg_replace("[^0-9a-zA-Z]","",$billable); $pause_code = ereg_replace("[^0-9a-zA-Z]","",$pause_code); $vicidial_recording_override = ereg_replace("[^0-9a-zA-Z]","",$vicidial_recording_override); $queuemetrics_log_id = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_log_id); +$after_hours_action = ereg_replace("[^0-9a-zA-Z]","",$after_hours_action); +$after_hours_exten = ereg_replace("[^0-9a-zA-Z]","",$after_hours_exten); +$after_hours_voicemail = ereg_replace("[^0-9a-zA-Z]","",$after_hours_voicemail); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -826,6 +929,17 @@ $dial_status = ereg_replace("[^-\_0-9a-zA-Z]","",$dial_status); $queuemetrics_eq_prepend = ereg_replace("[^-\_0-9a-zA-Z]","",$queuemetrics_eq_prepend); $vicidial_agent_disable = ereg_replace("[^-\_0-9a-zA-Z]","",$vicidial_agent_disable); $alter_custdata_override = ereg_replace("[^-\_0-9a-zA-Z]","",$alter_custdata_override); +$list_order_mix = ereg_replace("[^-\_0-9a-zA-Z]","",$list_order_mix); +$vcl_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vcl_id); +$mix_method = ereg_replace("[^-\_0-9a-zA-Z]","",$mix_method); +$category = ereg_replace("[^-\_0-9a-zA-Z]","",$category); +$vsc_id = ereg_replace("[^-\_0-9a-zA-Z]","",$vsc_id); +$moh_context = ereg_replace("[^-\_0-9a-zA-Z]","",$moh_context); +$agent_alert_exten = ereg_replace("[^-\_0-9a-zA-Z]","",$agent_alert_exten); +$source_campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_campaign_id); +$source_user_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_user_id); +$source_group_id = ereg_replace("[^-\_0-9a-zA-Z]","",$source_group_id); +$default_xfer_group = ereg_replace("[^-\_0-9a-zA-Z]","",$default_xfer_group); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); @@ -860,6 +974,9 @@ $wrapup_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$wrapup_message); $pause_code_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$pause_code_name); $campaign_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$campaign_description); $list_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$list_description); +$vcl_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vcl_name); +$vsc_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_name); +$vsc_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$vsc_description); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -874,9 +991,13 @@ $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); $queuemetrics_dbname = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_dbname); $queuemetrics_login = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_login); $queuemetrics_pass = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$queuemetrics_pass); +$after_hours_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$after_hours_message_filename); +$welcome_message_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$welcome_message_filename); +$onhold_prompt_filename = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$onhold_prompt_filename); ### remove semi-colons ### $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); +$list_mix_container = ereg_replace(";","",$list_mix_container); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -994,15 +1115,48 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70319-1625 - Added option to allow agents to login to outbound campaigns with no leads in the hopper # 70322-1455 - Added sipsak messages parameters # 70402-1157 - Added HOME link and entry to system_settings table, added QM link on reports section - +# 70516-1628 - Started reformatting campaigns to use submenus to break up options +# 70529-1653 - Added help for list mix +# 70530-1354 - Added human_answered field to statuses, added system status modification +# 70530-1714 - Added lists for all campaign subsections +# 70531-1631 - Development on List mix admin interface +# 70601-1629 - More development on List mix admin interface, formatting, and added some javascript +# 70602-1300 - More development on List mix admin interface, more javascript +# 70608-1459 - Added option to set LIVE Callbacks to INACTIVE after one month +# 70612-1451 - Added Callback INACTIVE link for after one week, sort by user/group/entrydate +# 70614-0231 - Added Status Categories, ability to Modify Statuses, moved system statuses to sub-section +# 70623-1008 - List Mix section now allows modification of list mix entries +# 70629-1721 - List Mix section adding and removing of list entries active +# 70706-1636 - List Mix section cleanup and more error-checking +# 70908-0941 - Added agc logile enable system_settings +# 71020-1934 - Added inbound groups options: on-hold music, messages, call_times +# 71022-1343 - Added inbound group ranks for users +# 71029-1710 - Added option for campaign to be inbound and/or blended with no restrictions on the campaign_id name +# - Added 5th NEW and 6th NEW to the dial order options +# 71030-2010 - Added Manual Dial List ID field to campaigns table +# 71103-2207 - Added inbound_group_rank and fewest_calls to the inbound groups call order options +# 71113-1521 - Added campaign_rank to agent options +# - Added ability to Copy a campaign's setting to a new campaign +# 71113-2225 - Added ability to copy user and in-group settings to new users and in-groups +# 71116-0942 - Added campaign_rank and fewest_calls as methods for agent call routing +# 71122-1135 - Added default transfer group for campaigns and inbound groups +# 71125-1751 - Added allowable transfer groups to campaign detail screen +# +# # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.0.95'; -$build = '70402-1157'; +$admin_version = '2.0.4-119'; +$build = '71125-1751'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); +$MT[0]=''; +$US='_'; +$month_old = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); +$past_month_date = date("Y-m-d H:i:s",$month_old); +$week_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); +$past_week_date = date("Y-m-d H:i:s",$week_old); if ($force_logout) { @@ -1095,6 +1249,13 @@ $browser = getenv("HTTP_USER_AGENT"); } } +###################################################################################################### +###################################################################################################### +####### Header settings +###################################################################################################### +###################################################################################################### + + header ("Content-type: text/html; charset=utf-8"); echo "\n"; echo "\n"; @@ -1103,11 +1264,14 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Añadir un Usuario";} -if ($ADD==11) {$hh='campaigns'; echo "Añadir una Campaña";} +if ($ADD=="1") {$hh='users'; echo "Añadir un Usuario";} +if ($ADD=="1A") {$hh='users'; echo "Usuario Del Copy";} +if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Añadir una Campaña";} +if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Campaña Del Copy";} if ($ADD==111) {$hh='lists'; echo "Añadir una Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} if ($ADD==1111) {$hh='ingroups'; echo "Añadir un Grupo-Entrantes";} +if ($ADD==1211) {$hh='ingroups'; echo "En-Grupo Del Copy";} if ($ADD==11111) {$hh='remoteagent'; echo "Añadir Agentes Remotos";} if ($ADD==111111) {$hh='usergroups'; echo "Añadir un Grupo De Usuarios";} if ($ADD==1111111) {$hh='scripts'; echo "Agregue La Nueva Escritura";} @@ -1118,16 +1282,20 @@ if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "NUEVO TELÉFONO";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NUEVO SERVIDOR";} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo "NUEVA CONFERENCIA";} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo "ADD NEW VICIDIAL CONFERENCE";} -if ($ADD==2) {$hh='users'; echo "Nueva Adición De Usuario";} -if ($ADD==21) {$hh='campaigns'; echo "Nueva Adición De la Campaña";} -if ($ADD==22) {$hh='campaigns'; echo "Nueva Adición Del Estado De la Campaña";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaña HotKey Addition";} -if ($ADD==25) {$hh='campaigns'; echo "El Nuevo Plomo De la Campaña Recicla La Adición";} -if ($ADD==26) {$hh='campaigns'; echo "Nuevo Estado Del Dial Del Alt Del Automóvil";} -if ($ADD==27) {$hh='campaigns'; echo "Nuevo Código De la Pausa Del Agente";} -if ($ADD==28) {$hh='campaigns'; echo "Estado Del Dial De la Campaña Agregado";} +if ($ADD=="2") {$hh='users'; echo "Nueva Adición De Usuario";} +if ($ADD=="2A") {$hh='users'; echo "Nueva Adición Copiada Del Usuario";} +if ($ADD==20) {$hh='campaigns'; $sh='basic'; echo "Nueva Adición Copiada De la Campaña";} +if ($ADD==21) {$hh='campaigns'; $sh='basic'; echo "Nueva Adición De la Campaña";} +if ($ADD==22) {$hh='campaigns'; $sh='status'; echo "Nueva Adición Del Estado De la Campaña";} +if ($ADD==23) {$hh='campaigns'; $sh='hotkey'; echo "New Campaña HotKey Addition";} +if ($ADD==25) {$hh='campaigns'; $sh='recycle'; echo "El Nuevo Plomo De la Campaña Recicla La Adición";} +if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nuevo Estado Del Dial Del Alt Del Automóvil";} +if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nuevo Código De la Pausa Del Agente";} +if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Estado Del Dial De la Campaña Agregado";} +if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la Campaña Agregada";} if ($ADD==211) {$hh='lists'; echo "Nueva Adición De la Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Nueva Adición Del Grupo de Entrantes";} +if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} if ($ADD==21111) {$hh='remoteagent'; echo "Nueva Adición de Agentes Remotos";} if ($ADD==211111) {$hh='usergroups'; echo "Nueva Adición Del Grupo De Usuarios";} if ($ADD==2111111) {$hh='scripts'; echo "Nueva Adición De la Escritura";} @@ -1139,10 +1307,28 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIÓN DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo "CREANDO CONFERENCIA";} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo "ADDING NEW VICIDIAL CONFERENCE";} +if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo "ADICIÓN DE ESTADOS DE SISTEMA DE VICIDIAL";} +if ($ADD==231111111111111) {$hh='admin'; $sh='status'; echo "ADICIÓN DE CATEGORÍA DEL ESTADO DE VICIDIAL";} if ($ADD==3) {$hh='users'; echo "Modificar Usuario";} if ($ADD==30) {$hh='campaigns'; echo "Campaña No permitida";} -if ($ADD==31) {$hh='campaigns'; echo "Modifcar Campaña";} -if ($ADD==34) {$hh='campaigns'; echo "Modificar Campaña - Vista Básica";} +if ($ADD==31) + { + $hh='campaigns'; $sh='detail'; echo "Modifcar Campaña - Detail - $campaign_id"; + if ($SUB==22) {echo " - Statuses";} + if ($SUB==23) {echo " - HotKeys";} + if ($SUB==25) {echo " -El Plomo ReciclaEntries";} + if ($SUB==26) {echo " - Auto Alt Dial Statuses";} + if ($SUB==27) {echo " - Agent Pause Codes";} + if ($SUB==29) {echo " - List Mixes";} + } +if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Estados De la Campaña";} +if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaña HotKeys";} +if ($ADD==34) {$hh='campaigns'; $sh='basic'; echo "Modificar Campaña - Vista Básica";} +if ($ADD==35) {$hh='campaigns'; $sh='recycle'; echo "El Plomo De la Campaña Recicla Entradas";} +if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Estados Auto Del Dial Del Alt De la Campaña";} +if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos De la Pausa Del Agente De la Campaña";} +if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la Campaña";} +if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} if ($ADD==311) {$hh='lists'; echo "Modificar Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} @@ -1157,15 +1343,18 @@ if ($ADD==311111111111) {$hh='admin'; $sh='server'; echo "MODIFICAR EL SERVIDOR" if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} +if ($ADD==321111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LOS ESTADOS DE SISTEMA DE VICIDIAL";} +if ($ADD==331111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LA CATEGORÍA DEL ESTADO DE VICIDIAL";} if ($ADD=="4A") {$hh='users'; echo "Modificar Usuario - Admin";} if ($ADD=="4B") {$hh='users'; echo "Modificar Usuario - Admin";} if ($ADD==4) {$hh='users'; echo "Modificar Usuario";} -if ($ADD==41) {$hh='campaigns'; echo "Modifcar Campaña";} -if ($ADD==42) {$hh='campaigns'; echo "Modifcar Campaña Status";} -if ($ADD==43) {$hh='campaigns'; echo "Modifcar Campaña HotKey";} -if ($ADD==44) {$hh='campaigns'; echo "Modificar Campaña - Vista Básica";} -if ($ADD==45) {$hh='campaigns'; echo "Modifique El Plomo De la Campaña Reciclan";} -if ($ADD==47) {$hh='campaigns'; echo "Modifique El Código De la Pausa Del Agente";} +if ($ADD==41) {$hh='campaigns'; $sh='detail'; echo "Modifcar Campaña";} +if ($ADD==42) {$hh='campaigns'; $sh='status'; echo "Modifcar Campaña Status";} +if ($ADD==43) {$hh='campaigns'; $sh='hotkey'; echo "Modifcar Campaña HotKey";} +if ($ADD==44) {$hh='campaigns'; $sh='basic'; echo "Modificar Campaña - Vista Básica";} +if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la Campaña Reciclan";} +if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Código De la Pausa Del Agente";} +if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} if ($ADD==411) {$hh='lists'; echo "Modificar Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} @@ -1180,10 +1369,12 @@ if ($ADD==421111111111) {$hh='admin'; $sh='server'; echo "MODIFIQUE EL EXPEDIENT if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo "MODIFICAR LA CONFERENCIA";} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo "MODIFY VICIDIAL CONFERENCE";} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo "MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL";} +if ($ADD==421111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LOS ESTADOS DE SISTEMA DE VICIDIAL";} +if ($ADD==431111111111111) {$hh='admin'; $sh='status'; echo "MODIFIQUE LAS CATEGORÍAS DEL ESTADO DE VICIDIAL";} if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaña";} -if ($ADD==52) {$hh='campaigns'; echo "Agentes Del Registro de estado de la máquina";} -if ($ADD==53) {$hh='campaigns'; echo "Claro Del Atasco De la Emergencia VDAC";} +if ($ADD==51) {$hh='campaigns'; $sh='detail'; echo "Delete Campaña";} +if ($ADD==52) {$hh='campaigns'; $sh='detail'; echo "Agentes Del Registro de estado de la máquina";} +if ($ADD==53) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} if ($ADD==511) {$hh='lists'; echo "Delete List";} if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} @@ -1197,13 +1388,14 @@ if ($ADD==511111111111) {$hh='admin'; $sh='server'; echo "DELETE SERVER";} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo "DELETE CONFERENCE";} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo "DELETE VICIDIAL CONFERENCE";} if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaña";} -if ($ADD==62) {$hh='campaigns'; echo "Agentes Del Registro de estado de la máquina";} -if ($ADD==63) {$hh='campaigns'; echo "Claro Del Atasco De la Emergencia VDAC";} -if ($ADD==65) {$hh='campaigns'; echo "El Plomo De la Cancelación Recicla";} -if ($ADD==66) {$hh='campaigns'; echo "Estado Auto Del Dial Del Alt De la Cancelación";} -if ($ADD==67) {$hh='campaigns'; echo "Código De la Pausa Del Agente De la Cancelación";} -if ($ADD==68) {$hh='campaigns'; echo "El Estado Del Dial De la Campaña Quitó";} +if ($ADD==61) {$hh='campaigns'; $sh='detail'; echo "Delete Campaña";} +if ($ADD==62) {$hh='campaigns'; $sh='detail'; echo "Agentes Del Registro de estado de la máquina";} +if ($ADD==63) {$hh='campaigns'; $sh='detail'; echo "Claro Del Atasco De la Emergencia VDAC";} +if ($ADD==65) {$hh='campaigns'; $sh='recycle'; echo "El Plomo De la Cancelación Recicla";} +if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del Alt De la Cancelación";} +if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Código De la Pausa Del Agente De la Cancelación";} +if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "El Estado Del Dial De la Campaña Quitó";} +if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quitó";} if ($ADD==611) {$hh='lists'; echo "Delete List";} if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} @@ -1221,10 +1413,10 @@ if ($ADD==73) {$hh='campaigns'; echo "Cuenta Del Plomo De Dialable";} if ($ADD==7111111) {$hh='scripts'; echo "Escritura De la Inspección previo";} if ($ADD==0) {$hh='users'; echo "Lista De Usuarios";} if ($ADD==8) {$hh='users'; echo "Servicios repetidos Dentro Del Agente";} -if ($ADD==81) {$hh='campaigns'; echo "Servicios repetidos Dentro De la Campaña";} +if ($ADD==81) {$hh='campaigns'; $sh='list'; echo "Servicios repetidos Dentro De la Campaña";} if ($ADD==811) {$hh='lists'; echo "Servicios repetidos Dentro De la Lista";} if ($ADD==8111) {$hh='usergroups'; echo "Servicios repetidos Dentro Del Grupo De Usuario";} -if ($ADD==10) {$hh='campaigns'; echo "Campañas";} +if ($ADD==10) {$hh='campaigns'; $sh='list'; echo "Campañas";} if ($ADD==100) {$hh='lists'; echo "Listas";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} @@ -1308,29 +1500,142 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $o++; } - ##### get campaigns listing for dynamic pulldown + ##### BEGIN get campaigns listing for rankings ##### + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; + $campaigns_value=''; + $RANKcampaigns_list="<tr><td>CAMPAIGN</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($campaigns_to_print > $o) { $rowx=mysql_fetch_row($rslt); $campaigns_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; + $campaign_id_values[$o] = $rowx[0]; + $campaign_name_values[$o] = $rowx[1]; $o++; } + $o=0; + while ($campaigns_to_print > $o) + { + $stmt="SELECT campaign_rank,calls_today from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $SELECT_campaign_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_campaign_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} + elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$campaign_rank = $SELECT_campaign_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + # disable non user-group allowable campaign ranks + $stmt="SELECT user_group from vicidial_users where user='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $Ruser_group = $row[0]; + + $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$Ruser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $allowed_campaigns = $row[0]; + $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); + $UGcampaigns = explode(" ", $allowed_campaigns); + + $p=0; $RANK_camp_active=0; $CR_disabled = ''; + if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns)) + {$RANK_camp_active++;} + else + { + $UGcampaign_ct = count($UGcampaigns); + while ($p < $UGcampaign_ct) + { + if ($campaign_id_values[$o] == $UGcampaigns[$p]) + {$RANK_camp_active++;} + $p++; + } + } + if ($RANK_camp_active < 1) {$CR_disabled = 'DISABLED';} + + $RANKcampaigns_list .= "<tr $bgcolor><td>"; + $campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n"; + $RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>"; + $RANKcampaigns_list .= "<td>     <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n"; + $h="9"; + while ($h>=-9) + { + $RANKcampaigns_list .= "<option value=\"$h\""; + if ($h==$campaign_rank) + {$RANKcampaigns_list .= " SELECTED";} + $RANKcampaigns_list .= ">$h</option>"; + $h--; + } + $RANKcampaigns_list .= "</select></td>\n"; + $RANKcampaigns_list .= "<td align=right>     $calls_today</td></tr>\n"; + $o++; + } + ##### END get campaigns listing for rankings ##### + + ##### BEGIN get inbound groups listing for checkboxes ##### + $xfer_groupsSQL=''; if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) ) { - $stmt="SELECT closer_campaigns from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $closer_campaigns = $row[0]; - $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); - $groups = explode(" ", $closer_campaigns); + $closer_campaigns = preg_replace("/ -$/","",$closer_campaigns); + $groups = explode(" ", $closer_campaigns); + $xfer_groups = $row[1]; + $xfer_groups = preg_replace("/ -$/","",$xfer_groups); + $XFERgroups = explode(" ", $xfer_groups); + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; + } + if ($ADD==41) + { + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + $xfer_groups .= " $XFERgroups[$p]"; + $p++; + } + $xfer_groupsSQL = preg_replace("/^ | -$/","",$xfer_groups); + $xfer_groupsSQL = preg_replace("/ /","','",$xfer_groupsSQL); + $xfer_groupsSQL = "WHERE group_id IN('$xfer_groupsSQL')"; } if ( (($ADD==31111) or ($ADD==31111)) and (count($groups)<1) ) @@ -1358,28 +1663,103 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $groups_to_print = mysql_num_rows($rslt); $groups_list=''; $groups_value=''; + $XFERgroups_list=''; + $RANKgroups_list="<tr><td>INBOUND GROUP</td><td>     RANK</td><td>     CALLS</td></tr>\n"; $o=0; while ($groups_to_print > $o) { $rowx=mysql_fetch_row($rslt); - $group_id_value = $rowx[0]; - $group_name_value = $rowx[1]; - $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_value\""; - $p=0; - while ($p<100) + $group_id_values[$o] = $rowx[0]; + $group_name_values[$o] = $rowx[1]; + $o++; + } + + $o=0; + while ($groups_to_print > $o) + { + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]'"; + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + if ($ranks_to_print > 0) { - if ($group_id_value == $groups[$p]) + $row=mysql_fetch_row($rslt); + $SELECT_group_rank = $row[0]; + $calls_today = $row[1]; + } + else + {$calls_today=0; $SELECT_group_rank=0;} + if ( ($ADD=="4A") or ($ADD=="4B") ) + { + if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];} + elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];} + + if ($ranks_to_print > 0) + { + $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else + { + $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user';"; + $rslt=mysql_query($stmt, $link); + } + + $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; + $rslt=mysql_query($stmt, $link); + } + else {$group_rank = $SELECT_group_rank;} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $groups_list .= "<input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $XFERgroups_list .= "<input type=\"checkbox\" name=\"XFERgroups[]\" value=\"$group_id_values[$o]\""; + $RANKgroups_list .= "<tr $bgcolor><td><input type=\"checkbox\" name=\"groups[]\" value=\"$group_id_values[$o]\""; + $p=0; + $group_ct = count($groups); + while ($p < $group_ct) + { + if ($group_id_values[$o] == $groups[$p]) { $groups_list .= " CHECKED"; - $groups_value .= " $group_id_value"; + $RANKgroups_list .= " CHECKED"; + $groups_value .= " $group_id_values[$o]"; } $p++; } - $groups_list .= "> $group_id_value - $group_name_value<BR>\n"; + $p=0; + $XFERgroup_ct = count($XFERgroups); + while ($p < $XFERgroup_ct) + { + if ($group_id_values[$o] == $XFERgroups[$p]) + { + $XFERgroups_list .= " CHECKED"; + $XFERgroups_value .= " $group_id_values[$o]"; + } + $p++; + } + $groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n"; + $RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>"; + $RANKgroups_list .= "<td>     <select size=1 name=RANK_$group_id_values[$o]>\n"; + $h="9"; + while ($h>=-9) + { + $RANKgroups_list .= "<option value=\"$h\""; + if ($h==$group_rank) + {$RANKgroups_list .= " SELECTED";} + $RANKgroups_list .= ">$h</option>"; + $h--; + } + $RANKgroups_list .= "</select></td>\n"; + $RANKgroups_list .= "<td align=right>     $calls_today</td></tr>\n"; $o++; } if (strlen($groups_value)>2) {$groups_value .= " -";} + if (strlen($XFERgroups_value)>2) {$XFERgroups_value .= " -";} } ##### END get inbound groups listing for checkboxes ##### @@ -1395,7 +1775,6 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $allowed_campaigns = $row[0]; $allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns); $campaigns = explode(" ", $allowed_campaigns); - echo "<!-- $allowed_campaigns -->"; } $campaigns_value=''; @@ -1464,6 +1843,15 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD $NWB = "   <a href=\"javascript:openNewWindow('$PHP_SELF?ADD=99999"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 Border=0 ALT=\"AYUDA\" ALIGN=TOP></A>"; + + +###################################################################################################### +###################################################################################################### +####### 9 series, HELP screen +###################################################################################################### +###################################################################################################### + + ###################### # ADD=99999 display the HELP SCREENS ###################### @@ -1522,11 +1910,6 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>El agente elige Ingroups -</B> esta opción si el sistema a 1 permite que el usuario elija los ingroups de los cuales recibirán llamadas cuando ellos conexión a una campaña MÁS CERCANA o DE ENTRADA. Si no el encargado necesitará fijar esto en su pantalla del detalle del usuario de la página del admin. -<BR> -<A NAME="vicidial_users-closer_campaigns"> -<BR> -<B>Grupos de entrada -</B> aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. - <BR> <A NAME="vicidial_users-scheduled_callbacks"> <BR> @@ -1562,6 +1945,16 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Invalidación de la grabación de VICIDIAL -</B> esta opción seeliminará lo que es la opción en la campaña para la grabación.LISIADO no eliminará el ajuste de la grabación de la campaña. NUNCAinhabilitará la grabación en el cliente. ONDEMAND es el defecto ypermite que el agente comience y pare a registrar según lonecesitado. ALLCALLS comenzará la grabación en el cliente siempreque una llamada se envíe a un agente. ALLFORCE comenzará lagrabación en el cliente siempre que una llamada se envíe a un agenteque no da al agente ninguna opción para parar el registrar. ParaALLCALLS y ALLFORCE hay una opción para utilizar la grabaciónretrasa para reducir en grabaciones y carga de sistema muy cortas delrecude. +<BR> +<A NAME="vicidial_users-vicidial_users-campaign_ranks"> +<BR> +<B>La campaña alinea -</B> en esta sección usted puede definir a la filaque un agente tendrá para cada campaña. Estas filas pueden serutilizadas para tener en cuenta la encaminamiento preferida de lallamada cuando la llamada siguiente del agente se fija alcampaign_rank. + +<BR> +<A NAME="vicidial_users-closer_campaigns"> +<BR> +<B>Grupos de entrada -</B> aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. Usted también podrá fijar la fila, o el nivel de habilidad, en estasección para cada uno de los grupos de entrada así como poder ver elnúmero de las llamadas recibidas de cada grupo de entrada para esteagente específico. También en esta sección está la capacidad de dar al agente una filapara cada grupo de entrada. Estas filas pueden ser utilizadas para laencaminamiento preferida de la llamada cuando esa opción seselecciona en la pantalla del en-grupo. + <BR> <A NAME="vicidial_users-alter_custdata_override"> <BR> @@ -1722,6 +2115,21 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Permita Closers -</B> aquí es donde usted puede fijar si los usuarios de esta campaña tendrán la opción para enviar la llamada a un más cercano. +<BR> +<A NAME="vicidial_campaigns-default_xfer_group"> +<BR> +<B>Grupo de la transferencia del defecto -</B> este campo es el En-Grupo deldefecto que será seleccionado automáticamente cuando el agente va almarco de la transferir-conferencia en su interfaz del agente. + +<BR> +<A NAME="vicidial_campaigns-xfer_groups"> +<BR> +<B>Grupos permitidos de la transferencia -</B> con estos listados delcheckbox usted puede seleccionar a los grupos a quienes los agentes enesta campaña pueden transferir llamadas. Permita Closers debe serpermitido para que esta opción demuestre para arriba. + +<BR> +<A NAME="vicidial_campaigns-campaign_allow_inbound"> +<BR> +<B>Permita de entrada y mezclado -</B> aquí es donde usted puede fijar silos usuarios de esta campaña tendrán la opción para tomar llamadasde entrada con esta campaña. Si usted desea hacer de entrada y desalida mezclada entonces esto se debe fijar a Y. Si usted deseasolamente hacer marcar de salida en esta campaña fijó esto a N.Default es N. + <BR> <A NAME="vicidial_campaigns-dial_status"> <BR> @@ -1816,6 +2224,8 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: las órdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. <BR>   - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. <BR>   - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. + <BR>   - campaign_rank: órdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - fewest_calls: órdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. <BR> <A NAME="vicidial_campaigns-local_call_time"> @@ -1957,6 +2367,37 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Permita Ninguno-Tolva-Conduce conexiones -</B> si el sistema a Y, permiteagentes a la conexión a la campaña incluso si no hay plomos cargadosen la tolva para esa campaña. Esta función no se necesita encampañas de CLOSER-type. El defecto es N. +<BR> +<A NAME="vicidial_campaigns-list_order_mix"> +<BR> +<B>Mezcla de la orden de la lista -</B> elimina los campos de la orden delplomo y del estado del dial. Utilizará los parámetros de la lista ydel estado para la entrada seleccionada de la mezcla de la lista en lasección del submarino de la mezcla de la lista en lugar de otro. Eldefecto es LISIADO. + +<BR> +<A NAME="vicidial_campaigns-vcl_id"> +<BR> +<B>Identificación de la mezcla de la lista -</B> identificación de lamezcla de la lista. Debe ser a partir de 2-20 caracteres en longitudsin los espacios o la otra puntuación especial. + +<BR> +<A NAME="vicidial_campaigns-vcl_name"> +<BR> +<B>Nombre de la mezcla de la lista -</B> nombre descriptivo de la mezcla dela lista. Debe ser a partir de 2-50 caracteres en longitud. + +<BR> +<A NAME="vicidial_campaigns-list_mix_container"> +<BR> +<B>Detalle de la mezcla de la lista -</B> la composición de la entrada de lamezcla de la lista. Contiene la identificación de la lista, la ordende la mezcla, los porcentajes y los estados que hacen para arriba estamezcla de la lista. Los porcentajes tienen que agregar siempre hasta100, y las listas todas tienen que ser activas y fijadas a la campañapara que la entrada de la mezcla de la orden sea activada. + +<BR> +<A NAME="vicidial_campaigns-mix_method"> +<BR> +<B>Método de la mezcla de la lista -</B> el método de mezclar a todas laspartes del detalle de la mezcla de la lista juntas. EVEN_MIX mezclarálos plomos de cada parte interpolada con las otras partes, como estos1.2.3.1.2.3.1.2.3. IN_ORDER pondrá los plomos en la orden en la cualse enumeran en la pantalla 1.1.1.2.2.2.3.3.3 del detalle de la mezclade la lista. La voluntad AL AZAR los puso en la orden AL AZAR1.3.2.1.1.3.2.1.3. El defecto es IN_ORDER. + +<BR> +<A NAME="vicidial_campaigns-manual_dial_list_id"> +<BR> +<B>Identificación manual de la lista del dial -</B> el list_id del defectoque se utilizará cuando los placces de un agente una llamada manual yun nuevo expediente del plomo se crean en vicidial_list. El defecto es999. Este campo puede contener dígitos solamente. + + <BR><BR><BR><BR> @@ -2043,7 +2484,10 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR>   - oldest_call_start: las órdenes por la vez última un agente fueron enviadas una llamada. Resultados en los agentes que reciben el número casi igual de llamadas cabalmente. <BR>   - oldest_call_finish: las órdenes por la vez última un agente acabaron una llamada. El agente de AKA que espera lo más de largo posible recibe la primera llamada. <BR>   - overall_user_level: las órdenes por el user_level del agente según lo definido en los vicidial_users tabulan un user_level más alto recibirán más llamadas. - + <BR>   - inbound_group_rank: órdenes de la fila dada al agente para el grupode entrada específico. Lo más arriba posible a lo más bajo posible. + <BR>   - fewest_calls: órdenes por el número de las llamadas recibidas por unagente para ese grupo de entrada específico. Menos llamadas primero. + <BR>   - campaign_rank: órdenes de la fila dada al agente para la campaña. Lomás arriba posible a lo más bajo posible. + <BR>   - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first. <BR> <A NAME="vicidial_inbound_groups-fronter_display"> <BR> @@ -2084,6 +2528,66 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <BR> <B>Gota Exten -</B> ésta es la extensión dial plan que el archivo audiocaído deseado de la llamada está situado en en su servidor. +<BR> +<A NAME="vicidial_inbound_groups-call_time_id"> +<BR> +<B>Tiempo de la llamada -</B> éste es el esquema del tiempo de la llamada autilizar para este grupo de entrada. Tenga presente que el tiempoestá basado en el tiempo del servidor. El defecto es 24hours. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_action"> +<BR> +<B>Después de la acción de las horas -</B> la acción a realizarse si esdespués de horas según lo definido en la época de la llamada paraeste grupo de entrada. Del RETRASO de la voluntad el retrasoinmediatamente la llamada, MESSASGE jugará el archivo en después delcampo de Filenam del mensaje de las horas, la EXTENSIÓN enviará lallamada a después de la extensión de las horas en el dialplan yVOICEMAIL enviará la llamada a la caja del voicemail enumerada endespués del campo de Buzón de Voz de las horas. El defecto es MENSAJE. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_message_filename"> +<BR> +<B>Después del nombre de fichero del mensaje de las horas -</B> el archivoaudio situado en el servidor que se jugará si la acción se fija alMENSAJE. El defecto es VM-ADIO'S + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_exten"> +<BR> +<B>Después de la extensión de las horas -</B> la extensión dialplan paraenviar la llamada si la acción se fija a la EXTENSIÓN. El defecto es8300. + +<BR> +<A NAME="vicidial_inbound_groups-after_hours_voicemail"> +<BR> +<B>Después de las horas Buzón de Voz -</B> la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. + +<BR> +<A NAME="vicidial_inbound_groups-welcome_message_filename"> +<BR> +<B>Nombre de fichero agradable del mensaje -</B> el archivo audio situado enel servidor que se jugará cuando viene la llamada adentro. Si sistemaa ---NONE --- entonces no se jugará ningún mensaje. El defecto es---NONE --- + +<BR> +<A NAME="vicidial_inbound_groups-moh_context"> +<BR> +<B>Música en contexto del asimiento -</B> la música en el contexto delasimiento para utilizar cuando colocan al cliente en asimiento. Eldefecto es defecto. + +<BR> +<A NAME="vicidial_inbound_groups-onhold_prompt_filename"> +<BR> +<B>En el nombre de fichero del aviso del asimiento -</B> el archivo audiosituado en el servidor que se jugará en un intervalo regular cuandoel cliente está en asimiento. El defecto es generic_hold. Estearchivo audio DEBE estar 9 segundos o menos en longitud. + +<BR> +<A NAME="vicidial_inbound_groups-prompt_interval"> +<BR> +<B>En el intervalo del aviso del asimiento -</B> la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_exten"> +<BR> +<B>Extensión alerta del agente -</B> la extensión a enviar en la sesióndel agente para anunciar que una llamada está viniendo al agente.Esta extensión debe tener un aparato de lectura de un archivo audio.No utilizar esta función fijó esto a X. Default es X. + +<BR> +<A NAME="vicidial_inbound_groups-agent_alert_delay"> +<BR> +<B>La alarma del agente retrasa -</B> la longitud de la hora en milisegundosde esperar antes de enviar la llamada al agente después de jugarencendido la extensión alerta del agente. El defecto es 1000. + +<BR> +<A NAME="vicidial_inbound_groups-default_xfer_group"> +<BR> +<B>Grupo de la transferencia del defecto -</B> este campo es el En-Grupo deldefecto que será seleccionado automáticamente cuando el agente va almarco de la transferir-conferencia en su interfaz del agente. + <BR><BR><BR><BR> @@ -2137,7 +2641,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>VICIDIAL_CAMPAIGN_STATUSES TABLA</FONT></B><BR><BR> <A NAME="vicidial_campaign_statuses"> <BR> -<B>Con el uso de los estados de encargo de la campaña, usted puede tener estados que existan solamente para una campaña específica. El estado debe ser 1-8 caracteres en longitud, la descripción debe ser 2-30 caracteres en longitud y seleccionable define si demuestra para arriba en VICIDIAL como disposición.</B> +<B>Con el uso de los estados de encargo de la campaña, usted puede tener estados que existan solamente para una campaña específica. El estado debe ser 1-8 caracteres en longitud, la descripción debe ser 2-30 caracteres en longitud y seleccionable define si demuestra para arriba en VICIDIAL como disposición. Human_answered el campo se utiliza al calcular el porcentaje de lagota, o la tarifa del abandono. El ajuste human_answered a Yutilizará este estado al contar las llamadas humano-contestadas. La opción de la categoría permite que usted agrupe varios estados enun catogy que se pueda utilizar para el análisis estadístico.</B> @@ -2226,7 +2730,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B>Texto de la escritura -</B> This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id. For example, this sentence would print the persons name in it----<BR><BR> Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?<BR><BR> This would read----<BR><BR>Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?<BR><BR> You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: <DIV style="height:200px;width:400px;background:white;overflow:scroll;font-size:12px;font-family:sans-serif;" id=iframe_example> -<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290"> +<iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&phone=--A--phone--B--" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe> </DIV> @@ -2301,7 +2805,7 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN <B><FONT SIZE=3>FUNCIONALIDAD DEL CARGADOR DE LA LISTA DE VICIDIAL</FONT></B><BR><BR> <A NAME="vicidial_list_loader"> <BR> -El VICIDIAL tela-baso' cargador del plomo se diseña simplemente llevar un file(up del plomo 8MB de tamaño) que es lengüeta o pipa delimitada y cargarlo en la tabla del vicidial_list. Hay también un cargador estupendo nuevo del plomo de la versión beta que permite para el campo que elige y de TXT- el texto claramente, los valores separados coma de CSV- y XLS- sobresalen formatos del archivo. El cargador del plomo no hace la validación de datos o la comprobación para duplicados en sí mismo u otras listas, de modo que esté algo usted necesita hacer antes de usted la carga los plomos. También, cerciórese de que usted haya creado la lista que estos plomos son estar debajo de modo que usted pueda utilizarlos. Hay también la materia de la tiempo-zona-codificacio'n estos plomos. Usted puede desear aumentar la frecuencia que el ADMIN_adjust_GMTnow_on_leads.pl se está funcionando en el cron en su servidor del asterisco para poder cifrar cualquier plomo cargado más rápidamente. Aquí está una lista de los campos en su orden apropiada para los archivos del plomo: +El cargador tela-basado básico del plomo de VICIDIAL se diseñasimplemente para tomar un archivo del plomo - hasta 8MB de tamaño quees la lengüeta o la pipa delimitada y para cargarlo en la tabla delvicidial_list. El cargador del plomo permite el campo que elige y deTXT- el texto claramente, los valores separados coma de CSV- y XLS-sobresalen formatos del archivo. El cargador del plomo no hace lavalidación de datos, sino que permite que usted compruebe para sabersi hay duplicados en sí mismo, dentro de la campaña o dentro delsistema entero. También, cerciórese de que usted haya creado lalista que estos plomos son estar debajo de modo que usted puedautilizarlos. Aquí está una lista de los campos en su orden apropiadapara los archivos del plomo: <OL> <LI>Código del plomo del vendedor - demuestra para arriba en el campo de la identificación del vendedor del GUI <LI>Código de fuente - uso interno solamente para los admins y DBAs @@ -2328,7 +2832,7 @@ El VICIDIAL tela-baso' cargador del plomo se diseña simplemente llevar un file( <LI>Comentarios </OL> -<BR>NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. +<BR>NOTAS: La funcionalidad del cargador del plomo del sobresalir espermitida por una serie de escrituras del Perl y necesita tener unarchivo correctamente configurado de /etc/astguiclient.conf en lugaren el web server. También, los módulos de un Perl de los pares sedeben cargar para ella para trabajar también -oLE-Storage_Lite-Storage_Lite y la Hoja de balance-ParseExcel. Ustedpuede comprobar para saber si hay errores runtime en éstos mirando suarchivo del error_log de apache. También, para los cheques deduplicación contra gampaign enumera, la lista que tiene nuevos plomosel entrar él necesita ser creada en el sistema antes de que ustedcomience a cargar los plomos. @@ -2882,6 +3386,30 @@ El VICIDIAL tela-baso' cargador del plomo se diseña simplemente llevar un file( <BR> <B>URL casero del Admin -</B> ésta es la dirección del URL o del Web siteque usted irá si usted chasca encendido el acoplamiento CASERO en latapa de la página de admin.php. +<BR> +<A NAME="settings-enable_agc_xfer_log"> +<BR> +<B>Permita el logfile de la transferencia del agente -</B> esta opciónregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. + + + + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUSES TABLA</FONT></B><BR><BR> +<A NAME="vicidial_statuses"> +<BR> +<B>Con el uso de los estados de sistema, usted puede tener estados queexistan para la campaña y el en-grupo. El estado debe ser 1-6caracteres en longitud, la descripción debe ser 2-30 caracteres enlongitud y seleccionable define si demuestra para arriba en VICIDIALcomo disposición del agente. Human_answered el campo se utiliza alcalcular el porcentaje de la gota, o la tarifa del abandono. El ajustehuman_answered a Y utilizará este estado al contar las llamadashumano-contestadas. La opción de la categoría permite que ustedagrupe varios estados en un catogy que se pueda utilizar para elanálisis estadístico.</B> + + +<BR><BR><BR><BR> + +<B><FONT SIZE=3>VICIDIAL_STATUS_CATEGORIES TABLA</FONT></B><BR><BR> +<A NAME="vicidial_status_categories"> +<BR> +<B>Con el uso de las categorías del estado de sistema, usted puedeagrupar juntos estados para tener en cuenta análisis estadístico enun grupo de estados. La identificación de la categoría debe ser 2-20caracteres en longitud sin espacios, el nombre debe ser 2-50caracteres en longitud, la descripción es opcional y la exhibiciónde TimeonVDAD define si ese estado será uno de hasta que 4 estadosque se puedan calcular y exhibir en el tiempo en informe del tiemporeal de VDAD.</B> + @@ -2896,6 +3424,12 @@ exit; } +###################################################################################################### +###################################################################################################### +####### 7 series, filter count preview and script preview +###################################################################################################### +###################################################################################################### + @@ -3156,9 +3690,119 @@ if ($hh=='reports') {$reports_hh="bgcolor=\"$reports_color\""; $reports_fc="$reports_font"; $reports_bold="$header_selected_bold";} else {$reports_hh=''; $reports_fc='WHITE'; $reports_bold="$header_nonselected_bold";} +echo "\n"; +echo " -VICIDIAL ADMIN: Super Lead Loader +VICIDIAL ADMIN: Lead Loader
method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> - +
@@ -299,13 +303,22 @@ function ParseFileName() { + + + + - + @@ -314,15 +327,14 @@ function ParseFileName() { - - +
Cargar Leads de este archivo: ID De la Lista Override: (Solamente números or leave blank for values in the file)
Phone Code Override: (Solamente números or leave blank for values in the file)
Disposición de archivo a utilizar: VICIDIAL Estándar    Disposición de encargo
Cheque Del Duplicado Del Plomo:
Operaciones de búsqueda De la Zona De Tiempo De Plomo:
        
CHASQUE AQUÍ PARA IR AL CARGADOR DEL PLOMO DEL BASIC         DE NUEVO AL ADMIN
CARGADOR ESTUPENDO DE LA LISTA-     VERSIÓN:     CONSTRUCCION:
        DE NUEVO AL ADMINLIST LOADER-     VERSIÓN:     CONSTRUCCION:    
document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;"; + print ""; flush(); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -350,6 +362,11 @@ function ParseFileName() { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

"; + } + while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -396,9 +413,78 @@ function ParseFileName() { # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -408,6 +494,7 @@ function ParseFileName() { { $row=mysql_fetch_row($rslt); $dup_lead = $row[0]; + $dup_lead_list = $list_id; } if ($dup_lead < 1) { @@ -441,7 +528,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} $bad++; } $total++; @@ -473,11 +560,17 @@ function ParseFileName() { { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

\n"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

\n"; + } # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); @@ -491,6 +584,11 @@ function ParseFileName() { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

"; + } + while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -528,12 +626,80 @@ function ParseFileName() { if (strlen($list_id_override)>0) { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -577,7 +743,7 @@ function ParseFileName() { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -637,6 +803,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

\n"; + } while (!feof($file)) { $record++; $buffer=rtrim(fgets($file, 4096)); @@ -680,12 +850,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -729,7 +967,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -768,9 +1006,11 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else @@ -795,6 +1035,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

"; + } while($row=fgetcsv($file, 1000, ",")) { $pulldate=date("Y-m-d H:i:s"); @@ -832,12 +1076,80 @@ if ($leadfile && filesize($LF_path)<=8388608) { if (strlen($list_id_override)>0) { - # print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; $list_id = $list_id_override; } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } - ##### Check for duplicate phone numbers in vicidial_list table ##### - if (eregi("DUP",$dupcheck)) + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### + if (eregi("DUPCAMP",$dupcheck)) + { + $dup_lead=0; + $dup_lists=''; + $stmt="select campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$dup_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $dup_lists .= "'$row[0]',"; + $L++; + } + $dup_lists = eregi_replace(",$",'',$dup_lists); + + $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPSYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$phone_number$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### + if (eregi("DUPLIST",$dupcheck)) { $dup_lead=0; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; @@ -881,7 +1193,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { $good++; } else { - if ($bad < 10) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 10000) {print "
record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} $bad++; } $total++; @@ -906,7 +1218,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { } else { print "
"; flush(); - print "\r\n"; + print "
\r\n"; print " \r\n"; print " \r\n"; print " \r\n"; @@ -945,6 +1257,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

"; + } $buffer=rtrim(fgets($file, 4096)); $buffer=stripslashes($buffer); $row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); @@ -1016,7 +1332,9 @@ if ($leadfile && filesize($LF_path)<=8388608) { # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; - if (eregi("DUP",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} + if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} + if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } @@ -1043,6 +1361,10 @@ if ($leadfile && filesize($LF_path)<=8388608) { { print "

ID DE LA LISTA OVERRIDE FOR THIS FILE: $list_id_override

"; } + if (strlen($phone_code_override)>0) + { + print "

INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

"; + } $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; $row=fgetcsv($file, 1000, ","); @@ -1102,6 +1424,7 @@ if ($leadfile && filesize($LF_path)<=8388608) { print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print "
VICIDIAL ColumnaDatos del archivo        
\r\n"; diff --git a/LANG_www/vicidial_es/user_stats.php b/LANG_www/vicidial_es/user_stats.php index 2a8f79ae..f4351011 100644 --- a/LANG_www/vicidial_es/user_stats.php +++ b/LANG_www/vicidial_es/user_stats.php @@ -1,13 +1,14 @@ LICENSE: GPLv2 +### Copyright (C) 2007 Matt Florell LICENSE: GPLv2 ### # CHANGES # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit # 70118-1605 - Added user group column to login/out and calls lists +# 70702-1231 - Added recording location link and truncation # header ("Content-type: text/html; charset=utf-8"); @@ -263,7 +264,7 @@ echo "

\n"; echo "
\n"; -echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; echo "\n"; @@ -298,9 +299,45 @@ echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAÑA GROUP LIST LEAD


\n"; +echo "CLOSER CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; +echo "\n"; +echo "\n"; + + $stmt="select * from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + } + + +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAÑA WAIT (S) LIST LEAD
$u$row[4] $row[7] $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]


\n"; + + + + echo "RECORDINGS FOR THIS TIME PERIOD: (10000 record limit)\n"; echo "\n"; -echo "\n"; +echo "\n"; $stmt="select * from recording_log where user='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by recording_id desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -315,16 +352,25 @@ echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + $location = $row[11]; + if (strlen($location)>30) + {$locat = substr($location,0,27); $locat = "$locat...";} + else + {$locat = $location;} + if (eregi("http",$location)) + {$location = "$locat";} + else + {$location = $locat;} + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; }
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION
# LEADDATE/TIME SECONDS   RECIDFILENAMELOCATION  
# LEAD"; - echo "$u $row[12] $row[4] $row[8] $row[0] $row[10] $row[11]
$u $row[12] $row[4] $row[8] $row[0] $row[10] $location