From a911086dd6cd089927cf7bfad8b65a9738c95654 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 17 Jan 2022 23:53:55 -0700 Subject: [PATCH] Add field device location (#6244) * Add device location * Add label-device_location * Add permission and field device_location. * Update app_languages.php --- app/devices/app_config.php | 9 ++++++++ app/devices/app_languages.php | 42 +++++++++++++++++++++++++++++++++++ app/devices/device_edit.php | 20 ++++++++++++++++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/app/devices/app_config.php b/app/devices/app_config.php index 05b54c673b..0c6e43ae2d 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -206,6 +206,10 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "device_location"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "device_model"; //$apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; @@ -398,6 +402,11 @@ $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "device_location"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['search'] = 'true'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "device_model"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "phone_model"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index 57ecfe91cf..28f07cfe4d 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -2523,6 +2523,27 @@ $text['label-device_vendor']['ru-ru'] = "Производитель"; $text['label-device_vendor']['sv-se'] = "Tillverkare"; $text['label-device_vendor']['uk-ua'] = ""; +$text['label-device_location']['en-us'] = "Location"; +$text['label-device_location']['en-gb'] = "Location"; +$text['label-device_location']['ar-eg'] = "Location"; +$text['label-device_location']['de-at'] = "Ort"; //copied from de-de +$text['label-device_location']['de-ch'] = "Ort"; //copied from de-de +$text['label-device_location']['de-de'] = "Ort"; +$text['label-device_location']['es-cl'] = "Ubicación"; +$text['label-device_location']['es-mx'] = "Ubicación"; //copied from es-cl +$text['label-device_location']['fr-ca'] = "Situation géographique"; +$text['label-device_location']['fr-fr'] = "Emplacement"; +$text['label-device_location']['he-il'] = "מקום"; +$text['label-device_location']['it-it'] = "Ubicazione"; +$text['label-device_location']['nl-nl'] = "Plaats"; +$text['label-device_location']['pl-pl'] = "Wprowadź lokalizację urządzenia."; +$text['label-device_location']['pt-br'] = "Localização"; //copied from pt-pt +$text['label-device_location']['pt-pt'] = "Localização"; +$text['label-device_location']['ro-ro'] = "Introduceți locația dispozitivului."; +$text['label-device_location']['ru-ru'] = "Местоположение"; +$text['label-device_location']['sv-se'] = "Ange enhetens plats."; +$text['label-device_location']['uk-ua'] = "Введіть розташування пристрою."; + $text['label-device_key_vendor']['en-us'] = "Vendor"; $text['label-device_key_vendor']['en-gb'] = "Vendor"; $text['label-device_key_vendor']['ar-eg'] = ""; @@ -5197,6 +5218,27 @@ $text['description-device_vendor']['ru-ru'] = "Введите название $text['description-device_vendor']['sv-se'] = "Fyll i tillverkar-namn."; $text['description-device_vendor']['uk-ua'] = ""; +$text['description-device_location']['en-us'] = "Enter the device location."; +$text['description-device_location']['en-gb'] = "Enter the device location."; +$text['description-device_location']['ar-eg'] = "Enter the device location."; +$text['description-device_location']['de-at'] = "Geben Sie den Gerätestandort ein."; //copied from de-de +$text['description-device_location']['de-ch'] = "Geben Sie den Gerätestandort ein."; //copied from de-de +$text['description-device_location']['de-de'] = "Geben Sie den Gerätestandort ein."; +$text['description-device_location']['es-cl'] = "Introduzca la ubicación del dispositivo."; +$text['description-device_location']['es-mx'] = "Introduzca la ubicación del dispositivo."; //copied from es-cl +$text['description-device_location']['fr-ca'] = "Entrez dans l'emplacement de l'appareil."; //copied from fr-fr +$text['description-device_location']['fr-fr'] = "Entrez l'emplacement de l'appareil."; +$text['description-device_location']['he-il'] = "הזן את מיקום ההתקן."; +$text['description-device_location']['it-it'] = "Inserisci la posizione del dispositivo."; +$text['description-device_location']['nl-nl'] = "Voer de locatie van het apparaat in."; +$text['description-device_location']['pl-pl'] = "Wprowadź lokalizację urządzenia."; +$text['description-device_location']['pt-br'] = "Digite a localização do dispositivo."; +$text['description-device_location']['pt-pt'] = "Introduza a localização do dispositivo."; +$text['description-device_location']['ro-ro'] = "Introduceți locația dispozitivului."; +$text['description-device_location']['ru-ru'] = "Введите расположение устройства."; +$text['description-device_location']['sv-se'] = "Ange enhetens plats."; +$text['description-device_location']['uk-ua'] = "Введіть розташування пристрою."; + $text['description-device_time_zone']['en-us'] = "Enter the time zone."; $text['description-device_time_zone']['en-gb'] = "Enter the time zone."; $text['description-device_time_zone']['ar-eg'] = ""; diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 9a3a99ca67..ad627395a9 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.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-2021 + Portions created by the Initial Developer are Copyright (C) 2008-2022 the Initial Developer. All Rights Reserved. */ @@ -115,6 +115,7 @@ $device_username = $_POST["device_username"]; $device_password = $_POST["device_password"]; $device_vendor = $_POST["device_vendor"]; + $device_location = $_POST["device_location"]; $device_uuid_alternate = $_POST["device_uuid_alternate"]; $device_model = $_POST["device_model"]; $device_firmware_version = $_POST["device_firmware_version"]; @@ -257,6 +258,9 @@ if (permission_exists('device_vendor')) { $array['devices'][0]['device_vendor'] = $device_vendor; } + if (permission_exists('device_location')) { + $array['devices'][0]['device_location'] = $device_location; + } if (permission_exists('device_alternate') && is_uuid($device_uuid_alternate)) { $array['devices'][0]['device_uuid_alternate'] = $device_uuid_alternate; } @@ -502,6 +506,7 @@ $device_username = $row["device_username"]; $device_password = $row["device_password"]; $device_vendor = $row["device_vendor"]; + $device_location = $row["device_location"]; $device_uuid_alternate = $row["device_uuid_alternate"]; $device_model = $row["device_model"]; $device_firmware_version = $row["device_firmware_version"]; @@ -1754,6 +1759,19 @@ echo "\n"; } + if (permission_exists('device_location')) { + echo "\n"; + echo "\n"; + echo " ".$text['label-device_location']."\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo $text['description-device_location']."\n"; + echo "\n"; + echo "\n"; + } + if (permission_exists('device_model')) { echo "\n"; echo "\n";