diff --git a/app/xml_cdr/app_languages.php b/app/xml_cdr/app_languages.php
index 035ffaeb69..cf38c6bc0a 100644
--- a/app/xml_cdr/app_languages.php
+++ b/app/xml_cdr/app_languages.php
@@ -100,25 +100,25 @@ $text['title-call-statistics']['ru-ru'] = "Статистика вызовов";
$text['title-call-statistics']['sv-se'] = "Detaljerad Samtals-statistik";
$text['title-call-statistics']['uk-ua'] = "";
-$text['title-archive']['en-us'] = "Call Detail Records Archive";
-$text['title-archive']['ar-eg'] = "";
-$text['title-archive']['de-at'] = "Meine Gespräche Archiv"; //copied from de-de
-$text['title-archive']['de-ch'] = "Meine Gespräche Archiv"; //copied from de-de
-$text['title-archive']['de-de'] = "Meine Gespräche Archiv";
-$text['title-archive']['es-cl'] = "Registro de Detalle de Llamadas Archivo";
-$text['title-archive']['es-mx'] = "Registro de Detalle de Llamadas Archivo"; //copied from es-cl
-$text['title-archive']['fr-ca'] = "Historique détaillé des appels Archiver"; //copied from fr-fr
-$text['title-archive']['fr-fr'] = "Historique détaillé des appels Archiver";
-$text['title-archive']['he-il'] = "";
-$text['title-archive']['it-it'] = "Cartellini di Chiamata Archivio";
-$text['title-archive']['nl-nl'] = "";
-$text['title-archive']['pl-pl'] = "Wykaz rozmów Archiwum";
-$text['title-archive']['pt-br'] = "Configurações da Conta Archiwum";
-$text['title-archive']['pt-pt'] = "Registo de Chamadas Arquivo";
-$text['title-archive']['ro-ro'] = "";
-$text['title-archive']['ru-ru'] = "Детализация Вызовов архив";
-$text['title-archive']['sv-se'] = "Detaljerad Samtalsinformation archív";
-$text['title-archive']['uk-ua'] = "Параметри облікового запису архів";
+$text['title-call_detail_records_archive']['en-us'] = "Call Detail Records Archive";
+$text['title-call_detail_records_archive']['ar-eg'] = "";
+$text['title-call_detail_records_archive']['de-at'] = "Meine Gespräche Archiv"; //copied from de-de
+$text['title-call_detail_records_archive']['de-ch'] = "Meine Gespräche Archiv"; //copied from de-de
+$text['title-call_detail_records_archive']['de-de'] = "Meine Gespräche Archiv";
+$text['title-call_detail_records_archive']['es-cl'] = "Registro de Detalle de Llamadas Archivo";
+$text['title-call_detail_records_archive']['es-mx'] = "Registro de Detalle de Llamadas Archivo"; //copied from es-cl
+$text['title-call_detail_records_archive']['fr-ca'] = "Historique détaillé des appels Archiver"; //copied from fr-fr
+$text['title-call_detail_records_archive']['fr-fr'] = "Historique détaillé des appels Archiver";
+$text['title-call_detail_records_archive']['he-il'] = "";
+$text['title-call_detail_records_archive']['it-it'] = "Cartellini di Chiamata Archivio";
+$text['title-call_detail_records_archive']['nl-nl'] = "";
+$text['title-call_detail_records_archive']['pl-pl'] = "Wykaz rozmów Archiwum";
+$text['title-call_detail_records_archive']['pt-br'] = "Configurações da Conta Archiwum";
+$text['title-call_detail_records_archive']['pt-pt'] = "Registo de Chamadas Arquivo";
+$text['title-call_detail_records_archive']['ro-ro'] = "";
+$text['title-call_detail_records_archive']['ru-ru'] = "Детализация Вызовов архив";
+$text['title-call_detail_records_archive']['sv-se'] = "Detaljerad Samtalsinformation archív";
+$text['title-call_detail_records_archive']['uk-ua'] = "Параметри облікового запису архів";
$text['title-advanced_search']['en-us'] = "Advanced Search";
$text['title-advanced_search']['ar-eg'] = "";
diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php
index 468dbc1530..2ea2f528ca 100644
--- a/app/xml_cdr/xml_cdr.php
+++ b/app/xml_cdr/xml_cdr.php
@@ -45,13 +45,13 @@
$text = $language->get();
//get posted data
- if (is_array($_POST['xml_cdrs'])) {
+ if (!$archive_request && is_array($_POST['xml_cdrs'])) {
$action = $_POST['action'];
$xml_cdrs = $_POST['xml_cdrs'];
}
//process the http post data by action
- if ($action != '' && is_array($xml_cdrs) && @sizeof($xml_cdrs) != 0) {
+ if (!$archive_request && $action != '' && is_array($xml_cdrs) && @sizeof($xml_cdrs) != 0) {
switch ($action) {
case 'delete':
if (permission_exists('xml_cdr_delete')) {
@@ -69,8 +69,13 @@
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);
-//additional includes
- $document['title'] = $text['title-call_detail_records'];
+//include the header
+ if ($archive_request) {
+ $document['title'] = $text['title-call_detail_records_archive'];
+ }
+ else {
+ $document['title'] = $text['title-call_detail_records'];
+ }
require_once "resources/header.php";
//xml cdr include
@@ -79,17 +84,17 @@
//javascript function: send_cmd
echo "\n";
//javascript to toggle export select box
@@ -103,11 +108,29 @@
echo " }";
echo "";
-//page title and description
+//show the content
echo "
\n";
- echo "
".$text['title-call_detail_records']."
\n";
+ echo "
";
+ if ($archive_request) {
+ echo "".$text['title-call_detail_records_archive']." ";
+ }
+ else {
+ echo "".$text['title-call_detail_records']." ";
+ }
+ echo "
\n";
echo "
\n";
- echo "
\n";
echo "
".$text['description_search']."
\n";
@@ -489,7 +507,7 @@
echo "
\n";
echo "\n";
- if (permission_exists('xml_cdr_delete')) {
+ if (!$archive_request && permission_exists('xml_cdr_delete')) {
$content .= " \n";
$content .= " \n";
$content .= " \n";
@@ -669,7 +687,7 @@
}
if (strlen($row['direction']) > 0) {
$image_name = "icon_cdr_" . $row['direction'] . "_" . $call_result;
- if($row['leg'] == 'b') {
+ if ($row['leg'] == 'b') {
$image_name .= '_b';
}
$image_name .= ".png";
@@ -826,12 +844,7 @@
else {
$content .= " ".ucwords(escape($call_result))." \n";
}
- //action icon
- //if (permission_exists('xml_cdr_details')) {
- // $content .= " ";
- // $content .= button::create(['type'=>'button','title'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
- // $content .= " \n";
- //}
+
$content .= " \n";
//show the leg b only to those with the permission
@@ -845,15 +858,13 @@
$x++;
}
+ unset($sql, $result, $row_count);
}
- unset($sql, $result, $row_count);
echo "
\n";
echo "
\n";
echo "
".$paging_controls."
\n";
-
echo "
\n";
-
echo "\n";
//store last search/sort query parameters in session
@@ -862,4 +873,4 @@
//show the footer
require_once "resources/footer.php";
-?>
+?>
\ No newline at end of file
diff --git a/app/xml_cdr/xml_cdr_archive.php b/app/xml_cdr/xml_cdr_archive.php
index 9068264951..38242862e1 100644
--- a/app/xml_cdr/xml_cdr_archive.php
+++ b/app/xml_cdr/xml_cdr_archive.php
@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane
- Portions created by the Initial Developer are Copyright (C) 2008-2019
+ Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -25,701 +25,11 @@
Luis Daniel Lucio Quiroz
*/
+//set archive flag
+ $archive_request = true;
+
//includes
require_once "root.php";
- require_once "resources/require.php";
- require_once "resources/check_auth.php";
+ require_once "xml_cdr.php";
-//check permisions
- if (permission_exists('xml_cdr_view')) {
- //access granted
- }
- else {
- echo "access denied";
- exit;
- }
-
-//add multi-lingual support
- $language = new text;
- $text = $language->get();
-
-//additional includes
- require_once "resources/header.php";
- require_once "resources/paging.php";
-
-//xml cdr include
- $rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
- $archive_request = 'true';
- require_once "xml_cdr_inc.php";
-
-//javascript function: send_cmd
- echo "\n";
-
-//javascript to toggle export select box
- echo "";
-
-//page title and description
- echo "\n";
- echo "\n";
- echo "".$text['title-archive']." \n";
- echo "\n";
- echo " \n";
- echo " \n";
- echo " \n";
-
- echo "\n";
- echo "\n";
-
- echo $text['description']." \n";
- echo $text['description2']." \n";
- echo $text['description-3']." \n";
- echo $text['description-4']." \n";
-
- echo " \n";
-
- echo " \n";
- echo " \n";
- echo "
\n";
-
- //basic search of call detail records
- if (permission_exists('xml_cdr_search')) {
-
- echo "";
- echo " ";
- }
-
-//mod paging parameters for inclusion in column sort heading links
- $param = substr($param, 1); //remove leading '&'
- $param = substr($param, 0, strrpos($param, '&order_by=')); //remove trailing order by
-
-//show the results
- $col_count = 8;
- //echo "";
- echo " ";
- echo $paging_controls;
- echo " ";
-
- // check or uncheck all checkboxes
- if (sizeof($xml_ids) > 0) {
- echo "\n";
- }
-
- //store last search/sort query parameters in session
- $_SESSION['xml_cdr']['last_query'] = $_SERVER["QUERY_STRING"];
-
-//show the footer
- require_once "resources/footer.php";
-
-?>
+?>
\ No newline at end of file
diff --git a/app/xml_cdr/xml_cdr_export.php b/app/xml_cdr/xml_cdr_export.php
index f912fb0b39..58f59c3931 100644
--- a/app/xml_cdr/xml_cdr_export.php
+++ b/app/xml_cdr/xml_cdr_export.php
@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane
- Portions created by the Initial Developer are Copyright (C) 2008-2014
+ Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -25,7 +25,7 @@
*/
//includes
- include "root.php";
+ require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
@@ -44,6 +44,7 @@
//additional includes
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
+ $archive_request = $_POST['archive_request'] == 'true' ? true : false;
require_once "xml_cdr_inc.php";
//get the format
@@ -111,15 +112,15 @@
//determine page size
switch ($_SESSION['fax']['page_size']['text']) {
- case 'a4' :
+ case 'a4':
$page_width = 11.7; //in
$page_height = 8.3; //in
break;
- case 'legal' :
+ case 'legal':
$page_width = 14; //in
$page_height = 8.5; //in
break;
- case 'letter' :
+ case 'letter':
default :
$page_width = 11; //in
$page_height = 8.5; //in
@@ -183,7 +184,7 @@
$z = 0; // total counter
$p = 0; // per page counter
if (sizeof($result) > 0) {
- foreach($result as $cdr_num => $fields) {
+ foreach ($result as $cdr_num => $fields) {
$data_body[$p] .= '';
$data_body[$p] .= ''.$text['label-'.$fields['direction']].' ';
$data_body[$p] .= ''.$fields['caller_id_name'].' ';
@@ -315,4 +316,4 @@
}
-?>
+?>
\ No newline at end of file
diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php
index 3dc82111d2..e9286fe782 100644
--- a/app/xml_cdr/xml_cdr_inc.php
+++ b/app/xml_cdr/xml_cdr_inc.php
@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane
- Portions created by the Initial Developer are Copyright (C) 2008-2019
+ Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -28,6 +28,7 @@
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
+ require_once "resources/paging.php";
//check permissions
if (permission_exists('xml_cdr_view')) {
@@ -38,9 +39,6 @@
exit;
}
-//additional includes
- require_once "resources/paging.php";
-
//set 24hr or 12hr clock
define('TIME_24HR', 1);
@@ -109,7 +107,7 @@
}
//check to see if permission does not exist
- if(!permission_exists('xml_cdr_b_leg')){
+ if (!permission_exists('xml_cdr_b_leg')) {
$leg = 'a';
}
@@ -520,16 +518,14 @@
}
$sql = str_replace(" ", " ", $sql);
$database = new database;
- if ($archive_request == 'true') {
- if ($_SESSION['cdr']['archive_database']['boolean'] == 'true') {
- $database->driver = $_SESSION['cdr']['archive_database_driver']['text'];
- $database->host = $_SESSION['cdr']['archive_database_host']['text'];
- $database->type = $_SESSION['cdr']['archive_database_type']['text'];
- $database->port = $_SESSION['cdr']['archive_database_port']['text'];
- $database->db_name = $_SESSION['cdr']['archive_database_name']['text'];
- $database->username = $_SESSION['cdr']['archive_database_username']['text'];
- $database->password = $_SESSION['cdr']['archive_database_password']['text'];
- }
+ if ($archive_request && $_SESSION['cdr']['archive_database']['boolean'] == 'true') {
+ $database->driver = $_SESSION['cdr']['archive_database_driver']['text'];
+ $database->host = $_SESSION['cdr']['archive_database_host']['text'];
+ $database->type = $_SESSION['cdr']['archive_database_type']['text'];
+ $database->port = $_SESSION['cdr']['archive_database_port']['text'];
+ $database->db_name = $_SESSION['cdr']['archive_database_name']['text'];
+ $database->username = $_SESSION['cdr']['archive_database_username']['text'];
+ $database->password = $_SESSION['cdr']['archive_database_password']['text'];
}
$result = $database->select($sql, $parameters, 'all');
$result_count = (count($result) ? count($result) : 0);
@@ -541,4 +537,4 @@
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page, false, $result_count); //bottom
}
-?>
+?>
\ No newline at end of file