From 432255f4af1028b744107d8bc8dc67f3ef906c31 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 17 Sep 2015 17:28:13 +0000 Subject: [PATCH] Added functionality to adjust the input field lengths in the agent screen and the admin modify lead pages to follow the database schema field lengths for the default lead fields. git-svn-id: svn://192.168.202.10@2380 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 4 + agc_2-X/trunk/www/agc/vicidial.php | 123 ++++++++++++++---- .../trunk/www/vicidial/admin_modify_lead.php | 115 +++++++++++++--- agc_2-X/trunk/www/vicidial/qc_modify_lead.php | 112 +++++++++++++--- 4 files changed, 292 insertions(+), 62 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index eeada7a5..e57080d2 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -146,6 +146,10 @@ OTHER CHANGES: 32. Added option to use RECID as a recording filename variable. NOTE: Cannot be used as the ONLY variable for recording filename +33. Added functionality to adjust the input field lengths in the agent screen + and the admin modify lead pages to follow the database schema field + lengths for the default lead fields. + diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index f753bd00..9f482c6e 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -498,10 +498,11 @@ # 150727-0908 - Added default_language # 150808-1439 - Added compatibility for custom fields data option # 150909-0212 - Fixed MDlogEPOCH variable issue #882 +# 150917-0926 - Added dynamic default field maxlengths based on DB schema # -$version = '2.12-470c'; -$build = '150909-0212'; +$version = '2.12-471c'; +$build = '150917-0926'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -3339,6 +3340,78 @@ else } $MMscriptids = substr("$MMscriptids", 0, -1); $MMscriptnames = substr("$MMscriptnames", 0, -1); + + + ##### BEGIN vicidial_list FIELD LENGTH LOOKUP ##### + $MAXvendor_lead_code = '20'; + $MAXphone_code = '10'; + $MAXphone_number = '18'; + $MAXtitle = '4'; + $MAXfirst_name = '30'; + $MAXmiddle_initial = '1'; + $MAXlast_name = '30'; + $MAXaddress1 = '100'; + $MAXaddress2 = '100'; + $MAXaddress3 = '100'; + $MAXcity = '50'; + $MAXstate = '2'; + $MAXprovince = '50'; + $MAXpostal_code = '10'; + $MAXalt_phone = '12'; + $MAXemail = '70'; + $MAXsecurity_phrase = '100'; + + $stmt = "SHOW COLUMNS FROM vicidial_list;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $scvl_ct = mysqli_num_rows($rslt); + $s=0; + while ($scvl_ct > $s) + { + $row=mysqli_fetch_row($rslt); + $vl_field = $row[0]; + $vl_type = preg_replace("/[^0-9]/",'',$row[1]); + if (strlen($vl_type) > 0) + { + if ( ($vl_field == 'vendor_lead_code') and ($MAXvendor_lead_code != $vl_type) ) + {$MAXvendor_lead_code = $vl_type;} + if ( ($vl_field == 'phone_code') and ($MAXphone_code != $vl_type) ) + {$MAXphone_code = $vl_type;} + if ( ($vl_field == 'phone_number') and ($MAXphone_number != $vl_type) ) + {$MAXphone_number = $vl_type;} + if ( ($vl_field == 'title') and ($MAXtitle != $vl_type) ) + {$MAXtitle = $vl_type;} + if ( ($vl_field == 'first_name') and ($MAXfirst_name != $vl_type) ) + {$MAXfirst_name = $vl_type;} + if ( ($vl_field == 'middle_initial') and ($MAXmiddle_initial != $vl_type) ) + {$MAXmiddle_initial = $vl_type;} + if ( ($vl_field == 'last_name') and ($MAXlast_name != $vl_type) ) + {$MAXlast_name = $vl_type;} + if ( ($vl_field == 'address1') and ($MAXaddress1 != $vl_type) ) + {$MAXaddress1 = $vl_type;} + if ( ($vl_field == 'address2') and ($MAXaddress2 != $vl_type) ) + {$MAXaddress2 = $vl_type;} + if ( ($vl_field == 'address3') and ($MAXaddress3 != $vl_type) ) + {$MAXaddress3 = $vl_type;} + if ( ($vl_field == 'city') and ($MAXcity != $vl_type) ) + {$MAXcity = $vl_type;} + if ( ($vl_field == 'state') and ($MAXstate != $vl_type) ) + {$MAXstate = $vl_type;} + if ( ($vl_field == 'province') and ($MAXprovince != $vl_type) ) + {$MAXprovince = $vl_type;} + if ( ($vl_field == 'postal_code') and ($MAXpostal_code != $vl_type) ) + {$MAXpostal_code = $vl_type;} + if ( ($vl_field == 'alt_phone') and ($MAXalt_phone != $vl_type) ) + {$MAXalt_phone = $vl_type;} + if ( ($vl_field == 'email') and ($MAXemail != $vl_type) ) + {$MAXemail = $vl_type;} + if ( ($vl_field == 'security_phrase') and ($MAXsecurity_phrase != $vl_type) ) + {$MAXsecurity_phrase = $vl_type;} + } + $s++; + } + ##### END vicidial_list FIELD LENGTH LOOKUP ##### } } @@ -16192,75 +16265,75 @@ $zi=2; if ($label_title == '---HIDE---') {echo "";} else - {echo "$label_title: ";} + {echo "$label_title: ";} if ($label_first_name == '---HIDE---') {echo "  ";} else - {echo "  $label_first_name: ";} + {echo "  $label_first_name: ";} if ($label_middle_initial == '---HIDE---') {echo "  ";} else - {echo "  $label_middle_initial: ";} + {echo "  $label_middle_initial: ";} if ($label_last_name == '---HIDE---') {echo "  ";} else - {echo "  $label_last_name: ";} + {echo "  $label_last_name: ";} echo ""; if ($label_address1 == '---HIDE---') {echo " ";} else - {echo "$label_address1: ";} + {echo "$label_address1: ";} echo ""; if ($label_address2 == '---HIDE---') {echo " ";} else - {echo "$label_address2: ";} + {echo "$label_address2: ";} echo ""; if ($label_address3 == '---HIDE---') {echo " ";} else - {echo "$label_address3: ";} + {echo "$label_address3: ";} echo ""; if ($label_city == '---HIDE---') {echo " ";} else - {echo "$label_city: ";} + {echo "$label_city: ";} echo ""; if ($label_state == '---HIDE---') {echo " ";} else - {echo "$label_state: ";} + {echo "$label_state: ";} echo ""; if ($label_postal_code == '---HIDE---') {echo " ";} else - {echo "$label_postal_code: ";} + {echo "$label_postal_code: ";} echo ""; if ($label_province == '---HIDE---') {echo " ";} else - {echo "$label_province: ";} + {echo "$label_province: ";} echo ""; if ($label_vendor_lead_code == '---HIDE---') {echo " ";} else - {echo "$label_vendor_lead_code: ";} + {echo "$label_vendor_lead_code: ";} echo ""; @@ -16291,7 +16364,7 @@ $zi=2; } else { - echo ""; + echo ""; } } @@ -16300,28 +16373,28 @@ $zi=2; if ($label_phone_code == '---HIDE---') {echo " ";} else - {echo "$label_phone_code: ";} + {echo "$label_phone_code: ";} echo ""; if ($label_alt_phone == '---HIDE---') {echo " ";} else - {echo "$label_alt_phone: ";} + {echo "$label_alt_phone: ";} echo ""; if ($label_security_phrase == '---HIDE---') {echo " ";} else - {echo "$label_security_phrase: ";} + {echo "$label_security_phrase: ";} echo ""; if ($label_email == '---HIDE---') {echo " ";} else - {echo "$label_email: ";} + {echo "$label_email: ";} if (strlen($agent_display_fields) > 3) { @@ -17206,22 +17279,22 @@ if ($agent_display_dialable_leads > 0) - : + : - : + : - : + : - : + : - : + : - : + :
            diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php index 10e31eee..2ab47aa7 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -71,6 +71,7 @@ # 150603-1527 - Allow non-digit characters in alt_phone field # 150808-1437 - Added compatibility for custom fields data options # 150908-1531 - Fixed input lengths for several standard fields to match DB +# 150917-1301 - Added dynamic default field maxlengths based on DB schema # require("dbconnect_mysqli.php"); @@ -368,6 +369,82 @@ if (strlen($row[17])>0) {$label_email = $row[17];} if (strlen($row[18])>0) {$label_comments = $row[18];} +##### BEGIN vicidial_list FIELD LENGTH LOOKUP ##### +$MAXvendor_lead_code = '20'; +$MAXphone_code = '10'; +$MAXphone_number = '18'; +$MAXtitle = '4'; +$MAXfirst_name = '30'; +$MAXmiddle_initial = '1'; +$MAXlast_name = '30'; +$MAXaddress1 = '100'; +$MAXaddress2 = '100'; +$MAXaddress3 = '100'; +$MAXcity = '50'; +$MAXstate = '2'; +$MAXprovince = '50'; +$MAXpostal_code = '10'; +$MAXalt_phone = '12'; +$MAXemail = '70'; +$MAXsecurity_phrase = '100'; +$MAXcountry_code = '3'; +$MAXowner = '20'; + +$stmt = "SHOW COLUMNS FROM vicidial_list;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {echo "$stmt\n";} +$scvl_ct = mysqli_num_rows($rslt); +$s=0; +while ($scvl_ct > $s) + { + $row=mysqli_fetch_row($rslt); + $vl_field = $row[0]; + $vl_type = preg_replace("/[^0-9]/",'',$row[1]); + if (strlen($vl_type) > 0) + { + if ( ($vl_field == 'vendor_lead_code') and ($MAXvendor_lead_code != $vl_type) ) + {$MAXvendor_lead_code = $vl_type;} + if ( ($vl_field == 'phone_code') and ($MAXphone_code != $vl_type) ) + {$MAXphone_code = $vl_type;} + if ( ($vl_field == 'phone_number') and ($MAXphone_number != $vl_type) ) + {$MAXphone_number = $vl_type;} + if ( ($vl_field == 'title') and ($MAXtitle != $vl_type) ) + {$MAXtitle = $vl_type;} + if ( ($vl_field == 'first_name') and ($MAXfirst_name != $vl_type) ) + {$MAXfirst_name = $vl_type;} + if ( ($vl_field == 'middle_initial') and ($MAXmiddle_initial != $vl_type) ) + {$MAXmiddle_initial = $vl_type;} + if ( ($vl_field == 'last_name') and ($MAXlast_name != $vl_type) ) + {$MAXlast_name = $vl_type;} + if ( ($vl_field == 'address1') and ($MAXaddress1 != $vl_type) ) + {$MAXaddress1 = $vl_type;} + if ( ($vl_field == 'address2') and ($MAXaddress2 != $vl_type) ) + {$MAXaddress2 = $vl_type;} + if ( ($vl_field == 'address3') and ($MAXaddress3 != $vl_type) ) + {$MAXaddress3 = $vl_type;} + if ( ($vl_field == 'city') and ($MAXcity != $vl_type) ) + {$MAXcity = $vl_type;} + if ( ($vl_field == 'state') and ($MAXstate != $vl_type) ) + {$MAXstate = $vl_type;} + if ( ($vl_field == 'province') and ($MAXprovince != $vl_type) ) + {$MAXprovince = $vl_type;} + if ( ($vl_field == 'postal_code') and ($MAXpostal_code != $vl_type) ) + {$MAXpostal_code = $vl_type;} + if ( ($vl_field == 'alt_phone') and ($MAXalt_phone != $vl_type) ) + {$MAXalt_phone = $vl_type;} + if ( ($vl_field == 'email') and ($MAXemail != $vl_type) ) + {$MAXemail = $vl_type;} + if ( ($vl_field == 'security_phrase') and ($MAXsecurity_phrase != $vl_type) ) + {$MAXsecurity_phrase = $vl_type;} + if ( ($vl_field == 'country_code') and ($MAXcountry_code != $vl_type) ) + {$MAXcountry_code = $vl_type;} + if ( ($vl_field == 'owner') and ($MAXowner != $vl_type) ) + {$MAXowner = $vl_type;} + } + $s++; + } +##### END vicidial_list FIELD LENGTH LOOKUP ##### + ### find out if status(dispo) is a scheduled callback status $scheduled_callback=''; $stmt="SELECT scheduled_callback from vicidial_statuses where status='$dispo';"; @@ -1154,28 +1231,28 @@ else } else { - echo "$label_title:   \n"; - echo "$label_first_name: \n"; - echo "$label_middle_initial:   \n"; - echo " $label_last_name: \n"; - echo "$label_address1 : \n"; - echo "$label_address2 : \n"; - echo "$label_address3 : \n"; - echo "$label_city : \n"; - echo "$label_state:   \n"; - echo " $label_postal_code: \n"; + echo "$label_title:   \n"; + echo "$label_first_name: \n"; + echo "$label_middle_initial:   \n"; + echo " $label_last_name: \n"; + echo "$label_address1 : \n"; + echo "$label_address2 : \n"; + echo "$label_address3 : \n"; + echo "$label_city : \n"; + echo "$label_state:   \n"; + echo " $label_postal_code: \n"; - echo "$label_province : \n"; - echo ""._QXZ("Country")." :   \n"; + echo "$label_province : \n"; + echo ""._QXZ("Country")." :   \n"; echo " "._QXZ("Date of Birth").": \n"; - echo "$label_phone_number : \n"; - echo "$label_phone_code : \n"; - echo "$label_alt_phone : \n"; - echo "$label_email : \n"; - echo "$label_security_phrase : \n"; - echo "$label_vendor_lead_code : \n"; + echo "$label_phone_number : \n"; + echo "$label_phone_code : \n"; + echo "$label_alt_phone : \n"; + echo "$label_email : \n"; + echo "$label_security_phrase : \n"; + echo "$label_vendor_lead_code : \n"; echo ""._QXZ("Rank")." : \n"; - echo ""._QXZ("Owner")." : \n"; + echo ""._QXZ("Owner")." : \n"; echo "$label_comments : \n"; } diff --git a/agc_2-X/trunk/www/vicidial/qc_modify_lead.php b/agc_2-X/trunk/www/vicidial/qc_modify_lead.php index 8a5c7aee..d3737ada 100644 --- a/agc_2-X/trunk/www/vicidial/qc_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/qc_modify_lead.php @@ -22,6 +22,7 @@ # 141229-1742 - Added code for on-the-fly language translations display # 150808-1437 - Added compatibility for custom fields data options # 150908-1531 - Fixed input lengths for several standard fields to match DB +# 150917-1311 - Added dynamic default field maxlengths based on DB schema # require("dbconnect_mysqli.php"); @@ -262,6 +263,81 @@ if (strlen($row[16])>0) {$label_security_phrase = $row[16];} if (strlen($row[17])>0) {$label_email = $row[17];} if (strlen($row[18])>0) {$label_comments = $row[18];} +##### BEGIN vicidial_list FIELD LENGTH LOOKUP ##### +$MAXvendor_lead_code = '20'; +$MAXphone_code = '10'; +$MAXphone_number = '18'; +$MAXtitle = '4'; +$MAXfirst_name = '30'; +$MAXmiddle_initial = '1'; +$MAXlast_name = '30'; +$MAXaddress1 = '100'; +$MAXaddress2 = '100'; +$MAXaddress3 = '100'; +$MAXcity = '50'; +$MAXstate = '2'; +$MAXprovince = '50'; +$MAXpostal_code = '10'; +$MAXalt_phone = '12'; +$MAXemail = '70'; +$MAXsecurity_phrase = '100'; +$MAXcountry_code = '3'; +$MAXowner = '20'; + +$stmt = "SHOW COLUMNS FROM vicidial_list;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {echo "$stmt\n";} +$scvl_ct = mysqli_num_rows($rslt); +$s=0; +while ($scvl_ct > $s) + { + $row=mysqli_fetch_row($rslt); + $vl_field = $row[0]; + $vl_type = preg_replace("/[^0-9]/",'',$row[1]); + if (strlen($vl_type) > 0) + { + if ( ($vl_field == 'vendor_lead_code') and ($MAXvendor_lead_code != $vl_type) ) + {$MAXvendor_lead_code = $vl_type;} + if ( ($vl_field == 'phone_code') and ($MAXphone_code != $vl_type) ) + {$MAXphone_code = $vl_type;} + if ( ($vl_field == 'phone_number') and ($MAXphone_number != $vl_type) ) + {$MAXphone_number = $vl_type;} + if ( ($vl_field == 'title') and ($MAXtitle != $vl_type) ) + {$MAXtitle = $vl_type;} + if ( ($vl_field == 'first_name') and ($MAXfirst_name != $vl_type) ) + {$MAXfirst_name = $vl_type;} + if ( ($vl_field == 'middle_initial') and ($MAXmiddle_initial != $vl_type) ) + {$MAXmiddle_initial = $vl_type;} + if ( ($vl_field == 'last_name') and ($MAXlast_name != $vl_type) ) + {$MAXlast_name = $vl_type;} + if ( ($vl_field == 'address1') and ($MAXaddress1 != $vl_type) ) + {$MAXaddress1 = $vl_type;} + if ( ($vl_field == 'address2') and ($MAXaddress2 != $vl_type) ) + {$MAXaddress2 = $vl_type;} + if ( ($vl_field == 'address3') and ($MAXaddress3 != $vl_type) ) + {$MAXaddress3 = $vl_type;} + if ( ($vl_field == 'city') and ($MAXcity != $vl_type) ) + {$MAXcity = $vl_type;} + if ( ($vl_field == 'state') and ($MAXstate != $vl_type) ) + {$MAXstate = $vl_type;} + if ( ($vl_field == 'province') and ($MAXprovince != $vl_type) ) + {$MAXprovince = $vl_type;} + if ( ($vl_field == 'postal_code') and ($MAXpostal_code != $vl_type) ) + {$MAXpostal_code = $vl_type;} + if ( ($vl_field == 'alt_phone') and ($MAXalt_phone != $vl_type) ) + {$MAXalt_phone = $vl_type;} + if ( ($vl_field == 'email') and ($MAXemail != $vl_type) ) + {$MAXemail = $vl_type;} + if ( ($vl_field == 'security_phrase') and ($MAXsecurity_phrase != $vl_type) ) + {$MAXsecurity_phrase = $vl_type;} + if ( ($vl_field == 'country_code') and ($MAXcountry_code != $vl_type) ) + {$MAXcountry_code = $vl_type;} + if ( ($vl_field == 'owner') and ($MAXowner != $vl_type) ) + {$MAXowner = $vl_type;} + } + $s++; + } +##### END vicidial_list FIELD LENGTH LOOKUP ##### //Added by Poundteam for QC. Gather record data to display on page and prepopulate title and hrefs, etc. $stmt="SELECT * from vicidial_list A inner join vicidial_lists B on A.list_id=B.list_id inner join vicidial_campaigns C on B.campaign_id=C.campaign_id left outer join vicidial_statuses D on A.status=D.status left outer join vicidial_qc_codes E on A.status=E.code where A.lead_id='$lead_id'"; @@ -834,26 +910,26 @@ else echo "$label_vendor_lead_code: $vendor_id     "._QXZ("Lead ID").": $lead_id\n"; echo ""._QXZ("Fronter").": $tsr     "._QXZ("List ID").": $list_id     "._QXZ("Called Count").": $called_count\n"; - echo "$label_title:   \n"; - echo "$label_first_name: \n"; - echo "$label_middle_initial:   \n"; - echo " $label_last_name: \n"; - echo "$label_address1 : \n"; - echo "$label_address2 : \n"; - echo "$label_address3 : \n"; - echo "$label_city : \n"; - echo "$label_state:   \n"; - echo " $label_postal_code: \n"; + echo "$label_title:   \n"; + echo "$label_first_name: \n"; + echo "$label_middle_initial:   \n"; + echo " $label_last_name: \n"; + echo "$label_address1 : \n"; + echo "$label_address2 : \n"; + echo "$label_address3 : \n"; + echo "$label_city : \n"; + echo "$label_state:   \n"; + echo " $label_postal_code: \n"; - echo "$label_province : \n"; - echo "Country : \n"; - echo "$label_phone_number : \n"; - echo "$label_phone_code : \n"; - echo "$label_alt_phone : \n"; - echo "$label_email : \n"; - echo "$label_security_phrase : \n"; + echo "$label_province : \n"; + echo "Country : \n"; + echo "$label_phone_number : \n"; + echo "$label_phone_code : \n"; + echo "$label_alt_phone : \n"; + echo "$label_email : \n"; + echo "$label_security_phrase : \n"; echo "Rank : \n"; - echo "Owner : \n"; + echo "Owner : \n"; echo "$label_comments : \n"; $stmt="SELECT user_id, timestamp, list_id, campaign_id, comment from vicidial_comments where lead_id='$lead_id' order by timestamp"; $rslt=mysql_to_mysqli($stmt, $link);