diff --git a/app/xml_cdr/app_languages.php b/app/xml_cdr/app_languages.php index 6e777e1515..c3263d2dc5 100644 --- a/app/xml_cdr/app_languages.php +++ b/app/xml_cdr/app_languages.php @@ -113,9 +113,9 @@ $text['table-calls-per-minute']['pl'] = "Ilość rozmów na minutę"; $text['table-calls-per-minute']['sv-se'] = "Samtal Per Minut"; $text['option-yesterday']['en-us'] = "Yesterday"; -$text['option-yesterday']['es-cl'] = "Yesterday"; -$text['option-yesterday']['pt-pt'] = "Yesterday"; -$text['option-yesterday']['fr-fr'] = "Yesterday"; +$text['option-yesterday']['es-cl'] = "Ayer"; +$text['option-yesterday']['pt-pt'] = "Ontem"; +$text['option-yesterday']['fr-fr'] = "Hier"; $text['option-yesterday']['pt-br'] = "Ontem"; $text['option-yesterday']['pl'] = "Wczoraj"; $text['option-yesterday']['sv-se'] = "Igår"; @@ -129,33 +129,41 @@ $text['option-true']['pl'] = "Tak"; $text['option-true']['sv-se'] = "Sann"; $text['option-today']['en-us'] = "Today"; -$text['option-today']['es-cl'] = "Today"; -$text['option-today']['pt-pt'] = "Today"; -$text['option-today']['fr-fr'] = "Today"; +$text['option-today']['es-cl'] = "Hoy"; +$text['option-today']['pt-pt'] = "Hoje"; +$text['option-today']['fr-fr'] = "Aujourd'hui"; $text['option-today']['pt-br'] = "Hoje"; $text['option-today']['pl'] = "Dzisiaj"; $text['option-today']['sv-se'] = "Idag"; $text['option-this_year']['en-us'] = "This Year"; -$text['option-this_year']['es-cl'] = "This Year"; -$text['option-this_year']['pt-pt'] = "This Year"; -$text['option-this_year']['fr-fr'] = "This Year"; +$text['option-this_year']['es-cl'] = "Este Año"; +$text['option-this_year']['pt-pt'] = "Este Ano"; +$text['option-this_year']['fr-fr'] = "Cette Année"; $text['option-this_year']['pt-br'] = "Este ano"; $text['option-this_year']['pl'] = "W tym roku"; $text['option-this_year']['sv-se'] = "Detta Året"; +$text['option-this_week']['en-us'] = "This Week"; +$text['option-this_week']['es-cl'] = "Esta Semana"; +$text['option-this_week']['pt-pt'] = "Esta Semana"; +$text['option-this_week']['fr-fr'] = "Cette Semaine"; +$text['option-this_week']['pt-br'] = "Este mês"; +$text['option-this_week']['pl'] = "W tym miesiącu"; +$text['option-this_week']['sv-se'] = "Denna Månaden"; + $text['option-this_month']['en-us'] = "This Month"; -$text['option-this_month']['es-cl'] = "This Month"; -$text['option-this_month']['pt-pt'] = "This Month"; -$text['option-this_month']['fr-fr'] = "This Month"; +$text['option-this_month']['es-cl'] = "Este Mes"; +$text['option-this_month']['pt-pt'] = "Este Mês"; +$text['option-this_month']['fr-fr'] = "ce Mois"; $text['option-this_month']['pt-br'] = "Este mês"; $text['option-this_month']['pl'] = "W tym miesiącu"; $text['option-this_month']['sv-se'] = "Denna Månaden"; $text['option-last_hour']['en-us'] = "Last Hour"; -$text['option-last_hour']['es-cl'] = "Last Hour"; -$text['option-last_hour']['pt-pt'] = "Last Hour"; -$text['option-last_hour']['fr-fr'] = "Last Hour"; +$text['option-last_hour']['es-cl'] = "Ultima Hora"; +$text['option-last_hour']['pt-pt'] = "Última Hora"; +$text['option-last_hour']['fr-fr'] = "Dernière Heure"; $text['option-last_hour']['pt-br'] = "Próxima hora"; $text['option-last_hour']['pl'] = "W ostatniej godzinie"; $text['option-last_hour']['sv-se'] = "Senaste Timman"; @@ -177,9 +185,9 @@ $text['option-false']['pl'] = "Nie"; $text['option-false']['sv-se'] = "Falsk"; $text['option-default']['en-us'] = "Default"; -$text['option-default']['es-cl'] = "Default"; -$text['option-default']['pt-pt'] = "Default"; -$text['option-default']['fr-fr'] = "Default"; +$text['option-default']['es-cl'] = "Predeterminado"; +$text['option-default']['pt-pt'] = "Predefinido"; +$text['option-default']['fr-fr'] = "Prédéterminé"; $text['option-default']['pt-br'] = "Padrão"; $text['option-default']['pl'] = "Domyślny"; $text['option-default']['sv-se'] = "Standard"; @@ -344,9 +352,9 @@ $text['label-price']['pl'] = "Cena"; $text['label-price']['sv-se'] = "Pris"; $text['label-preset']['en-us'] = "Quick Select"; -$text['label-preset']['es-cl'] = "Quick Select"; -$text['label-preset']['pt-pt'] = "Quick Select"; -$text['label-preset']['fr-fr'] = "Quick Select"; +$text['label-preset']['es-cl'] = "Selección rápida"; +$text['label-preset']['pt-pt'] = "Seleção rápida"; +$text['label-preset']['fr-fr'] = "Sélection Rapide"; $text['label-preset']['pt-br'] = "Selecione inicio"; $text['label-preset']['pl'] = "Szybkie wybieranie"; $text['label-preset']['sv-se'] = "Snabbval"; diff --git a/app/xml_cdr/xml_cdr_extension_summary.php b/app/xml_cdr/xml_cdr_extension_summary.php index 4a889722b0..bacd30b3a3 100644 --- a/app/xml_cdr/xml_cdr_extension_summary.php +++ b/app/xml_cdr/xml_cdr_extension_summary.php @@ -46,10 +46,12 @@ require_once "resources/require.php"; require_once "resources/header.php"; //retrieve submitted data - $start_stamp_begin = check_str($_REQUEST['start_stamp_begin']); - $start_stamp_end = check_str($_REQUEST['start_stamp_end']); - $include_internal = check_str($_REQUEST['include_internal']); - $quick_select = check_str($_REQUEST['quick_select']); + $quick_select = check_str($_POST['quick_select']); + $start_stamp_begin = check_str($_POST['start_stamp_begin']); + $start_stamp_end = check_str($_POST['start_stamp_end']); + $include_internal = check_str($_POST['include_internal']); + + $quick_select = (sizeof($_POST) == 0) ? 1 : $quick_select; //set default //get current extension info $sql = "select "; @@ -112,47 +114,37 @@ require_once "resources/require.php"; $sql .= "hangup_cause "; $sql .= "from v_xml_cdr "; $sql .= "where "; - if ($_GET['showall'] && permission_exists('xml_cdr_all')) { - $sql .= " "; - } else { - $sql .= " domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= " and "; + if (!($_GET['showall'] && permission_exists('xml_cdr_all'))) { + $sql .= " domain_uuid = '".$_SESSION['domain_uuid']."' and "; } $sql .= "( "; $sql .= " caller_id_number in ('".$ext_list."') or "; $sql .= " destination_number in ('".$ext_list."') "; $sql .= ") "; if (!$include_internal) { - $sql .= " and ( direction = 'inbound' or direction = 'outbound' ) "; + $sql .= " and (direction = 'inbound' or direction = 'outbound') "; + } + if (strlen($start_stamp_begin) > 0 || strlen($start_stamp_end) > 0) { + unset($quick_select); + if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) { + $sql .= " and start_stamp between '".$start_stamp_begin.":00.000' and '".$start_stamp_end.":59.999'"; + } + else { + if (strlen($start_stamp_begin) > 0) { $sql .= "and start_stamp >= '".$start_stamp_begin.":00.000' "; } + if (strlen($start_stamp_end) > 0) { $sql .= "and start_stamp <= '".$start_stamp_end.":59.999' "; } + } + } + else { + switch ($quick_select) { + case 1: $sql .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' "; break; //last 7 days + case 2: $sql .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' "; break; //last hour + case 3: $sql .= "and start_stamp >= '".date('Y-m-d')." "."00:00.000' "; break; //today + case 4: $sql .= "and start_stamp between '".date('Y-m-d',strtotime("-1 day"))." "."00:00.000' and '".date('Y-m-d',strtotime("-1 day"))." "."23:59.999' "; break; //yesterday + case 5: $sql .= "and start_stamp >= '".date('Y-m-d',strtotime("this week"))." "."00:00.000' "; break; //this week + case 6: $sql .= "and start_stamp >= '".date('Y-m-')."01 "."00:00.000' "; break; //this month + case 7: $sql .= "and start_stamp >= '".date('Y-')."01-01 "."00:00.000' "; break; //this year + } } - if (strlen($quick_select) == 0 || $quick_select == 0 ) { - if (strlen($start_stamp_begin) == 0 && strlen($start_stamp_end) == 0) { - $sql .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 week"))."' "; // show last 7 days if no range specified - } - else if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) { $sql .= " and start_stamp BETWEEN '".$start_stamp_begin.":00.000' AND '".$start_stamp_end.":59.999'"; } - else { - if (strlen($start_stamp_begin) > 0) { $sql .= " and start_stamp >= '".$start_stamp_begin.":00.000'"; } - if (strlen($start_stamp_end) > 0) { $sql .= " and start_stamp <= '".$start_stamp_end.":59.999'"; } - } - } - else { - if ($quick_select == 1){ - $sql .= "and start_stamp >= '".date('Y-m-d H:i:s.000', strtotime("-1 hour"))."' "; // show last hour - } - if ($quick_select == 2){ - $sql .= "and start_stamp >= '".date('Y-m-d')." "."00:00.000' "; // show today - } - if ($quick_select == 3){ - $sql .= "and start_stamp BETWEEN '".date('Y-m-d',strtotime("-1 day"))." "."00:00.000' AND '".date('Y-m-d',strtotime("-1 day"))." "."23:59.999'"; // show yesterday - } - if ($quick_select == 4){ - $sql .= "and start_stamp >= '".date('Y-m-')."01 "."00:00.000'"; // show this month - } - if ($quick_select == 5){ - $sql .= "and start_stamp >= '".date('Y-')."01-01 "."00:00.000'"; // show this year - } - } - //echo $sql."

"; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -200,40 +192,60 @@ require_once "resources/require.php"; echo "
\n"; if (permission_exists('xml_cdr_search')) { - echo "
\n"; + echo "\n"; echo "\n"; echo " \n"; - echo " "; + + echo " "; - echo " "; - echo " "; - echo " "; + echo " "; echo " "; echo " "; echo " "; echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo " ".$text['label-preset']."\n"; + echo " \n"; + echo " \n"; + echo "
\n"; + echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-start_date_time']."\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; - echo "
\n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " ".$text['label-end_date_time']."\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; - echo "
\n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; @@ -247,32 +259,13 @@ require_once "resources/require.php"; echo "
\n"; - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo " ".$text['label-preset']."\n"; - echo " \n"; - echo " \n"; - echo "
\n"; - echo "
"; echo " \n"; - echo " \n"; + echo " \n"; echo "
";