diff --git a/UPGRADE b/UPGRADE index 53602bc3..2bef91a8 100644 --- a/UPGRADE +++ b/UPGRADE @@ -399,6 +399,9 @@ OTHER CHANGES: in agent using the Agent API. Feature must be enabled in the Campaign Detail settings. +91. Added ability to modify scheduled callback dates and comments in the Admin + Modify Lead screen. + diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 34c86f28..5932f269 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -484,6 +484,7 @@ Manual Dial API|| This option allows you to set the Agent API to make either one call at a time, STANDARD, or the ability to queue up manual dial calls and have them dial automatically once the agent goes on pause or is available to take their next call with the option to disable the automatic dialing of these calls, QUEUE, or QUEUE_AND_AUTOCALL which is the same as QUEUE but without the option to disable the automatic dialing of these calls. If an agent has more than one call queued up for them they will see the count of how many manual dial calls are in queue right below the Pause button, or Dial Next Number button. We suggest that if QUEUE is used that you send API actions using the preview=YES option so you are not repeatedly dialing calls for the agent without notice. Also, if using QUEUE and heavily using manual dial calls in a non MANUAL dial method, we would recommend setting the Agent Pause After Each Call option to Y. Default is STANDARD|| Manual Call Time Check|| If this option is enabled, it will check all manual dial calls to make sure they are within the call time settings set for the campaign. Default is DISABLED|| +If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time|| AST_LISTS_campaign_stats.php diff --git a/www/vicidial/admin_modify_lead.php b/www/vicidial/admin_modify_lead.php index b5e94498..7de8b00e 100644 --- a/www/vicidial/admin_modify_lead.php +++ b/www/vicidial/admin_modify_lead.php @@ -39,6 +39,7 @@ # 100703-1122 - Added custom fields display/edit # 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # 100924-1431 - Added Called Count display +# 101127-1610 - Added ability to set a scheduled callback date and time # require("dbconnect.php"); @@ -128,6 +129,8 @@ if (isset($_GET["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_GET["CBchangeU elseif (isset($_POST["CBchangeUSERtoUSER"])) {$CBchangeUSERtoUSER=$_POST["CBchangeUSERtoUSER"];} if (isset($_GET["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_GET["CBchangeANYtoUSER"];} elseif (isset($_POST["CBchangeANYtoUSER"])) {$CBchangeANYtoUSER=$_POST["CBchangeANYtoUSER"];} +if (isset($_GET["CBchangeDATE"])) {$CBchangeDATE=$_GET["CBchangeDATE"];} + elseif (isset($_POST["CBchangeDATE"])) {$CBchangeDATE=$_POST["CBchangeDATE"];} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} if (isset($_GET["CBuser"])) {$CBuser=$_GET["CBuser"];} @@ -140,6 +143,10 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent elseif (isset($_POST["modify_agent_logs"])) {$modify_agent_logs=$_POST["modify_agent_logs"];} if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -277,6 +284,8 @@ if (strlen($row[18])>0) {$label_comments = $row[18];} ADMINISTRATION: Lead record modification + +
@@ -291,6 +300,7 @@ if ($end_call > 0) $rslt=mysql_query($stmt, $link); echo "information modified

\n"; + echo "Go back to the lead modification page

\n"; echo "
\n"; ### LOG INSERTION Admin Log Table ### @@ -320,6 +330,31 @@ if ($end_call > 0) echo "
vicidial_callback record inactivated: $lead_id
\n"; } + if ( ($dispo != $status) and ($status == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CBM_to_print = mysql_num_rows($rslt); + if ($CBM_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $callback_id = $rowx[0]; + } + else + { + $tomorrow = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y"))); + + $stmt="INSERT INTO vicidial_callbacks SET lead_id='" . mysql_real_escape_string($lead_id) . "',recipient='ANYONE',status='ACTIVE',user='$PHP_AUTH_USER',user_group='ADMIN',list_id='" . mysql_real_escape_string($list_id) . "',callback_time='$tomorrow 12:00:00',entry_time='$NOW_TIME',comments='',campaign_id='" . mysql_real_escape_string($campaign_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
Scheduled Callback added: $lead_id - $phone_number
\n"; + } + } + + if ( ($dispo != $status) and ($status == 'DNC') ) { ### add lead to the internal DNC list @@ -368,7 +403,7 @@ else if ($CBchangeUSERtoANY == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an ANYONE callback for this lead $stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -377,7 +412,7 @@ else } if ($CBchangeUSERtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to a different USERONLY callback record for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -386,7 +421,7 @@ else } if ($CBchangeANYtoUSER == 'YES') { - ### inactivate vicidial_callbacks record for this lead + ### set vicidial_callbacks record to an USERONLY callback for this lead $stmt="UPDATE vicidial_callbacks set user='" . mysql_real_escape_string($CBuser) . "',recipient='USERONLY' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -394,7 +429,25 @@ else echo "
vicidial_callback record changed to USERONLY, user: $CBuser
\n"; } - + if ($CBchangeDATE == 'YES') + { + ### change date/time of vicidial_callbacks record for this lead + $stmt="UPDATE vicidial_callbacks set callback_time='" . mysql_real_escape_string($appointment_date) . " " . mysql_real_escape_string($appointment_time) . "',comments='" . mysql_real_escape_string($comments) . "' where callback_id='" . mysql_real_escape_string($callback_id) . "';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
vicidial_callback record changed to $appointment_date $appointment_time
\n"; + } + + + + + + + + + + $stmt="SELECT count(*) from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; $rslt=mysql_query($stmt, $link); @@ -647,6 +700,7 @@ else $CAMPstatuses_to_print = mysql_num_rows($rslt); $o=0; + $CBhold_set=0; while ($CAMPstatuses_to_print > $o) { $rowx=mysql_fetch_row($rslt); @@ -654,11 +708,16 @@ else {$statuses_list .= "\n"; $DS++;} else {$statuses_list .= "\n";} + if ($rowx[0] == 'CBHOLD') {$CBhold_set++;} $o++; } + if ($dispo == 'CBHOLD') {$CBhold_set++;} - if ($DS < 1) {$statuses_list .= "\n";} + if ($DS < 1) + {$statuses_list .= "\n";} + if ($CBhold_set < 1) + {$statuses_list .= "\n";} echo "$statuses_list"; echo " (with $list_campaign statuses)\n"; @@ -673,6 +732,8 @@ else echo "\n"; echo "


\n"; + echo "
\n"; + echo "Callback Details:
\n"; if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) { ### find any vicidial_callback records for this lead @@ -711,13 +772,134 @@ else echo "New Callback Owner UserID: \n"; echo "
\n"; } + + $appointment_datetimeARRAY = explode(" ",$rowx[6]); + $appointment_date = $appointment_datetimeARRAY[0]; + $appointment_timeARRAY = explode(":",$appointment_datetimeARRAY[1]); + $appointment_hour = $appointment_timeARRAY[0]; + $appointment_min = $appointment_timeARRAY[1]; + + + ?> + +
+
Change Scheduled Callback Date:
+ + + + + + + + + + + + + +
+ > + + + + +
CallBack Date/Time: + + +     + + : + + +
+ Comments: + + +
+ + + + +
+ +
+ + No Callback records found
\n"; } - } + } + else + { + echo "
If you want to change this lead to a scheduled callback, first change the Disposition to CBHOLD, then submit and you will be able to set the callback date and time.
\n"; + } + echo "
\n"; echo "

\n";