diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 69abf156..ced2c57d 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -109,6 +109,9 @@ OTHER CHANGES: 22. Added campaign option to set owner field to user if the owner field is empty +23. Added Lead Tools web page from Admin Utilities. Allows for some basic lead + management through the web interface. + diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index c9af5eb2..372adac8 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -314,10 +314,11 @@ # 120831-1438 - Added vicidial_dial_log logging of outbound phone calls # 121018-2320 - Added blank option to owner only dialing # 121029-0159 - Added owner_populate campaign option +# 121114-1749 - Fixed manual dial lead preview script variable issue # -$version = '2.6-212'; -$build = '121029-0159'; +$version = '2.6-213'; +$build = '121114-1749'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=443; $one_mysql_log=0; @@ -2634,32 +2635,6 @@ if ($ACTION == 'manDiaLnextCaLL') } - ##### find if script contains recording fields - $stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00259',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vls_vc_ct = mysql_num_rows($rslt); - if ($vls_vc_ct > 0) - { - $row=mysql_fetch_row($rslt); - if ($row[0] > 0) - { - $script_recording_delay=0; - ##### find if script contains recording fields - $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00260',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vs_vc_ct = mysql_num_rows($rslt); - if ($vs_vc_ct > 0) - { - $row=mysql_fetch_row($rslt); - $script_recording_delay = $row[0]; - } - } - } - ### Check for List ID override settings $VDCL_xferconf_a_number=''; $VDCL_xferconf_b_number=''; @@ -2681,72 +2656,6 @@ if ($ACTION == 'manDiaLnextCaLL') $VDCL_xferconf_e_number = $row[4]; } - if (strlen($list_id)>0) - { - $stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);} - $VDIG_preset_ct = mysql_num_rows($rslt); - if ($VDIG_preset_ct > 0) - { - $row=mysql_fetch_row($rslt); - if (strlen($row[0]) > 0) - {$VDCL_xferconf_a_number = $row[0];} - if (strlen($row[1]) > 0) - {$VDCL_xferconf_b_number = $row[1];} - if (strlen($row[2]) > 0) - {$VDCL_xferconf_c_number = $row[2];} - if (strlen($row[3]) > 0) - {$VDCL_xferconf_d_number = $row[3];} - if (strlen($row[4]) > 0) - {$VDCL_xferconf_e_number = $row[4];} - } - - $custom_field_names='|'; - $custom_field_names_SQL=''; - $custom_field_values='----------'; - $custom_field_types='|'; - ### find the names of all custom fields, if any - $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('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','called_count','last_local_call_time','rank','owner');"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $cffn_ct = mysql_num_rows($rslt); - $d=0; - while ($cffn_ct > $d) - { - $row=mysql_fetch_row($rslt); - $custom_field_names .= "$row[0]|"; - $custom_field_names_SQL .= "$row[0],"; - $custom_field_types .= "$row[1]|"; - $custom_field_values .= "----------"; - $d++; - } - if ($cffn_ct > 0) - { - $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL); - ### find the values of the named custom fields - $stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00335',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $cffv_ct = mysql_num_rows($rslt); - if ($cffv_ct > 0) - { - $custom_field_values='----------'; - $row=mysql_fetch_row($rslt); - $d=0; - while ($cffn_ct > $d) - { - $custom_field_values .= "$row[$d]----------"; - $d++; - } - $custom_field_values = preg_replace("/\n/"," ",$custom_field_values); - $custom_field_values = preg_replace("/\r/","",$custom_field_values); - } - } - } ##### check if system is set to generate logfile for transfers $stmt="SELECT enable_agc_xfer_log FROM system_settings;"; $rslt=mysql_query($stmt, $link); @@ -2769,6 +2678,100 @@ if ($ACTION == 'manDiaLnextCaLL') } + ##### find if script contains recording fields + $stmt="SELECT count(*) FROM vicidial_lists WHERE list_id='$list_id' and agent_script_override!='' and agent_script_override IS NOT NULL and agent_script_override!='NONE';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00259',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vls_vc_ct = mysql_num_rows($rslt); + if ($vls_vc_ct > 0) + { + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $script_recording_delay=0; + ##### find if script contains recording fields + $stmt="SELECT count(*) FROM vicidial_scripts vs,vicidial_lists vls WHERE list_id='$list_id' and vs.script_id=vls.agent_script_override and script_text LIKE \"%--A--recording_%\";"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00260',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vs_vc_ct = mysql_num_rows($rslt); + if ($vs_vc_ct > 0) + { + $row=mysql_fetch_row($rslt); + $script_recording_delay = $row[0]; + } + } + } + + if (strlen($list_id)>0) + { + $stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIG_preset_ct = mysql_num_rows($rslt); + if ($VDIG_preset_ct > 0) + { + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$VDCL_xferconf_a_number = $row[0];} + if (strlen($row[1]) > 0) + {$VDCL_xferconf_b_number = $row[1];} + if (strlen($row[2]) > 0) + {$VDCL_xferconf_c_number = $row[2];} + if (strlen($row[3]) > 0) + {$VDCL_xferconf_d_number = $row[3];} + if (strlen($row[4]) > 0) + {$VDCL_xferconf_e_number = $row[4];} + } + + $custom_field_names='|'; + $custom_field_names_SQL=''; + $custom_field_values='----------'; + $custom_field_types='|'; + ### find the names of all custom fields, if any + $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('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','called_count','last_local_call_time','rank','owner');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffn_ct = mysql_num_rows($rslt); + $d=0; + while ($cffn_ct > $d) + { + $row=mysql_fetch_row($rslt); + $custom_field_names .= "$row[0]|"; + $custom_field_names_SQL .= "$row[0],"; + $custom_field_types .= "$row[1]|"; + $custom_field_values .= "----------"; + $d++; + } + if ($cffn_ct > 0) + { + $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL); + ### find the values of the named custom fields + $stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00335',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffv_ct = mysql_num_rows($rslt); + if ($cffv_ct > 0) + { + $custom_field_values='----------'; + $row=mysql_fetch_row($rslt); + $d=0; + while ($cffn_ct > $d) + { + $custom_field_values .= "$row[$d]----------"; + $d++; + } + $custom_field_values = preg_replace("/\n/"," ",$custom_field_values); + $custom_field_values = preg_replace("/\r/","",$custom_field_values); + } + } + } + + $comments = eregi_replace("\r",'',$comments); $comments = eregi_replace("\n",'!N',$comments); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 6f9ecbcb..0f6adb67 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -386,10 +386,11 @@ # 120914-1357 - Added group_alias to transfer_conference function # 121025-2335 - Do not allow AGENTDIRECT transfers without a user defined # 121029-0122 - Added pause_after_next_call and owner_populate campaign options +# 121114-1759 - Fixed manual dial lead preview script variable issue # -$version = '2.6-354c'; -$build = '121029-0122'; +$version = '2.6-355c'; +$build = '121114-1759'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $one_mysql_log=0; @@ -6970,6 +6971,16 @@ function set_length(SLnumber,SLlength_goal,SLdirection) } else { + if (custom_fields_enabled > 0) + { + FormContentsLoad(); + } + if ( (view_scripts == 1) && (campaign_script.length > 0) ) + { + var SCRIPT_web_form = 'http://127.0.0.1/testing.php'; + var TEMP_SCRIPT_web_form = URLDecode(SCRIPT_web_form,'YES','DEFAULT','1'); + RefresHScript(); + } reselect_preview_dial = 1; } } @@ -7121,6 +7132,8 @@ function set_length(SLnumber,SLlength_goal,SLdirection) agent_dialed_number=''; agent_dialed_type=''; CalL_ScripT_id=''; + RefresHScript('CLEAR'); + // document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=&list_id=&stage=WELCOME'; } } } diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 48f2ac41..6cefa6a4 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -33315,6 +33315,7 @@ if ($ADD==999994) echo "
| \n"; +echo "\n"; +echo " Lead Tools\n"; +echo "\n"; +echo " | \n"; +echo "\n"; +echo " |
| \n";
+
+# move confirmation page
+if ($move_submit == "move" )
+ {
+ # get the variables
+ $move_from_list="";
+ $move_to_list="";
+ $move_status="";
+ $move_count_op="";
+ $move_count_num="";
+
+
+ if (isset($_GET["move_from_list"])) {$move_from_list=$_GET["move_from_list"];}
+ elseif (isset($_POST["move_from_list"])) {$move_from_list=$_POST["move_from_list"];}
+ if (isset($_GET["move_to_list"])) {$move_to_list=$_GET["move_to_list"];}
+ elseif (isset($_POST["move_to_list"])) {$move_to_list=$_POST["move_to_list"];}
+ if (isset($_GET["move_status"])) {$move_status=$_GET["move_status"];}
+ elseif (isset($_POST["move_status"])) {$move_status=$_POST["move_status"];}
+ if (isset($_GET["move_count_op"])) {$move_count_op=$_GET["move_count_op"];}
+ elseif (isset($_POST["move_count_op"])) {$move_count_op=$_POST["move_count_op"];}
+ if (isset($_GET["move_count_num"])) {$move_count_num=$_GET["move_count_num"];}
+ elseif (isset($_POST["move_count_num"])) {$move_count_num=$_POST["move_count_num"];}
+
+ $move_status = ereg_replace("[^-_0-9a-zA-Z]","",$move_status);
+ $move_from_list = ereg_replace("[^0-9]","",$move_from_list);
+ $move_to_list = ereg_replace("[^0-9]","",$move_to_list);
+ $move_count_num = ereg_replace("[^0-9]","",$move_count_num);
+ $move_count_op = ereg_replace("[^<>=]","",$move_count_op);
+
+
+ $move_count_op_phrase="";
+ if ( $move_count_op == "<" )
+ {
+ $move_count_op_phrase= "less than ";
+ }
+ elseif ( $move_count_op == "<=" )
+ {
+ $move_count_op_phrase= "less than or equal to ";
+ }
+ elseif ( $move_count_op == ">" )
+ {
+ $move_count_op_phrase= "greater than ";
+ }
+ elseif ( $move_count_op == ">=" )
+ {
+ $move_count_op_phrase= "greater than or equal to ";
+ }
+
+ # get the number of leads this action will move
+ $move_lead_count=0;
+ $move_lead_count_stmt = "SELECT count(1) FROM vicidial_list WHERE list_id = '$move_from_list' and status = '$move_status' and called_count $move_count_op $move_count_num";
+ if ($DB) { echo "|$move_lead_count_stmt|\n"; }
+ $move_lead_count_rslt = mysql_query($move_lead_count_stmt, $link);
+ $move_lead_count_row = mysql_fetch_row($move_lead_count_rslt);
+ $move_lead_count = $move_lead_count_row[0];
+
+ # get the number of leads in the list this action will move to
+ $to_list_lead_count=0;
+ $to_list_lead_stmt = "SELECT count(1) FROM vicidial_list WHERE list_id = '$move_to_list'";
+ if ($DB) { echo "|$to_list_lead_stmt|\n"; }
+ $to_list_lead_rslt = mysql_query($to_list_lead_stmt, $link);
+ $to_list_lead_row = mysql_fetch_row($to_list_lead_rslt);
+ $to_list_lead_count = $to_list_lead_row[0];
+
+ # check to see if we will exceed list_lead_limit in the move to list
+ if ( $to_list_lead_count + $move_lead_count > $list_lead_limit )
+ {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo " Sorry. This operation will cause list $move_to_list to exceed $list_lead_limit leads which is not allowed. \n"; + echo "\n"; + echo "\n\n"; + } + else + { + echo "You are about to move $move_lead_count leads from list $move_from_list to $move_to_list with the status $move_status and that were called $move_count_op_phrase$move_count_num times. Please press confirm to continue. \n"; + echo "$move_sentence "; + echo "\n"; + } + + +# update confirmation page +if ($update_submit == "update" ) + { + # get the variables + $update_list=""; + $update_from_status=""; + $update_to_status=""; + $update_count_op=""; + $update_count_num=""; + + if (isset($_GET["update_list"])) {$update_list=$_GET["update_list"];} + elseif (isset($_POST["update_list"])) {$update_list=$_POST["update_list"];} + if (isset($_GET["update_from_status"])) {$update_from_status=$_GET["update_from_status"];} + elseif (isset($_POST["update_from_status"])) {$update_from_status=$_POST["update_from_status"];} + if (isset($_GET["update_to_status"])) {$update_to_status=$_GET["update_to_status"];} + elseif (isset($_POST["update_to_status"])) {$update_to_status=$_POST["update_to_status"];} + if (isset($_GET["update_count_op"])) {$update_count_op=$_GET["update_count_op"];} + elseif (isset($_POST["update_count_op"])) {$update_count_op=$_POST["update_count_op"];} + if (isset($_GET["update_count_num"])) {$update_count_num=$_GET["update_count_num"];} + elseif (isset($_POST["update_count_num"])) {$update_count_num=$_POST["update_count_num"];} + + $update_from_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_from_status); + $update_to_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_to_status); + $update_list = ereg_replace("[^0-9]","",$update_list); + $update_count_num = ereg_replace("[^0-9]","",$update_count_num); + $update_count_op = ereg_replace("[^<>=]","",$update_count_op); + + $update_count_op_phrase=""; + if ( $update_count_op == "<" ) + { + $update_count_op_phrase= "less than "; + } + elseif ( $update_count_op == "<=" ) + { + $update_count_op_phrase= "less than or equal to "; + } + elseif ( $update_count_op == ">" ) + { + $update_count_op_phrase= "greater than "; + } + elseif ( $update_count_op == ">=" ) + { + $update_count_op_phrase= "greater than or equal to "; + } + + # get the number of leads this action will move + $update_lead_count=0; + $update_lead_count_stmt = "SELECT count(1) FROM vicidial_list WHERE list_id = '$update_list' and status = '$update_from_status' and called_count $update_count_op $update_count_num"; + if ($DB) { echo "|$update_lead_count_stmt|\n"; } + $update_lead_count_rslt = mysql_query($update_lead_count_stmt, $link); + $update_lead_count_row = mysql_fetch_row($update_lead_count_rslt); + $update_lead_count = $update_lead_count_row[0]; + + echo "You are about to update $update_lead_count leads in list $update_list from the status $update_from_status to the status $update_to_status that were called $update_count_op_phrase$update_count_num times. Please press confirm to continue. \n"; + echo " | |