From f88c5fd34c165c36aba52b64293c62fa7327de34 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 4 Jul 2014 03:47:32 +0000 Subject: [PATCH] Add show all to registrations --- app/registrations/app_languages.php | 5 +++++ app/registrations/status_registrations.php | 5 +++-- app/registrations/status_registrations_inc.php | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/registrations/app_languages.php b/app/registrations/app_languages.php index c681ee5686..7295d28fe7 100644 --- a/app/registrations/app_languages.php +++ b/app/registrations/app_languages.php @@ -46,6 +46,11 @@ $text['label-response']['pt-pt'] = "Resposta:"; $text['label-response']['fr-fr'] = "Réponse:"; + $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['button-unregister']['en-us'] = "Unregister"; $text['button-unregister']['es-cl'] = ""; $text['button-unregister']['pt-pt'] = ""; diff --git a/app/registrations/status_registrations.php b/app/registrations/status_registrations.php index f9f14c71dd..05879128c6 100644 --- a/app/registrations/status_registrations.php +++ b/app/registrations/status_registrations.php @@ -47,8 +47,9 @@ require_once "resources/check_auth.php"; require_once "resources/header.php"; $page["title"] = $text['header-registrations']; -//retrieve profile, if set +//set the variables $profile = (isset($_REQUEST['profile']) && $_REQUEST['profile'] != '') ? $_REQUEST['profile'] : "internal"; + $show = trim($_REQUEST["show"]); //ajax for refresh ?> @@ -88,7 +89,7 @@ require_once "resources/check_auth.php"; } var requestTime = function() { - var url = 'status_registrations_inc.php?profile='; + var url = 'status_registrations_inc.php?profile=&show='; new loadXmlHttp(url, 'ajax_reponse'); setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1500); } diff --git a/app/registrations/status_registrations_inc.php b/app/registrations/status_registrations_inc.php index d69e1c233a..4134ce00c1 100644 --- a/app/registrations/status_registrations_inc.php +++ b/app/registrations/status_registrations_inc.php @@ -47,6 +47,7 @@ require_once "resources/check_auth.php"; //request profile $sip_profile_name = trim($_REQUEST["profile"]); + $show = trim($_REQUEST["show"]); //define variables $c = 0; @@ -108,7 +109,7 @@ require_once "resources/check_auth.php"; //remove unrelated domains if (count($_SESSION["domains"]) > 1) { - if (permission_exists('registration_all')) { + if (permission_exists('registration_all') && $show == "all") { //show all registrations } else { @@ -117,6 +118,7 @@ require_once "resources/check_auth.php"; } } } + //increment the array id $x++; } @@ -125,9 +127,19 @@ require_once "resources/check_auth.php"; //show the registrations echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; + echo "\n"; echo " ".$text['header-registrations'].": ".count($registrations)."\n"; echo "\n"; + if (permission_exists('registration_all')) { + if ($show == "all") { + echo " \n"; + } + else { + echo " \n"; + } + } + echo "
\n"; echo "
\n";