diff --git a/app/destinations/app_config.php b/app/destinations/app_config.php index f2ae0c269e..5ff97f7cd0 100644 --- a/app/destinations/app_config.php +++ b/app/destinations/app_config.php @@ -42,6 +42,10 @@ $apps[$x]['permissions'][$y]['name'] = 'destination_domain'; $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; $y++; + $apps[$x]['permissions'][$y]['name'] = 'destination_show_all'; + $apps[$x]['permissions'][$y]['groups'][] = 'superadmin'; + $y++; + //schema details $y = 0; //table array index diff --git a/app/destinations/app_languages.php b/app/destinations/app_languages.php index 2d5b47e559..0424bd4b7e 100644 --- a/app/destinations/app_languages.php +++ b/app/destinations/app_languages.php @@ -275,4 +275,14 @@ $text["billing-warning"]["es-cl"] = "Si está utilizando la aplicación de factu $text["billing-warning"]["pt-pt"] = "Se você estiver usando o aplicativo de faturamento fusionpbx, certifique-se de adicionar variáveis accountcode e carrier"; $text["billing-warning"]["fr-fr"] = "Si vous utilisez l'application de facturation fusionpbx, assurez-vous d'ajouter des variables de accountcode et carrier"; +$text['button-show_all']['en-us'] = "Show All"; +$text['button-show_all']['es-cl'] = "Mostrar Todos"; +$text['button-show_all']['pt-pt'] = "Mostrar Todos"; +$text['button-show_all']['fr-fr'] = "Montrer Tout"; + +$text['label-domain-name']['en-us'] = "Domain Name"; +$text['label-domain-name']['es-cl'] = "Nombre de Dominio"; +$text['label-domain-name']['pt-pt'] = "Nome de Domínio"; +$text['label-domain-name']['fr-fr'] = "Nom de Domaine"; + ?> \ No newline at end of file diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index aff60cbea2..900714e1d0 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -53,6 +53,11 @@ else { echo " ".$text['header-destinations']."\n"; echo "
\n"; echo " \n"; + //SCJB + if (permission_exists('destination_show_all')) { + echo " \n"; + } + //ECJB echo " "; echo " "; echo " \n"; @@ -67,9 +72,18 @@ else { //prepare to page the results $sql = " select count(*) as num_rows from v_destinations "; - $sql .= "where domain_uuid = '$domain_uuid' "; + if ($_GET['showall'] && permission_exists('xml_cdr_all')) { + if (strlen($search) > 0) { + $sql .= "where "; + } + } else { + $sql .= "where domain_uuid = '$domain_uuid' "; + if (strlen($search) > 0) { + $sql .= " and "; + } + } if (strlen($search) > 0) { - $sql .= "and ("; + $sql .= " ("; $sql .= " destination_type like '%".$search."%' "; $sql .= " or destination_number like '%".$search."%' "; $sql .= " or destination_context like '%".$search."%' "; @@ -100,9 +114,20 @@ else { //get the list $sql = "select * from v_destinations "; - $sql .= "where domain_uuid = '$domain_uuid' "; + if ($_GET['showall'] && permission_exists('destination_show_all')) { + $sql .= " join v_domains on v_domains.domain_uuid = v_destinations.domain_uuid "; + $param = "&showall=" . $_GET['showall']; + if (strlen($search) > 0) { + $sql .= " where "; + } + } else { + $sql .= "where domain_uuid = '$domain_uuid' "; + if (strlen($search) > 0) { + $sql .= " and "; + } + } if (strlen($search) > 0) { - $sql .= "and ("; + $sql .= " ("; $sql .= " destination_type like '%".$search."%' "; $sql .= " or destination_number like '%".$search."%' "; $sql .= " or destination_context like '%".$search."%' "; @@ -124,6 +149,9 @@ else { echo "\n"; echo "\n"; + if ($_GET['showall'] && permission_exists('destination_show_all')) { + echo th_order_by('domain_name', $text['label-domain-name'], $order_by, $order, $param); + } echo th_order_by('destination_type', $text['label-destination_type'], $order_by, $order); echo th_order_by('destination_number', $text['label-destination_number'], $order_by, $order); echo th_order_by('destination_context', $text['label-destination_context'], $order_by, $order); @@ -138,6 +166,9 @@ else { foreach($result as $row) { $tr_link = "href='destination_edit.php?id=".$row['destination_uuid']."'"; echo "\n"; + if ($_GET['showall'] && permission_exists('destination_show_all')) { + echo " \n"; + } echo " \n"; echo " \n"; echo " \n"; @@ -154,7 +185,11 @@ else { } //end if results echo "\n"; - echo "
".ucwords($row['domain_name'])."".ucwords($row['destination_type'])."".$row['destination_number']."".$row['destination_context']."
\n"; + if ($_GET['showall'] && permission_exists('destination_show_all')) { + echo "\n"; + } else { + echo "\n"; + } echo " \n"; echo " \n"; echo " \n";