diff --git a/bin/AST_VDsales_export.pl b/bin/AST_VDsales_export.pl index c1d49757..7ae10dfd 100644 --- a/bin/AST_VDsales_export.pl +++ b/bin/AST_VDsales_export.pl @@ -29,6 +29,7 @@ # 101022-1022 - Added hours minutes seconds to filename variables # 110829-1045 - Changed recording lookup to try to find by vicidial_id first # 120511-2029 - Added CLI options for FTP login details +# 120705-1954 - Added --temp-dir=XXX option # $txt = '.txt'; @@ -176,6 +177,7 @@ if (length($ARGV[0])>1) print " [--ftp-pass=XXXXXXXX] = FTP pass\n"; print " [--ftp-dir=XXXXXXXX] = remote FTP server directory to post files to\n"; print " [--with-transfer-audio] = Different method for finding audio, also grabs transfer audio filenames\n"; + print " [--temp-dir=XXX] = If running more than one instance at a time, specify a unique temp directory suffix\n"; print " [--with-did-lookup] = Looks up the DID pattern and name the call came in on if possible\n"; print " [--email-list=test@test.com:test2@test.com] = send email results to these addresses\n"; print " [--email-sender=vicidial@localhost] = sender for the email results\n"; @@ -338,6 +340,16 @@ if (length($ARGV[0])>1) if (!$Q) {print "\n----- IGNORE CALLTIME FOR OUTBOUND -----\n\n";} } + if ($args =~ /--temp-dir=/i) + { + @data_in = split(/--temp-dir=/,$args); + $temp_dir = $data_in[1]; + $temp_dir =~ s/ .*//gi; + $temp_dir =~ s/:/,/gi; + if ($DB > 0) {print "\n----- TEMP DIR: $temp_dir -----\n\n";} + } + else + {$temp_dir = '';} if ($args =~ /-ftp-transfer/i) { if (!$Q) @@ -382,7 +394,7 @@ if (length($ARGV[0])>1) } } } - $tempdir = '/root/tempaudioexport'; + $tempdir = "/root/tempaudioexport$temp_dir"; if (!-e "$tempdir") {`mkdir -p $tempdir`;} ## remove old audio files from directory diff --git a/extras/firefox_plugin/src/vicidial_webdial_plugin/install.rdf b/extras/firefox_plugin/src/vicidial_webdial_plugin/install.rdf index 9a0ea070..015f5c4c 100644 --- a/extras/firefox_plugin/src/vicidial_webdial_plugin/install.rdf +++ b/extras/firefox_plugin/src/vicidial_webdial_plugin/install.rdf @@ -14,7 +14,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 3.0 - 3.9 + 99.9 diff --git a/extras/firefox_plugin/vicidial_webdial_plugin.xpi b/extras/firefox_plugin/vicidial_webdial_plugin.xpi index a3a4606c..954c7df4 100644 Binary files a/extras/firefox_plugin/vicidial_webdial_plugin.xpi and b/extras/firefox_plugin/vicidial_webdial_plugin.xpi differ diff --git a/www/vicidial/fcstats.php b/www/vicidial/fcstats.php index 4eabadb5..55d9c7d1 100644 --- a/www/vicidial/fcstats.php +++ b/www/vicidial/fcstats.php @@ -20,6 +20,7 @@ # 110703-1828 - Added download option # 111104-1213 - Added user_group restrictions for selecting in-groups # 120224-0910 - Added HTML display option with bar graphs +# 120705-2007 - Changed SALES to use sales status flag # require("dbconnect.php"); @@ -279,7 +280,18 @@ $HTML_text.="In-Group Fronter-Closer Stats Report $NOW_TIME $HTML_text.="\n"; $HTML_text.="---------- TOTALS FOR $query_date_BEGIN to $query_date_END\n"; -$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status = 'SALE';"; +$sale_dispo_stmt="select distinct status from vicidial_campaign_statuses where sale='Y' and campaign_id in (SELECT campaign_id from vicidial_campaigns where closer_campaigns LIKE \"% " . mysql_real_escape_string($group) . " %\" $LOGallowed_campaignsSQL) UNION select distinct status from vicidial_statuses where sale='Y'"; +if ($DB) {$HTML_text.="$sale_dispo_stmt\n";} +$sale_dispo_rslt=mysql_query($sale_dispo_stmt, $link); +$sale_dispos="'SALE'"; $sale_dispo_str="|SALE"; +while ($ssrow=mysql_fetch_row($sale_dispo_rslt)) { + $sale_dispos.=",'$ssrow[0]'"; + $sale_dispo_str.="|$ssrow[0]"; +} +$sale_dispo_str.="|"; +if ($DB) {$HTML_text.="Sale dispo string: $sale_dispo_str\n";} + +$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and status in ($sale_dispos);"; $rslt=mysql_query($stmt, $link); if ($DB) {$HTML_text.="$stmt\n";} $row=mysql_fetch_row($rslt); @@ -665,12 +677,13 @@ while ($i < $users_to_print) { $row=mysql_fetch_row($rslt); $recL=0; - if ( ($row[0]=='SALE') and ($recL < 1) ) + if ( preg_match("/\|$row[0]\|/", $sale_dispo_str) and ($recL < 1) ) { $A1=$row[1]; $recL++; $sales=($sales + $row[1]); $points = ($points + ($row[1] * 1) ); } + /* if ( ($row[0]=='A2') and ($recL < 1) ) { $A2=$row[1]; $recL++; @@ -693,6 +706,7 @@ while ($i < $users_to_print) $uBOT=($uBOT + $row[1]); $points = ($points + ($row[1] * 3) ); } + */ # if ( ($row[0]=='A5') and ($recL < 1) ) {$A5=$row[1]; $recL++;} # if ( ($row[0]=='A6') and ($recL < 1) ) {$A6=$row[1]; $recL++;} # if ( ($row[0]=='A7') and ($recL < 1) ) {$A7=$row[1]; $recL++;} @@ -745,7 +759,7 @@ while ($i < $users_to_print) if ($A1>$max_sales) {$max_sales=$A1;} if ($DROP>$max_drops) {$max_drops=$DROP;} if ($OTHER>$max_other) {$max_other=$OTHER;} - if ($sales>$max_sales2) {$max_sales=$sales;} + if ($sales>$max_sales2) {$max_sales2=$sales;} if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;} $graph_stats[$i][0]="$user[$i] - $full_name[$i]"; $graph_stats[$i][1]=$USERcalls[$i];