added more custom Vtiger actions and a Vtiger database optimization script
added email, user_code and terriroty to the vicidial_users table as optional fields git-svn-id: svn://192.168.202.10@1097 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -359,7 +359,8 @@ if ($call_handle_method =~ /SURVEYCAMPCEP/)
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$survey_customer_nameRAW = "Hello, If this is $aryA[0] $aryA[1] Please press one now ";
|
||||
# $survey_customer_nameRAW = "Hello, If this is $aryA[0] $aryA[1] Please press one now ";
|
||||
$survey_customer_nameRAW = "hello, this is a call for $aryA[0] $aryA[1],, if you are $aryA[0] $aryA[1] then press 1 to speak with an agent,, if we have not reached the correct number, please press 2 to have your telephone number removed from our database";
|
||||
$survey_customer_name = $survey_customer_nameRAW;
|
||||
$survey_customer_name =~ s/[^, 0-9a-zA-Z]//gi;
|
||||
$survey_customer_name =~ s/ /\\ /gi;
|
||||
@@ -405,7 +406,7 @@ if ($affected_rows > 0)
|
||||
$sthA->finish();
|
||||
|
||||
### Grab campaign values from the database
|
||||
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
|
||||
$stmtA = "SELECT drop_call_seconds,drop_action,safe_harbor_exten,concurrent_transfers,next_agent_call,voicemail_ext,drop_inbound_group,use_internal_dnc,use_campaign_dnc,cpd_amd_action,am_message_exten,three_way_call_cid,campaign_cid FROM vicidial_campaigns where campaign_id = '$VDADcampaign';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -428,6 +429,8 @@ if ($affected_rows > 0)
|
||||
$use_campaign_dnc = "$aryA[8]";
|
||||
$cpd_amd_action = "$aryA[9]";
|
||||
$am_message_exten = "$aryA[10]";
|
||||
$three_way_call_cid = "$aryA[11]";
|
||||
$campaign_cid = "$aryA[12]";
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -760,7 +763,19 @@ if ($call_handle_method =~ /SURVEY/)
|
||||
{
|
||||
$survey_status='SVYEXT';
|
||||
if (length($survey_xfer_exten)>0)
|
||||
{$DROPexten = "$survey_xfer_exten";}
|
||||
{
|
||||
$DROPexten = "$survey_xfer_exten";
|
||||
|
||||
if ($three_way_call_cid !~ /CUSTOMER/)
|
||||
{
|
||||
$newcallerid = "\"$campaign_cid <$campaign_cid>\"";
|
||||
$AGI->set_callerid($newcallerid);
|
||||
|
||||
print STDERR "Setting CID \"$newcallerid\"\n";
|
||||
checkresult($result);
|
||||
if ($AGILOG) {$agi_string = "callerID changed: \"$calleridname\" \<$VDADphone\>"; &agi_output;}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($survey_method =~ /HANGUP/)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# 81021-2201 - Deactivated queue_log QUEUESTART event
|
||||
# 81022-0713 - Added gathering of vicidial_inbound_groups stats(day only)
|
||||
# 81108-0808 - Added more inbound stats with some debug output and added campaign agent non-pause time
|
||||
# 90415-0925 - Fixed rare division by zero bug
|
||||
#
|
||||
|
||||
# constants
|
||||
@@ -1497,8 +1498,16 @@ if ( ($dial_method[$i] =~ /ADAPT_HARD_LIMIT|ADAPT_AVERAGE|ADAPT_TAPERED/) || ($f
|
||||
{
|
||||
# Calculate the optimal dial_level differential for the past minute
|
||||
$differential_target[$i] = ($differential_onemin[$i] + $adaptive_dl_diff_target[$i]);
|
||||
if ( ($differential_target[$i] != 0) && ($agents_average_onemin[$i] != 0) )
|
||||
{
|
||||
$differential_mul[$i] = ($differential_target[$i] / $agents_average_onemin[$i]);
|
||||
$differential_pct_raw[$i] = ($differential_mul[$i] * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
$differential_mul[$i] = 0;
|
||||
$differential_pct_raw[$i] = 0;
|
||||
}
|
||||
$differential_pct[$i] = sprintf("%.2f", $differential_pct_raw[$i]);
|
||||
|
||||
# Factor in the intensity setting
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# CHANGES
|
||||
# 90128-0319 - First build
|
||||
# 90401-1347 - Fixed quiet flag
|
||||
# 90417-0519 - Added custom field updates for timezone and last/largest sale amounts
|
||||
#
|
||||
|
||||
$secX = time();
|
||||
@@ -101,12 +102,16 @@ if (length($ARGV[0])>1)
|
||||
{
|
||||
print "allowed run time options:\n";
|
||||
print " [-q] = quiet\n";
|
||||
print " [-t] = test\n";
|
||||
print " [--test] = test\n";
|
||||
print " [--debug] = debug output\n";
|
||||
print " [--format=standard] = ability to define a format, standard is default, formats allowed shown in examples\n";
|
||||
print " [--forcelistid=1234] = overrides the listID given in the file with the 1234\n";
|
||||
print " [--duplicate-system-check] = checks for the same phone number in the entire system before inserting lead\n";
|
||||
print " [--duplicate-system-vendor] = checks for the same website in the entire system before inserting lead\n";
|
||||
print " [--vt-sales-update] = updates the Vtiger account custom sales fields based upon today sales order data\n";
|
||||
print " [--vt-sales-update-alldate] = updates the Vtiger account custom sales fields based upon all sales order data\n";
|
||||
print " [--vt-timezone-update] = updates the Vtiger account custom timezone field based upon ViciDial timezone/state\n";
|
||||
print " [--skip-vicidial-update] = skips the lead file export and all ViciDial list updating functions\n";
|
||||
print " [--ftp-pull] = grabs lead files from a remote FTP server, uses REPORTS FTP login information\n";
|
||||
print " [--ftp-dir=leads_in] = remote FTP server directory to grab files from, should have a DONE sub-directory\n";
|
||||
print " [--email-list=test@test.com:test2@test.com] = send email results for each file to these addresses\n";
|
||||
@@ -141,12 +146,13 @@ if (length($ARGV[0])>1)
|
||||
}
|
||||
else {$DBX=0;}
|
||||
|
||||
if ($args =~ /-t/i)
|
||||
if ($args =~ /-test/i)
|
||||
{
|
||||
$T=1;
|
||||
$TEST=1;
|
||||
if ($q < 1) {print "\n----- TESTING -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$T=0;}
|
||||
|
||||
if ($args =~ /-format=/i)
|
||||
{
|
||||
@@ -178,6 +184,26 @@ if (length($ARGV[0])>1)
|
||||
$dupcheckvend=1;
|
||||
if ($q < 1) {print "\n----- DUPLICATE SYSTEM CHECK VENDOR -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-vt-sales-update/i)
|
||||
{
|
||||
$vt_sales_update=1;
|
||||
if ($q < 1) {print "\n----- VTIGER SALES DATE FIELD UPDATE TODAY -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-vt-sales-update-alldate/i)
|
||||
{
|
||||
$vt_sales_update_alldate=1;
|
||||
if ($q < 1) {print "\n----- VTIGER SALES DATE FIELD UPDATE ALLDATE -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-vt-timezone-update/i)
|
||||
{
|
||||
$vt_timezone_update=1;
|
||||
if ($q < 1) {print "\n----- VTIGER TIMEZONE FIELD UPDATE -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-skip-vicidial-update/i)
|
||||
{
|
||||
$skip_vicidial_update=1;
|
||||
if ($q < 1) {print "\n----- SKIP VICIDIAL UPDATE -----\n\n";}
|
||||
}
|
||||
if ($args =~ /-ftp-pull/i)
|
||||
{
|
||||
$ftp_pull=1;
|
||||
@@ -224,13 +250,18 @@ else
|
||||
$i=0;
|
||||
$forcelistid = '';
|
||||
$format='standard';
|
||||
$vt_sales_update=0;
|
||||
$vt_sales_update_alldate=0;
|
||||
$vt_timezone_update=0;
|
||||
$skip_vicidial_update=0;
|
||||
$T=0;
|
||||
}
|
||||
### end parsing run-time options ###
|
||||
|
||||
if ($q < 1)
|
||||
{
|
||||
print "\n\n\n\n\n\n\n\n\n\n\n\n-- Vtiger_OUT_sync2VICIDIAL_file.pl --\n\n";
|
||||
print "This program is designed to export a PIPE delimited file of the Accounts from Vtiger and format it for import into the VICIDIAL system. \n\n";
|
||||
print "This program is designed to export a PIPE delimited file of the Accounts from Vtiger and format it for import into the VICIDIAL system. Also allows for other Vtiger data update functions.\n\n";
|
||||
}
|
||||
|
||||
$i=0;
|
||||
@@ -285,13 +316,104 @@ $d=0; ### status of 'REFERRED' counter ###
|
||||
$e=0; ### status of 'DUPLICATE' vendor counter ###
|
||||
$f=0; ### number of 'DUPLICATE' phone counter ###
|
||||
$g=0; ### number of leads with multi-alt-entries
|
||||
$h=0; ### number of timezone updates
|
||||
$j=0; ### number of saleamount updates
|
||||
|
||||
|
||||
### open the output file for writing ###
|
||||
open(out, ">$dir2/$VDLfile")
|
||||
|| die "Can't open $VDLfile: $!\n";
|
||||
|
||||
$vt_timezone_field_exists=0;
|
||||
if ($vt_timezone_update > 0)
|
||||
{
|
||||
$stmtB="SELECT count(*) from vtiger_field where fieldlabel='Timezone';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_timezone_field_exists = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($vt_timezone_field_exists > 0)
|
||||
{
|
||||
$stmtB="SELECT fieldname from vtiger_field where fieldlabel='Timezone';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_timezone_field_name = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($q < 1) {print "Vtiger Timezone field found: $vt_timezone_field_name, starting updates...\n";}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$vt_last_saleamount_field_exists=0;
|
||||
$vt_largest_saleamount_field_exists=0;
|
||||
if ( ($vt_sales_update > 0) || ($vt_sales_update_alldate > 0) )
|
||||
{
|
||||
$stmtB="SELECT count(*) from vtiger_field where fieldlabel='Last Sale Amount';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_last_saleamount_field_exists = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$stmtB="SELECT count(*) from vtiger_field where fieldlabel='Largest Sale Amount';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_largest_saleamount_field_exists = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($vt_last_saleamount_field_exists > 0)
|
||||
{
|
||||
$stmtB="SELECT fieldname from vtiger_field where fieldlabel='Last Sale Amount';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_last_saleamount_field_name = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($q < 1) {print "Vtiger Last Sale Amount field found: $vt_last_saleamount_field_name, starting updates...\n";}
|
||||
}
|
||||
if ($vt_largest_saleamount_field_exists > 0)
|
||||
{
|
||||
$stmtB="SELECT fieldname from vtiger_field where fieldlabel='Largest Sale Amount';";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$vt_largest_saleamount_field_name = "$aryB[0]";
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($q < 1) {print "Vtiger Largest Sale Amount field found: $vt_largest_saleamount_field_name, starting updates...\n";}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -313,6 +435,122 @@ $sthB->finish();
|
||||
$i=0;
|
||||
while ($sthBrowsC > $i)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
##### BEGIN TIMEZONE UPDATE #####
|
||||
if ( ($vt_timezone_update > 0) && ($vt_timezone_field_exists > 0) )
|
||||
{
|
||||
$VL_exists=0;
|
||||
$stmtA = "SELECT count(*) FROM vicidial_list where vendor_lead_code='$crmid[$i]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VL_exists = "$aryA[0]";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($VL_exists > 0)
|
||||
{
|
||||
$stmtA = "SELECT state,gmt_offset_now FROM vicidial_list where vendor_lead_code='$crmid[$i]';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VL_state = "$aryA[0]";
|
||||
$VL_timezone = "$aryA[1]";
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$tz_set=0;
|
||||
$timezone_abb = 'NONE';
|
||||
if ($VL_state =~ /AZ/) {$timezone_abb = 'MST'; $tz_set=1;}
|
||||
if ( ($VL_state =~ /HI/) && ($tz_set < 1) ) {$timezone_abb = 'HST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-10") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'HST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-9") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'AKT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-8") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'PST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-7") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'MST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-6") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'CST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-5") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'EST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-4") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'AST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-3.5") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'NST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "10") && ($isdst < 1) && ($tz_set < 1) ) {$timezone_abb = 'ChST'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-9") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'HDT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-8") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'ADT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-7") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'PDT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-6") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'MDT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-5") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'CDT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-4") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'EDT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-3") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'ADT'; $tz_set=1;}
|
||||
if ( ($VL_timezone == "-2.5") && ($isdst > 0) && ($tz_set < 1) ) {$timezone_abb = 'NDT'; $tz_set=1;}
|
||||
|
||||
$stmtB = "UPDATE vtiger_accountscf SET $vt_timezone_field_name='$timezone_abb' where accountid='$crmid[$i]';";
|
||||
if ($T < 1) {$affected_rowsB = $dbhB->do($stmtB) or die "Couldn't execute query: |$stmtB|\n";}
|
||||
if($DB){print "|$affected_rowsB|$stmtB|\n";}
|
||||
$h = ($affected_rowsB + $h);
|
||||
}
|
||||
}
|
||||
##### END TIMEZONE UPDATE #####
|
||||
|
||||
|
||||
|
||||
##### BEGIN SALE AMOUNT UPDATE #####
|
||||
if ( ( ($vt_sales_update > 0) || ($vt_sales_update_alldate > 0) ) && ( ($vt_last_saleamount_field_exists > 0) && ($vt_largest_saleamount_field_exists > 0) ) )
|
||||
{
|
||||
$last_sale='0.00';
|
||||
$largest_sale='0.00';
|
||||
if ($vt_sales_update > 0) {$duedateSQL = "and duedate='$crmid[$i]'";}
|
||||
if ($vt_sales_update_alldate > 0) {$duedateSQL = "";}
|
||||
|
||||
$VS_exists=0;
|
||||
$stmtB="SELECT count(*) from vtiger_salesorder where accountid='$crmid[$i]' $duedateSQL order by duedate;";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$VS_exists = $aryB[0];
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($VS_exists > 0)
|
||||
{
|
||||
$k=0;
|
||||
$stmtB="SELECT total from vtiger_salesorder where accountid='$crmid[$i]' $duedateSQL order by duedate;";
|
||||
if($DBX){print STDERR "\n|$stmtB|\n";}
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
while ($sthBrows > $k)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$last_sale = $aryB[0];
|
||||
if ($aryB[0] > $largest_sale) {$largest_sale = $aryB[0];}
|
||||
$k++;
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
$stmtB = "UPDATE vtiger_accountscf SET $vt_largest_saleamount_field_name='$largest_sale',$vt_last_saleamount_field_name='$last_sale' where accountid='$crmid[$i]';";
|
||||
if ($T < 1) {$affected_rowsB = $dbhB->do($stmtB) or die "Couldn't execute query: |$stmtB|\n";}
|
||||
if($DB){print "|$affected_rowsB|$stmtB|\n";}
|
||||
$j = ($affected_rowsB + $j);
|
||||
}
|
||||
}
|
||||
##### END SALE AMOUNT UPDATE #####
|
||||
|
||||
|
||||
|
||||
##### BEGIN VICIDIAL UPDATE #####
|
||||
if ($skip_vicidial_update < 1)
|
||||
{
|
||||
$VL_dup=0;
|
||||
$VL_phone_dup=0;
|
||||
|
||||
@@ -388,7 +626,7 @@ while ($sthBrowsC > $i)
|
||||
$affected_rowsA=0;
|
||||
### update the existing vicidial_list entry ###
|
||||
$stmtA = "UPDATE vicidial_list SET first_name='$accountname',last_name='$ownership',address1='$bill_street',address2='$bill_pobox',city='$bill_city',state='$bill_state',postal_code='$bill_code',country='$bill_country',vendor_lead_code='$crmid[$i]',address3='$fax',alt_phone='$otherphone',email='$email1',province='$website',security_phrase='$tickersymbol',comments='$siccode|$annualrevenue' where phone_number='$phone' limit 1;";
|
||||
if (!$T) {$affected_rowsA = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtB|\n";
|
||||
if ($T < 1) {$affected_rowsA = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtB|\n";
|
||||
if($DB){print STDERR "\n|$affected_rowsA|$stmtA|\n";}
|
||||
$c = ($affected_rowsA + $c);
|
||||
}
|
||||
@@ -401,7 +639,7 @@ while ($sthBrowsC > $i)
|
||||
$affected_rowsA=0;
|
||||
### update the existing vicidial_list entry ###
|
||||
$stmtA = "UPDATE vicidial_list SET first_name='$accountname',last_name='$ownership',address1='$bill_street',address2='$bill_pobox',city='$bill_city',state='$bill_state',postal_code='$bill_code',country_code='$bill_country',phone_number='$phone',address3='$fax',alt_phone='$otherphone',email='$email1',province='$website',security_phrase='$tickersymbol',comments='$siccode $annualrevenue' where vendor_lead_code='$crmid[$i]' limit 1;";
|
||||
if (!$T) {$affected_rowsA = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtB|\n";
|
||||
if ($T < 1) {$affected_rowsA = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtB|\n";
|
||||
if($DB){print STDERR "\n|$affected_rowsA|$stmtA|\n";}
|
||||
$c = ($affected_rowsA + $c);
|
||||
}
|
||||
@@ -412,6 +650,8 @@ while ($sthBrowsC > $i)
|
||||
$b++;
|
||||
}
|
||||
}
|
||||
}
|
||||
##### END VICIDIAL UPDATE #####
|
||||
|
||||
$i++;
|
||||
|
||||
@@ -426,7 +666,7 @@ while ($sthBrowsC > $i)
|
||||
if ($i =~ /70$/i) {print STDERR "| $i\r";}
|
||||
if ($i =~ /80$/i) {print STDERR "+ $i\r";}
|
||||
if ($i =~ /90$/i) {print STDERR "0 $i\r";}
|
||||
if ($i =~ /00$/i) {print "$i|$b|$c|$d|$e|$f|$g|$crmid[$i]|$phone_number|\n";}
|
||||
if ($i =~ /00$/i) {print "$i|$b|$c|$d|$e|$f|$g|$h|$crmid[$i]|$phone_number|\n";}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,6 +688,8 @@ while ($sthBrowsC > $i)
|
||||
{$Falert .= "VENDOR DUPLICATES: $e\n";}
|
||||
if ($f > 0)
|
||||
{$Falert .= "PHONE DUPLICATES: $f\n";}
|
||||
$Falert .= "TIMEZONE UPDATES: $h\n";
|
||||
$Falert .= "SALE AMOUNT UPDATES:$j\n";
|
||||
|
||||
if ($q < 1) {print "$Falert";}
|
||||
print Sout "$Falert";
|
||||
@@ -458,7 +700,7 @@ while ($sthBrowsC > $i)
|
||||
chmod 0777, "$VDHLOGfile";
|
||||
|
||||
### Move file to the LEADS_IN directory locally
|
||||
if (!$T) {`mv -f $dir2/$VDLfile $dir1/$VDLfile`;}
|
||||
if ($T < 1) {`mv -f $dir2/$VDLfile $dir1/$VDLfile`;}
|
||||
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Vtiger_optimize_all_tables.pl version 2.0.5 *DBI-version*
|
||||
#
|
||||
# DESCRIPTION:
|
||||
# runs optimize table on all Vtiger tables in MySQL database
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES
|
||||
# 90422-0521 - First build
|
||||
#
|
||||
|
||||
$secX = time();
|
||||
|
||||
# default path to astguiclient configuration file:
|
||||
$PATHconf = '/etc/astguiclient.conf';
|
||||
|
||||
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
|
||||
@conf = <conf>;
|
||||
close(conf);
|
||||
$i=0;
|
||||
foreach(@conf)
|
||||
{
|
||||
$line = $conf[$i];
|
||||
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
|
||||
if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) )
|
||||
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
|
||||
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) )
|
||||
{$PATHagi = $line; $PATHagi =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) )
|
||||
{$PATHweb = $line; $PATHweb =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
|
||||
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) )
|
||||
{$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) )
|
||||
{$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) )
|
||||
{$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) )
|
||||
{$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) )
|
||||
{$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) )
|
||||
{$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
|
||||
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARREPORT_host/) && ($CLIREPORT_host < 1) )
|
||||
{$VARREPORT_host = $line; $VARREPORT_host =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARREPORT_user/) && ($CLIREPORT_user < 1) )
|
||||
{$VARREPORT_user = $line; $VARREPORT_user =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARREPORT_pass/) && ($CLIREPORT_pass < 1) )
|
||||
{$VARREPORT_pass = $line; $VARREPORT_pass =~ s/.*=//gi;}
|
||||
if ( ($line =~ /^VARREPORT_port/) && ($CLIREPORT_port < 1) )
|
||||
{$VARREPORT_port = $line; $VARREPORT_port =~ s/.*=//gi;}
|
||||
$i++;
|
||||
}
|
||||
|
||||
# Customized Variables
|
||||
$server_ip = $VARserver_ip; # Asterisk server IP
|
||||
|
||||
### begin parsing run-time options ###
|
||||
if (length($ARGV[0])>1)
|
||||
{
|
||||
$i=0;
|
||||
while ($#ARGV >= $i)
|
||||
{
|
||||
$args = "$args $ARGV[$i]";
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($args =~ /--help|-h/i)
|
||||
{
|
||||
print "allowed run time options:\n";
|
||||
print " [-q] = quiet\n";
|
||||
print " [--test] = test\n";
|
||||
print " [--debug] = debug output\n";
|
||||
print " [-h] = this help screen\n\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($args =~ /-q/i)
|
||||
{
|
||||
$q=1;
|
||||
$DB=0;
|
||||
$DBX=0;
|
||||
$force_quiet=1;
|
||||
}
|
||||
if ( ($args =~ /-debug/i) && ($force_quiet < 1) )
|
||||
{
|
||||
$DB=1;
|
||||
print "\n----- DEBUGGING -----\n\n";
|
||||
}
|
||||
if ( ($args =~ /-debugX/i) && ($force_quiet < 1) )
|
||||
{
|
||||
$DBX=1;
|
||||
print "\n----- SUPER-DUPER DEBUGGING -----\n\n";
|
||||
}
|
||||
else {$DBX=0;}
|
||||
|
||||
if ($args =~ /-test/i)
|
||||
{
|
||||
$T=1;
|
||||
if ($q < 1) {print "\n----- TESTING -----\n\n";}
|
||||
}
|
||||
else
|
||||
{$T=0;}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "no command line options set\n";
|
||||
$args = "";
|
||||
$i=0;
|
||||
$forcelistid = '';
|
||||
$T=0;
|
||||
}
|
||||
### end parsing run-time options ###
|
||||
|
||||
if ($q < 1)
|
||||
{
|
||||
print "\n\n\n\n\n\n\n\n\n\n\n\n-- Vtiger_optimize_all_tables.pl --\n\n";
|
||||
print "This program is designed to optimize all tables in the VtigerCRM MySQL database.\n\n";
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$US = '_';
|
||||
$phone_list = '|';
|
||||
|
||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
|
||||
use DBI;
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmtA = "SELECT use_non_latin,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass FROM system_settings;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
if ($sthArows > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$non_latin = "$aryA[0]";
|
||||
$vtiger_server_ip = "$aryA[1]";
|
||||
$vtiger_dbname = "$aryA[2]";
|
||||
$vtiger_login = "$aryA[3]";
|
||||
$vtiger_pass = "$aryA[4]";
|
||||
}
|
||||
$sthA->finish();
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$dbhB = DBI->connect("DBI:mysql:$vtiger_dbname:$vtiger_server_ip:$VARDB_port", "$vtiger_login", "$vtiger_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
|
||||
if ($non_latin > 0) {$affected_rows = $dbhA->do("SET NAMES 'UTF8'");}
|
||||
|
||||
|
||||
$i=0; ### each table counter ###
|
||||
|
||||
$stmtB="show tables;";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
while ($sthBrows > $i)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
$tables[$i] = "$aryB[0]";
|
||||
$i++;
|
||||
}
|
||||
$sthB->finish();
|
||||
|
||||
if ($q < 1) {print "VtigerCRM Database tables found: $i\n";}
|
||||
|
||||
|
||||
if ( ($i > 0) && ($T < 1) )
|
||||
{
|
||||
$j=0;
|
||||
while ($i > $j)
|
||||
{
|
||||
$stmtB="OPTIMIZE TABLE $tables[$j];";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
if ($sthBrows > 0)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
if ($q < 1) {print "$stmtB|$aryB[0]|$aryB[1]|$aryB[2]|$aryB[3]\n";}
|
||||
}
|
||||
$sthB->finish();
|
||||
$j++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
### calculate time to run script ###
|
||||
$secY = time();
|
||||
$secZ = ($secY - $secX);
|
||||
$secZm = ($secZ /60);
|
||||
|
||||
if ($q < 1)
|
||||
{
|
||||
print "script execution time in seconds: $secZ minutes: $secZm\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
@@ -343,3 +343,25 @@ exten => _689XXX,1,Dial(${TRUNKIAX1}/08600${EXTEN:3},55,o)
|
||||
exten => _789XXX,1,Dial(${TRUNKIAX2}/08600${EXTEN:3},55,o)
|
||||
exten => _08600XXX,1,Dial(${TRUNKblind}/6${EXTEN:1},55,To)
|
||||
|
||||
|
||||
|
||||
Example of altering vicidial_conferences entries to make monitoring easier:
|
||||
delete from vicidial_conferences where conf_exten < 8600100 and server_ip='192.168.1.101';
|
||||
delete from vicidial_conferences where conf_exten > 8600199 and server_ip='192.168.1.101';
|
||||
update vicidial_conferences set conf_exten = (conf_exten + 100) where server_ip='192.168.1.101';
|
||||
|
||||
Then add the following to your extensions.conf:
|
||||
remove existing blind monitoring 08600XXX extension and replace with this:
|
||||
; blind monitoring
|
||||
exten => _086001XX,1,Dial(${TRUNKblind}/6${EXTEN:1},55,ot)
|
||||
exten => _086002XX,1,Dial(${TRUNKvicidial2}/${EXTEN},55,ot)
|
||||
exten => _086003XX,1,Dial(${TRUNKvicidial3}/${EXTEN},55,ot)
|
||||
exten => _086004XX,1,Dial(${TRUNKvicidial4}/${EXTEN},55,ot)
|
||||
|
||||
Change the _8600[1-2]XX to just _86--1XX
|
||||
|
||||
in the meetme.conf
|
||||
remove all conferences before 8600200 and after 8600299
|
||||
|
||||
(vi command for search and replace ":%s/86001/86002/g")
|
||||
|
||||
|
||||
@@ -601,8 +601,8 @@ exten => i,1,Goto(monitor_exit,s,1)
|
||||
exten => #,1,Goto(monitor_exit,s,1)
|
||||
exten => t,1,Goto(monitor_exit,s,1)
|
||||
|
||||
exten => _8[0-2]XX,1,Meetme(8600${EXTEN:1},FmqX) ; Listen
|
||||
exten => _99[0-2]XX,1,Meetme(8600${EXTEN:2},FX) ; Barge
|
||||
exten => _8[0-2]XX,1,Meetme(8600${EXTEN:1},mqX) ; Listen
|
||||
exten => _99[0-2]XX,1,Meetme(8600${EXTEN:2},X) ; Barge
|
||||
|
||||
[monitor_exit]
|
||||
exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
|
||||
|
||||
@@ -601,8 +601,8 @@ exten => i,1,Goto(monitor_exit,s,1)
|
||||
exten => #,1,Goto(monitor_exit,s,1)
|
||||
exten => t,1,Goto(monitor_exit,s,1)
|
||||
|
||||
exten => _8[0-2]XX,1,Meetme(8600${EXTEN:1},FmqX) ; Listen
|
||||
exten => _99[0-2]XX,1,Meetme(8600${EXTEN:2},FX) ; Barge
|
||||
exten => _8[0-2]XX,1,Meetme(8600${EXTEN:1},mqX) ; Listen
|
||||
exten => _99[0-2]XX,1,Meetme(8600${EXTEN:2},X) ; Barge
|
||||
|
||||
[monitor_exit]
|
||||
exten => h,1,DeadAGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
|
||||
|
||||
@@ -495,7 +495,10 @@ agent_shift_enforcement_override ENUM('DISABLED','OFF','START','ALL') default 'D
|
||||
manager_shift_enforcement_override ENUM('0','1') default '0',
|
||||
shift_override_flag ENUM('0','1') default '0',
|
||||
export_reports ENUM('0','1') default '0',
|
||||
delete_from_dnc ENUM('0','1') default '0'
|
||||
delete_from_dnc ENUM('0','1') default '0',
|
||||
email VARCHAR(100) default '',
|
||||
user_code VARCHAR(100) default '',
|
||||
territory VARCHAR(100) default ''
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -24,3 +24,9 @@ ALTER TABLE vicidial_campaign_statuses ADD not_interested ENUM('Y','N') default
|
||||
ALTER TABLE vicidial_campaign_statuses ADD unworkable ENUM('Y','N') default 'N';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1137';
|
||||
|
||||
ALTER TABLE vicidial_users ADD email VARCHAR(100) default '';
|
||||
ALTER TABLE vicidial_users ADD user_code VARCHAR(100) default '';
|
||||
ALTER TABLE vicidial_users ADD territory VARCHAR(100) default '';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1138';
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
############################################################ ADMIN
|
||||
Delete From DNC Lists||
|
||||
This setting if set to 1 will allow a manager to remove phone numbers from the DNC lists in the VICIDIAL system||
|
||||
DNC NOT DELETED||
|
||||
This phone number is not in the Do Not Call List||
|
||||
DNC DELETED||
|
||||
ADD OR DELETE NUMBERS FROM THE DNC LIST||
|
||||
Add or Delete||
|
||||
Add-Delete Number From DNC||
|
||||
Vtiger Search Dead Accounts||
|
||||
If Vtiger integration is enabled in the system settings then this setting will define whether deleted accounts will be searched when the agent clicks WEB FORM to search in the Vtiger system. DISABLED- deleted leads will not be searched, ASK- deleted leads will be searched and the vtiger search web page will ask the agent if they want to make the Vtiger account active, RESURRECT- will automatically make the deleted account active again and will take the agent to the account screen without delay upon clicking on WEB FORM. Default is DISABLED||
|
||||
The DISPO option will create a call record for the Vtiger account without the agent needing to go to the vtiger search page through the WEB FORM||
|
||||
The NEW_WINDOW option will open a new window upon login to the VICIDIAL agent screen||
|
||||
Vtiger Status Call||
|
||||
If Vtiger integration is enabled in the system settings then this setting will define whether the status of the Vtiger Account will be updated with the status of the VICIDIAL call after it has been dispositioned. Default is N||
|
||||
There are also 5 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable||
|
||||
If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds||
|
||||
Email, User Code and Territory||
|
||||
These are optional fields||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
|
||||
|
||||
############################################################ MANAGER Manual
|
||||
|
||||
|
||||
|
||||
############################################################ AGENT Manual
|
||||
|
||||
@@ -434,7 +434,7 @@ $camp_form_code .= "<option value=\"\"></option>\n";
|
||||
$LOGallowed_campaignsSQL='';
|
||||
if ($relogin == 'YES')
|
||||
{
|
||||
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'";
|
||||
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass';";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -488,7 +488,7 @@ if ($MGR_override > 0)
|
||||
}
|
||||
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
+29
-10
@@ -970,6 +970,10 @@ if (isset($_GET["not_interested"])) {$not_interested=$_GET["not_interested"];
|
||||
elseif (isset($_POST["not_interested"])) {$not_interested=$_POST["not_interested"];}
|
||||
if (isset($_GET["unworkable"])) {$unworkable=$_GET["unworkable"];}
|
||||
elseif (isset($_POST["unworkable"])) {$unworkable=$_POST["unworkable"];}
|
||||
if (isset($_GET["user_code"])) {$user_code=$_GET["user_code"];}
|
||||
elseif (isset($_POST["user_code"])) {$user_code=$_POST["user_code"];}
|
||||
if (isset($_GET["territory"])) {$territory=$_GET["territory"];}
|
||||
elseif (isset($_POST["territory"])) {$territory=$_POST["territory"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -1428,6 +1432,8 @@ $template_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$template_name);
|
||||
$carrier_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$carrier_name);
|
||||
$group_alias_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$group_alias_name);
|
||||
$caller_id_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$caller_id_name);
|
||||
$user_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$user_code);
|
||||
$territory = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$territory);
|
||||
|
||||
### ALPHA-NUMERIC and underscore and dash and slash and at and dot
|
||||
$call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group);
|
||||
@@ -1674,11 +1680,13 @@ $dialplan_entry = ereg_replace(";","",$dialplan_entry);
|
||||
# 90322-1105 - Added new status settings and vtiger options
|
||||
# 90409-2133 - Fixed special characters in SCRIPTS
|
||||
# 90413-0755 - Fixed filter and script slashes issues
|
||||
# 90417-0211 - Fixed filter and script slashes issues
|
||||
# 90422-0613 - Added user_code, territory and email to vicidial_users
|
||||
#
|
||||
# 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.2.0-177';
|
||||
$build = '90413-0755';
|
||||
$admin_version = '2.2.0-179';
|
||||
$build = '90422-0613';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -2618,6 +2626,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
|
||||
<BR>
|
||||
<B>Active -</B> This field defines whether the user is active in the system and can use VICIDIAL resources. Default is Y
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_users-optional">
|
||||
<BR>
|
||||
<B>Email, User Code and Territory -</B> These are optional fields.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_users-hotkeys_active">
|
||||
<BR>
|
||||
@@ -3650,7 +3663,7 @@ if ($SSqc_features_active > 0)
|
||||
<BR>
|
||||
<A NAME="vicidial_inbound_groups-play_estimate_hold_time">
|
||||
<BR>
|
||||
<B>Play Estimated Hold Time -</B> This defines whether the caller will hear the estimated hold time before they are transferred to an agent. Default is N.
|
||||
<B>Play Estimated Hold Time -</B> This defines whether the caller will hear the estimated hold time before they are transferred to an agent. Default is N. If the customer is on hold and hears this estimated hold time message, the minimum time that will be played is 15 seconds.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_inbound_groups-hold_time_option">
|
||||
@@ -6791,7 +6804,7 @@ if ($ADD=="2A")
|
||||
$stmt="UPDATE system_settings SET auto_user_add_value='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc from vicidial_users where user=\"$source_user_id\";";
|
||||
$stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory from vicidial_users where user=\"$source_user_id\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";";
|
||||
@@ -7782,7 +7795,7 @@ if ($ADD==2111111)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','$script_text','$active');";
|
||||
$stmt="INSERT INTO vicidial_scripts values('$script_id','$script_name','$script_comments','" . mysql_real_escape_string($script_text) . "','$active');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB > 0) {echo "|$stmt|";}
|
||||
echo "<br><B>SCRIPT ADDED: $script_id</B>\n";
|
||||
@@ -7821,7 +7834,7 @@ if ($ADD==21111111)
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='$lead_filter_sql';";
|
||||
$stmt="INSERT INTO vicidial_lead_filters SET lead_filter_id='$lead_filter_id',lead_filter_name='$lead_filter_name',lead_filter_comments='$lead_filter_comments',lead_filter_sql='" . mysql_real_escape_string($lead_filter_sql) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
if ($DB > 0) {echo "|$stmt|";}
|
||||
@@ -8510,7 +8523,7 @@ if ($ADD=="4A")
|
||||
}
|
||||
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc' where user='$user';";
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory' where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -8743,7 +8756,7 @@ if ($ADD=="4B")
|
||||
}
|
||||
echo "<br><B>USER MODIFIED - ADMIN: $user</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override' where user='$user';";
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory' where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -8971,7 +8984,7 @@ if ($ADD==4)
|
||||
{
|
||||
echo "<br><B>USER MODIFIED: $user</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active' where user='$user';";
|
||||
$stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',active='$active',email='$email',user_code='$user_code',territory='$territory' where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -12933,6 +12946,9 @@ if ($ADD==3)
|
||||
$manager_shift_enforcement_override = $row[62];
|
||||
$export_reports = $row[64];
|
||||
$delete_from_dnc = $row[65];
|
||||
$email = $row[66];
|
||||
$user_code = $row[67];
|
||||
$territory = $row[68];
|
||||
|
||||
if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) )
|
||||
{
|
||||
@@ -12982,6 +12998,9 @@ if ($ADD==3)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Login: </td><td align=left><input type=text name=phone_login size=20 maxlength=20 value=\"$phone_login\">$NWB#vicidial_users-phone_login$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Phone Pass: </td><td align=left><input type=text name=phone_pass size=20 maxlength=20 value=\"$phone_pass\">$NWB#vicidial_users-phone_pass$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$active</option></select>$NWB#vicidial_users-active$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Email: </td><td align=left><input type=text name=email size=40 maxlength=100 value=\"$email\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>User Code: </td><td align=left><input type=text name=user_code size=40 maxlength=100 value=\"$user_code\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Territory: </td><td align=left><input type=text name=territory size=40 maxlength=100 value=\"$territory\">$NWB#vicidial_users-optional$NWE</td></tr>\n";
|
||||
|
||||
if ( ($LOGuser_level > 8) or ($LOGalter_agent_interface == "1") )
|
||||
{
|
||||
@@ -19924,7 +19943,7 @@ if ($ADD==999999)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="select server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers;";
|
||||
$stmt="select server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$servers_to_print = mysql_num_rows($rslt);
|
||||
|
||||
Reference in New Issue
Block a user