Added Custom List Fields functions to the Admin and Agent web interfaces. To activate you need to enable custom fields in system settings, then you can go to the Lists section to add custom fields to a list. The fields are tied to a list, not a campaign, and they can be displayed in a new tab in the agent interface, and there is a new option to have the Get Call Launch open this custom fields tab upon a call being sent to the agent. Also, the Calls Export Report and the List Download feature include the custom fields values for the leads exported. There is currently no way to import data through the lead loader into custom fields.

git-svn-id: svn://192.168.202.10@1462 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2010-07-02 19:59:28 +00:00
parent 9d12742228
commit f1a40d059f
16 changed files with 1150 additions and 88 deletions
+10
View File
@@ -173,6 +173,16 @@ OTHER CHANGES:
42. Added new code to help deal with agents on poor network connections. New
vicidial.php option is $conf_check_attempts
43. Added Custom List Fields functions to the Admin and Agent web interfaces.
To activate you need to enable custom fields in system settings, then
you can go to the Lists section to add custom fields to a list. The
fields are tied to a list, not a campaign, and they can be displayed
in a new tab in the agent interface, and there is a new option to have
the Get Call Launch open this custom fields tab upon a call being sent
to the agent. Also, the Calls Export Report and the List Download
feature include the custom fields values for the leads exported. There
is currently no way to import data through the lead loader into custom
fields.
@@ -625,7 +625,7 @@ campaign_rec_exten VARCHAR(20) default '8309',
campaign_recording ENUM('NEVER','ONDEMAND','ALLCALLS','ALLFORCE') default 'ONDEMAND',
campaign_rec_filename VARCHAR(50) default 'FULLDATE_CUSTPHONE',
campaign_script VARCHAR(10),
get_call_launch ENUM('NONE','SCRIPT','WEBFORM') default 'NONE',
get_call_launch ENUM('NONE','SCRIPT','WEBFORM','WEBFORMTWO','FORM') default 'NONE',
am_message_exten VARCHAR(100) default 'vm-goodbye',
amd_send_to_vmx ENUM('Y','N') default 'N',
xferconf_a_dtmf VARCHAR(50),
@@ -841,7 +841,7 @@ voicemail_ext VARCHAR(10),
next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level','inbound_group_rank','campaign_rank','fewest_calls','fewest_calls_campaign','longest_wait_time') default 'longest_wait_time',
fronter_display ENUM('Y','N') default 'Y',
ingroup_script VARCHAR(10),
get_call_launch ENUM('NONE','SCRIPT','WEBFORM') default 'NONE',
get_call_launch ENUM('NONE','SCRIPT','WEBFORM','WEBFORMTWO','FORM') default 'NONE',
xferconf_a_dtmf VARCHAR(50),
xferconf_a_number VARCHAR(50),
xferconf_b_dtmf VARCHAR(50),
@@ -2269,7 +2269,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
UPDATE system_settings SET db_schema_version='1230',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1231',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+6
View File
@@ -393,3 +393,9 @@ UPDATE system_settings SET db_schema_version='1229',db_schema_update_date=NOW();
ALTER TABLE vicidial_lists_fields MODIFY field_type ENUM('TEXT','AREA','SELECT','MULTI','RADIO','CHECKBOX','DATE','TIME','DISPLAY','SCRIPT') default 'TEXT';
UPDATE system_settings SET db_schema_version='1230',db_schema_update_date=NOW();
ALTER TABLE vicidial_campaigns MODIFY get_call_launch ENUM('NONE','SCRIPT','WEBFORM','WEBFORMTWO','FORM') default 'NONE';
ALTER TABLE vicidial_inbound_groups MODIFY get_call_launch ENUM('NONE','SCRIPT','WEBFORM','WEBFORMTWO','FORM') default 'NONE';
UPDATE system_settings SET db_schema_version='1231',db_schema_update_date=NOW();
@@ -242,6 +242,10 @@ Registration Password||
Login Password||
The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registration Password in the next field||
SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does||
You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are||
If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent||
Enable Custom List Fields||
This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled||
AST_VICIDIAL_ingrouplist.php
+502
View File
@@ -0,0 +1,502 @@
<?php
#
# functions.php version 2.4
#
# functions for agent scripts
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
#
# CHANGES:
# 100629-1201 - First Build
#
##### BEGIN gather values for display of custom list fields for a lead #####
function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
{
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$vicidial_list_fields = '|lead_id|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|';
require("dbconnect.php");
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05002',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$list_id;";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05003',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysql_num_rows($rslt);
if ($fieldscount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_records_count = $rowx[0];
$select_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05004',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_description[$o] = $rowx[3];
$A_field_rank[$o] = $rowx[4];
$A_field_help[$o] = $rowx[5];
$A_field_type[$o] = $rowx[6];
$A_field_options[$o] = $rowx[7];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_default[$o] = $rowx[10];
$A_field_cost[$o] = $rowx[11];
$A_field_required[$o] = $rowx[12];
$A_multi_position[$o] = $rowx[13];
$A_name_position[$o] = $rowx[14];
$A_field_order[$o] = $rowx[15];
$A_field_value[$o] = '';
if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$select_SQL .= "8,";
$A_field_select[$o]='----EMPTY----';
}
else
{
$select_SQL .= "$A_field_label[$o],";
$A_field_select[$o]=$A_field_label[$o];
}
}
else
{$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';}
$o++;
$rank_select .= "<option>$o</option>";
}
$o++;
$rank_select .= "<option>$o</option>";
$last_rank = $o;
$select_SQL = preg_replace("/.$/",'',$select_SQL);
##### BEGIN grab the data from custom table for the lead_id
$stmt="SELECT $select_SQL FROM custom_$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,'05005',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$o=0;
while ($fields_to_print > $o)
{
$A_field_value[$o] = trim("$row[$o]");
if ($A_field_select[$o]=='----EMPTY----')
{$A_field_value[$o]='';}
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';}
$o++;
}
}
else
{
if ($DB) {echo "ERROR: no custom data for this lead: $lead_id\n";}
}
##### END grab the data from custom table for the lead_id
$CFoutput .= "<input type=hidden name=stage id=stage value=\"SUBMIT\">\n";
$CFoutput .= "<center><TABLE cellspacing=2 cellpadding=2>\n";
if ($fields_to_print < 1)
{$CFoutput .= "<tr bgcolor=white align=center><td colspan=4><font size=1>There are no custom fields for this list</td></tr>";}
$o=0;
$last_field_rank=0;
while ($fields_to_print > $o)
{
$helpHTML='';
if (strlen($A_field_help[$o])>0)
{$helpHTML="&nbsp; <a href=\"javascript:open_help('HELP_$A_field_label[$o]','$A_field_help[$o]');\">help+</a>";}
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp; &nbsp; &nbsp; &nbsp; ";}
else
{
$CFoutput .= "</td></tr>\n";
$CFoutput .= "<tr bgcolor=white><td align=";
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= "left colspan=2";}
else
{$CFoutput .= "right";}
$CFoutput .= "><font size=2>";
}
if ($A_field_type[$o]!='SCRIPT')
{$CFoutput .= "<B>$A_field_name[$o]</B>";}
if ( ($A_name_position[$o]=='TOP') or ($A_field_type[$o]=='SCRIPT') )
{$CFoutput .= " &nbsp; <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span><BR>";}
else
{
if ($last_field_rank=="$A_field_rank[$o]")
{$CFoutput .= " &nbsp;";}
else
{$CFoutput .= "</td><td align=left><font size=2>";}
}
$field_HTML='';
if ($A_field_type[$o]=='SELECT')
{
$field_HTML .= "<select size=1 name=$A_field_label[$o] id=$A_field_label[$o]>\n";
}
if ($A_field_type[$o]=='MULTI')
{
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o][] id=$A_field_label[$o][]>\n";
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
$field_options_array = explode("\n",$A_field_options[$o]);
$field_options_count = count($field_options_array);
$te=0;
while ($te < $field_options_count)
{
if (preg_match("/,/",$field_options_array[$te]))
{
$field_selected='';
$field_options_value_array = explode(",",$field_options_array[$te]);
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'SELECTED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';}
}
$field_HTML .= "<option value=\"$field_options_value_array[0]\" $field_selected>$field_options_value_array[1]</option>\n";
}
if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= " &nbsp; ";}
if (strlen($A_field_value[$o]) > 0)
{
if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o]))
{$field_selected = 'CHECKED';}
}
else
{
if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';}
}
$field_HTML .= "<input type=$A_field_type[$o] name=$A_field_label[$o][] id=$A_field_label[$o][] value=\"$field_options_value_array[0]\" $field_selected> $field_options_value_array[1]\n";
if ($A_multi_position[$o]=='VERTICAL')
{$field_HTML .= "<BR>\n";}
}
}
$te++;
}
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') )
{
$field_HTML .= "</select>\n";
}
if ($A_field_type[$o]=='TEXT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<input type=text size=$A_field_size[$o] maxlength=$A_field_max[$o] name=$A_field_label[$o] id=$A_field_label[$o] value=\"$A_field_value[$o]\">\n";
}
if ($A_field_type[$o]=='AREA')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];}
$field_HTML .= "<textarea name=$A_field_label[$o] id=$A_field_label[$o] ROWS=$A_field_max[$o] COLS=$A_field_size[$o]>$A_field_value[$o]</textarea>";
}
if ($A_field_type[$o]=='DISPLAY')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_default[$o]\n";
}
if ($A_field_type[$o]=='SCRIPT')
{
if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';}
$field_HTML .= "$A_field_options[$o]\n";
}
if ($A_field_type[$o]=='DATE')
{
if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;}
$day_diff = $A_field_default[$o];
$default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y")));
if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $default_date;}
$field_HTML .= "<input type=text size=11 maxlength=10 name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_date\" onclick=\"f_tcalToggle()\">\n";
$field_HTML .= "<script language=\"JavaScript\">\n";
$field_HTML .= "var o_cal = new tcal ({\n";
$field_HTML .= " 'formname': 'form_custom_fields',\n";
$field_HTML .= " 'controlname': '$A_field_label[$o]'});\n";
$field_HTML .= "o_cal.a_tpl.yearscroll = false;\n";
$field_HTML .= "</script>\n";
}
if ($A_field_type[$o]=='TIME')
{
$minute_diff = $A_field_default[$o];
$default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
$default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y")));
if (strlen($A_field_value[$o]) > 2)
{
$default_time = $A_field_value[$o];
$time_field_value = explode(':',$default_time);
$default_hour = $time_field_value[0];
$default_minute = $time_field_value[1];
}
$field_HTML .= "<input type=hidden name=$A_field_label[$o] id=$A_field_label[$o] value=\"$default_time\">";
$field_HTML .= "<SELECT name=HOUR_$A_field_label[$o] id=HOUR_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>01</option>";
$field_HTML .= "<option>02</option>";
$field_HTML .= "<option>03</option>";
$field_HTML .= "<option>04</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>06</option>";
$field_HTML .= "<option>07</option>";
$field_HTML .= "<option>08</option>";
$field_HTML .= "<option>09</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>11</option>";
$field_HTML .= "<option>12</option>";
$field_HTML .= "<option>13</option>";
$field_HTML .= "<option>14</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>16</option>";
$field_HTML .= "<option>17</option>";
$field_HTML .= "<option>18</option>";
$field_HTML .= "<option>19</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>21</option>";
$field_HTML .= "<option>22</option>";
$field_HTML .= "<option>23</option>";
$field_HTML .= "<OPTION value=\"$default_hour\" selected>$default_hour</OPTION>";
$field_HTML .= "</SELECT>";
$field_HTML .= "<SELECT name=MINUTE_$A_field_label[$o] id=MINUTE_$A_field_label[$o]>";
$field_HTML .= "<option>00</option>";
$field_HTML .= "<option>05</option>";
$field_HTML .= "<option>10</option>";
$field_HTML .= "<option>15</option>";
$field_HTML .= "<option>20</option>";
$field_HTML .= "<option>25</option>";
$field_HTML .= "<option>30</option>";
$field_HTML .= "<option>35</option>";
$field_HTML .= "<option>40</option>";
$field_HTML .= "<option>45</option>";
$field_HTML .= "<option>50</option>";
$field_HTML .= "<option>55</option>";
$field_HTML .= "<OPTION value=\"$default_minute\" selected>$default_minute</OPTION>";
$field_HTML .= "</SELECT>";
}
if ( ($A_name_position[$o]=='LEFT') and ($A_field_type[$o]!='SCRIPT') )
{
$CFoutput .= " $field_HTML <span style=\"position:static;\" id=P_HELP_$A_field_label[$o]></span><span style=\"position:static;background:white;\" id=HELP_$A_field_label[$o]> $helpHTML</span>";
}
else
{
$CFoutput .= " $field_HTML\n";
}
$last_field_rank=$A_field_rank[$o];
$o++;
}
$CFoutput .= "</td></tr></table>\n";
}
else
{$CFoutput .= "ERROR: no custom list fields\n";}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
##### BEGIN parsing for vicidial variables #####
if (preg_match("/--A--/",$CFoutput))
{
if ( (eregi('--A--user_custom_',$CFoutput)) or (eregi('--A--fullname',$CFoutput)) )
{
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05006',$user,$server_ip,$session_name,$one_mysql_log);}
$VUC_ct = mysql_num_rows($rslt);
if ($VUC_ct > 0)
{
$row=mysql_fetch_row($rslt);
$user_custom_one = trim($row[0]);
$user_custom_two = trim($row[1]);
$user_custom_three = trim($row[2]);
$user_custom_four = trim($row[3]);
$user_custom_five = trim($row[4]);
$fullname = trim($row[5]);
}
}
if (eregi('--A--dialed_',$CFoutput))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
### find the dialed number and label for this call
$stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05008',$user,$server_ip,$session_name,$one_mysql_log);}
$vl_dialed_ct = mysql_num_rows($rslt);
if ($vl_dialed_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dialed_number = $row[0];
$dialed_label = $row[1];
}
}
##### grab the data from vicidial_list for the lead_id
$stmt="SELECT lead_id,entry_date,modify_date,status,user,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 FROM vicidial_list where lead_id='$lead_id' LIMIT 1;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05007',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$list_lead_ct = mysql_num_rows($rslt);
if ($list_lead_ct > 0)
{
$row=mysql_fetch_row($rslt);
$dispo = trim($row[3]);
$tsr = trim($row[4]);
$vendor_id = trim($row[5]);
$vendor_lead_code = trim($row[5]);
$source_id = trim($row[6]);
$list_id = trim($row[7]);
$gmt_offset_now = trim($row[8]);
$phone_code = trim($row[10]);
$phone_number = trim($row[11]);
$title = trim($row[12]);
$first_name = trim($row[13]);
$middle_initial = trim($row[14]);
$last_name = trim($row[15]);
$address1 = trim($row[16]);
$address2 = trim($row[17]);
$address3 = trim($row[18]);
$city = trim($row[19]);
$state = trim($row[20]);
$province = trim($row[21]);
$postal_code = trim($row[22]);
$country_code = trim($row[23]);
$gender = trim($row[24]);
$date_of_birth = trim($row[25]);
$alt_phone = trim($row[26]);
$email = trim($row[27]);
$security = trim($row[28]);
$comments = trim($row[29]);
$called_count = trim($row[30]);
$rank = trim($row[32]);
$owner = trim($row[33]);
}
$CFoutput = eregi_replace('--A--lead_id--B--',"$lead_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_id--B--',"$vendor_id",$CFoutput);
$CFoutput = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$CFoutput);
$CFoutput = eregi_replace('--A--list_id--B--',"$list_id",$CFoutput);
$CFoutput = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$CFoutput);
$CFoutput = eregi_replace('--A--phone_code--B--',"$phone_code",$CFoutput);
$CFoutput = eregi_replace('--A--phone_number--B--',"$phone_number",$CFoutput);
$CFoutput = eregi_replace('--A--title--B--',"$title",$CFoutput);
$CFoutput = eregi_replace('--A--first_name--B--',"$first_name",$CFoutput);
$CFoutput = eregi_replace('--A--middle_initial--B--',"$middle_initial",$CFoutput);
$CFoutput = eregi_replace('--A--last_name--B--',"$last_name",$CFoutput);
$CFoutput = eregi_replace('--A--address1--B--',"$address1",$CFoutput);
$CFoutput = eregi_replace('--A--address2--B--',"$address2",$CFoutput);
$CFoutput = eregi_replace('--A--address3--B--',"$address3",$CFoutput);
$CFoutput = eregi_replace('--A--city--B--',"$city",$CFoutput);
$CFoutput = eregi_replace('--A--state--B--',"$state",$CFoutput);
$CFoutput = eregi_replace('--A--province--B--',"$province",$CFoutput);
$CFoutput = eregi_replace('--A--postal_code--B--',"$postal_code",$CFoutput);
$CFoutput = eregi_replace('--A--country_code--B--',"$country_code",$CFoutput);
$CFoutput = eregi_replace('--A--gender--B--',"$gender",$CFoutput);
$CFoutput = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$CFoutput);
$CFoutput = eregi_replace('--A--alt_phone--B--',"$alt_phone",$CFoutput);
$CFoutput = eregi_replace('--A--email--B--',"$email",$CFoutput);
$CFoutput = eregi_replace('--A--security_phrase--B--',"$security_phrase",$CFoutput);
$CFoutput = eregi_replace('--A--comments--B--',"$comments",$CFoutput);
$CFoutput = eregi_replace('--A--user--B--',"$user",$CFoutput);
$CFoutput = eregi_replace('--A--pass--B--',"$pass",$CFoutput);
$CFoutput = eregi_replace('--A--campaign--B--',"$campaign",$CFoutput);
$CFoutput = eregi_replace('--A--server_ip--B--',"$server_ip",$CFoutput);
$CFoutput = eregi_replace('--A--session_id--B--',"$session_id",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_number--B--',"$dialed_number",$CFoutput);
$CFoutput = eregi_replace('--A--dialed_label--B--',"$dialed_label",$CFoutput);
$CFoutput = eregi_replace('--A--source_id--B--',"$source_id",$CFoutput);
$CFoutput = eregi_replace('--A--rank--B--',"$rank",$CFoutput);
$CFoutput = eregi_replace('--A--owner--B--',"$owner",$CFoutput);
$CFoutput = eregi_replace('--A--fullname--B--',"$fullname",$CFoutput);
$CFoutput = eregi_replace('--A--uniqueid--B--',"$uniqueid",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput);
$CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput);
# custom fields replacement
$o=0;
while ($fields_to_print > $o)
{
$CFoutput = eregi_replace("--A--$A_field_label[$o]--B--","$A_field_value[$o]",$CFoutput);
$o++;
}
if ($DB > 0) {echo "$CFoutput<BR>\n";}
}
##### END parsing for vicidial variables #####
return $CFoutput;
}
##### END gather values for display of custom list fields for a lead #####
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 916 B

After

Width:  |  Height:  |  Size: 1.5 KiB

+319
View File
@@ -0,0 +1,319 @@
<?php
# vdc_form_display.php
#
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of the FORM tab in the agent
# interface, as well as take submission of the form submission when the agent
# dispositions the call
#
# CHANGELOG:
# 100630-1119 - First build of script
#
$version = '2.4-1';
$build = '100630-1119';
require("dbconnect.php");
require("functions.php");
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
$script_height = ($script_height - 20);
$vicidial_list_fields = '|lead_id|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|';
$IFRAME=0;
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
$length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
$phone_code = ereg_replace("[^0-9]","",$phone_code);
$phone_number = ereg_replace("[^0-9]","",$phone_number);
}
else
{
$user = ereg_replace("'|\"|\\\\|;","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
}
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VUmodify=$row[0];
$stmt="SELECT count(*) from vicidial_live_agents where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$LVAactive=$row[0];
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) )
{
echo "Invalid Username/Password: |$user|$pass|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
exit;
}
else
{
# do nothing for now
}
### BEGIN parse submission of the custom fields form ###
if ($stage=='SUBMIT')
{
$CFoutput='';
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06001',$user,$server_ip,$session_name,$one_mysql_log);}
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt="SELECT count(*) from custom_$list_id;";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06002',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldscount_to_print = mysql_num_rows($rslt);
if ($fieldscount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_records_count = $rowx[0];
$update_SQL='';
$VL_update_SQL='';
$stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06003',$user,$server_ip,$session_name,$one_mysql_log);}
$fields_to_print = mysql_num_rows($rslt);
$fields_list='';
$o=0;
while ($fields_to_print > $o)
{
$new_field_value='';
$form_field_value='';
$rowx=mysql_fetch_row($rslt);
$A_field_id[$o] = $rowx[0];
$A_field_label[$o] = $rowx[1];
$A_field_name[$o] = $rowx[2];
$A_field_type[$o] = $rowx[6];
$A_field_size[$o] = $rowx[8];
$A_field_max[$o] = $rowx[9];
$A_field_required[$o] = $rowx[12];
$A_field_value[$o] = '';
$field_name_id = $A_field_label[$o];
if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];}
elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];}
if ( ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='RADIO') )
{
$k=0;
$multi_count = count($form_field_value);
$multi_array = $form_field_value;
while ($k < $multi_count)
{
$new_field_value .= "$multi_array[$k],";
$k++;
}
$form_field_value = preg_replace("/,$/","",$new_field_value);
}
if ($A_field_type[$o]=='TIME')
{
if (isset($_GET["MINUTE_$field_name_id"])) {$form_field_valueM=$_GET["MINUTE_$field_name_id"];}
elseif (isset($_POST["MINUTE_$field_name_id"])) {$form_field_valueM=$_POST["MINUTE_$field_name_id"];}
if (isset($_GET["HOUR_$field_name_id"])) {$form_field_valueH=$_GET["HOUR_$field_name_id"];}
elseif (isset($_POST["HOUR_$field_name_id"])) {$form_field_valueH=$_POST["HOUR_$field_name_id"];}
$form_field_value = "$form_field_valueH:$form_field_valueM:00";
}
$A_field_value[$o] = $form_field_value;
if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') )
{
$A_field_value[$o]='----IGNORE----';
}
else
{
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$VL_update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
else
{
$update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
}
$SUBMIT_output .= "<b>$A_field_name[$o]:</b> $A_field_value[$o]<BR>";
}
$o++;
}
if (strlen($VL_update_SQL)>3)
{
$VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL);
$list_table_update_SQL = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$lead_id';";
$rslt=mysql_query($list_table_update_SQL, $link);
$list_update_count = mysql_affected_rows($link);
if ($DB) {echo "$field_update|$list_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
if (strlen($update_SQL)>3)
{
$custom_record_lead_count=0;
$stmt="SELECT count(*) from custom_$list_id where lead_id='$lead_id';";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06004',$user,$server_ip,$session_name,$one_mysql_log);}
$fieldleadcount_to_print = mysql_num_rows($rslt);
if ($fieldleadcount_to_print > 0)
{
$rowx=mysql_fetch_row($rslt);
$custom_record_lead_count = $rowx[0];
}
$update_SQL = preg_replace("/,$/","",$update_SQL);
$custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$update_SQL;";
if ($custom_record_lead_count > 0)
{$custom_table_update_SQL = "UPDATE custom_$list_id SET $update_SQL where lead_id='$lead_id';";}
$rslt=mysql_query($custom_table_update_SQL, $link);
$custom_update_count = mysql_affected_rows($link);
if ($DB) {echo "$field_update|$custom_table_update_SQL\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
# echo "$list_update_count|$list_table_update_SQL\n<BR>\n$custom_update_count|$custom_table_update_SQL<BR>\n";
}
else
{$CFoutput .= "ERROR: no custom list fields\n";}
}
else
{$CFoutput .= "ERROR: no custom list fields table\n";}
echo "Custom Form Output:\n<BR>\n";
echo "$SUBMIT_output";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n";
}
### END parse submission of the custom fields form ###
else
{
echo "<html>\n";
echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build USER: $user server_ip: $server_ip-->\n";
echo "<title>ViciDiaL Form Display Script";
echo "</title>\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo " <link rel=\"stylesheet\" href=\"calendar.css\">\n";
echo " <script language=\"Javascript\">\n";
echo " function open_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:close_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help-</a><BR> &nbsp; \";\n";
echo " document.getElementById(taskspan).innerHTML = \"<B>\" + taskhelp + \"</B>\";\n";
echo " document.getElementById(taskspan).style.background = \"#FFFF99\";\n";
echo " }\n";
echo " function close_help(taskspan,taskhelp) \n";
echo " {\n";
echo " document.getElementById(\"P_\" + taskspan).innerHTML = \"\";\n";
echo " document.getElementById(taskspan).innerHTML = \" &nbsp; <a href=\\\"javascript:open_help('\" + taskspan + \"','\" + taskhelp + \"');\\\">help+</a>\";\n";
echo " document.getElementById(taskspan).style.background = \"white\";\n";
echo " }\n";
echo " </script>\n";
echo " <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=lead_id id=lead_id value=\"$lead_id\">\n";
echo "<input type=hidden name=list_id id=list_id value=\"$list_id\">\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "<input type=hidden name=pass id=pass value=\"$pass\">\n";
echo "\n";
require("functions.php");
$CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user);
echo "$CFoutput";
# echo "<BR><BR><BR><BR><input type=submit name=VCformSubmit id=VCformSubmit value=submit>\n";
echo "</form></center><BR><BR>\n";
echo "</BODY></HTML>\n";
}
exit;
?>
+72 -26
View File
@@ -298,15 +298,18 @@
# 100616-1622 - Allowed longer manual dial numbers
# 100622-2209 - Added field labels
# 100625-1118 - Added poor-network-connection-mitigating code
# 100629-1158 - Added initial code for custom list fields
# 100702-1315 - Custom List Fields functionality enabled
#
$version = '2.4-276';
$build = '100625-1118';
$version = '2.4-278';
$build = '100702-1315';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=66;
$one_mysql_log=0;
require("dbconnect.php");
require("functions.php");
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
@@ -383,7 +386,7 @@ $random = (rand(1000000, 9999999) + 10000000);
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url FROM system_settings;";
$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -403,6 +406,7 @@ if ($qm_conf_ct > 0)
$enable_second_webform = $row[9];
$user_territories_active = $row[10];
$static_agent_url = $row[11];
$custom_fields_enabled = $row[12];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -454,6 +458,7 @@ else
$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770
$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6
$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0
$FORM_COLOR = '#EFEFEF';
$SIDEBAR_COLOR = '#F6F6F6';
}
@@ -2980,6 +2985,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var api_transferconf_override='';
var api_parkcustomer='';
var API_selected_xfergroup='';
var custom_fields_enabled='<?php echo $custom_fields_enabled ?>';
var form_contents_loaded=0;
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\" Pause \"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
@@ -6074,6 +6081,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
else
{
load_script_contents();
FormContentsLoad();
}
}
@@ -6086,6 +6094,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
ScriptPanelToFront();
}
if (get_call_launch == 'FORM')
{
FormPanelToFront();
}
if (get_call_launch == 'WEBFORM')
{
window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
@@ -6461,6 +6475,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
else
{
load_script_contents();
FormContentsLoad();
}
}
@@ -6472,6 +6487,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
ScriptPanelToFront();
}
if (get_call_launch == 'FORM')
{
FormPanelToFront();
}
if (get_call_launch == 'WEBFORM')
{
window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
@@ -7408,6 +7427,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
else
{
load_script_contents();
FormContentsLoad();
}
}
@@ -7419,6 +7439,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
ScriptPanelToFront();
}
if (CalL_AutO_LauncH == 'FORM')
{
FormPanelToFront();
}
if (CalL_AutO_LauncH == 'WEBFORM')
{
@@ -10150,6 +10174,14 @@ function phone_number_format(formatphone) {
}
// ################################################################################
// Refresh the FORM content
function FormContentsLoad()
{
document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + document.vicidial_form.list_id.value + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY';
}
// ################################################################################
// Move the Dispo frame out of the way and change the link to maximize
function DispoMinimize()
@@ -10430,6 +10462,8 @@ else
hideDiv('MainPanel');
hideDiv('ScriptPanel');
hideDiv('ScriptRefresH');
hideDiv('FormPanel');
hideDiv('FormRefresH');
hideDiv('DispoSelectBox');
hideDiv('LogouTBox');
hideDiv('AgenTDisablEBoX');
@@ -10627,6 +10661,13 @@ else
reselect_alt_dial = 0;
}
}
// Submit custom form if it is custom_fields_enabled
if (custom_fields_enabled > 0)
{
// alert("IFRAME submitting!");
vcFormIFrame.document.form_custom_fields.submit();
}
}
if (AgentDispoing > 0)
{
@@ -11182,6 +11223,8 @@ else
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $MAIN_COLOR ?>";
hideDiv('ScriptPanel');
hideDiv('ScriptRefresH');
hideDiv('FormPanel');
hideDiv('FormRefresH');
showDiv('MainPanel');
ShoWGenDerPulldown();
@@ -11228,6 +11271,8 @@ else
{
showDiv('ScriptPanel');
showDiv('ScriptRefresH');
hideDiv('FormPanel');
hideDiv('FormRefresH');
document.getElementById("MainTable").style.backgroundColor="<?php echo $SCRIPT_COLOR ?>";
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $SCRIPT_COLOR ?>";
panel_bgcolor='<?php echo $SCRIPT_COLOR ?>';
@@ -11236,6 +11281,18 @@ else
HidEGenDerPulldown();
}
function FormPanelToFront()
{
showDiv('FormPanel');
showDiv('FormRefresH');
document.getElementById("MainTable").style.backgroundColor="<?php echo $FORM_COLOR ?>";
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $FORM_COLOR ?>";
panel_bgcolor='<?php echo $FORM_COLOR ?>';
document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
HidEGenDerPulldown();
}
function HidEGenDerPulldown()
{
var gIndex = 0;
@@ -11323,7 +11380,10 @@ $zi=1;
<TABLE border=0 bgcolor="#FFFFFF" width=<?php echo $MNwidth ?> height=30>
<TR VALIGN=TOP ALIGN=LEFT>
<TD ALIGN=LEFT WIDTH=115><A HREF="#" onclick="MainPanelToFront('NO');"><IMG SRC="./images/vdc_tab_vicidial.gif" ALT="MAIN" WIDTH=115 HEIGHT=30 BORDER=0></A></TD>
<TD ALIGN=LEFT WIDTH=105><A HREF="#" onclick="ScriptPanelToFront();"><IMG SRC="./images/vdc_tab_script.gif" ALT="SCRIPT" WIDTH=105 HEIGHT=30 BORDER=0></A></TD>
<TD ALIGN=LEFT WIDTH=90><A HREF="#" onclick="ScriptPanelToFront();"><IMG SRC="./images/vdc_tab_script.gif" ALT="SCRIPT" WIDTH=90 HEIGHT=30 BORDER=0></A></TD>
<?php if ($custom_fields_enabled > 0)
{echo "<TD ALIGN=LEFT WIDTH=67><A HREF=\"#\" onclick=\"FormPanelToFront();\"><IMG SRC=\"./images/vdc_tab_form.gif\" ALT=\"FORM\" WIDTH=67 HEIGHT=30 BORDER=0></A></TD>\n";}
?>
<TD WIDTH=<?php echo $HSwidth ?> VALIGN=MIDDLE ALIGN=CENTER><font class="body_text">&nbsp; <span id=status>LIVE</span>&nbsp; &nbsp;session ID: <span id=sessionIDspan></span>&nbsp; &nbsp;<span id=AgentStatusCalls></span></TD>
<TD WIDTH=109><IMG SRC="./images/agc_live_call_OFF.gif" NAME=livecall ALT="Live Call" WIDTH=109 HEIGHT=30 BORDER=0></TD>
</TR>
@@ -11610,6 +11670,14 @@ if ($agent_display_dialable_leads > 0)
<a href="#" onclick="RefresHScript()"><font class="body_small">refresh</font></a>
</span>
<span style="position:absolute;left:154px;top:65px;z-index:<?php $zi++; echo $zi ?>;" id="FormPanel">
<TABLE border=0 bgcolor="<?php echo $SCRIPT_COLOR ?>" width=<?php echo $SSwidth ?> height=<?php echo $SSheight ?>><TR><TD align=left valign=top><font class="sb_text"><div class="noscroll_script" id="FormContents"><iframe src="./vdc_form_display.php?lead_id=&list_id=&stage=DISPLAY" style="background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="vcFormIFrame" name="vcFormIFrame" width="<?php echo $SDwidth ?>" height="<?php echo $SSheight ?>" STYLE="z-index:18"> </iframe></div></font></TD></TR></TABLE>
</span>
<span style="position:absolute;left:<?php echo $AMwidth ?>px;top:69px;z-index:<?php $zi++; echo $zi ?>;" id="FormRefresH">
<a href="#" onclick="FormContentsLoad()"><font class="body_small">refresh</font></a>
</span>
<span style="position:absolute;left:157px;top:<?php echo $HTheight ?>px;z-index:<?php $zi++; echo $zi ?>;" id="TransferMain">
<TABLE bgcolor="#CCCCFF" width=<?php echo $SDwidth ?>>
@@ -12025,26 +12093,4 @@ Available Agents Transfer: <span id="AgentXferViewSelect"></span></CENTER></font
exit;
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?>
+34 -14
View File
@@ -1327,6 +1327,8 @@ if (isset($_GET["label_email"])) {$label_email=$_GET["label_email"];}
elseif (isset($_POST["label_email"])) {$label_email=$_POST["label_email"];}
if (isset($_GET["label_comments"])) {$label_comments=$_GET["label_comments"];}
elseif (isset($_POST["label_comments"])) {$label_comments=$_POST["label_comments"];}
if (isset($_GET["custom_fields_enabled"])) {$custom_fields_enabled=$_GET["custom_fields_enabled"];}
elseif (isset($_POST["custom_fields_enabled"])) {$custom_fields_enabled=$_POST["custom_fields_enabled"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -1542,6 +1544,7 @@ if ($non_latin < 1)
$hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum);
$onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds);
$hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds);
$custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled);
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
@@ -2317,11 +2320,12 @@ else
# 100616-2232 - Added VIDPROMPT call menu options
# 100621-1010 - Added admin_web_directory system setting
# 100622-1700 - Added custom agent field names for default fields
# 100702-1142 - Added FORM get_call_launch option for custom list fields tab in agent interface
#
# 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.4-259';
$build = '100622-1700';
$admin_version = '2.4-260';
$build = '100702-1142';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -4130,7 +4134,7 @@ if ($ADD==99999)
<BR>
<A NAME="vicidial_campaigns-get_call_launch">
<BR>
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign.
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
<BR>
<A NAME="vicidial_campaigns-xferconf_a_dtmf">
@@ -4551,7 +4555,7 @@ if ($ADD==99999)
<BR>
<A NAME="vicidial_inbound_groups-get_call_launch">
<BR>
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign.
<B>Get Call Launch -</B> This menu allows you to choose whether you want to auto-launch the web-form page in a separate window, auto-switch to the SCRIPT tab or do nothing when a call is sent to the agent for this campaign. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
<BR>
<A NAME="vicidial_inbound_groups-xferconf_a_dtmf">
@@ -6454,6 +6458,11 @@ if ($ADD==99999)
<BR>
<B>Enable CallCard -</B> This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled.
<BR>
<A NAME="settings-custom_fields_enabled">
<BR>
<B>Enable Custom List Fields -</B> This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled.
<BR>
<A NAME="settings-default_field_labels">
<BR>
@@ -7192,10 +7201,12 @@ if ($ADD==11)
echo "$scripts_list";
echo "</select>$NWB#vicidial_campaigns-campaign_script$NWE</td></tr>\n";
$eswHTML='';
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML</select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML</select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
@@ -7533,10 +7544,12 @@ if ($ADD==1111)
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
echo "</select>$NWB#vicidial_inbound_groups-ingroup_script$NWE</td></tr>\n";
$eswHTML='';
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML</select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML</select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n";
}
@@ -14213,7 +14226,7 @@ if ($ADD==411111111111111)
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='$webphone_url',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments';";
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='$webphone_url',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled';";
$rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ###
@@ -17635,10 +17648,12 @@ if ($ADD==31)
{echo " <font color=red>LIST OVERRIDE ACTIVE</font>";}
echo "</td></tr>\n";
$eswHTML='';
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_campaigns-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#8EBCFD><td align=right>Answering Machine Message: </td><td><input type=text size=50 maxlength=100 name=am_message_exten id=am_message_exten value=\"$am_message_exten\"> <a href=\"javascript:launch_chooser('am_message_exten','date',1200);\">audio chooser</a> $NWB#vicidial_campaigns-am_message_exten$NWE\n";
$stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';";
@@ -20469,10 +20484,12 @@ if ($ADD==3111)
echo "<tr bgcolor=#B6D3FC><td align=right>Ignore List Script Override: </td><td align=left><select size=1 name=ignore_list_script_override><option>Y</option><option>N</option><option SELECTED>$ignore_list_script_override</option></select>$NWB#vicidial_inbound_groups-ignore_list_script_override$NWE</td></tr>\n";
$eswHTML='';
$eswHTML=''; $cfwHTML='';
if ($SSenable_second_webform > 0)
{$eswHTML = '<option>WEBFORMTWO</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
if ($SScustom_fields_enabled > 0)
{$cfwHTML = '<option>FORM</option>';}
echo "<tr bgcolor=#B6D3FC><td align=right>Get Call Launch: </td><td align=left><select size=1 name=get_call_launch><option selected>NONE</option><option>SCRIPT</option><option>WEBFORM</option>$eswHTML$cfwHTML<option selected>$get_call_launch</option></select>$NWB#vicidial_inbound_groups-get_call_launch$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Transfer-Conf DTMF 1: </td><td align=left><input type=text name=xferconf_a_dtmf size=20 maxlength=50 value=\"$xferconf_a_dtmf\">$NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE</td></tr>\n";
@@ -23467,7 +23484,7 @@ if ($ADD==311111111111111)
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;";
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled from system_settings;";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$version = $row[0];
@@ -23544,6 +23561,7 @@ if ($ADD==311111111111111)
$label_security_phrase = $row[71];
$label_email = $row[72];
$label_comments = $row[73];
$custom_fields_enabled = $row[74];
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=411111111111111>\n";
@@ -23694,6 +23712,8 @@ if ($ADD==311111111111111)
echo "<tr bgcolor=#B6D3FC><td align=right>Enable CallCard: </td><td align=left><select size=1 name=callcard_enabled><option>1</option><option>0</option><option selected>$callcard_enabled</option></select>$NWB#settings-callcard_enabled$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Custom List Fields: </td><td align=left><select size=1 name=custom_fields_enabled><option>1</option><option>0</option><option selected>$custom_fields_enabled</option></select>$NWB#settings-custom_fields_enabled$NWE</td></tr>\n";
if ($SSallow_custom_dialplan > 0)
{
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Custom Dialplan Entry: $NWB#settings-custom_dialplan_entry$NWE <TEXTAREA NAME=custom_dialplan_entry ROWS=5 COLS=80>$custom_dialplan_entry</TEXTAREA></td></tr>\n";
@@ -120,6 +120,8 @@ $STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$vicidial_list_fields = '|lead_id|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|';
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;";
@@ -191,6 +193,10 @@ else
<html>
<head>
<?php
if ($action != "HELP")
{
?>
<script language="JavaScript" src="calendar_db.js"></script>
<link rel="stylesheet" href="calendar.css">
@@ -209,6 +215,10 @@ function close_help(taskspan,taskhelp)
}
</script>
<?php
}
?>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<title>ADMINISTRATION: Lists Custom Fields
<?php
@@ -218,92 +228,99 @@ function close_help(taskspan,taskhelp)
if ($action == "HELP")
{
?>
<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=4>
</title>
</head>
<body bgcolor=white>
<center>
<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=4><TR><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>
<BR>
<B>ViciDial Lists Custom Fields Help</B>
<BR><BR>
<A NAME="vicidial_lists_fields-field_label">
<BR>
<B>Field Label -</B> This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters.
<B>Field Label -</B> This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters. You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are -
lead_id, 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
<BR><BR>
<A NAME="vicidial_lists_fields-field_name">
<BR>
<B>Field Name -</B> This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters.
<B>Field Name -</B> This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters.
<BR><BR>
<A NAME="vicidial_lists_fields-field_description">
<BR>
<B>Field Description -</B> The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters.
<B>Field Description -</B> The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters.
<BR><BR>
<A NAME="vicidial_lists_fields-field_rank">
<BR>
<B>Field Rank -</B> The order in which these fields is displayed to the agent from lowest on top to highest on the bottom.
<B>Field Rank -</B> The order in which these fields is displayed to the agent from lowest on top to highest on the bottom.
<BR><BR>
<A NAME="vicidial_lists_fields-field_order">
<BR>
<B>Field Order -</B> If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right.
<B>Field Order -</B> If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right.
<BR><BR>
<A NAME="vicidial_lists_fields-field_help">
<BR>
<B>Field Help -</B> Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface.
<B>Field Help -</B> Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface.
<BR><BR>
<A NAME="vicidial_lists_fields-field_type">
<BR>
<B>Field Type -</B> This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does.
<B>Field Type -</B> This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does.
<BR><BR>
<A NAME="vicidial_lists_fields-field_options">
<BR>
<B>Field Options -</B> For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter
<B>Field Options -</B> For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter
<BR><BR>
<A NAME="vicidial_lists_fields-multi_position">
<BR>
<B>Option Position -</B> For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL.
<B>Option Position -</B> For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL.
<BR><BR>
<A NAME="vicidial_lists_fields-field_size">
<BR>
<B>Field Size -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<B>Field Size -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<BR><BR>
<A NAME="vicidial_lists_fields-field_max">
<BR>
<B>Field Max -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<B>Field Max -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<BR><BR>
<A NAME="vicidial_lists_fields-field_default">
<BR>
<B>Field Default -</B> This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function. For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time.
<B>Field Default -</B> This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function. For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time.
<BR><BR>
<A NAME="vicidial_lists_fields-field_cost">
<BR>
<B>Field Cost -</B> This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space.
<B>Field Cost -</B> This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space.
<BR><BR>
<A NAME="vicidial_lists_fields-field_required">
<BR>
<B>Field Required -</B> If set to Y, this field will force the agent to enter text or select an option for this field. Default is N.
<B>Field Required -</B> If set to Y, this field will force the agent to enter text or select an option for this field. Default is N.
<BR><BR>
<A NAME="vicidial_lists_fields-name_position">
<BR>
<B>Field Name Position -</B> If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT.
<B>Field Name Position -</B> If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT.
<BR><BR>
<A NAME="vicidial_lists_fields-copy_option">
<BR>
<B>Copy Option -</B> When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option.
<B>Copy Option -</B> When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option.
<BR><BR>
</TD></TR></TABLE>
</BODY>
</HTML>
<?php
exit;
}
@@ -470,7 +487,7 @@ if ( ($action == "COPY_FIELDS_SUBMIT") and ($list_id > 99) and ($source_list_id
while ($fields_to_print > $o)
{
### delete field function
delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o]);
delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields);
echo "SUCCESS: Custom Field Deleted - $list_id|$A_field_label[$o]\n<BR>";
$o++;
@@ -530,7 +547,7 @@ if ( ($action == "COPY_FIELDS_SUBMIT") and ($list_id > 99) and ($source_list_id
if ($new_field_exists < 1)
{
### add field function
add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o]);
add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$A_field_id[$o],$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields);
echo "SUCCESS: Custom Field Added - $list_id|$A_field_label[$o]\n<BR>";
@@ -587,7 +604,7 @@ if ( ($action == "COPY_FIELDS_SUBMIT") and ($list_id > 99) and ($source_list_id
$current_field_id = $rowx[0];
### modify field function
modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o]);
modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$current_field_id,$list_id,$A_field_label[$o],$A_field_name[$o],$A_field_description[$o],$A_field_rank[$o],$A_field_help[$o],$A_field_type[$o],$A_field_options[$o],$A_field_size[$o],$A_field_max[$o],$A_field_default[$o],$A_field_required[$o],$A_field_cost[$o],$A_multi_position[$o],$A_name_position[$o],$A_field_order[$o],$vicidial_list_fields);
echo "SUCCESS: Custom Field Modified - $list_id|$A_field_label[$o]\n<BR>";
}
@@ -681,7 +698,7 @@ if ( ($action == "DELETE_CUSTOM_FIELD") and ($list_id > 99) and ($field_id > 0)
else
{
### delete field function
delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order);
delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields);
echo "SUCCESS: Custom Field Deleted - $list_id|$field_label\n<BR>";
}
@@ -725,7 +742,7 @@ if ( ($action == "ADD_CUSTOM_FIELD") and ($list_id > 99) )
else
{
### add field function
add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order);
add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields);
echo "SUCCESS: Custom Field Added - $list_id|$field_label\n<BR>";
}
@@ -772,7 +789,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELD_SUBMIT") and ($list_id > 99) and ($field_i
else
{
### modify field function
modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order);
modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields);
echo "SUCCESS: Custom Field Modified - $list_id|$field_label\n<BR>";
}
@@ -865,12 +882,18 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
$o=0;
while ($fields_to_print > $o)
{
$LcolorB=''; $LcolorE='';
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$LcolorB='<font color=red>';
$LcolorE='</font>';
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor align=right><td><font size=1>$A_field_rank[$o] - $A_field_order[$o] &nbsp; &nbsp; </td>";
echo "<td align=right><font size=2> <a href=\"#ANCHOR_$A_field_label[$o]\">$A_field_label[$o]</a> &nbsp; &nbsp; </td>";
echo "<td align=right><font size=2> <a href=\"#ANCHOR_$A_field_label[$o]\">$LcolorB$A_field_label[$o]$LcolorE</a> &nbsp; &nbsp; </td>";
echo "<td align=right><font size=2> $A_field_name[$o] &nbsp; &nbsp; </td>";
echo "<td align=right><font size=2> $A_field_type[$o] &nbsp; &nbsp; </td>";
echo "<td align=right><font size=2> $A_field_cost[$o] &nbsp; &nbsp; </td></tr>\n";
@@ -933,7 +956,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
}
if ($A_field_type[$o]=='MULTI')
{
$field_HTML .= "<select size=$A_field_size[$o] name=$A_field_label[$o] id=$A_field_label[$o]>\n";
$field_HTML .= "<select MULTIPLE size=$A_field_size[$o] name=$A_field_label[$o] id=$A_field_label[$o]>\n";
}
if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') )
{
@@ -1072,6 +1095,12 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
$o=0;
while ($fields_to_print > $o)
{
$LcolorB=''; $LcolorE='';
if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields))
{
$LcolorB='<font color=red>';
$LcolorE='</font>';
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
@@ -1084,7 +1113,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<input type=hidden name=field_label value=\"$A_field_label[$o]\">\n";
echo "<a name=\"ANCHOR_$A_field_label[$o]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3 cellpadding=1>\n";
echo "<tr $bgcolor><td align=right>Field Label $A_field_rank[$o]: </td><td align=left> <B>$A_field_label[$o]</B> $NWB#vicidial_lists_fields-field_label$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Label $A_field_rank[$o]: </td><td align=left> $LcolorB<B>$A_field_label[$o]</B>$LcolorE $NWB#vicidial_lists_fields-field_label$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Rank $A_field_rank[$o]: </td><td align=left><select size=1 name=field_rank>\n";
echo "$rank_select\n";
echo "<option selected>$A_field_rank[$o]</option>\n";
@@ -1375,7 +1404,7 @@ echo "\n\n\n<br><br><br>\n<font size=1> runtime: $RUNtime seconds &nbsp; &nbsp;
################################################################################
##### BEGIN add field function
function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order)
function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields)
{
if ($table_exists < 1)
{$field_sql = "CREATE TABLE custom_$list_id (lead_id INT(9) UNSIGNED PRIMARY KEY NOT NULL, $field_label ";}
@@ -1450,9 +1479,9 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
else
{$field_sql .= ";";}
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') )
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/",$vicidial_list_fields)) )
{
if ($DB) {echo "Non-DB $field_type field type\n";}
if ($DB) {echo "Non-DB $field_type field type, $field_label\n";}
}
else
{
@@ -1485,7 +1514,7 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
################################################################################
##### BEGIN modify field function
function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order)
function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields)
{
$field_sql = "ALTER TABLE custom_$list_id MODIFY $field_label ";
$field_options_ENUM='';
@@ -1553,9 +1582,9 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
else
{$field_sql .= "default '$field_default';";}
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') )
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/",$vicidial_list_fields)) )
{
if ($DB) {echo "Non-DB $field_type field type\n";}
if ($DB) {echo "Non-DB $field_type field type, $field_label\n";}
}
else
{
@@ -1588,11 +1617,11 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
################################################################################
##### BEGIN delete field function
function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order)
function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field_id,$list_id,$field_label,$field_name,$field_description,$field_rank,$field_help,$field_type,$field_options,$field_size,$field_max,$field_default,$field_required,$field_cost,$multi_position,$name_position,$field_order,$vicidial_list_fields)
{
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') )
if ( ($field_type=='DISPLAY') or ($field_type=='SCRIPT') or (preg_match("/\|$field_label\|/",$vicidial_list_fields)) )
{
if ($DB) {echo "Non-DB $field_type field type\n";}
if ($DB) {echo "Non-DB $field_type field type, $field_label\n";}
}
else
{
@@ -18,6 +18,7 @@
# 100214-1421 - Sort menu alphabetically
# 100216-0042 - Added popup date selector
# 100507-1413 - Added headers for export
# 100702-1332 - Added custom fields option
#
require("dbconnect.php");
@@ -45,6 +46,8 @@ if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];}
elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];}
if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];}
elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];}
if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];}
elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];}
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
@@ -54,14 +57,15 @@ if (strlen($shift)<2) {$shift='ALL';}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin FROM system_settings;";
$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$non_latin = $row[0];
$custom_fields_enabled = $row[1];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -241,6 +245,7 @@ if ($run_export > 0)
$export_status[$k] = $row[2];
$export_list_id[$k] = $row[8];
$export_lead_id[$k] = $row[35];
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t";
$i++;
$k++;
@@ -271,6 +276,7 @@ if ($run_export > 0)
$export_status[$k] = $row[2];
$export_list_id[$k] = $row[8];
$export_lead_id[$k] = $row[35];
$export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t";
$i++;
$k++;
@@ -304,12 +310,17 @@ if ($run_export > 0)
if ($header_row=='YES')
{
echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name\r\n";
$CFheader = '';
if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') )
{$CFheader = 'custom_fields';}
echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name\t$CFheader\r\n";
}
$i=0;
while ($k > $i)
{
$custom_data='';
$ex_list_name='';
$ex_list_description='';
$stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';";
@@ -346,7 +357,48 @@ if ($run_export > 0)
}
}
echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n";
if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') )
{
$stmt="SHOW TABLES LIKE \"custom_$export_list_id[$i]\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt = "describe custom_$export_list_id[$i];";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$columns_ct = mysql_num_rows($rslt);
$u=0;
while ($columns_ct > $u)
{
$row=mysql_fetch_row($rslt);
$column = $row[0];
$u++;
}
if ($columns_ct > 1)
{
$stmt = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$customfield_ct = mysql_num_rows($rslt);
if ($customfield_ct > 0)
{
$row=mysql_fetch_row($rslt);
$t=1;
while ($columns_ct > $t)
{
$custom_data .= "\t$row[$t]";
$t++;
}
}
}
$custom_data = preg_replace("/\r\n/",'!N',$custom_data);
$custom_data = preg_replace("/\n/",'!N',$custom_data);
}
}
echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$custom_data\r\n";
$i++;
}
}
@@ -526,10 +578,18 @@ else
</script>
<?php
echo "<BR><BR><BR>\n";
echo "<BR><BR>\n";
echo "Header Row:<BR>\n";
echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option>\n";
echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n";
if ($custom_fields_enabled > 0)
{
echo "<BR><BR>\n";
echo "Custom Fields:<BR>\n";
echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n";
}
echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n";
echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n";
+70 -4
View File
@@ -13,6 +13,7 @@
# 90721-1238 - Added rank and owner as vicidial_list fields
# 100119-1039 - Filtered comments for \n newlines
# 100508-1439 - Added header row to output
# 100702-1335 - Added custom fields
#
require("dbconnect.php");
@@ -33,14 +34,15 @@ if (strlen($shift)<2) {$shift='ALL';}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin FROM system_settings;";
$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$non_latin = $row[0];
$custom_fields_enabled = $row[1];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -113,7 +115,8 @@ header('Pragma: public');
ob_clean();
flush();
echo "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner\r\n";
$header_row = "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner";
$header_columns='';
$stmt="select lead_id,entry_date,modify_date,status,user,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 from vicidial_list where list_id='$list_id';";
$rslt=mysql_query($stmt, $link);
@@ -126,7 +129,70 @@ while ($i < $leads_to_print)
$row[29] = preg_replace("/\n|\r/",'!N',$row[29]);
echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n";
$row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]";
$export_lead_id[$i] = $row[0];
$i++;
}
if ($custom_fields_enabled > 0)
{
$stmt="SHOW TABLES LIKE \"custom_$list_id\";";
if ($DB>0) {echo "$stmt";}
$rslt=mysql_query($stmt, $link);
$tablecount_to_print = mysql_num_rows($rslt);
if ($tablecount_to_print > 0)
{
$stmt = "describe custom_$list_id;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$columns_ct = mysql_num_rows($rslt);
$u=0;
while ($columns_ct > $u)
{
$row=mysql_fetch_row($rslt);
$column = $row[0];
if ($u > 0)
{$header_columns .= "\t$column";}
$u++;
}
if ($columns_ct > 1)
{
$i=0;
while ($i < $leads_to_print)
{
$stmt = "SELECT * from custom_$list_id where lead_id='$export_lead_id[$i]' limit 1;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$customfield_ct = mysql_num_rows($rslt);
if ($customfield_ct > 0)
{
$row=mysql_fetch_row($rslt);
$t=1;
while ($columns_ct > $t)
{
$custom_data[$i] .= "\t$row[$t]";
$t++;
}
}
$custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]);
$custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]);
$i++;
}
}
}
}
echo "$header_row$header_columns\r\n";
$i=0;
while ($i < $leads_to_print)
{
echo "$row_data[$i]$custom_data[$i]\r\n";
$i++;
}