From 78b4f2f3867696949bc12da6d55190729a9a5b52 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 7 May 2010 18:31:32 +0000 Subject: [PATCH] Added header option to calls export report Added copy carrier option in admin.php git-svn-id: svn://192.168.202.10@1427 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../www/vicidial/call_report_export.php | 13 ++ agc_2-X/trunk/docs/CUSTOM_FIELDS.txt | 7 ++ .../TO_BE_TRANSLATED_2.4.txt | 5 + agc_2-X/trunk/www/vicidial/admin.php | 117 +++++++++++++++++- agc_2-X/trunk/www/vicidial/admin_header.php | 3 +- .../trunk/www/vicidial/admin_lists_custom.php | 10 +- .../trunk/www/vicidial/call_report_export.php | 13 ++ 7 files changed, 159 insertions(+), 9 deletions(-) diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php index f4599238..55d62ebe 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php @@ -17,6 +17,7 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export # require("dbconnect.php"); @@ -42,6 +43,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -299,6 +302,11 @@ if ($run_export > 0) ob_clean(); flush(); + 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"; + } + $i=0; while ($k > $i) { @@ -518,6 +526,11 @@ else

\n"; + + echo "Header Row:
\n"; + echo "\n"; diff --git a/agc_2-X/trunk/docs/CUSTOM_FIELDS.txt b/agc_2-X/trunk/docs/CUSTOM_FIELDS.txt index 9bd083fb..31d5c4ca 100644 --- a/agc_2-X/trunk/docs/CUSTOM_FIELDS.txt +++ b/agc_2-X/trunk/docs/CUSTOM_FIELDS.txt @@ -46,6 +46,13 @@ New settings will be added in the astguiclient.conf file for DB_custom_user and +Admin changes: + +Added admin_lists_custom.php for these features to be administered. This will allow the viewing of custom fields as well as the copying of custom field definitions to lists with no custom fields. + + + + MySQL tables: diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index 1ec57904..25c33939 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -165,6 +165,11 @@ Option Position|| 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|| Hold Time Option Minimum|| If Hold Time Option enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Option Seconds value. Default is 0 seconds|| +ADDING COPIED CARRIER|| +ADD COPIED CARRIER|| +Source Carrier|| +COPIED CARRIER ADDED|| +Copy A Carrier|| AST_VICIDIAL_ingrouplist.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index dfca51f2..61e39017 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1253,6 +1253,8 @@ if (isset($_GET["custom_fields_modify"])) {$custom_fields_modify=$_GET["custom elseif (isset($_POST["custom_fields_modify"])) {$custom_fields_modify=$_POST["custom_fields_modify"];} if (isset($_GET["hold_time_option_minimum"])) {$hold_time_option_minimum=$_GET["hold_time_option_minimum"];} elseif (isset($_POST["hold_time_option_minimum"])) {$hold_time_option_minimum=$_POST["hold_time_option_minimum"];} +if (isset($_GET["source_carrier"])) {$source_carrier=$_GET["source_carrier"];} + elseif (isset($_POST["source_carrier"])) {$source_carrier=$_POST["source_carrier"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -1725,6 +1727,7 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); @@ -2197,7 +2200,7 @@ else # 100420-1010 - Added scheduled_callbacks_count campaign option # 100423-1030 - Added realtime_block_user_info, manual dial campaign, blind monitor warnings, in-group callid, phones codecs features # 100506-1807 - Added hidden settings for lists custom fields -# 100507-1102 - Added hold_time_option_minimum option to in-groups +# 100507-1102 - Added hold_time_option_minimum option to in-groups and copy carrier function # # 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 @@ -2392,6 +2395,7 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";} if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "ADD NEW SERVER";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "ADD NEW CONF TEMPLATE";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "ADD NEW CARRIER";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRY";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC ON HOLD ENTRY";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW VOICEMAIL BOX";} @@ -2430,6 +2434,7 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADDING NEW SERVER VICIDIAL TRUNK RECORD";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "ADDING NEW CONF TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "ADDING NEW CARRIER";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "ADDING NEW TTS ENTRY";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC ON HOLD ENTRY";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "ADDING NEW VOICEMAIL BOX";} @@ -8260,6 +8265,70 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
ADD COPIED CARRIER
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
Carrier ID: $NWB#vicidial_server_carriers-carrier_id$NWE
Carrier Name: $NWB#vicidial_server_carriers-carrier_name$NWE
Server IP: $NWB#vicidial_server_carriers-server_ip$NWE
Source Carrier: $NWB#vicidial_server_carriers-carrier_id$NWE
\n"; + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### @@ -10610,6 +10679,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
CARRIER NOT ADDED - there is already a carrier in the system with this ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
CARRIER NOT ADDED - Please go back and look at the data you entered\n";} + else + { + echo "
COPIED CARRIER ADDED\n"; + + $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -22059,6 +22167,9 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; @@ -22110,8 +22221,6 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -22166,6 +22275,8 @@ if ($ADD==31111111111) echo "

Click here for phone stats\n"; + echo "

Click here for phone call recordings\n"; + if ($LOGast_delete_phones > 0) { echo "

DELETE THIS PHONE\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 6bd7fbb6..de9705be 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -20,6 +20,7 @@ # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus # 100311-2210 - Added callcard_enabled Admin element # 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu # @@ -1273,7 +1274,7 @@ $SScustom_fields_enabled = $row[3]; 1) and (strlen($admin_hh) > 1) ) { ?> - > + > 1) and (strlen($admin_hh) > 1) ) { ?> diff --git a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php index fd1efd59..87003409 100644 --- a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php +++ b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php @@ -179,14 +179,14 @@ else @@ -815,7 +815,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) echo ">"; echo "$A_field_name[$o]"; if ($A_name_position[$o]=='TOP') - {echo "     ?
";} + {echo "     help+
";} else {echo "";} $field_HTML=''; @@ -936,7 +936,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) ) } if ($A_name_position[$o]=='LEFT') - {echo "
\n"; diff --git a/agc_2-X/trunk/www/vicidial/call_report_export.php b/agc_2-X/trunk/www/vicidial/call_report_export.php index f4599238..55d62ebe 100644 --- a/agc_2-X/trunk/www/vicidial/call_report_export.php +++ b/agc_2-X/trunk/www/vicidial/call_report_export.php @@ -17,6 +17,7 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export # require("dbconnect.php"); @@ -42,6 +43,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} 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["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -299,6 +302,11 @@ if ($run_export > 0) ob_clean(); flush(); + 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"; + } + $i=0; while ($k > $i) { @@ -518,6 +526,11 @@ else

\n"; + + echo "Header Row:
\n"; + echo "
Phone extension: $NWB#phones-extension$NWE (Agent Screen Phone Login)
Dial Plan Number: (digits only)$NWB#phones-dialplan_number$NWE
DTMFSend Channel: $NWB#phones-dtmf_send_extension$NWE
Outbound Call Group: $NWB#phones-call_out_number_group$NWE
Browser Location: $NWB#phones-client_browser$NWE
Install Directory: $NWB#phones-install_directory$NWE
CallerID URL: $NWB#phones-local_web_callerID_URL$NWE
VICIDIAL Default URL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
  > Show Carriers   |   > Add A New Carrier
  > Show Carriers   |   > Add A New Carrier   |   > Copy A Carrier
$field_HTML   ?";} + {echo " $field_HTML   help+";} else { echo " $field_HTML
\n"; echo "Campaigns:
\n"; echo "