Przeglądaj źródła

Moved to their own repos

markjcrane 5 miesięcy temu
rodzic
commit
3c076525ae

+ 0 - 36
bulk_account_settings/app_config.php

@@ -1,36 +0,0 @@
-<?php
-	
-	//application details
-		$apps[$x]['name'] = "Bulk Account Settings";
-		$apps[$x]['uuid'] = "6b4e03c9-c302-4eaa-b16d-e1c5c08a2eb7";
-		$apps[$x]['category'] = "Advanced";
-		$apps[$x]['subcategory'] = "";
-		$apps[$x]['version'] = "";
-		$apps[$x]['license'] = "Mozilla Public License 1.1";
-		$apps[$x]['url'] = "http://www.fusionpbx.com";
-		$apps[$x]['description']['en-us'] = "Bulk Account Settings";
-
-	//permission details
-		$y=0;
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings";
-		$apps[$x]['permissions'][$y]['menu']['uuid'] = "74341982-313c-4c42-bf4a-533be4f50a4a";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_extensions";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_devices";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;		
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_users";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;		
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_voicemails";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;		
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_view";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-		$y++;		
-		$apps[$x]['permissions'][$y]['name'] = "bulk_account_settings_pound";
-		$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
-?>

+ 0 - 1456
bulk_account_settings/app_languages.php

@@ -1,1456 +0,0 @@
-<?php
-$text['button-devices']['en-us'] = "Devices";
-$text['button-devices']['es-cl'] = "Devices";
-$text['button-devices']['pt-pt'] = "Devices";
-$text['button-devices']['fr-fr'] = "Devices";
-$text['button-devices']['pt-br'] = "Devices";
-$text['button-devices']['pl'] = "Devices";
-$text['button-devices']['sv-se'] = "Devices";
-$text['button-devices']['uk'] = "Devices";
-$text['button-devices']['de-at'] = "Devices";
-$text['button-devices']['it-it'] = "Devices";
-$text['button-devices']['ru-ru'] = "Устройства";
-
-$text['button-extensions']['en-us'] = "Extensions";
-$text['button-extensions']['es-cl'] = "Extensions";
-$text['button-extensions']['pt-pt'] = "Extensions";
-$text['button-extensions']['fr-fr'] = "Extensions";
-$text['button-extensions']['pt-br'] = "Extensions";
-$text['button-extensions']['pl'] = "Extensions";
-$text['button-extensions']['sv-se'] = "Extensions";
-$text['button-extensions']['uk'] = "Extensions";
-$text['button-extensions']['de-at'] = "Extensions";
-$text['button-extensions']['it-it'] = "Extensions";
-$text['button-extensions']['ru-ru'] = "Extensions";
-
-$text['button-users']['en-us'] = "Users";
-$text['button-users']['es-cl'] = "Users";
-$text['button-users']['pt-pt'] = "Users";
-$text['button-users']['fr-fr'] = "Users";
-$text['button-users']['pt-br'] = "Users";
-$text['button-users']['pl'] = "Users";
-$text['button-users']['sv-se'] = "Users";
-$text['button-users']['uk'] = "Users";
-$text['button-users']['de-at'] = "Users";
-$text['button-users']['it-it'] = "Users";
-$text['button-users']['ru-ru'] = "Пользователи";
-
-$text['button-voicemails']['en-us'] = "Voicemails";
-$text['button-voicemails']['es-cl'] = "Voicemails";
-$text['button-voicemails']['pt-pt'] = "Voicemails";
-$text['button-voicemails']['fr-fr'] = "Voicemails";
-$text['button-voicemails']['pt-br'] = "Voicemails";
-$text['button-voicemails']['pl'] = "Voicemails";
-$text['button-voicemails']['sv-se'] = "Voicemails";
-$text['button-voicemails']['uk'] = "Voicemails";
-$text['button-voicemails']['de-at'] = "Voicemails";
-$text['button-voicemails']['it-it'] = "Voicemails";
-$text['button-voicemails']['ru-ru'] = "Голосовые сообщения";
-
-$text['button-call_routing']['en-us'] = "Call Routing";
-$text['button-call_routing']['es-cl'] = "Call Routing";
-$text['button-call_routing']['pt-pt'] = "Call Routing";
-$text['button-call_routing']['fr-fr'] = "Call Routing";
-$text['button-call_routing']['pt-br'] = "Call Routing";
-$text['button-call_routing']['pl'] = "Call Routing";
-$text['button-call_routing']['sv-se'] = "Call Routing";
-$text['button-call_routing']['uk'] = "Call Routing";
-$text['button-call_routing']['de-at'] = "Call Routing";
-$text['button-call_routing']['it-it'] = "Call Routing";
-$text['button-call_routing']['ru-ru'] = "Маршрутизация звонков";
-
-$text['button-submit']['en-us'] = "Submit";
-$text['button-submit']['es-cl'] = "Submit";
-$text['button-submit']['pt-pt'] = "Submit";
-$text['button-submit']['fr-fr'] = "Submit";
-$text['button-submit']['pt-br'] = "Submit";
-$text['button-submit']['pl'] = "Submit";
-$text['button-submit']['sv-se'] = "Submit";
-$text['button-submit']['uk'] = "Submit";
-$text['button-submit']['de-at'] = "Submit";
-$text['button-submit']['it-it'] = "Submit";
-$text['button-submit']['ru-ru'] = "Отправить";
-
-$text['confirm-update']['en-us'] = "Please confirm the following updates";
-$text['confirm-update']['es-cl'] = "Please confirm the following updates";
-$text['confirm-update']['pt-pt'] = "Please confirm the following updates";
-$text['confirm-update']['fr-fr'] = "Please confirm the following updates";
-$text['confirm-update']['pt-br'] = "Please confirm the following updates";
-$text['confirm-update']['pl'] = "Please confirm the following updates";
-$text['confirm-update']['sv-se'] = "Please confirm the following updates";
-$text['confirm-update']['uk'] = "Please confirm the following updates";
-$text['confirm-update']['de-at'] = "Please confirm the following updates";
-$text['confirm-update']['it-it'] = "Please confirm the following updates";
-$text['confirm-update']['ru-ru'] = "Пожалуйста, подтвердите следующие обновления";
-
-
-$text['description-extension_settings_description']['en-us'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['es-cl'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['pt-pt'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['fr-fr'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['pt-br'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['pl'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['sv-se'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['uk'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['de-at'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['it-it'] = "Choose the setting to modify.";
-$text['description-extension_settings_description']['ru-ru'] = "Выберите настройку для изменения.";
-
-$text['description-accountcode']['en-us'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['es-cl'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['pt-pt'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['fr-fr'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['pt-br'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['pl'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['sv-se'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['uk'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['de-at'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['it-it'] = "Enter the new accountcode for the selected extensions.";
-$text['description-accountcode']['ru-ru'] = "Введите новый accountcode для выбранных extensions.";
-
-$text['description-call_group']['en-us'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['es-cl'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['pt-pt'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['fr-fr'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['pt-br'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['pl'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['sv-se'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['uk'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['de-at'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['it-it'] = "Enter the new call group for the selected extensions.";
-$text['description-call_group']['ru-ru'] = "Введите новую группу вызова для выбранных extensions.";
-
-$text['description-call_timeout']['en-us'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['es-cl'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['pt-pt'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['fr-fr'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['pt-br'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['pl'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['sv-se'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['uk'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['de-at'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['it-it'] = "Enter the new call timeout for the selected extensions.";
-$text['description-call_timeout']['ru-ru'] = "Задайте новый таймаут вызова для выбранных extensions.";
-
-$text['description-devices_settings']['en-us'] = "Choose the setting to modify.";
-$text['description-devices_settings']['es-cl'] = "Choose the setting to modify.";
-$text['description-devices_settings']['pt-pt'] = "Choose the setting to modify.";
-$text['description-devices_settings']['fr-fr'] = "Choose the setting to modify.";
-$text['description-devices_settings']['pt-br'] = "Choose the setting to modify.";
-$text['description-devices_settings']['pl'] = "Choose the setting to modify.";
-$text['description-devices_settings']['sv-se'] = "Choose the setting to modify.";
-$text['description-devices_settings']['uk'] = "Choose the setting to modify.";
-$text['description-devices_settings']['de-at'] = "Choose the setting to modify.";
-$text['description-devices_settings']['it-it'] = "Choose the setting to modify.";
-$text['description-devices_settings']['ru-ru'] = "Выберите настройку для изменения.";
-
-$text['description-device_profile']['en-us'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['es-cl'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['pt-pt'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['fr-fr'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['pt-br'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['pl'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['sv-se'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['uk'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['de-at'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['it-it'] = "Select the new device profile for the selected devices.";
-$text['description-device_profile']['ru-ru'] = "Выберите новый профиль для выбранных устройств.";
-
-$text['description-device_template']['en-us'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['es-cl'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['pt-pt'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['fr-fr'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['pt-br'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['pl'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['sv-se'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['uk'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['de-at'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['it-it'] = "Select the new device template for the selected devices.";
-$text['description-device_template']['ru-ru'] = "Выберите новый шаблон для выбрарнных устройств.";
-
-$text['description-password']['en-us'] = "Enter the new password for the selected users.";
-$text['description-password']['es-cl'] = "Enter the new password for the selected users.";
-$text['description-password']['pt-pt'] = "Enter the new password for the selected users.";
-$text['description-password']['fr-fr'] = "Enter the new password for the selected users.";
-$text['description-password']['pt-br'] = "Enter the new password for the selected users.";
-$text['description-password']['pl'] = "Enter the new password for the selected users.";
-$text['description-password']['sv-se'] = "Enter the new password for the selected users.";
-$text['description-password']['uk'] = "Enter the new password for the selected users.";
-$text['description-password']['de-at'] = "Enter the new password for the selected users.";
-$text['description-password']['it-it'] = "Enter the new password for the selected users.";
-$text['description-password']['ru-ru'] = "Введите новый пароль для выбранных пользователей.";
-
-$text['description-enabled']['en-us'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['es-cl'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['pt-pt'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['fr-fr'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['pt-br'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['pl'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['sv-se'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['uk'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['de-at'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['it-it'] = "Select the new enabled status for the selected extensions.";
-$text['description-enabled']['ru-ru'] = "Выберите новый статус для выбранных extensions.";
-
-$text['description-device_enabled']['en-us'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['es-cl'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['pt-pt'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['fr-fr'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['pt-br'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['pl'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['sv-se'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['uk'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['de-at'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['it-it'] = "Select the new enabled status for the selected devices.";
-$text['description-device_enabled']['ru-ru'] = "Выберите новый статус для выбранных devices.";
-
-$text['description-directory_visible']['en-us'] = "Select whether to hide the name from the directory.";
-$text['description-directory_visible']['es-cl'] = "";
-$text['description-directory_visible']['pt-pt'] = "";
-$text['description-directory_visible']['en-fr'] = "";
-$text['description-directory_visible']['en-br'] = "";
-$text['description-directory_visible']['pl'] = "";
-$text['description-directory_visible']['sv-se'] = "";
-$text['description-directory_visible']['uk'] = "Select whether to hide the name from the directory.";
-$text['description-directory_visible']['de-at'] = "";
-$text['description-directory_visible']['it-it'] = "";
-$text['description-directory_visible']['ru-ru'] = "";
-
-$text['description-user_record']['en-us'] = "Select whether to record the extension.";
-$text['description-user_record']['es-cl'] = "";
-$text['description-user_record']['pt-pt'] = "";
-$text['description-user_record']['en-fr'] = "";
-$text['description-user_record']['en-br'] = "";
-$text['description-user_record']['pl'] = "";
-$text['description-user_record']['sv-se'] = "";
-$text['description-user_record']['uk'] = "Select whether to record the extension.";
-$text['description-user_record']['de-at'] = "";
-$text['description-user_record']['it-it'] = "";
-$text['description-user_record']['ru-ru'] = "";
-
-$text['description-emergency_caller_id_name']['en-us'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['es-cl'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['pt-pt'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['fr-fr'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['pt-br'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['pl'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['sv-se'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['uk'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['de-at'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['it-it'] = "Enter the new emergency caller id name for the selected extensions.";
-$text['description-emergency_caller_id_name']['ru-ru'] = "Enter the new emergency caller id name for the selected extensions.";
-
-$text['description-emergency_caller_id_number']['en-us'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['es-cl'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['pt-pt'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['fr-fr'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['pt-br'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['pl'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['sv-se'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['uk'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['de-at'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['it-it'] = "Enter the new emergency caller id number for the selected extensions.";
-$text['description-emergency_caller_id_number']['ru-ru'] = "Enter the new emergency caller id number for the selected extensions.";
-
-$text['description-hold_music']['en-us'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['es-cl'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['pt-pt'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['fr-fr'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['pt-br'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['pl'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['sv-se'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['uk'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['de-at'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['it-it'] = "Select the new hold music for the selected extensions.";
-$text['description-hold_music']['ru-ru'] = "Выберите новую музыку при ожидании для выбраннных extensions.";
-
-$text['description-outbound_caller_id_name']['en-us'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['es-cl'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['pt-pt'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['fr-fr'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['pt-br'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['pl'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['sv-se'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['uk'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['de-at'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['it-it'] = "Enter the new outbound caller id name for the selected extensions.";
-$text['description-outbound_caller_id_name']['ru-ru'] = "Enter the new outbound caller id name for the selected extensions.";
-
-$text['description-outbound_caller_id_number']['en-us'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['es-cl'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['pt-pt'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['fr-fr'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['pt-br'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['pl'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['sv-se'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['uk'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['de-at'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['it-it'] = "Enter the new outbound caller id number for the selected extensions.";
-$text['description-outbound_caller_id_number']['ru-ru'] = "Enter the new outbound caller id number for the selected extensions.";
-
-$text['description-limit_max']['en-us'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['es-cl'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['pt-pt'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['fr-fr'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['pt-br'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['pl'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['sv-se'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['uk'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['de-at'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['it-it'] = "Select the new limit max calls for the selected extensions.";
-$text['description-limit_max']['ru-ru'] = "Задайте новое максимальное количество вызовов для выбранных extensions.";
-
-$text['description-toll_allow']['en-us'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['es-cl'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['pt-pt'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['fr-fr'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['pt-br'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['pl'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['sv-se'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['uk'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['de-at'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['it-it'] = "Select the new toll allow for the selected extensions.";
-$text['description-toll_allow']['ru-ru'] = "Select the new toll allow for the selected extensions.";
-
-$text['description-time_zone']['en-us'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['es-cl'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['pt-pt'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['fr-fr'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['pt-br'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['pl'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['sv-se'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['uk'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['de-at'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['it-it'] = "Select the new timezone for the selected users.";
-$text['description-time_zone']['ru-ru'] = "Выберите часовой пояс для выбранных пользователей.";
-
-$text['description-user_enabled']['en-us'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['es-cl'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['pt-pt'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['fr-fr'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['pt-br'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['pl'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['sv-se'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['uk'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['de-at'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['it-it'] = "Select the new enabled status for the selected users.";
-$text['description-user_enabled']['ru-ru'] = "Select the new enabled status for the selected users.";
-
-$text['description-user_status']['en-us'] = "Select the new status for the selected users.";
-$text['description-user_status']['es-cl'] = "Select the new status for the selected users.";
-$text['description-user_status']['pt-pt'] = "Select the new status for the selected users.";
-$text['description-user_status']['fr-fr'] = "Select the new status for the selected users.";
-$text['description-user_status']['pt-br'] = "Select the new status for the selected users.";
-$text['description-user_status']['pl'] = "Select the new status for the selected users.";
-$text['description-user_status']['sv-se'] = "Select the new status for the selected users.";
-$text['description-user_status']['uk'] = "Select the new status for the selected users.";
-$text['description-user_status']['de-at'] = "Select the new status for the selected users.";
-$text['description-user_status']['it-it'] = "Select the new status for the selected users.";
-$text['description-user_status']['ru-ru'] = "Выберите новый статус для выбранных пользователей.";
-
-$text['description-user_settings_description']['en-us'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['es-cl'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['pt-pt'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['fr-fr'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['pt-br'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['pl'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['sv-se'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['uk'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['de-at'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['it-it'] = "Choose the setting to modify.";
-$text['description-user_settings_description']['ru-ru'] = "Выберите настройку для изменения.";
-
-$text['description-voicemail_settings_description']['en-us'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['es-cl'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['pt-pt'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['fr-fr'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['pt-br'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['pl'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['sv-se'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['uk'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['de-at'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['it-it'] = "Choose the setting to modify.";
-$text['description-voicemail_settings_description']['ru-ru'] = "Выберите настройку для изменения.";
-
-$text['header-bulk_account_settings']['en-us'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['es-cl'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['pt-pt'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['fr-fr'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['pt-br'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['pl'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['sv-se'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['uk'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['de-at'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['it-it'] = "Bulk Account Settings";
-$text['header-bulk_account_settings']['ru-ru'] = "Bulk Account Settings";
-
-$text['header-extensions']['en-us'] = "Extensions";
-$text['header-extensions']['es-cl'] = "Extensions";
-$text['header-extensions']['pt-pt'] = "Extensions";
-$text['header-extensions']['fr-fr'] = "Extensions";
-$text['header-extensions']['pt-br'] = "Extensions";
-$text['header-extensions']['pl'] = "Extensions";
-$text['header-extensions']['sv-se'] = "Extensions";
-$text['header-extensions']['uk'] = "Extensions";
-$text['header-extensions']['de-at'] = "Extensions";
-$text['header-extensions']['it-it'] = "Extensions";
-$text['header-extensions']['ru-ru'] = "Extensions";
-
-$text['header-users']['en-us'] = "Users";
-$text['header-users']['es-cl'] = "Users";
-$text['header-users']['pt-pt'] = "Users";
-$text['header-users']['fr-fr'] = "Users";
-$text['header-users']['pt-br'] = "Users";
-$text['header-users']['pl'] = "Users";
-$text['header-users']['sv-se'] = "Users";
-$text['header-users']['uk'] = "Users";
-$text['header-users']['de-at'] = "Users";
-$text['header-users']['it-it'] = "Users";
-$text['header-users']['ru-ru'] = "Пользователи";
-
-$text['header-devices']['en-us'] = "Devices";
-$text['header-devices']['es-cl'] = "Devices";
-$text['header-devices']['pt-pt'] = "Devices";
-$text['header-devices']['fr-fr'] = "Devices";
-$text['header-devices']['pt-br'] = "Devices";
-$text['header-devices']['pl'] = "Devices";
-$text['header-devices']['sv-se'] = "Devices";
-$text['header-devices']['uk'] = "Devices";
-$text['header-devices']['de-at'] = "Devices";
-$text['header-devices']['it-it'] = "Devices";
-$text['header-devices']['ru-ru'] = "Устройства";
-
-$text['header-voicemails']['en-us'] = "Voicemails";
-$text['header-voicemails']['es-cl'] = "Voicemails";
-$text['header-voicemails']['pt-pt'] = "Voicemails";
-$text['header-voicemails']['fr-fr'] = "Voicemails";
-$text['header-voicemails']['pt-br'] = "Voicemails";
-$text['header-voicemails']['pl'] = "Voicemails";
-$text['header-voicemails']['sv-se'] = "Voicemails";
-$text['header-voicemails']['uk'] = "Voicemails";
-$text['header-voicemails']['de-at'] = "Voicemails";
-$text['header-voicemails']['it-it'] = "Voicemails";
-$text['header-voicemails']['ru-ru'] = "Голосовые сообщения";
-
-$text['label-add']['en-us'] = "Add";
-$text['label-add']['es-cl'] = "Add";
-$text['label-add']['pt-pt'] = "Add";
-$text['label-add']['fr-fr'] = "Add";
-$text['label-add']['pt-br'] = "Add";
-$text['label-add']['pl'] = "Add";
-$text['label-add']['sv-se'] = "Add";
-$text['label-add']['uk'] = "Add";
-$text['label-add']['de-at'] = "Add";
-$text['label-add']['it-it'] = "Add";
-$text['label-add']['ru-ru'] = "Добавить";
-
-$text['label-inbound']['en-us'] = "Inbound";
-$text['label-inbound']['es-cl'] = "Inbound";
-$text['label-inbound']['pt-pt'] = "Inbound";
-$text['label-inbound']['fr-fr'] = "Inbound";
-$text['label-inbound']['pt-br'] = "Inbound";
-$text['label-inbound']['pl'] = "Inbound";
-$text['label-inbound']['sv-se'] = "Inbound";
-$text['label-inbound']['uk'] = "Inbound";
-$text['label-inbound']['de-at'] = "Inbound";
-$text['label-inbound']['it-it'] = "Inbound";
-$text['label-inbound']['ru-ru'] = "";
-
-$text['label-outbound']['en-us'] = "Outbound";
-$text['label-outbound']['es-cl'] = "Outbound";
-$text['label-outbound']['pt-pt'] = "Outbound";
-$text['label-outbound']['fr-fr'] = "utbound";
-$text['label-outbound']['pt-br'] = "Outbound";
-$text['label-outbound']['pl'] = "Outbound";
-$text['label-outbound']['sv-se'] = "Outbound";
-$text['label-outbound']['uk'] = "Outbound";
-$text['label-outbound']['de-at'] = "Outbound";
-$text['label-outbound']['it-it'] = "Outbound";
-$text['label-outbound']['ru-ru'] = "";
-
-$text['label-local']['en-us'] = "Local";
-$text['label-local']['es-cl'] = "Local";
-$text['label-local']['pt-pt'] = "Local";
-$text['label-local']['fr-fr'] = "Local";
-$text['label-local']['pt-br'] = "Local";
-$text['label-local']['pl'] = "Local";
-$text['label-local']['sv-se'] = "Local";
-$text['label-local']['uk'] = "Local";
-$text['label-local']['de-at'] = "Local";
-$text['label-local']['it-it'] = "Local";
-$text['label-local']['ru-ru'] = "";
-
-$text['label-disabled']['en-us'] = "Disabled";
-$text['label-disabled']['es-cl'] = "Disabled";
-$text['label-disabled']['pt-pt'] = "Disabled";
-$text['label-disabled']['fr-fr'] = "Disabled";
-$text['label-disabled']['pt-br'] = "Disabled";
-$text['label-disabled']['pl'] = "Disabled";
-$text['label-disabled']['sv-se'] = "Disabled";
-$text['label-disabled']['uk'] = "Disabled";
-$text['label-disabled']['de-at'] = "Disabled";
-$text['label-disabled']['it-it'] = "Disabled";
-$text['label-disabled']['ru-ru'] = "";
-
-$text['label-user_record_none']['en-us'] = "Disabled";
-$text['label-user_record_none']['en-gb'] = "Disabled";
-$text['label-user_record_none']['ar-eg'] = "معطل";
-$text['label-user_record_none']['de-at'] = "Ausgeschaltet"; //copied from de-de
-$text['label-user_record_none']['de-ch'] = "Ausgeschaltet"; //copied from de-de
-$text['label-user_record_none']['de-de'] = "Ausgeschaltet";
-$text['label-user_record_none']['es-cl'] = "Ninguno";
-$text['label-user_record_none']['es-mx'] = "Ninguno"; //copied from es-cl
-$text['label-user_record_none']['fr-ca'] = "Aucun"; //copied from fr-fr
-$text['label-user_record_none']['fr-fr'] = "Aucun";
-$text['label-user_record_none']['he-il'] = "מנוטרל";
-$text['label-user_record_none']['it-it'] = "Disabilitato";
-$text['label-user_record_none']['nl-nl'] = "Uitgeschakeld";
-$text['label-user_record_none']['pl-pl'] = "Wyłączone";
-$text['label-user_record_none']['pt-br'] = "Desabilitado"; //copied from pt-pt
-$text['label-user_record_none']['pt-pt'] = "Nenhum";
-$text['label-user_record_none']['ro-ro'] = "";
-$text['label-user_record_none']['ru-ru'] = "Выключено";
-$text['label-user_record_none']['sv-se'] = "Inaktiverad";
-$text['label-user_record_none']['uk-ua'] = "Відключено";
-
-$text['label-directory_visible']['en-us'] = "Directory Visible";
-$text['label-directory_visible']['es-cl'] = "";
-$text['label-directory_visible']['pt-pt'] = "";
-$text['label-directory_visible']['fr-fr'] = "";
-$text['label-directory_visible']['pt-pt'] = "";
-$text['label-directory_visible']['pl'] = "";
-$text['label-directory_visible']['sv-se'] = "";
-$text['label-directory_visible']['uk'] = "Directory Visible";
-$text['label-directory_visible']['de-at'] = "";
-$text['label-directory_visible']['it-it'] = "";
-$text['label-directory_visible']['ru-ru'] = "";
-
-$text['label-user_record']['en-us'] = "User Record";
-$text['label-user_record']['es-cl'] = "";
-$text['label-user_record']['pt-pt'] = "";
-$text['label-user_record']['fr-fr'] = "";
-$text['label-user_record']['pt-pt'] = "";
-$text['label-user_record']['pl'] = "";
-$text['label-user_record']['sv-se'] = "";
-$text['label-user_record']['uk'] = "User Record";
-$text['label-user_record']['de-at'] = "";
-$text['label-user_record']['it-it'] = "";
-$text['label-user_record']['ru-ru'] = "";
-
-$text['label-remove']['en-us'] = "Remove";
-$text['label-remove']['es-cl'] = "Remove";
-$text['label-remove']['pt-pt'] = "Remove";
-$text['label-remove']['fr-fr'] = "Remove";
-$text['label-remove']['pt-br'] = "Remove";
-$text['label-remove']['pl'] = "Remove";
-$text['label-remove']['sv-se'] = "Remove";
-$text['label-remove']['uk'] = "Remove";
-$text['label-remove']['de-at'] = "Remove";
-$text['label-remove']['it-it'] = "Remove";
-$text['label-remove']['ru-ru'] = "Удалить";
-
-$text['label-accountcode']['en-us'] = "Accountcode";
-$text['label-accountcode']['es-cl'] = "Accountcode";
-$text['label-accountcode']['pt-pt'] = "Accountcode";
-$text['label-accountcode']['fr-fr'] = "Accountcode";
-$text['label-accountcode']['pt-br'] = "Accountcode";
-$text['label-accountcode']['pl'] = "Accountcode";
-$text['label-accountcode']['sv-se'] = "Accountcode";
-$text['label-accountcode']['uk'] = "Accountcode";
-$text['label-accountcode']['de-at'] = "Accountcode";
-$text['label-accountcode']['it-it'] = "Accountcode";
-$text['label-accountcode']['ru-ru'] = "Accountcode";
-
-$text['label-call_group']['en-us'] = "Call Group";
-$text['label-call_group']['es-cl'] = "Call Group";
-$text['label-call_group']['pt-pt'] = "Call Group";
-$text['label-call_group']['fr-fr'] = "Call Group";
-$text['label-call_group']['pt-br'] = "Call Group";
-$text['label-call_group']['pl'] = "Call Group";
-$text['label-call_group']['sv-se'] = "Call Group";
-$text['label-call_group']['uk'] = "Call Group";
-$text['label-call_group']['de-at'] = "Call Group";
-$text['label-call_group']['it-it'] = "Call Group";
-$text['label-call_group']['ru-ru'] = "Call Group";
-
-$text['label-confirm_password']['en-us'] = "Confirm Password";
-$text['label-confirm_password']['es-cl'] = "Confirm Password";
-$text['label-confirm_password']['pt-pt'] = "Confirm Password";
-$text['label-confirm_password']['fr-fr'] = "Confirm Password";
-$text['label-confirm_password']['pt-br'] = "Confirm Password";
-$text['label-confirm_password']['pl'] = "Confirm Password";
-$text['label-confirm_password']['sv-se'] = "Confirm Password";
-$text['label-confirm_password']['uk'] = "Confirm Password";
-$text['label-confirm_password']['de-at'] = "Confirm Password";
-$text['label-confirm_password']['it-it'] = "Confirm Password";
-$text['label-confirm_password']['ru-ru'] = "Подтвердить пароль";
-
-$text['label-destination']['en-us'] = "Destination";
-$text['label-destination']['es-cl'] = "Destination";
-$text['label-destination']['pt-pt'] = "Destination";
-$text['label-destination']['fr-fr'] = "Destination";
-$text['label-destination']['pt-br'] = "Destination";
-$text['label-destination']['pl'] = "Destination";
-$text['label-destination']['sv-se'] = "Destination";
-$text['label-destination']['uk'] = "Destination";
-$text['label-destination']['de-at'] = "Destination";
-$text['label-destination']['it-it'] = "Destination";
-$text['label-destination']['ru-ru'] = "Назначение";
-
-$text['label-order']['en-us'] = "Order";
-$text['label-order']['es-cl'] = "Order";
-$text['label-order']['pt-pt'] = "Order";
-$text['label-order']['fr-fr'] = "Order";
-$text['label-order']['pt-br'] = "Order";
-$text['label-order']['pl'] = "Order";
-$text['label-order']['sv-se'] = "Order";
-$text['label-order']['uk'] = "Order";
-$text['label-order']['de-at'] = "Order";
-$text['label-order']['it-it'] = "Order";
-$text['label-order']['ru-ru'] = "Порядок";
-
-$text['label-description']['en-us'] = "Description";
-$text['label-description']['es-cl'] = "Description";
-$text['label-description']['pt-pt'] = "Description";
-$text['label-description']['fr-fr'] = "Description";
-$text['label-description']['pt-br'] = "Description";
-$text['label-description']['pl'] = "Description";
-$text['label-description']['sv-se'] = "Description";
-$text['label-description']['uk'] = "Description";
-$text['label-description']['de-at'] = "Description";
-$text['label-description']['it-it'] = "Description";
-$text['label-description']['ru-ru'] = "Описание";
-
-$text['label-extension']['en-us'] = "Extension";
-$text['label-extension']['es-cl'] = "Extension";
-$text['label-extension']['pt-pt'] = "Extension";
-$text['label-extension']['fr-fr'] = "Extension";
-$text['label-extension']['pt-br'] = "Extension";
-$text['label-extension']['pl'] = "Extension";
-$text['label-extension']['sv-se'] = "Extension";
-$text['label-extension']['uk'] = "Extension";
-$text['label-extension']['de-at'] = "Extension";
-$text['label-extension']['it-it'] = "Extension";
-$text['label-extension']['ru-ru'] = "Extension";
-
-$text['label-call_timeout']['en-us'] = "Call Timeout";
-$text['label-call_timeout']['es-cl'] = "Call Timeout";
-$text['label-call_timeout']['pt-pt'] = "Call Timeout";
-$text['label-call_timeout']['fr-fr'] = "Call Timeout";
-$text['label-call_timeout']['pt-br'] = "Call Timeout";
-$text['label-call_timeout']['pl'] = "Call Timeout";
-$text['label-call_timeout']['sv-se'] = "Call Timeout";
-$text['label-call_timeout']['uk'] = "Call Timeout";
-$text['label-call_timeout']['de-at'] = "Call Timeout";
-$text['label-call_timeout']['it-it'] = "Call Timeout";
-$text['label-call_timeout']['ru-ru'] = "Call Timeout";
-
-$text['label-group']['en-us'] = "Group";
-$text['label-group']['es-cl'] = "Group";
-$text['label-group']['pt-pt'] = "Group";
-$text['label-group']['fr-fr'] = "Group";
-$text['label-group']['pt-br'] = "Group";
-$text['label-group']['pl'] = "Group";
-$text['label-group']['sv-se'] = "Group";
-$text['label-group']['uk'] = "Group";
-$text['label-group']['de-at'] = "Group";
-$text['label-group']['it-it'] = "Group";
-$text['label-group']['ru-ru'] = "Группа";
-
-$text['label-line_1_server_address']['en-us'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['es-cl'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['pt-pt'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['fr-fr'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['pt-br'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['pl'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['sv-se'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['uk'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['de-at'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['it-it'] = "Line 1 - Server Address";
-$text['label-line_1_server_address']['ru-ru'] = "Линия 1 - Адрес сервера";
-
-$text['label-line_1_server_address_primary']['en-us'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['es-cl'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['pt-pt'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['fr-fr'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['pt-br'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['pl'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['sv-se'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['uk'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['de-at'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['it-it'] = "Line 1 - Server Address Primary";
-$text['label-line_1_server_address_primary']['ru-ru'] = "Линия 1 - Server Address прокси основной";
-
-$text['label-line_1_server_address_secondary']['en-us'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['es-cl'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['pt-pt'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['fr-fr'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['pt-br'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['pl'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['sv-se'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['uk'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['de-at'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['it-it'] = "Line 1 - Server Address Secondary";
-$text['label-line_1_server_address_secondary']['ru-ru'] = "Линия 1 - Server Address резервный";
-
-$text['label-line_1_outbound_proxy_primary']['en-us'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['es-cl'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['pt-pt'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['fr-fr'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['pt-br'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['pl'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['sv-se'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['uk'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['de-at'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['it-it'] = "Line 1 - Outbound Proxy Primary";
-$text['label-line_1_outbound_proxy_primary']['ru-ru'] = "Линия 1 - Исходящий прокси основной";
-
-$text['label-line_1_outbound_proxy_secondary']['en-us'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['es-cl'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['pt-pt'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['fr-fr'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['pt-br'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['pl'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['sv-se'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['uk'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['de-at'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['it-it'] = "Line 1 - Outbound Proxy Secondary";
-$text['label-line_1_outbound_proxy_secondary']['ru-ru'] = "Линия 1 - Исходящий прокси резервный";
-
-$text['label-line_1_sip_port']['en-us'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['es-cl'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['pt-pt'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['fr-fr'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['pt-br'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['pl'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['sv-se'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['uk'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['de-at'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['it-it'] = "Line 1 - SIP Port";
-$text['label-line_1_sip_port']['ru-ru'] = "Линия 1 - SIP порт";
-
-$text['label-line_1_sip_transport']['en-us'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['es-cl'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['pt-pt'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['fr-fr'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['pt-br'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['pl'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['sv-se'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['uk'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['de-at'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['it-it'] = "Line 1 - SIP Transport";
-$text['label-line_1_sip_transport']['ru-ru'] = "Линия 1 - SIP транспорт";
-
-$text['label-line_1_register_expires']['en-us'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['es-cl'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['pt-pt'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['fr-fr'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['pt-br'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['pl'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['sv-se'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['uk'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['de-at'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['it-it'] = "Line 1 - Register Expires";
-$text['label-line_1_register_expires']['ru-ru'] = "Линия 1 - Регистрация истекает";
-
-$text['label-hold_music']['en-us'] = "Hold Music";
-$text['label-hold_music']['es-cl'] = "Hold Music";
-$text['label-hold_music']['pt-pt'] = "Hold Music";
-$text['label-hold_music']['fr-fr'] = "Hold Music";
-$text['label-hold_music']['pt-br'] = "Hold Music";
-$text['label-hold_music']['pl'] = "Hold Music";
-$text['label-hold_music']['sv-se'] = "Hold Music";
-$text['label-hold_music']['uk'] = "Hold Music";
-$text['label-hold_music']['de-at'] = "Hold Music";
-$text['label-hold_music']['it-it'] = "Hold Music";
-$text['label-hold_music']['ru-ru'] = "Музыка при ожидании";
-
-$text['label-outbound_caller_id_name']['en-us'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['es-cl'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['pt-pt'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['fr-fr'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['pt-br'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['pl'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['sv-se'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['uk'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['de-at'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['it-it'] = "Outbound Caller ID Name";
-$text['label-outbound_caller_id_name']['ru-ru'] = "Outbound Caller ID Name";
-
-$text['label-outbound_caller_id_number']['en-us'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['es-cl'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['pt-pt'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['fr-fr'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['pt-br'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['pl'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['sv-se'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['uk'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['de-at'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['it-it'] = "Outbound Caller ID Number";
-$text['label-outbound_caller_id_number']['ru-ru'] = "Outbound Caller ID Number";
-
-$text['label-password']['en-us'] = "Password";
-$text['label-password']['es-cl'] = "Password";
-$text['label-password']['pt-pt'] = "Password";
-$text['label-password']['fr-fr'] = "Password";
-$text['label-password']['pt-br'] = "Password";
-$text['label-password']['pl'] = "Password";
-$text['label-password']['sv-se'] = "Password";
-$text['label-password']['uk'] = "Password";
-$text['label-password']['de-at'] = "Password";
-$text['label-password']['it-it'] = "Password";
-$text['label-password']['ru-ru'] = "Пароль";
-
-$text['label-user_status']['en-us'] = "Status";
-$text['label-user_status']['es-cl'] = "Status";
-$text['label-user_status']['pt-pt'] = "Status";
-$text['label-user_status']['fr-fr'] = "Status";
-$text['label-user_status']['pt-br'] = "Status";
-$text['label-user_status']['pl'] = "Status";
-$text['label-user_status']['sv-se'] = "Status";
-$text['label-user_status']['uk'] = "Status";
-$text['label-user_status']['de-at'] = "Status";
-$text['label-user_status']['it-it'] = "Status";
-$text['label-user_status']['ru-ru'] = "Статус";
-
-$text['label-time_zone']['en-us'] = "Timezone";
-$text['label-time_zone']['es-cl'] = "Timezone";
-$text['label-time_zone']['pt-pt'] = "Timezone";
-$text['label-time_zone']['fr-fr'] = "Timezone";
-$text['label-time_zone']['pt-br'] = "Timezone";
-$text['label-time_zone']['pl'] = "Timezone";
-$text['label-time_zone']['sv-se'] = "Timezone";
-$text['label-time_zone']['uk'] = "Timezone";
-$text['label-time_zone']['de-at'] = "Timezone";
-$text['label-time_zone']['it-it'] = "Timezone";
-$text['label-time_zone']['ru-ru'] = "Часовой пояс";
-
-$text['label-emergency_caller_id_name']['en-us'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['es-cl'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['pt-pt'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['fr-fr'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['pt-br'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['pl'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['sv-se'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['uk'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['de-at'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['it-it'] = "Emergency Caller ID Name";
-$text['label-emergency_caller_id_name']['ru-ru'] = "Emergency Caller ID Name";
-
-$text['label-emergency_caller_id_number']['en-us'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['es-cl'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['pt-pt'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['fr-fr'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['pt-br'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['pl'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['sv-se'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['uk'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['de-at'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['it-it'] = "Emergency Caller ID Number";
-$text['label-emergency_caller_id_number']['ru-ru'] = "Emergency Caller ID Number";
-
-$text['label-limit_max']['en-us'] = "Limit Max";
-$text['label-limit_max']['es-cl'] = "Limit Max";
-$text['label-limit_max']['pt-pt'] = "Limit Max";
-$text['label-limit_max']['fr-fr'] = "Limit Max";
-$text['label-limit_max']['pt-br'] = "Limit Max";
-$text['label-limit_max']['pl'] = "Limit Max";
-$text['label-limit_max']['sv-se'] = "Limit Max";
-$text['label-limit_max']['uk'] = "Limit Max";
-$text['label-limit_max']['de-at'] = "Limit Max";
-$text['label-limit_max']['it-it'] = "Limit Max";
-$text['label-limit_max']['ru-ru'] = "Limit Max";
-
-$text['label-toll_allow']['en-us'] = "Toll Allow";
-$text['label-toll_allow']['es-cl'] = "Toll Allow";
-$text['label-toll_allow']['pt-pt'] = "Toll Allow";
-$text['label-toll_allow']['fr-fr'] = "Toll Allow";
-$text['label-toll_allow']['pt-br'] = "Toll Allow";
-$text['label-toll_allow']['pl'] = "Toll Allow";
-$text['label-toll_allow']['sv-se'] = "Toll Allow";
-$text['label-toll_allow']['uk'] = "Toll Allow";
-$text['label-toll_allow']['de-at'] = "Toll Allow";
-$text['label-toll_allow']['it-it'] = "Toll Allow";
-$text['label-toll_allow']['ru-ru'] = "Toll Allow";
-
-$text['label-sip_bypass_media']['en-us'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['ar-eg'] = "";
-$text['label-sip_bypass_media']['de-at'] = "SIP Bypass Media"; //copied from de-de
-$text['label-sip_bypass_media']['de-ch'] = "SIP Bypass Media"; //copied from de-de
-$text['label-sip_bypass_media']['de-de'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['es-cl'] = "Bypass de Medios SIP";
-$text['label-sip_bypass_media']['es-mx'] = "Bypass de Medios SIP"; //copied from es-cl
-$text['label-sip_bypass_media']['fr-ca'] = "SIP Bypass Media"; //copied from fr-fr
-$text['label-sip_bypass_media']['fr-fr'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['he-il'] = "";
-$text['label-sip_bypass_media']['it-it'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['nl-nl'] = "SIP Bypass media";
-$text['label-sip_bypass_media']['pl-pl'] = "Nagłówek SIP 'Bypass Media'";
-$text['label-sip_bypass_media']['pt-br'] = "Ignorar mídia SIP (bypass)";
-$text['label-sip_bypass_media']['pt-pt'] = "Fazer Bypass à media SIP";
-$text['label-sip_bypass_media']['ro-ro'] = "";
-$text['label-sip_bypass_media']['ru-ru'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['sv-se'] = "SIP Bypass Media";
-$text['label-sip_bypass_media']['uk-ua'] = "";
-
-$text['label-mwi_account']['en-us'] = "MWI Account";
-$text['label-mwi_account']['ar-eg'] = "MWI Account";
-$text['label-mwi_account']['de-at'] = "MWI Account";
-$text['label-mwi_account']['de-ch'] = "MWI Account";
-$text['label-mwi_account']['de-de'] = "MWI Account";
-$text['label-mwi_account']['es-cl'] = "MWI Account";
-$text['label-mwi_account']['es-mx'] = "MWI Account";
-$text['label-mwi_account']['fr-ca'] = "MWI Account";
-$text['label-mwi_account']['fr-fr'] = "MWI Account";
-$text['label-mwi_account']['he-il'] = "MWI Account";
-$text['label-mwi_account']['it-it'] = "MWI Account";
-$text['label-mwi_account']['nl-nl'] = "MWI Account";
-$text['label-mwi_account']['pl-pl'] = "MWI Account";
-$text['label-mwi_account']['pt-br'] = "MWI Account";
-$text['label-mwi_account']['pt-pt'] = "MWI Account";
-$text['label-mwi_account']['ro-ro'] = "MWI Account";
-$text['label-mwi_account']['ru-ru'] = "MWI Account";
-$text['label-mwi_account']['sv-se'] = "MWI Account";
-$text['label-mwi_account']['uk-ua'] = "MWI Account";
-
-$text['label-sip_force_expires']['en-us'] = "SIP Force Expires";
-$text['label-sip_force_expires']['es-cl'] = "SIP Force Expires";
-$text['label-sip_force_expires']['pt-pt'] = "SIP Force Expires";
-$text['label-sip_force_expires']['fr-fr'] = "SIP Force Expires";
-$text['label-sip_force_expires']['pt-br'] = "SIP Force Expires";
-$text['label-sip_force_expires']['pl'] = "SIP Force Expires";
-$text['label-sip_force_expires']['sv-se'] = "SIP Force Expires";
-$text['label-sip_force_expires']['uk'] = "SIP Force Expires";
-$text['label-sip_force_expires']['de-at'] = "SIP Force Expires";
-$text['label-sip_force_expires']['it-it'] = "SIP Force Expires";
-$text['label-sip_force_expires']['ru-ru'] = "SIP Force Expires";
-
-$text['label-username']['en-us'] = "Username";
-$text['label-username']['es-cl'] = "Username";
-$text['label-username']['pt-pt'] = "Username";
-$text['label-username']['fr-fr'] = "Username";
-$text['label-username']['pt-br'] = "Username";
-$text['label-username']['pl'] = "Username";
-$text['label-username']['sv-se'] = "Username";
-$text['label-username']['uk'] = "Username";
-$text['label-username']['de-at'] = "Username";
-$text['label-username']['it-it'] = "Username";
-$text['label-username']['ru-ru'] = "Пользователь";
-
-$text['label-user_enabled']['en-us'] = "Enabled";
-$text['label-user_enabled']['es-cl'] = "Enabled";
-$text['label-user_enabled']['pt-pt'] = "Enabled";
-$text['label-user_enabled']['fr-fr'] = "Enabled";
-$text['label-user_enabled']['pt-br'] = "Enabled";
-$text['label-user_enabled']['pl'] = "Enabled";
-$text['label-user_enabled']['sv-se'] = "Enabled";
-$text['label-user_enabled']['uk'] = "Enabled";
-$text['label-user_enabled']['de-at'] = "Enabled";
-$text['label-user_enabled']['it-it'] = "Enabled";
-$text['label-user_enabled']['ru-ru'] = "Включено";
-
-$text['label-device_label']['en-us'] = "Label";
-$text['label-device_label']['es-cl'] = "Label";
-$text['label-device_label']['pt-pt'] = "Label";
-$text['label-device_label']['fr-fr'] = "Label";
-$text['label-device_label']['pt-br'] = "Label";
-$text['label-device_label']['pl'] = "Label";
-$text['label-device_label']['sv-se'] = "Label";
-$text['label-device_label']['uk'] = "Label";
-$text['label-device_label']['de-at'] = "Label";
-$text['label-device_label']['it-it'] = "Label";
-$text['label-device_label']['ru-ru'] = "Метка";
-
-$text['label-device_vendor']['en-us'] = "Vendor";
-$text['label-device_vendor']['es-cl'] = "Vendor";
-$text['label-device_vendor']['pt-pt'] = "Vendor";
-$text['label-device_vendor']['fr-fr'] = "Vendor";
-$text['label-device_vendor']['pt-br'] = "Vendor";
-$text['label-device_vendor']['pl'] = "Vendor";
-$text['label-device_vendor']['sv-se'] = "Vendor";
-$text['label-device_vendor']['uk'] = "Vendor";
-$text['label-device_vendor']['de-at'] = "Vendor";
-$text['label-device_vendor']['it-it'] = "Vendor";
-$text['label-device_vendor']['ru-ru'] = "Vendor";
-
-$text['label-device_template']['en-us'] = "Template";
-$text['label-device_template']['es-cl'] = "Template";
-$text['label-device_template']['pt-pt'] = "Template";
-$text['label-device_template']['fr-fr'] = "Template";
-$text['label-device_template']['pt-br'] = "Template";
-$text['label-device_template']['pl'] = "Template";
-$text['label-device_template']['sv-se'] = "Template";
-$text['label-device_template']['uk'] = "Template";
-$text['label-device_template']['de-at'] = "Template";
-$text['label-device_template']['it-it'] = "Template";
-$text['label-device_template']['ru-ru'] = "Шаблон";
-
-$text['label-device_profile']['en-us'] = "Profile";
-$text['label-device_profile']['es-cl'] = "Profile";
-$text['label-device_profile']['pt-pt'] = "Profile";
-$text['label-device_profile']['fr-fr'] = "Profile";
-$text['label-device_profile']['pt-br'] = "Profile";
-$text['label-device_profile']['pl'] = "Profile";
-$text['label-device_profile']['sv-se'] = "Profile";
-$text['label-device_profile']['uk'] = "Profile";
-$text['label-device_profile']['de-at'] = "Profile";
-$text['label-device_profile']['it-it'] = "Profile";
-$text['label-device_profile']['ru-ru'] = "Профиль";
-
-$text['label-device_enabled']['en-us'] = "Enabled";
-$text['label-device_enabled']['es-cl'] = "Enabled";
-$text['label-device_enabled']['pt-pt'] = "Enabled";
-$text['label-device_enabled']['fr-fr'] = "Enabled";
-$text['label-device_enabled']['pt-br'] = "Enabled";
-$text['label-device_enabled']['pl'] = "Enabled";
-$text['label-device_enabled']['sv-se'] = "Enabled";
-$text['label-device_enabled']['uk'] = "Enabled";
-$text['label-device_enabled']['de-at'] = "Enabled";
-$text['label-device_enabled']['it-it'] = "Enabled";
-$text['label-device_enabled']['ru-ru'] = "Включено";
-
-$text['label-device_description']['en-us'] = "Description";
-$text['label-device_description']['es-cl'] = "Description";
-$text['label-device_description']['pt-pt'] = "Description";
-$text['label-device_description']['fr-fr'] = "Description";
-$text['label-device_description']['pt-br'] = "Description";
-$text['label-device_description']['pl'] = "Description";
-$text['label-device_description']['sv-se'] = "Description";
-$text['label-device_description']['uk'] = "Description";
-$text['label-device_description']['de-at'] = "Description";
-$text['label-device_description']['it-it'] = "Description";
-$text['label-device_description']['ru-ru'] = "Описание";
-
-$text['label-device_address']['en-us'] = "Address";
-$text['label-device_address']['es-cl'] = "Address";
-$text['label-device_address']['pt-pt'] = "Address";
-$text['label-device_address']['fr-fr'] = "Address";
-$text['label-device_address']['pt-br'] = "Address";
-$text['label-device_address']['pl'] = "Address";
-$text['label-device_address']['sv-se'] = "Address";
-$text['label-device_address']['uk'] = "Address";
-$text['label-device_address']['de-at'] = "Address";
-$text['label-device_address']['it-it'] = "Address";
-$text['label-device_address']['ru-ru'] = "адрес";
-
-$text['label-voicemail_file']['en-us'] = "Voicemail File";
-$text['label-voicemail_file']['es-cl'] = "Voicemail File";
-$text['label-voicemail_file']['pt-pt'] = "Voicemail File";
-$text['label-voicemail_file']['fr-fr'] = "Voicemail File";
-$text['label-voicemail_file']['pt-br'] = "Voicemail File";
-$text['label-voicemail_file']['pl'] = "Voicemail File";
-$text['label-voicemail_file']['sv-se'] = "Voicemail File";
-$text['label-voicemail_file']['uk'] = "Voicemail File";
-$text['label-voicemail_file']['de-at'] = "Voicemail File";
-$text['label-voicemail_file']['it-it'] = "Voicemail File";
-$text['label-voicemail_file']['ru-ru'] = "Файл голосовой почты";
-
-$text['label-voicemail_description']['en-us'] = "Description";
-$text['label-voicemail_description']['es-cl'] = "Description";
-$text['label-voicemail_description']['pt-pt'] = "Description";
-$text['label-voicemail_description']['fr-fr'] = "Description";
-$text['label-voicemail_description']['pt-br'] = "Description";
-$text['label-voicemail_description']['pl'] = "Description";
-$text['label-voicemail_description']['sv-se'] = "Description";
-$text['label-voicemail_description']['uk'] = "Description";
-$text['label-voicemail_description']['de-at'] = "Description";
-$text['label-voicemail_description']['it-it'] = "Description";
-$text['label-voicemail_description']['ru-ru'] = "Описание";
-
-$text['label-voicemail_null']['en-us'] = " ";
-$text['label-voicemail_null']['es-cl'] = " ";
-$text['label-voicemail_null']['pt-pt'] = " ";
-$text['label-voicemail_null']['fr-fr'] = " ";
-$text['label-voicemail_null']['pt-br'] = " ";
-$text['label-voicemail_null']['pl'] = " ";
-$text['label-voicemail_null']['sv-se'] = " ";
-$text['label-voicemail_null']['uk'] = " ";
-$text['label-voicemail_null']['de-at'] = " ";
-$text['label-voicemail_null']['it-it'] = " ";
-$text['label-voicemail_null']['ru-ru'] = " ";
-
-$text['label-voicemail_option_0']['en-us'] = "Option 0";
-$text['label-voicemail_option_0']['es-cl'] = "Option 0";
-$text['label-voicemail_option_0']['pt-pt'] = "Option 0";
-$text['label-voicemail_option_0']['fr-fr'] = "Option 0";
-$text['label-voicemail_option_0']['pt-br'] = "Option 0";
-$text['label-voicemail_option_0']['pl'] = "Option 0";
-$text['label-voicemail_option_0']['sv-se'] = "Option 0";
-$text['label-voicemail_option_0']['uk'] = "Option 0";
-$text['label-voicemail_option_0']['de-at'] = "Option 0";
-$text['label-voicemail_option_0']['it-it'] = "Option 0";
-$text['label-voicemail_option_0']['ru-ru'] = "Option 0";
-
-$text['label-voicemail_option_1']['en-us'] = "Option 1";
-$text['label-voicemail_option_1']['es-cl'] = "Option 1";
-$text['label-voicemail_option_1']['pt-pt'] = "Option 1";
-$text['label-voicemail_option_1']['fr-fr'] = "Option 1";
-$text['label-voicemail_option_1']['pt-br'] = "Option 1";
-$text['label-voicemail_option_1']['pl'] = "Option 1";
-$text['label-voicemail_option_1']['sv-se'] = "Option 1";
-$text['label-voicemail_option_1']['uk'] = "Option 1";
-$text['label-voicemail_option_1']['de-at'] = "Option 1";
-$text['label-voicemail_option_1']['it-it'] = "Option 1";
-$text['label-voicemail_option_1']['ru-ru'] = "Option 1";
-
-$text['label-voicemail_option_2']['en-us'] = "Option 2";
-$text['label-voicemail_option_2']['es-cl'] = "Option 2";
-$text['label-voicemail_option_2']['pt-pt'] = "Option 2";
-$text['label-voicemail_option_2']['fr-fr'] = "Option 2";
-$text['label-voicemail_option_2']['pt-br'] = "Option 2";
-$text['label-voicemail_option_2']['pl'] = "Option 2";
-$text['label-voicemail_option_2']['sv-se'] = "Option 2";
-$text['label-voicemail_option_2']['uk'] = "Option 2";
-$text['label-voicemail_option_2']['de-at'] = "Option 2";
-$text['label-voicemail_option_2']['it-it'] = "Option 2";
-$text['label-voicemail_option_2']['ru-ru'] = "Option 2";
-
-$text['label-voicemail_option_3']['en-us'] = "Option 3";
-$text['label-voicemail_option_3']['es-cl'] = "Option 3";
-$text['label-voicemail_option_3']['pt-pt'] = "Option 3";
-$text['label-voicemail_option_3']['fr-fr'] = "Option 3";
-$text['label-voicemail_option_3']['pt-br'] = "Option 3";
-$text['label-voicemail_option_3']['pl'] = "Option 3";
-$text['label-voicemail_option_3']['sv-se'] = "Option 3";
-$text['label-voicemail_option_3']['uk'] = "Option 3";
-$text['label-voicemail_option_3']['de-at'] = "Option 3";
-$text['label-voicemail_option_3']['it-it'] = "Option 3";
-$text['label-voicemail_option_3']['ru-ru'] = "Option 3";
-
-$text['label-voicemail_option_4']['en-us'] = "Option 4";
-$text['label-voicemail_option_4']['es-cl'] = "Option 4";
-$text['label-voicemail_option_4']['pt-pt'] = "Option 4";
-$text['label-voicemail_option_4']['fr-fr'] = "Option 4";
-$text['label-voicemail_option_4']['pt-br'] = "Option 4";
-$text['label-voicemail_option_4']['pl'] = "Option 4";
-$text['label-voicemail_option_4']['sv-se'] = "Option 4";
-$text['label-voicemail_option_4']['uk'] = "Option 4";
-$text['label-voicemail_option_4']['de-at'] = "Option 4";
-$text['label-voicemail_option_4']['it-it'] = "Option 4";
-$text['label-voicemail_option_4']['ru-ru'] = "Option 4";
-
-$text['label-voicemail_option_5']['en-us'] = "Option 5";
-$text['label-voicemail_option_5']['es-cl'] = "Option 5";
-$text['label-voicemail_option_5']['pt-pt'] = "Option 5";
-$text['label-voicemail_option_5']['fr-fr'] = "Option 5";
-$text['label-voicemail_option_5']['pt-br'] = "Option 5";
-$text['label-voicemail_option_5']['pl'] = "Option 5";
-$text['label-voicemail_option_5']['sv-se'] = "Option 5";
-$text['label-voicemail_option_5']['uk'] = "Option 5";
-$text['label-voicemail_option_5']['de-at'] = "Option 5";
-$text['label-voicemail_option_5']['it-it'] = "Option 5";
-$text['label-voicemail_option_5']['ru-ru'] = "Option 5";
-
-$text['label-voicemail_option_6']['en-us'] = "Option 6";
-$text['label-voicemail_option_6']['es-cl'] = "Option 6";
-$text['label-voicemail_option_6']['pt-pt'] = "Option 6";
-$text['label-voicemail_option_6']['fr-fr'] = "Option 6";
-$text['label-voicemail_option_6']['pt-br'] = "Option 6";
-$text['label-voicemail_option_6']['pl'] = "Option 6";
-$text['label-voicemail_option_6']['sv-se'] = "Option 6";
-$text['label-voicemail_option_6']['uk'] = "Option 6";
-$text['label-voicemail_option_6']['de-at'] = "Option 6";
-$text['label-voicemail_option_6']['it-it'] = "Option 6";
-$text['label-voicemail_option_6']['ru-ru'] = "Option 6";
-
-$text['label-voicemail_option_7']['en-us'] = "Option 7";
-$text['label-voicemail_option_7']['es-cl'] = "Option 7";
-$text['label-voicemail_option_7']['pt-pt'] = "Option 7";
-$text['label-voicemail_option_7']['fr-fr'] = "Option 7";
-$text['label-voicemail_option_7']['pt-br'] = "Option 7";
-$text['label-voicemail_option_7']['pl'] = "Option 7";
-$text['label-voicemail_option_7']['sv-se'] = "Option 7";
-$text['label-voicemail_option_7']['uk'] = "Option 7";
-$text['label-voicemail_option_7']['de-at'] = "Option 7";
-$text['label-voicemail_option_7']['it-it'] = "Option 7";
-$text['label-voicemail_option_7']['ru-ru'] = "Option 7";
-
-$text['label-voicemail_option_8']['en-us'] = "Option 8";
-$text['label-voicemail_option_8']['es-cl'] = "Option 8";
-$text['label-voicemail_option_8']['pt-pt'] = "Option 8";
-$text['label-voicemail_option_8']['fr-fr'] = "Option 8";
-$text['label-voicemail_option_8']['pt-br'] = "Option 8";
-$text['label-voicemail_option_8']['pl'] = "Option 8";
-$text['label-voicemail_option_8']['sv-se'] = "Option 8";
-$text['label-voicemail_option_8']['uk'] = "Option 8";
-$text['label-voicemail_option_8']['de-at'] = "Option 8";
-$text['label-voicemail_option_8']['it-it'] = "Option 8";
-$text['label-voicemail_option_8']['ru-ru'] = "Option 8";
-
-$text['label-voicemail_option_9']['en-us'] = "Option 9";
-$text['label-voicemail_option_9']['es-cl'] = "Option 9";
-$text['label-voicemail_option_9']['pt-pt'] = "Option 9";
-$text['label-voicemail_option_9']['fr-fr'] = "Option 9";
-$text['label-voicemail_option_9']['pt-br'] = "Option 9";
-$text['label-voicemail_option_9']['pl'] = "Option 9";
-$text['label-voicemail_option_9']['sv-se'] = "Option 9";
-$text['label-voicemail_option_9']['uk'] = "Option 9";
-$text['label-voicemail_option_9']['de-at'] = "Option 9";
-$text['label-voicemail_option_9']['it-it'] = "Option 9";
-$text['label-voicemail_option_9']['ru-ru'] = "Option 9";
-
-$text['label-voicemail_option_star']['en-us'] = "Option *";
-$text['label-voicemail_option_star']['es-cl'] = "Option *";
-$text['label-voicemail_option_star']['pt-pt'] = "Option *";
-$text['label-voicemail_option_star']['fr-fr'] = "Option *";
-$text['label-voicemail_option_star']['pt-br'] = "Option *";
-$text['label-voicemail_option_star']['pl'] = "Option *";
-$text['label-voicemail_option_star']['sv-se'] = "Option *";
-$text['label-voicemail_option_star']['uk'] = "Option *";
-$text['label-voicemail_option_star']['de-at'] = "Option *";
-$text['label-voicemail_option_star']['it-it'] = "Option *";
-$text['label-voicemail_option_star']['ru-ru'] = "Option *";
-
-$text['label-voicemail_option_pound']['en-us'] = "Option #";
-$text['label-voicemail_option_pound']['es-cl'] = "Option #";
-$text['label-voicemail_option_pound']['pt-pt'] = "Option #";
-$text['label-voicemail_option_pound']['fr-fr'] = "Option #";
-$text['label-voicemail_option_pound']['pt-br'] = "Option #";
-$text['label-voicemail_option_pound']['pl'] = "Option #";
-$text['label-voicemail_option_pound']['sv-se'] = "Option #";
-$text['label-voicemail_option_pound']['uk'] = "Option #";
-$text['label-voicemail_option_pound']['de-at'] = "Option #";
-$text['label-voicemail_option_pound']['it-it'] = "Option #";
-$text['label-voicemail_option_pound']['ru-ru'] = "Option #";
-
-$text['label-voicemail_enabled']['en-us'] = "Enabled";
-$text['label-voicemail_enabled']['es-cl'] = "Enabled";
-$text['label-voicemail_enabled']['pt-pt'] = "Enabled";
-$text['label-voicemail_enabled']['fr-fr'] = "Enabled";
-$text['label-voicemail_enabled']['pt-br'] = "Enabled";
-$text['label-voicemail_enabled']['pl'] = "Enabled";
-$text['label-voicemail_enabled']['sv-se'] = "Enabled";
-$text['label-voicemail_enabled']['uk'] = "Enabled";
-$text['label-voicemail_enabled']['de-at'] = "Enabled";
-$text['label-voicemail_enabled']['it-it'] = "Enabled";
-$text['label-voicemail_enabled']['ru-ru'] = "Включено";
-
-$text['label-voicemail_id']['en-us'] = "Voicemail ID";
-$text['label-voicemail_id']['es-cl'] = "Voicemail ID";
-$text['label-voicemail_id']['pt-pt'] = "Voicemail ID";
-$text['label-voicemail_id']['fr-fr'] = "Voicemail ID";
-$text['label-voicemail_id']['pt-br'] = "Voicemail ID";
-$text['label-voicemail_id']['pl'] = "Voicemail ID";
-$text['label-voicemail_id']['sv-se'] = "Voicemail ID";
-$text['label-voicemail_id']['uk'] = "Voicemail ID";
-$text['label-voicemail_id']['de-at'] = "Voicemail ID";
-$text['label-voicemail_id']['it-it'] = "Voicemail ID";
-$text['label-voicemail_id']['ru-ru'] = "Voicemail ID";
-
-$text['label-voicemail_local_after_email']['en-us'] = "Keep Local";
-$text['label-voicemail_local_after_email']['es-cl'] = "Keep Local";
-$text['label-voicemail_local_after_email']['pt-pt'] = "Keep Local";
-$text['label-voicemail_local_after_email']['fr-fr'] = "Keep Local";
-$text['label-voicemail_local_after_email']['pt-br'] = "Keep Local";
-$text['label-voicemail_local_after_email']['pl'] = "Keep Local";
-$text['label-voicemail_local_after_email']['sv-se'] = "Keep Local";
-$text['label-voicemail_local_after_email']['uk'] = "Keep Local";
-$text['label-voicemail_local_after_email']['de-at'] = "Keep Local";
-$text['label-voicemail_local_after_email']['it-it'] = "Keep Local";
-$text['label-voicemail_local_after_email']['ru-ru'] = "Keep Local";
-
-$text['label-voicemail_password']['en-us'] = "Voicemail Password";
-$text['label-voicemail_password']['es-cl'] = "Voicemail Password";
-$text['label-voicemail_password']['pt-pt'] = "Voicemail Password";
-$text['label-voicemail_password']['fr-fr'] = "Voicemail Password";
-$text['label-voicemail_password']['pt-br'] = "Voicemail Password";
-$text['label-voicemail_password']['pl'] = "Voicemail Password";
-$text['label-voicemail_password']['sv-se'] = "Voicemail Password";
-$text['label-voicemail_password']['uk'] = "Voicemail Password";
-$text['label-voicemail_password']['de-at'] = "Voicemail Password";
-$text['label-voicemail_password']['it-it'] = "Voicemail Password";
-$text['label-voicemail_password']['ru-ru'] = "Пароль голосовой почты";
-
-$text['label-voicemail_transcription_enabled']['en-us'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['es-cl'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['pt-pt'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['fr-fr'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['pt-br'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['pl'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['sv-se'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['uk'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['de-at'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['it-it'] = "Transcription Enabled";
-$text['label-voicemail_transcription_enabled']['ru-ru'] = "Transcription Enabled";
-
-$text['option-available']['en-us'] = "Available";
-$text['option-available']['es-cl'] = "Available";
-$text['option-available']['pt-pt'] = "Available";
-$text['option-available']['fr-fr'] = "Available";
-$text['option-available']['pt-br'] = "Available";
-$text['option-available']['pl'] = "Available";
-$text['option-available']['sv-se'] = "Available";
-$text['option-available']['uk'] = "Available";
-$text['option-available']['de-at'] = "Available";
-$text['option-available']['it-it'] = "Available";
-$text['option-available']['ru-ru'] = "Доступно";
-
-$text['option-available_on_demand']['en-us'] = "Available (On Demand)";
-$text['option-available_on_demand']['es-cl'] = "Available (On Demand)";
-$text['option-available_on_demand']['pt-pt'] = "Available (On Demand)";
-$text['option-available_on_demand']['fr-fr'] = "Available (On Demand)";
-$text['option-available_on_demand']['pt-br'] = "Available (On Demand)";
-$text['option-available_on_demand']['pl'] = "Available (On Demand)";
-$text['option-available_on_demand']['sv-se'] = "Available (On Demand)";
-$text['option-available_on_demand']['uk'] = "Available (On Demand)";
-$text['option-available_on_demand']['de-at'] = "Available (On Demand)";
-$text['option-available_on_demand']['it-it'] = "Available (On Demand)";
-$text['option-available_on_demand']['ru-ru'] = "Доступно (по запросу)";
-
-$text['option-bypass_media']['en-us'] = "Bypass Media";
-$text['option-bypass_media']['ar-eg'] = "";
-$text['option-bypass_media']['de-at'] = "Bypass Media"; //copied from de-de
-$text['option-bypass_media']['de-ch'] = "Bypass Media"; //copied from de-de
-$text['option-bypass_media']['de-de'] = "Bypass Media";
-$text['option-bypass_media']['es-cl'] = "Bypass de Medios";
-$text['option-bypass_media']['es-mx'] = "Bypass de Medios"; //copied from es-cl
-$text['option-bypass_media']['fr-ca'] = "Bypass Media"; //copied from fr-fr
-$text['option-bypass_media']['fr-fr'] = "Bypass Media";
-$text['option-bypass_media']['he-il'] = "";
-$text['option-bypass_media']['it-it'] = "Bypass Media";
-$text['option-bypass_media']['nl-nl'] = "Bypass Media";
-$text['option-bypass_media']['pl-pl'] = "Obejście strumienia głosu";
-$text['option-bypass_media']['pt-br'] = "Ignorar mídia (bypass)";
-$text['option-bypass_media']['pt-pt'] = "Fazer Bypass à media";
-$text['option-bypass_media']['ro-ro'] = "";
-$text['option-bypass_media']['ru-ru'] = "Обходной носитель";
-$text['option-bypass_media']['sv-se'] = "Bypass Media";
-$text['option-bypass_media']['uk-ua'] = "";
-
-$text['option-bypass_media_after_bridge']['en-us'] = "Bypass Media After Bridge";
-$text['option-bypass_media_after_bridge']['ar-eg'] = "";
-$text['option-bypass_media_after_bridge']['de-at'] = "Bypass Media After Bridge"; //copied from de-de
-$text['option-bypass_media_after_bridge']['de-ch'] = "Bypass Media After Bridge"; //copied from de-de
-$text['option-bypass_media_after_bridge']['de-de'] = "Bypass Media After Bridge";
-$text['option-bypass_media_after_bridge']['es-cl'] = "Después de la omisión de medios puente";
-$text['option-bypass_media_after_bridge']['es-mx'] = "Después de la omisión de medios puente"; //copied from es-cl
-$text['option-bypass_media_after_bridge']['fr-ca'] = "Après le contournement de média Pont"; //copied from fr-fr
-$text['option-bypass_media_after_bridge']['fr-fr'] = "Après le contournement de média Pont";
-$text['option-bypass_media_after_bridge']['he-il'] = "";
-$text['option-bypass_media_after_bridge']['it-it'] = "Bypass Media After Bridge";
-$text['option-bypass_media_after_bridge']['nl-nl'] = "Bypass Media na Bridge";
-$text['option-bypass_media_after_bridge']['pl-pl'] = "Obejście strumienia głosu po BRIDGE";
-$text['option-bypass_media_after_bridge']['pt-br'] = "Ignorar mídia depois da conexão (Bridge)";
-$text['option-bypass_media_after_bridge']['pt-pt'] = "Depois de Ponte de mídia Bypass";
-$text['option-bypass_media_after_bridge']['ro-ro'] = "";
-$text['option-bypass_media_after_bridge']['ru-ru'] = "Bypass Media After Bridge";
-$text['option-bypass_media_after_bridge']['sv-se'] = "Bypass Media After Bridge";
-$text['option-bypass_media_after_bridge']['uk-ua'] = "";
-
-$text['option-proxy_media']['en-us'] = "Proxy Media";
-$text['option-proxy_media']['ar-eg'] = "";
-$text['option-proxy_media']['de-at'] = "Proxy Media"; //copied from de-de
-$text['option-proxy_media']['de-ch'] = "Proxy Media"; //copied from de-de
-$text['option-proxy_media']['de-de'] = "Proxy Media";
-$text['option-proxy_media']['es-cl'] = "Proxy Medios";
-$text['option-proxy_media']['es-mx'] = "Proxy Medios"; //copied from es-cl
-$text['option-proxy_media']['fr-ca'] = "Proxy Médias"; //copied from fr-fr
-$text['option-proxy_media']['fr-fr'] = "Proxy Médias";
-$text['option-proxy_media']['he-il'] = "";
-$text['option-proxy_media']['it-it'] = "Proxy Media";
-$text['option-proxy_media']['nl-nl'] = "Proxy Media";
-$text['option-proxy_media']['pl-pl'] = "Proxy Media ";
-$text['option-proxy_media']['pt-br'] = "Mídia Proxy";
-$text['option-proxy_media']['pt-pt'] = "Proxy Mídia";
-$text['option-proxy_media']['ro-ro'] = "";
-$text['option-proxy_media']['ru-ru'] = "Proxy Media";
-$text['option-proxy_media']['sv-se'] = "Proxy Media";
-$text['option-proxy_media']['uk-ua'] = "";
-
-$text['option-logged_out']['en-us'] = "Logged Out";
-$text['option-logged_out']['es-cl'] = "Logged Out";
-$text['option-logged_out']['pt-pt'] = "Logged Out";
-$text['option-logged_out']['fr-fr'] = "Logged Out";
-$text['option-logged_out']['pt-br'] = "Logged Out";
-$text['option-logged_out']['pl'] = "Logged Out";
-$text['option-logged_out']['sv-se'] = "Logged Out";
-$text['option-logged_out']['uk'] = "Logged Out";
-$text['option-logged_out']['de-at'] = "Logged Out";
-$text['option-logged_out']['it-it'] = "Logged Out";
-$text['option-logged_out']['ru-ru'] = "Logged Out";
-
-$text['option-on_break']['en-us'] = "On Break";
-$text['option-on_break']['es-cl'] = "On Break";
-$text['option-on_break']['pt-pt'] = "On Break";
-$text['option-on_break']['fr-fr'] = "On Break";
-$text['option-on_break']['pt-br'] = "On Break";
-$text['option-on_break']['pl'] = "On Break";
-$text['option-on_break']['sv-se'] = "On Break";
-$text['option-on_break']['uk'] = "On Break";
-$text['option-on_break']['de-at'] = "On Break";
-$text['option-on_break']['it-it'] = "On Break";
-$text['option-on_break']['ru-ru'] = "On Break";
-
-$text['option-do_not_disturb']['en-us'] = "Do Not Disturb";
-$text['option-do_not_disturb']['es-cl'] = "Do Not Disturb";
-$text['option-do_not_disturb']['pt-pt'] = "Do Not Disturb";
-$text['option-do_not_disturb']['fr-fr'] = "Do Not Disturb";
-$text['option-do_not_disturb']['pt-br'] = "Do Not Disturb";
-$text['option-do_not_disturb']['pl'] = "Do Not Disturb";
-$text['option-do_not_disturb']['sv-se'] = "Do Not Disturb";
-$text['option-do_not_disturb']['uk'] = "Do Not Disturb";
-$text['option-do_not_disturb']['de-at'] = "Do Not Disturb";
-$text['option-do_not_disturb']['it-it'] = "Do Not Disturb";
-$text['option-do_not_disturb']['ru-ru'] = "Do Not Disturb";
-
-$text['option-voicemail_file_listen']['en-us'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['es-cl'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['pt-pt'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['fr-fr'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['pt-br'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['pl'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['sv-se'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['uk'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['de-at'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['it-it'] = "Listen Link (Login Required)";
-$text['option-voicemail_file_listen']['ru-ru'] = "Ссылка для прослушивания (требуется авторизация)";
-
-$text['option-voicemail_file_link']['en-us'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['es-cl'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['pt-pt'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['fr-fr'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['pt-br'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['pl'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['sv-se'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['uk'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['de-at'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['it-it'] = "Download Link (No Login Required)";
-$text['option-voicemail_file_link']['ru-ru'] = "Ссылка для скачивания (без авторизации)";
-
-$text['option-voicemail_file_attach']['en-us'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['es-cl'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['pt-pt'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['fr-fr'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['pt-br'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['pl'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['sv-se'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['uk'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['de-at'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['it-it'] = "Audio File Attachment";
-$text['option-voicemail_file_attach']['ru-ru'] = "Audio File Attachment";
-
-$text['title-users_settings']['en-us'] = "User Settings";
-$text['title-users_settings']['es-cl'] = "User Settings";
-$text['title-users_settings']['pt-pt'] = "User Settings";
-$text['title-users_settings']['fr-fr'] = "User Settings";
-$text['title-users_settings']['pt-br'] = "User Settings";
-$text['title-users_settings']['pl'] = "User Settings";
-$text['title-users_settings']['sv-se'] = "User Settings";
-$text['title-users_settings']['uk'] = "User Settings";
-$text['title-users_settings']['de-at'] = "User Settings";
-$text['title-users_settings']['it-it'] = "User Settings";
-$text['title-users_settings']['ru-ru'] = "Настройки пользователя";
-
-$text['title-devices_settings']['en-us'] = "Device Settings";
-$text['title-devices_settings']['es-cl'] = "Device Settings";
-$text['title-devices_settings']['pt-pt'] = "Device Settings";
-$text['title-devices_settings']['fr-fr'] = "Device Settings";
-$text['title-devices_settings']['pt-br'] = "Device Settings";
-$text['title-devices_settings']['pl'] = "Device Settings";
-$text['title-devices_settings']['sv-se'] = "Device Settings";
-$text['title-devices_settings']['uk'] = "Device Settings";
-$text['title-devices_settings']['de-at'] = "Device Settings";
-$text['title-devices_settings']['it-it'] = "Device Settings";
-$text['title-devices_settings']['ru-ru'] = "Настройки устройства";
-
-?>

+ 0 - 10
bulk_account_settings/app_menu.php

@@ -1,10 +0,0 @@
-<?php
-
-$apps[$x]['menu'][0]['title']['en-us'] = "Bulk Account Settings";
-$apps[$x]['menu'][0]['uuid'] = "cdfd8c74-d086-4a49-a7e6-3b702953d554";
-$apps[$x]['menu'][0]['parent_uuid'] = "594d99c5-6128-9c88-ca35-4b33392cec0f";
-$apps[$x]['menu'][0]['category'] = "internal";
-$apps[$x]['menu'][0]['path'] = "/app/bulk_account_settings/bulk_account_settings.php";
-$apps[$x]['menu'][0]['groups'][] = "superadmin";
-
-?>

+ 0 - 70
bulk_account_settings/bulk_account_settings.php

@@ -1,70 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-	require_once "resources/paging.php";
-
-//include the class
-	require_once "resources/check_auth.php";
-
-//check permissions
-	require_once "resources/check_auth.php";
-	if (permission_exists('bulk_account_settings_view')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-	
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-	
-	
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left' width='100%'>\n";
-	echo "		<b>".$text['header-bulk_account_settings']." </b><br>\n";
-	echo "	</td>\n";
-	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
-	echo "		<form method='get' action=''>\n";
-	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
-	echo 				"<input type='button' class='btn' alt='".$text['button-devices']."' onclick=\"window.location='bulk_account_settings_devices.php'\" value='".$text['button-devices']."'>\n";
-	echo 				"<input type='button' class='btn' alt='".$text['button-extensions']."' onclick=\"window.location='bulk_account_settings_extensions.php'\" value='".$text['button-extensions']."'>\n";
-	echo 				"<input type='button' class='btn' alt='".$text['button-users']."' onclick=\"window.location='bulk_account_settings_users.php'\" value='".$text['button-users']."'>\n";
-	echo 				"<input type='button' class='btn' alt='".$text['button-voicemails']."' onclick=\"window.location='bulk_account_settings_voicemails.php'\" value='".$text['button-voicemails']."'>\n";
-//	echo 				"<input type='button' class='btn' alt='".$text['button-call_routing']."' onclick=\"window.location='bulk_account_settings_call_routing.php'\" value='".$text['button-call_routing']."'>\n";
-	echo "			</td>\n";
-	echo "		</form>\n";	
-	echo "  </tr>\n";
-	echo "  </table>\n";
-//show the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 459
bulk_account_settings/bulk_account_settings_devices.php

@@ -1,459 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-	require_once "resources/paging.php";
-
-//check permissions
-	require_once "resources/check_auth.php";
-	if (permission_exists('bulk_account_settings_devices')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//use a database object
-	$database = database::new();
-
-//get the http values and set them as variables
-	$order_by = $_GET["order_by"] ?? null;
-	$order = $_GET["order"] ?? null;
-	$option_selected = $_GET["option_selected"] ?? null;
-	
-//	if (count($_POST)>0) {
-//		$option_selected = $_POST["option_selected"];
-//	}
-
-//handle search term
-	$search = $_GET["search"] ?? null;
-	if (!empty($search)) {
-		$sql_mod = "and ( ";
-		$sql_mod .= "device_address ILIKE '%".$search."%' ";
-		$sql_mod .= "or device_label ILIKE '%".$search."%' ";		
-		$sql_mod .= "or device_vendor ILIKE '%".$search."%' ";
-		$sql_mod .= "or device_model ILIKE '%".$search."%' ";
-		$sql_mod .= "or device_description ILIKE '%".$search."%' ";
-		$sql_mod .= "or device_template ILIKE '%".$search."%' ";		
-		$sql_mod .= ") ";
-	}
-	if (empty($order_by)) {
-		$order_by = "device_label";
-		$order = "ASC";
-	}
-
-	$domain_uuid = $_SESSION['domain_uuid'];
-
-//get total device count from the database
-	$sql = "select count(*) as num_rows from v_devices where domain_uuid = '".$_SESSION['domain_uuid']."' ".($sql_mod ?? '')." ";
-	$result = $database->select($sql, null, 'column');
-	if (!empty($result)) {
-		$numeric_devices = intval($result);
-	} else {
-		$numeric_devices = 0;
-	}
-
-//prepare to page the results
-	$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
-	$param = (!empty($search) ? "&search=".$search : null).(!empty($option_selected) ? "&option_selected=".$option_selected : null);
-	$page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 0;
-	list($paging_controls, $rows_per_page) = paging($total_devices, $param, $rows_per_page);
-	list($paging_controls_mini, $rows_per_page) = paging($total_devices, $param, $rows_per_page, true);
-	$offset = $rows_per_page * $page;
-
-//get all the devices from the database
-	$sql = "SELECT \n";
-	$sql .= "d.device_uuid, \n";
-	$sql .= "d.device_label, \n";
-	$sql .= "d.device_address, \n";
-	$sql .= "d.device_vendor, \n";
-	$sql .= "d.device_template, \n";
-	$sql .= "d.device_enabled, \n";
-	$sql .= "d.device_description, \n";
-	$sql .= "(\n";
-	$sql .= "select dp.device_profile_name from v_device_profiles as dp \n";
-	$sql .= "where d.device_profile_uuid = dp.device_profile_uuid \n";
-	$sql .= ") as device_profile_name \n";
-	$sql .= "FROM v_devices as d \n";
-	$sql .= "WHERE domain_uuid = '".$_SESSION['domain_uuid']."' \n";
-	$sql .= $sql_mod ?? ''; //add search mod from above
-	$sql .= "ORDER BY ".$order_by." ".$order." \n";
-	$sql .= "limit $rows_per_page offset $offset ";
-	$database = new database;
-	$directory = $database->select($sql, 'all');
-	unset($database);
-
-//lookup the lines
-	$x = 0;
-	if (!empty($directory)) {
-		foreach ($directory as $key => $row) {
-			$sql = "SELECT * \n";
-			$sql .= "FROM v_device_lines \n";
-			$sql .= "WHERE domain_uuid = '$domain_uuid' \n";
-			$sql .= "and device_uuid = '".$row['device_uuid']."' ";
-			$sql .= "and line_number = '1' ";
-			$database = new database;
-			$sqlview1 = $sql;
-			$result = $database->select($sql, 'all');
-			$directory[$key]['line_1_server_address'] = $result[0]['server_address'];
-			$directory[$key]['line_1_server_address_primary'] = $result[0]['server_address_primary'];
-			$directory[$key]['line_1_server_address_secondary'] = $result[0]['server_address_secondary'];
-			$directory[$key]['line_1_outbound_proxy_primary'] = $result[0]['outbound_proxy_primary'];
-			$directory[$key]['line_1_outbound_proxy_secondary'] = $result[0]['outbound_proxy_secondary'];
-			$directory[$key]['line_1_sip_port'] = $result[0]['sip_port'];
-			$directory[$key]['line_1_sip_transport'] = $result[0]['sip_transport'];
-			$directory[$key]['line_1_register_expires'] = $result[0]['register_expires'];
-
-			unset($result, $database);
-			$x++;
-		}
-	}
-
-//additional includes
-	require_once "resources/header.php";
-	$document['title'] = $text['title-devices_settings'];
-
-//set the alternating styles
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left' width='100%'>\n";
-	echo "		<b>".$text['header-devices']." (".$numeric_devices.")</b><br>\n";
-
-//options list
-	echo "<form name='frm' method='get' id=option_selected>\n";
-	echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
-	echo "    <option value=''></option>\n";
-//Enabled		
-	if ($option_selected == "device_enabled") {
-		echo "    <option value='device_enabled' selected='selected'>".$text['label-enabled']."</option>\n";
-	}
-	else {
-		echo "    <option value='device_enabled'>".$text['label-enabled']."</option>\n";
-	}
-//Device Profile
-	if ($option_selected == "device_profile_uuid") {
-		echo "    <option value='device_profile_uuid' selected='selected'>".$text['label-device_profile']."</option>\n";
-	}
-	else {
-		echo "    <option value='device_profile_uuid'>".$text['label-device_profile']."</option>\n";
-	}
-//Device Template
-	if ($option_selected == "device_template") {
-		echo "    <option value='device_template' selected='selected'>".$text['label-device_template']."</option>\n";
-	}
-	else {
-		echo "    <option value='device_template'>".$text['label-device_template']."</option>\n";
-	}
-//Line 1 - Server Address
-	if ($option_selected == "line_1_server_address") {
-		echo "    <option value='line_1_server_address' selected='selected'>".$text['label-line_1_server_address']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_server_address'>".$text['label-line_1_server_address']."</option>\n";
-	}
-
-//Line 1 - Server Address Primary	
-	if ($option_selected == "line_1_server_address_primary") {
-		echo "    <option value='line_1_server_address_primary' selected='selected'>".$text['label-line_1_server_address_primary']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_server_address_primary'>".$text['label-line_1_server_address_primary']."</option>\n";
-	}
-
-//Line 1 - Server Address Secondary	
-	if ($option_selected == "line_1_server_address_secondary") {
-		echo "    <option value='line_1_server_address_secondary' selected='selected'>".$text['label-line_1_server_address_secondary']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_server_address_secondary'>".$text['label-line_1_server_address_secondary']."</option>\n";
-	}
-//Line 1 - Outbound Proxy Primary
-	if ($option_selected == "line_1_outbound_proxy_primary") {
-		echo "    <option value='line_1_outbound_proxy_primary' selected='selected'>".$text['label-line_1_outbound_proxy_primary']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_outbound_proxy_primary'>".$text['label-line_1_outbound_proxy_primary']."</option>\n";
-	}
-//Line 1 - Outbound Proxy Secondary
-	if ($option_selected == "line_1_outbound_proxy_secondary") {
-		echo "    <option value='line_1_outbound_proxy_secondary' selected='selected'>".$text['label-line_1_outbound_proxy_secondary']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_outbound_proxy_secondary'>".$text['label-line_1_outbound_proxy_secondary']."</option>\n";
-	}
-//Line 1 - SIP Port
-	if ($option_selected == "line_1_sip_port") {
-		echo "    <option value='line_1_sip_port' selected='selected'>".$text['label-line_1_sip_port']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_sip_port'>".$text['label-line_1_sip_port']."</option>\n";
-	}
-//Line 1 - SIP Transport
-	if ($option_selected == "line_1_sip_transport") {
-		echo "    <option value='line_1_sip_transport' selected='selected'>".$text['label-line_1_sip_transport']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_sip_transport'>".$text['label-line_1_sip_transport']."</option>\n";
-	}
-//Line 1 - Register Expires
-	if ($option_selected == "line_1_register_expires") {
-		echo "    <option value='line_1_register_expires' selected='selected'>".$text['label-line_1_register_expires']."</option>\n";
-	}
-	else {
-		echo "    <option value='line_1_register_expires'>".$text['label-line_1_register_expires']."</option>\n";
-	}
-		
-	echo "    </select>\n";
-	echo "    </form>\n";
-	echo "<br />\n";
-	echo ($text['description-device_settings_description'] ?? '')."\n";
-	echo "</td>\n";
-
-	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
-	echo "		<form method='get' action=''>\n";
-	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
-	echo "				<input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='bulk_account_settings.php'\" value='".$text['button-back']."'>\n";	
-	echo "				<input type='text' class='txt' style='width: 150px' name='search' id='search' value='".$search."'>";
-	echo "				<input type='hidden' class='txt' style='width: 150px' name='option_selected' id='option_selected' value='".$option_selected."'>";
-	echo "				<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	if (!empty($paging_controls_mini)) {
-		echo 			"<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
-	}
-	echo "			</td>\n";
-	echo "		</form>\n";	
-	echo "  </tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2'>\n";
-	echo "			".$text['description-devices_settings']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	if (!empty($option_selected)) {
-		echo "<form name='devices' method='post' action='bulk_account_settings_devices_update.php'>\n";
-		echo "<input class='formfld' type='hidden' name='option_selected' maxlength='255' value=\"".escape($option_selected)."\">\n";
-		echo "<table width='auto' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		//option is Enabled
-		if ($option_selected == 'device_enabled') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='true'>".$text['label-true']."</option>\n";
-			echo "    <option value='false'>".$text['label-false']."</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-
-		//option is Device Profile
-		if ($option_selected == 'device_profile_uuid' && permission_exists('device_profile_edit')) {
-			$sql = "select * from v_device_profiles ";
-			$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
-			$sql .= "order by device_profile_name asc ";
-			$result = $database->select($sql);
-			if (!empty($result)) {
-				$result_count = count(intval($result));
-			} else {
-				$result_count = 0;
-			}
-			unset ($sql);
-			if ($result_count > 0) {
-				echo "<td class='vtable' align='left'>\n";
-				echo "    <select class='formfld' name='new_setting'>\n";
-				echo "				<option value=''></option>\n";
-				foreach ($result as $row) {
-					echo "			<option value='".escape($row['device_profile_uuid'])."' ".(($row['device_profile_uuid'] == $device_profile_uuid) ? "selected='selected'" : null).">".escape($row['device_profile_name'])." ".(($row['domain_uuid'] == '') ? "&nbsp;&nbsp;(".$text['select-global'].")" : null)."</option>\n";
-				}
-				//echo "			</select>\n";
-				echo "    </select>\n";
-				echo "    <br />\n";
-				echo $text["description-".$option_selected.""]."\n";
-				echo "</td>\n";
-			}
-		}
-
-		//option is Device Templates
-		if ($option_selected == 'device_template' && permission_exists('device_template')) {
-			$device = new device;
-			$template_dir = $device->get_template_dir();
-			
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "<option value=''></option>\n";
-			if (is_dir($template_dir)) {
-					$templates = scandir($template_dir);
-					foreach ($templates as $dir) {
-						if (!empty($file) && $file != "." && !empty($dir) && $dir != ".." && $dir[0] != '.') {
-							if (is_dir($template_dir . "/" . $dir)) {
-								echo "<optgroup label='$dir'>";
-								$dh_sub=$template_dir . "/" . $dir;
-								if (is_dir($dh_sub)) {
-									$templates_sub = scandir($dh_sub);
-									foreach ($templates_sub as $dir_sub) {
-										if ($file_sub != '.' && $dir_sub != '..' && $dir_sub[0] != '.') {
-											if (is_dir($template_dir . '/' . $dir .'/'. $dir_sub)) {
-												if ($device_template == $dir."/".$dir_sub) {
-													echo "<option value='".$dir."/".$dir_sub."' selected='selected'>".$dir."/".$dir_sub."</option>\n";
-												}
-												else {
-													echo "<option value='".$dir."/".$dir_sub."'>".$dir."/".$dir_sub."</option>\n";
-												}
-											}
-										}
-									}
-								}
-								echo "</optgroup>";
-							}
-						}
-					}
-				}
-			echo "</select>\n";
-			echo "    <br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-
-		//options with a free form input
-		if ($option_selected == 'line_1_server_address' || $option_selected == 'line_1_server_address_primary' || $option_selected == 'line_1_server_address_secondary' || $option_selected == 'line_1_outbound_proxy_primary' || $option_selected == 'line_1_outbound_proxy_secondary' || $option_selected == 'line_1_sip_port' || $option_selected == 'line_1_register_expires') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <input class='formfld' type='text' name='new_setting' maxlength='255' value=\"".escape($new_setting ?? '')."\">\n";
-			echo "<br />\n";
-			echo ($text["description-".escape($option_selected)] ?? '')."\n";
-			echo "</td>\n";
-		}
-		
-		//option is transport
-		if ($option_selected == 'line_1_sip_transport') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='tcp'>TCP</option>\n";
-			echo "    <option value='udp'>UDP</option>\n";
-			echo "    <option value='tls'>TLS</option>\n";
-			echo "    <option value='dns srv'>DNS SRV</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo ($text["description-".escape($option_selected)] ?? '')."\n";
-			echo "</td>\n";
-		}
-
-		echo "<td align='left'>\n";
-		echo "<input type='button' class='btn' alt='".$text['button-submit']."' onclick=\"if (confirm('".$text['confirm-update']."')) { document.forms.devices.submit(); }\" value='".$text['button-submit']."'>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-		echo "</table>";
-		echo "<br />";
-	}
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	if (is_array($directory)) {
-		echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
-	}
-	echo th_order_by('device_address', $text['label-device_address'], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_label', $text['label-device_label'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	if (preg_match('/line_(.)/',($option_selected ?? ''))) {
-			echo th_order_by($option_selected, $text["label-".$option_selected.""], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-		}
-	echo th_order_by('device_vendor', $text['label-device_vendor'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_template', $text['label-device_template'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_label', $text['label-device_profile'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_enabled', $text['label-device_enabled'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('device_description', $text['label-device_description'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo "</tr>\n";
-
-	if (is_array($directory)) {
-		foreach ($directory as $key => $row) {
-			$tr_link = (permission_exists('device_edit')) ? " href='/app/devices/device_edit.php?id=".$row['device_uuid']."'" : null;
-			echo "<tr ".$tr_link.">\n";
-
-			echo "	<td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
-			echo "		<input type='checkbox' name='id[]' id='checkbox_".escape($row['device_uuid'])."' value='".escape($row['device_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all').checked = false; }\">";
-			echo "	</td>";
-			$device_ids[] = 'checkbox_'.$row['device_uuid'];
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape(format_device_address($row['device_address']))."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_label'])."&nbsp;</td>\n";
-			if (preg_match ('/line_/',($option_selected ?? ''))) {
-				echo "	<td valign='top' class='".$row_style[$c]."'> ".$row[$option_selected]."&nbsp;</td>\n";	
-			}
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_vendor'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_template'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_profile_name'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_enabled'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['device_description'])."&nbsp;</td>\n";
-			echo "</tr>\n";
-			$c = ($c) ? 0 : 1;
-		}
-		unset($directory, $row);
-	}
-
-	echo "</table>";
-	echo "</form>";
-
-	if (!empty($paging_controls)) {
-		echo "<br />";
-		echo $paging_controls."\n";
-	}
-
-	echo "<br /><br />".(!empty($directory) && is_array($directory) ? "<br /><br />" : null);
-
-	// check or uncheck all checkboxes
-	if (!empty($device_ids) && is_array($device_ids) && @sizeof($device_ids) != 0) {
-		echo "<script>\n";
-		echo "	function check(what) {\n";
-		echo "		document.getElementById('chk_all').checked = (what == 'all') ? true : false;\n";
-		foreach ($device_ids as $device_id) {
-			echo "		document.getElementById('".$device_id."').checked = (what == 'all') ? true : false;\n";
-		}
-		echo "	}\n";
-		echo "</script>\n";
-	}
-
-	if (!empty($directory) && is_array($directory)) {
-		// check all checkboxes
-		key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true);
-
-		// delete checked
-		key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true);
-	}
-
-//show the footer
-	require_once "resources/footer.php";
-
-?>

+ 0 - 115
bulk_account_settings/bulk_account_settings_devices_update.php

@@ -1,115 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('bulk_account_settings_devices')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//check for the ids
-	if (is_array($_REQUEST) && sizeof($_REQUEST) > 0) {
-
-		$device_uuids = $_REQUEST["id"];
-		$option_selected = $_REQUEST["option_selected"];
-		$new_setting = $_REQUEST["new_setting"];
-
-		foreach($device_uuids as $device_uuid) {
-			$device_uuid = check_str($device_uuid);
-			if ($device_uuid != '') {
-				//line settings
-				if (preg_match ('/line/', $option_selected)) {
-					
-					preg_match ('/line_(.)/', $option_selected, $matches);
-					$line_number = $matches[1];
-					$matches = null;
-					preg_match ('/line_._(.*$)/', $option_selected, $matches);
-					$option_line = $matches[1];
-
-					$sql = "select * from v_device_lines ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and device_uuid = '".$device_uuid."' ";
-					$sql .= "and line_number = '".$line_number."' ";
-					$database = new database;
-					$devices = $database->select($sql, 'all');
-					if (is_array($devices)) { 
-						foreach ($devices as &$row) {
-							$device_line_uuid = $row["device_line_uuid"];
-						}
-						unset ($prep_statement);
-					}
-					
-					$array["device_lines"][$i]["device_line_uuid"] = $device_line_uuid;
-					$array["device_lines"][$i][$option_line] = $new_setting;
-					$array["device_lines"][$i]["domain_uuid"] = $domain_uuid;
-					$array["device_lines"][$i]["device_uuid"] = $device_uuid;					
-
-					$database = new database;
-					$database->app_name = 'bulk_account_settings';
-					$database->app_uuid = null;
-					$database->save($array);
-					$message = $database->message;
-					
-					unset($database,$array,$i);
-				}
-				//other device settings
-				else {
-					$array["devices"][$i]["domain_uuid"] = $domain_uuid;
-					$array["devices"][$i]["device_uuid"] = $device_uuid;
-					$array["devices"][$i][$option_selected] = $new_setting;
-
-					$database = new database;
-					$database->app_name = 'bulk_account_settings';
-					$database->app_uuid = null;
-					$database->save($array);
-					$message = $database->message;
-				
-					//echo "<pre>".print_r($message, true)."<pre>\n";
-					//exit;
-					
-					unset($database,$array,$i);
-				}   
-			}
-		}
-	}
-
-//redirect the browser
-	$_SESSION["message"] = $text['message-update'];
-	header("Location: bulk_account_settings_devices.php?option_selected=".$option_selected."");
-	return;
-
-?>

+ 0 - 429
bulk_account_settings/bulk_account_settings_extensions.php

@@ -1,429 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-	require_once "resources/paging.php";
-
-//include the class
-	require_once "resources/check_auth.php";
-
-//check permissions
-	require_once "resources/check_auth.php";
-	if (permission_exists('bulk_account_settings_extensions')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//create database object
-	$database = database::new();
-
-//get the http values and set them as variables
-	$order_by = check_str($_GET["order_by"]);
-	$order = check_str($_GET["order"]);
-	$option_selected = check_str($_GET["option_selected"]);
-
-//handle search term
-	$search = check_str($_GET["search"]);
-	if (strlen($search) > 0) {
-		$search = strtolower($search);
-		$sql_mod = "and ( ";
-		$sql_mod .= "lower(extension) like '%".$search."%' ";
-		$sql_mod .= "or lower(accountcode) like '%".$search."%' ";
-		$sql_mod .= "or lower(call_group) like '%".$search."%' ";
-		$sql_mod .= "or lower(description) like '%".$search."%' ";
-		if (($option_selected == "") or ($option_selected == 'call_group') or ($option_selected == 'accountcode')) {
-
-		} elseif (($option_selected == 'call_timeout') or ($option_selected == 'sip_force_expires')){
-			$sql_mod .= "or lower(cast (".$option_selected." as text)) like '%".$search."%' ";
-		} else {
-			$sql_mod .= "or lower(".$option_selected.") like '%".$search."%' ";
-		}
-		$sql_mod .= ") ";
-	}
-	if (strlen($order_by) < 1) {
-		$order_by = "extension";
-		$order = "ASC";
-	}
-
-	$domain_uuid = $_SESSION['domain_uuid'];
-
-
-//get total extension count from the database
-	$sql = "select count(*) as num_rows from v_extensions where domain_uuid = '".$_SESSION['domain_uuid']."' ".$sql_mod." ";
-	$result = $database->select($sql, null, 'column');
-	if (!empty($result)) {
-		$total_extensions = intval($result);
-	} else {
-		$total_extensions = 0;
-	}
-	unset($sql);
-
-//prepare to page the results
-	$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
-	$param = "&search=".$search."&option_selected=".$option_selected;
-	if (!isset($_GET['page'])) { $_GET['page'] = 0; }
-	$_GET['page'] = check_str($_GET['page']);
-	list($paging_controls_mini, $rows_per_page, $var_3) = paging($total_extensions, $param, $rows_per_page, true); //top
-	list($paging_controls, $rows_per_page, $var_3) = paging($total_extensions, $param, $rows_per_page); //bottom
-	$offset = $rows_per_page * $_GET['page'];
-
-//get all the extensions from the database
-	$sql = "SELECT \n";
-	$sql .= "description, \n";
-	$sql .= "extension, \n";
-	$sql .= "extension_uuid, \n";
-	if (($option_selected == "") or ($option_selected == 'call_group') or ($option_selected == 'accountcode')) {} else {
-		$sql .= "".$option_selected.", \n";
-	}
-	$sql .= "accountcode, \n";
-	$sql .= "call_group \n";
-	$sql .= "FROM v_extensions \n";
-	$sql .= "WHERE domain_uuid = '$domain_uuid' \n";
-	$sql .= $sql_mod; //add search mod from above
-	$sql .= "ORDER BY ".$order_by." ".$order." \n";
-	$sql .= "limit $rows_per_page offset $offset ";
-	$database = new database;
-	$directory = $database->select($sql, 'all');
-	unset($database);
-
-//additional includes
-	require_once "resources/header.php";
-	$document['title'] = $text['title-extensions_settings'];
-
-//set the alternating styles
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left' width='100%'>\n";
-	echo "		<b>".$text['header-extensions']." (".$total_extensions.")</b><br>\n";
-
-//options list
-		echo "<form name='frm' method='get' id=option_selected>\n";
-		echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
-		echo "    <option value=''>".$text['label-extension_null']."</option>\n";
-		if ($option_selected == "accountcode") {
-			echo "    <option value='accountcode' selected='selected'>".$text['label-accountcode']."</option>\n";
-		}
-		else {
-			echo "    <option value='accountcode'>".$text['label-accountcode']."</option>\n";
-		}
-		if ($option_selected == "call_group") {
-			echo "    <option value='call_group' selected='selected'>".$text['label-call_group']."</option>\n";
-		}
-		else {
-			echo "    <option value='call_group'>".$text['label-call_group']."</option>\n";
-		}
-		if ($option_selected == "call_timeout") {
-			echo "    <option value='call_timeout' selected='selected'>".$text['label-call_timeout']."</option>\n";
-		}
-		else {
-			echo "    <option value='call_timeout'>".$text['label-call_timeout']."</option>\n";
-		}
-		if ($option_selected == "emergency_caller_id_name") {
-			echo "    <option value='emergency_caller_id_name' selected='selected'>".$text['label-emergency_caller_id_name']."</option>\n";
-		}
-		else {
-			echo "    <option value='emergency_caller_id_name'>".$text['label-emergency_caller_id_name']."</option>\n";
-		}
-		if ($option_selected == "emergency_caller_id_number") {
-			echo "    <option value='emergency_caller_id_number' selected='selected'>".$text['label-emergency_caller_id_number']."</option>\n";
-		}
-		else {
-			echo "    <option value='emergency_caller_id_number'>".$text['label-emergency_caller_id_number']."</option>\n";
-		}
-		if ($option_selected == "enabled") {
-			echo "    <option value='enabled' selected='selected'>".$text['label-enabled']."</option>\n";
-		}
-		else {
-			echo "    <option value='enabled'>".$text['label-enabled']."</option>\n";
-		}
-		if ($option_selected == "directory_visible") {
-                        echo "    <option value='directory_visible' selected='selected'>".$text['label-directory_visible']."</option>\n";
-                }
-                else {
-                        echo "    <option value='directory_visible'>".$text['label-directory_visible']."</option>\n";
-                }
-
-		 if ($option_selected == "user_record") {
-                        echo "    <option value='user_record' selected='selected'>".$text['label-user_record']."</option>\n";
-                }
-                else {
-                        echo "    <option value='user_record'>".$text['label-user_record']."</option>\n";
-                }
-
-
-		if ($option_selected == "hold_music") {
-			echo "    <option value='hold_music' selected='selected'>".$text['label-hold_music']."</option>\n";
-		}
-		else {
-			echo "    <option value='hold_music'>".$text['label-hold_music']."</option>\n";
-		}
-		if ($option_selected == "limit_max") {
-			echo "    <option value='limit_max' selected='selected'>".$text['label-limit_max']."</option>\n";
-		}
-		else {
-			echo "    <option value='limit_max'>".$text['label-limit_max']."</option>\n";
-		}
-		if ($option_selected == "outbound_caller_id_name") {
-			echo "    <option value='outbound_caller_id_name' selected='selected'>".$text['label-outbound_caller_id_name']."</option>\n";
-		}
-		else {
-			echo "    <option value='outbound_caller_id_name'>".$text['label-outbound_caller_id_name']."</option>\n";
-		}
-		if ($option_selected == "outbound_caller_id_number") {
-			echo "    <option value='outbound_caller_id_number' selected='selected'>".$text['label-outbound_caller_id_number']."</option>\n";
-		}
-		else {
-			echo "    <option value='outbound_caller_id_number'>".$text['label-outbound_caller_id_number']."</option>\n";
-		}
-		if ($option_selected == "toll_allow") {
-			echo "    <option value='toll_allow' selected='selected'>".$text['label-toll_allow']."</option>\n";
-		}
-		else {
-			echo "    <option value='toll_allow'>".$text['label-toll_allow']."</option>\n";
-		}
-		if ($option_selected == "sip_force_expires") {
-			echo "    <option value='sip_force_expires' selected='selected'>".$text['label-sip_force_expires']."</option>\n";
-		}
-		else {
-			echo "    <option value='sip_force_expires'>".$text['label-sip_force_expires']."</option>\n";
-		}
-		if ($option_selected == "sip_bypass_media") {
-			echo "    <option value='sip_bypass_media' selected='selected'>".$text['label-sip_bypass_media']."</option>\n";
-		}
-		else {
-			echo "    <option value='sip_bypass_media'>".$text['label-sip_bypass_media']."</option>\n";
-		}
-		if ($option_selected == "mwi_account") {
-			echo "    <option value='mwi_account' selected='selected'>".$text['label-mwi_account']."</option>\n";
-		}
-		else {
-			echo "    <option value='mwi_account'>".$text['label-mwi_account']."</option>\n";
-		}
-		echo "    </select>\n";
-		echo "    </form>\n";
-		echo "<br />\n";
-		echo $text['description-extension_settings_description']."\n";
-		echo "</td>\n";
-
-
-
-	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
-	echo "		<form method='get' action=''>\n";
-	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
-	echo "				<input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='bulk_account_settings.php'\" value='".$text['button-back']."'>\n";
-	echo "				<input type='text' class='txt' style='width: 150px' name='search' id='search' value='".escape($search)."'>";
-	echo "				<input type='hidden' class='txt' style='width: 150px' name='option_selected' id='option_selected' value='".escape($option_selected)."'>";
-	echo "				<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	if ($paging_controls_mini != '') {
-		echo 			"<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
-	}
-	echo "			</td>\n";
-	echo "		</form>\n";
-	echo "  </tr>\n";
-
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2'>\n";
-	echo "			".$text['description-extensions_settings']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	if (strlen($option_selected) > 0) {
-		echo "<form name='extensions' method='post' action='bulk_account_settings_extensions_update.php'>\n";
-		echo "<input class='formfld' type='hidden' name='option_selected' maxlength='255' value=\"".escape($option_selected)."\">\n";
-		echo "<table width='auto' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		//options with a free form input
-		if($option_selected == 'accountcode' || $option_selected == 'call_group' || $option_selected == 'call_timeout' || $option_selected == 'emergency_caller_id_name' || $option_selected == 'emergency_caller_id_number' || $option_selected == 'limit_max' || $option_selected == 'outbound_caller_id_name' || $option_selected == 'outbound_caller_id_number' || $option_selected == 'toll_allow' || $option_selected == 'sip_force_expires' || $option_selected == 'mwi_account') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <input class='formfld' type='text' name='new_setting' maxlength='255' value=\"$new_setting\">\n";
-			echo "<br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		//option is Enabled
-		if($option_selected == 'enabled') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='true'>".$text['label-true']."</option>\n";
-			echo "    <option value='false'>".$text['label-false']."</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-		//option is Directory Visible
-                if($option_selected == 'directory_visible') {
-                        echo "<td class='vtable' align='left'>\n";
-                        echo "    <select class='formfld' name='new_setting'>\n";
-                        echo "    <option value='true'>".$text['label-true']."</option>\n";
-                        echo "    <option value='false'>".$text['label-false']."</option>\n";
-                        echo "    </select>\n";
-                        echo "    <br />\n";
-                        echo $text["description-".$option_selected.""]."\n";
-                        echo "</td>\n";
-                }
-
-		//option is User Record
-                if($option_selected == 'user_record') {
-                        echo "<td class='vtable' align='left'>\n";
-                        echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value=''>".$text['label-user_record_none']."</option>\n";
-                        echo "    <option value='all'>".$text['label-all']."</option>\n";
-                        echo "    <option value=inbound'>".$text['label-inbound']."</option>\n";
-                        echo "    <option value=outbound'>".$text['label-outbound']."</option>\n";
-                        echo "    <option value=local'>".$text['label-local']."</option>\n";
-                        echo "	  <option value=disabled'>".$text['label-disabled']."</option>\n";
-                        echo "    </select>\n";
-                        echo "    <br />\n";
-                        echo $text["description-".$option_selected.""]."\n";
-                        echo "</td>\n";
-                }
-
-		//option is SIP Bypass Media
-		if($option_selected=='sip_bypass_media') {
-                        echo "<td class='vtable' align='left'>\n";
-                        echo "    <select class='formfld' name='new_setting'>\n";
-                        echo "    <option value=''></option>\n";
-                        echo "    <option value='bypass-media'>".$text['option-bypass_media']."</option>\n";
-                        echo "    <option value='bypass-media-after-bridge'>".$text['option-bypass_media_after_bridge']."</option>\n";
-                        echo "    <option value='proxy-media'>".$text['option-proxy_media']."</option>\n";
-                        echo "    </select>\n";
-                        echo "    <br />\n";
-                        echo $text["description-".$option_selected.""]."\n";
-                        echo "</td>\n";
-		}
-		//option is hold_music
-		if($option_selected == 'hold_music') {
-			echo "<td class='vtable' align='left'>\n";
-			if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/music_on_hold')) {
-				require_once "app/music_on_hold/resources/classes/switch_music_on_hold.php";
-				$options = '';
-				$moh = new switch_music_on_hold;
-				echo $moh->select('new_setting', $hold_music, $options);
-			}
-			$new_setting = $hold_music;
-			echo "    <br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		echo "<td align='left'>\n";
-		echo "<input type='button' class='btn' alt='".$text['button-submit']."' onclick=\"if (confirm('".$text['confirm-update']."')) { document.forms.extensions.submit(); }\" value='".$text['button-submit']."'>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-		echo "</table>";
-		echo "<br />";
-	}
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	if (is_array($directory)) {
-		echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
-	}
-	echo th_order_by('extension', $text['label-extension'], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-	if (($option_selected == "") or ($option_selected == 'call_group') or ($option_selected == 'accountcode')) {
-		} else {
-			echo th_order_by($option_selected, $text["label-".$option_selected.""], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-		}
-	echo th_order_by('accountcode', $text['label-accountcode'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('call_group', $text['label-call_group'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('description', $text['label-description'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo "</tr>\n";
-
-
-
-if (is_array($directory)) {
-
-		foreach($directory as $key => $row) {
-			$tr_link = (permission_exists('extension_edit')) ? " href='/app/extensions/extension_edit.php?id=".$row['extension_uuid']."'" : null;
-			echo "<tr ".$tr_link.">\n";
-
-			echo "	<td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
-			echo "		<input type='checkbox' name='id[]' id='checkbox_".escape($row['extension_uuid'])."' value='".escape($row['extension_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all').checked = false; }\">";
-			echo "	</td>";
-			$ext_ids[] = 'checkbox_'.$row['extension_uuid'];
-
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".$row['extension']."&nbsp;</td>\n";
-			if (($option_selected == "") or ($option_selected == 'call_group') or ($option_selected == 'accountcode')) {
-			} else {
-				echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row[$option_selected])."&nbsp;</td>\n";
-			}
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['accountcode'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['call_group'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['description'])."</td>\n";
-			echo "</tr>\n";
-			$c = ($c) ? 0 : 1;
-		}
-
-		unset($directory, $row);
-	}
-
-	echo "</table>";
-	echo "</form>";
-
-	if (strlen($paging_controls) > 0) {
-		echo "<br />";
-		echo $paging_controls."\n";
-	}
-	echo "<br /><br />".((is_array($directory)) ? "<br /><br />" : null);
-
-	// check or uncheck all checkboxes
-	if (sizeof($ext_ids) > 0) {
-		echo "<script>\n";
-		echo "	function check(what) {\n";
-		echo "		document.getElementById('chk_all').checked = (what == 'all') ? true : false;\n";
-		foreach ($ext_ids as $ext_id) {
-			echo "		document.getElementById('".$ext_id."').checked = (what == 'all') ? true : false;\n";
-		}
-		echo "	}\n";
-		echo "</script>\n";
-	}
-
-	if (is_array($directory)) {
-		// check all checkboxes
-		key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true);
-
-		// delete checked
-		key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true);
-	}
-
-//show the footer
-	require_once "resources/footer.php";

+ 0 - 98
bulk_account_settings/bulk_account_settings_extensions_update.php

@@ -1,98 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('bulk_account_settings_extensions')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//check for the ids
-	if (is_array($_REQUEST) && sizeof($_REQUEST) > 0) {
-
-		$extension_uuids = $_REQUEST["id"];
-		$option_selected = $_REQUEST["option_selected"];
-		$new_setting = $_REQUEST["new_setting"];
-		foreach($extension_uuids as $extension_uuid) {
-			$extension_uuid = check_str($extension_uuid);
-			if ($extension_uuid != '') {
-				//get the extensions array
-					$sql = "select * from v_extensions ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and extension_uuid = '".$extension_uuid."' ";
-					$database = new database;
-					$extensions = $database->select($sql, 'all');
-					if (is_array($extensions)) { 
-						foreach ($extensions as &$row) {
-							$extension = $row["extension"];
-							$user_context = $row["user_context"];
-							$number_alias = $row["number_alias"];
-						}
-						unset ($prep_statement);
-					}
-
-					$array["extensions"][$i]["domain_uuid"] = $domain_uuid;
-					$array["extensions"][$i]["extension_uuid"] = $extension_uuid;
-					$array["extensions"][$i][$option_selected] = $new_setting;
-
-					$database = new database;
-					$database->app_name = 'bulk_account_settings';
-					$database->app_uuid = null;
-					$database->save($array);
-					$message = $database->message;
-				
-					//echo "<pre>".print_r($message, true)."<pre>\n";
-					//exit;
-					
-					unset($database, $array,$i);
-				
-				//clear the cache
-					$cache = new cache;
-					$cache->delete("directory:".$extension."@".$user_context);
-					if (permission_exists('number_alias') && strlen($number_alias) > 0) {
-						$cache->delete("directory:".$number_alias."@".$user_context);
-					}
-			}
-		}
-	}
-
-//redirect the browser
-	$_SESSION["message"] = $text['message-update'];
-	header("Location: bulk_account_settings_extensions.php?option_selected=".$option_selected."");
-	return;
-
-?>

+ 0 - 479
bulk_account_settings/bulk_account_settings_users.php

@@ -1,479 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-	require_once "resources/paging.php";
-
-//check permissions
-	require_once "resources/check_auth.php";
-	if (permission_exists('bulk_account_settings_users')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-	
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//set defaults
-	$user_ids = [];
-
-//get the http values and set them as variables
-	$order_by = check_str($_GET["order_by"]);
-	$order = check_str($_GET["order"]);
-	$option_selected = check_str($_GET["option_selected"]);
-	
-//handle search term
-	$search = check_str($_GET["search"]);
-	if (strlen($search) > 0) {
-		$sql_mod = "and ( ";
-		$sql_mod .= "username ILIKE '%".$search."%' ";
-		$sql_mod .= "or user_enabled ILIKE '%".$search."%' ";		
-		$sql_mod .= "or user_status ILIKE '%".$search."%' ";
-		$sql_mod .= ") ";
-	}
-	if (strlen($order_by) < 1) {
-		$order_by = "username";
-		$order = "ASC";
-	}
-
-	$domain_uuid = $_SESSION['domain_uuid'];
-	
-//get total extension count from the database
-	$sql = "select count(*) as num_rows from v_users where domain_uuid = '".$_SESSION['domain_uuid']."' ".$sql_mod." ";
-	$prep_statement = $db->prepare($sql);
-	if ($prep_statement) {
-		$prep_statement->execute();
-		$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-		$total_users = $row['num_rows'];
-		if (($db_type == "pgsql") or ($db_type == "mysql")) {
-			$numberic_users = $row['num_rows'];
-		}
-	}
-	unset($prep_statement, $row);
-
-//prepare to page the results
-	$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
-	$param = "&search=".$search."&option_selected=".$option_selected;
-	if (!isset($_GET['page'])) { $_GET['page'] = 0; }
-	$_GET['page'] = check_str($_GET['page']);
-	list($paging_controls_mini, $rows_per_page, $var_3) = paging($total_users, $param, $rows_per_page, true); //top
-	list($paging_controls, $rows_per_page, $var_3) = paging($total_users, $param, $rows_per_page); //bottom
-	$offset = $rows_per_page * $_GET['page'];
-
-//get all the users from the database
-	$sql = "SELECT \n";
-	$sql .= "username, \n";
-	$sql .= "user_uuid, \n";
-	$sql .= "user_status, \n";
-	$sql .= "user_enabled \n";
-	$sql .= "FROM v_users \n";
-	$sql .= "WHERE domain_uuid = '$domain_uuid' and 1 = 1 \n";
-	$sql .= $sql_mod; //add search mod from above
-	$sql .= "ORDER BY ".$order_by." ".$order." \n";
-	$sql .= "limit $rows_per_page offset $offset ";
-	$database = new database;
-	$directory = $database->select($sql, 'all');
-	unset($database);
-
-//get all the users' groups from the database
-	$sql = "select ";
-	$sql .= "	ug.*, g.domain_uuid as group_domain_uuid ";
-	$sql .= "from ";
-	$sql .= "	v_user_groups as ug, ";
-	$sql .= "	v_groups as g ";
-	$sql .= "where ";
-	$sql .= "	ug.group_uuid = g.group_uuid ";
-	if (!(permission_exists('user_all') && $_GET['showall'] == 'true')) {
-		$sql .= "	and ug.domain_uuid = '".$domain_uuid."' ";
-	}
-	$sql .= "order by ";
-	$sql .= "	g.domain_uuid desc, ";
-	$sql .= "	g.group_name asc ";
-	$database = new database;
-	$result = $database->select($sql, 'all');
-	if (is_array($result)) {
-		foreach($result as $row) {
-			$user_groups[$row['user_uuid']][] = $row['group_name'].(($row['group_domain_uuid'] != '') ? "@".$_SESSION['domains'][$row['group_domain_uuid']]['domain_name'] : null);
-		}
-	}
-	unset($database,$result);
-
-//get all the users' timezones from the database
-	$sql = "select ";
-	$sql .= "	us.*, u.domain_uuid as setting_domain_uuid ";
-	$sql .= "from ";
-	$sql .= "	v_user_settings as us, ";
-	$sql .= "	v_users as u ";
-	$sql .= "where ";
-	$sql .= "	us.user_uuid = u.user_uuid ";
-	$sql .= "	and user_setting_subcategory = 'time_zone' ";
-	$sql .= "order by ";
-	$sql .= "	u.domain_uuid desc, ";
-	$sql .= "	u.username asc ";
-	$database = new database;
-	$result = $database->select($sql, 'all');
-	if (is_array($result) > 0) {
-		foreach($result as $row) {
-			$user_time_zone[$row['user_uuid']][] = $row['user_setting_value'];
-		}
-	}
-	unset($database,$result);
-
-		
-//additional includes
-	require_once "resources/header.php";
-	$document['title'] = $text['title-users_settings'];
-
-//set the alternating styles
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//javascript for password
-	echo "<script>\n";
-	echo "	function compare_passwords() {\n";
-	echo "		if (document.getElementById('password') === document.activeElement || document.getElementById('password_confirm') === document.activeElement) {\n";
-	echo "			if ($('#password').val() != '' || $('#password_confirm').val() != '') {\n";
-	echo "				if ($('#password').val() != $('#password_confirm').val()) {\n";
-	echo "					$('#password').removeClass('formfld_highlight_good');\n";
-	echo "					$('#password_confirm').removeClass('formfld_highlight_good');\n";
-	echo "					$('#password').addClass('formfld_highlight_bad');\n";
-	echo "					$('#password_confirm').addClass('formfld_highlight_bad');\n";
-	echo "				}\n";
-	echo "				else {\n";
-	echo "					$('#password').removeClass('formfld_highlight_bad');\n";
-	echo "					$('#password_confirm').removeClass('formfld_highlight_bad');\n";
-	echo "					$('#password').addClass('formfld_highlight_good');\n";
-	echo "					$('#password_confirm').addClass('formfld_highlight_good');\n";
-	echo "				}\n";
-	echo "			}\n";
-	echo "		}\n";
-	echo "		else {\n";
-	echo "			$('#password').removeClass('formfld_highlight_bad');\n";
-	echo "			$('#password_confirm').removeClass('formfld_highlight_bad');\n";
-	echo "			$('#password').removeClass('formfld_highlight_good');\n";
-	echo "			$('#password_confirm').removeClass('formfld_highlight_good');\n";
-	echo "		}\n";
-	echo "	}\n";
-
-	$req['length'] = $_SESSION['security']['password_length']['numeric'];
-	$req['number'] = ($_SESSION['security']['password_number']['boolean'] == 'true') ? true : false;
-	$req['lowercase'] = ($_SESSION['security']['password_lowercase']['boolean'] == 'true') ? true : false;
-	$req['uppercase'] = ($_SESSION['security']['password_uppercase']['boolean'] == 'true') ? true : false;
-	$req['special'] = ($_SESSION['security']['password_special']['boolean'] == 'true') ? true : false;
-
-	echo "	function check_password_strength(pwd) {\n";
-	echo "		if ($('#password').val() != '' || $('#password_confirm').val() != '') {\n";
-	echo "			var msg_errors = [];\n";
-	if (is_numeric($req['length']) && $req['length'] != 0) {
-		echo "		var re = /.{".$req['length'].",}/;\n"; //length
-		echo "		if (!re.test(pwd)) { msg_errors.push('".$req['length']."+ ".$text['label-characters']."'); }\n";
-	}
-	if ($req['number']) {
-		echo "		var re = /(?=.*[\d])/;\n";  //number
-		echo "		if (!re.test(pwd)) { msg_errors.push('1+ ".$text['label-numbers']."'); }\n";
-	}
-	if ($req['lowercase']) {
-		echo "		var re = /(?=.*[a-z])/;\n";  //lowercase
-		echo "		if (!re.test(pwd)) { msg_errors.push('1+ ".$text['label-lowercase_letters']."'); }\n";
-	}
-	if ($req['uppercase']) {
-		echo "		var re = /(?=.*[A-Z])/;\n";  //uppercase
-		echo "		if (!re.test(pwd)) { msg_errors.push('1+ ".$text['label-uppercase_letters']."'); }\n";
-	}
-	if ($req['special']) {
-		echo "		var re = /(?=.*[\W])/;\n";  //special
-		echo "		if (!re.test(pwd)) { msg_errors.push('1+ ".$text['label-special_characters']."'); }\n";
-	}
-	echo "			if (msg_errors.length > 0) {\n";
-	echo "				var msg = '".$text['message-password_requirements'].": ' + msg_errors.join(', ');\n";
-	echo "				display_message(msg, 'negative', '6000');\n";
-	echo "				return false;\n";
-	echo "			}\n";
-	echo "			else {\n";
-	echo "				return true;\n";
-	echo "			}\n";
-	echo "		}\n";
-	echo "		else {\n";
-	echo "			return true;\n";
-	echo "		}\n";
-	echo "	}\n";
-
-	echo "	function show_strenth_meter() {\n";
-	echo "		$('#pwstrength_progress').slideDown();\n";
-	echo "	}\n";
-	echo "</script>\n";
-
-	
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left' width='100%'>\n";
-	echo "		<b>".$text['header-users']." (".$numberic_users.")</b><br>\n";
-
-//options list
-	echo "<form name='frm' method='get' id=option_selected>\n";
-	echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
-	echo "    <option value=''>".$text['label-extension_null']."</option>\n";
-	if ($option_selected == "user_enabled") {
-		echo "    <option value='user_enabled' selected='selected'>".$text['label-user_enabled']."</option>\n";
-	}
-	else {
-		echo "    <option value='user_enabled'>".$text['label-user_enabled']."</option>\n";
-	}
-	if ($option_selected == "group") {
-		echo "    <option value='group' selected='selected'>".$text['label-group']."</option>\n";
-	}
-	if ($option_selected == "password") {
-		echo "    <option value='password' selected='selected'>".$text['label-password']."</option>\n";
-	}
-	else {
-		echo "    <option value='password'>".$text['label-password']."</option>\n";
-	}
-	if ($option_selected == "user_status") {
-		echo "    <option value='user_status' selected='selected'>".$text['label-user_status']."</option>\n";
-	}
-	else {
-		echo "    <option value='user_status'>".$text['label-user_status']."</option>\n";
-	}
-	if ($option_selected == "time_zone") {
-		echo "    <option value='time_zone' selected='selected'>".$text['label-time_zone']."</option>\n";
-	}
-	else {
-		echo "    <option value='time_zone'>".$text['label-time_zone']."</option>\n";
-	}
-	echo "    </select>\n";
-	echo "    </form>\n";
-	echo "<br />\n";
-	echo $text['description-user_settings_description']."\n";
-	echo "</td>\n";
-
-	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
-	echo "		<form method='get' action=''>\n";
-	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
-	echo "				<input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='bulk_account_settings.php'\" value='".$text['button-back']."'>\n";	
-	echo "				<input type='text' class='txt' style='width: 150px' name='search' id='search' value='".escape($search)."'>";
-	echo "				<input type='hidden' class='txt' style='width: 150px' name='option_selected' id='option_selected' value='".escape($option_selected)."'>";
-	echo "				<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	if ($paging_controls_mini != '') {
-		echo 			"<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
-	}
-	echo "			</td>\n";
-	echo "		</form>\n";	
-	echo "  </tr>\n";
-	
-	
-	echo "	<tr>\n";
-	echo "		<td colspan='2'>\n";
-	echo "			".$text['description-users_settings']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	if (strlen($option_selected) > 0) {
-		echo "<form name='users' method='post' action='bulk_account_settings_users_update.php'>\n";
-		echo "<input class='formfld' type='hidden' name='option_selected' maxlength='255' value=\"".escape($option_selected)."\">\n";
-		echo "<table width='auto' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		//option is Password
-		if($option_selected == 'password') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <input class='formfld' type='password' name='new_setting' maxlength='255' value=\"".escape($new_setting)."\">\n";
-			echo "<br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		
-		//option is Enabled
-		if($option_selected == 'user_enabled') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='true'>".$text['label-true']."</option>\n";
-			echo "    <option value='false'>".$text['label-false']."</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		//option is user_status
-		if($option_selected == 'user_status') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "		<select name='new_setting' class='formfld' style=''>\n";
-			echo "			<option value=''></option>\n";
-			echo "			<option value='Available'>".$text['option-available']."</option>\n";
-			echo "			<option value='Available (On Demand)'>".$text['option-available_on_demand']."</option>\n";
-			echo "			<option value='Logged Out'>".$text['option-logged_out']."</option>\n";
-			echo "			<option value='On Break'>".$text['option-on_break']."</option>\n";
-			echo "			<option value='Do Not Disturb'>".$text['option-do_not_disturb']."</option>\n";
-			echo "		</select>\n";
-			echo "    <br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		//option is user_time_zone
-		if($option_selected == 'time_zone') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "		<select name='new_setting' class='formfld' style=''>\n";
-			echo "		<option value=''></option>\n";
-				//$list = DateTimeZone::listAbbreviations();
-			    $time_zone_identifiers = DateTimeZone::listIdentifiers();
-				$previous_category = '';
-				$x = 0;
-				foreach ($time_zone_identifiers as $key => $row) {
-					$time_zone = explode("/", $row);
-					$category = $time_zone[0];
-					if ($category != $previous_category) {
-						if ($x > 0) {
-							echo "		</optgroup>\n";
-						}
-						echo "		<optgroup label='".escape($category)."'>\n";
-					}
-
-						echo "			<option value='".escape($row)."'>".escape($row)."</option>\n";
-
-					$previous_category = $category;
-					$x++;
-				}
-				echo "		</select>\n";
-			echo "    <br />\n";
-			echo $text["description-".escape($option_selected).""]."\n";
-			echo "</td>\n";
-		}
-		//option is group
-		if($option_selected == 'group') {
-			echo "		<td class='vtable'>";
-			$sql = "select * from v_groups ";
-			$sql .= "where (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
-			$sql .= "order by domain_uuid desc, group_name asc ";
-			$database = new database;
-			$result = $database->select($sql, 'all');
-			$result_count = count($result);
-			if ($result_count > 0) {
-				if (isset($assigned_groups)) { echo "<br />\n"; }
-				echo "<select name='group_uuid_name' class='formfld' style='width: auto; margin-right: 3px;'>\n";
-				echo "	<option value=''></option>\n";
-				foreach($result as $field) {
-					if ($field['group_name'] == "superadmin" && !if_group("superadmin")) { continue; }	//only show the superadmin group to other superadmins
-					if ($field['group_name'] == "admin" && (!if_group("superadmin") && !if_group("admin") )) { continue; }	//only show the admin group to other admins
-					if ( !isset($assigned_groups) || (isset($assigned_groups) && !in_array($field["group_uuid"], $assigned_groups)) ) {
-						echo "	<option value='".escape($field['group_uuid'])."|".escape($field['group_name'])."'>".escape($field['group_name']).(($field['domain_uuid'] != '') ? "@".$_SESSION['domains'][$field['domain_uuid']]['domain_name'] : null)."</option>\n";
-					}
-				}
-				echo "</select>";
-				if ($action == 'edit') {
-					echo "<input type='button' class='btn' value=\"".$text['button-add']."\" onclick=\"document.getElementById('action').value = '".$text['button-add']."'; submit_form();\">\n";
-				}
-			}
-			unset($sql, $prep_statement, $result);
-			echo "		</td>";
-		}
-		echo "<td align='left'>\n";
-		echo "<input type='button' class='btn' alt='".$text['button-submit']."' onclick=\"if (confirm('".$text['confirm-update']."')) { document.forms.users.submit(); }\" value='".$text['button-submit']."'; if (check_password_strength(document.getElementById('password').value)) { submit_form(); }>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-		echo "</table>";
-		echo "<br />";
-	}
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	if (is_array($directory)) {
-		echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
-	}
-	echo th_order_by('username', $text['label-username'], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('user_status', $text['label-user_status'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('username', $text['label-group'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('username', $text['label-time_zone'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo th_order_by('user_enabled', $text['label-user_enabled'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo "</tr>\n";
-
-if (is_array($directory)) {
-
-		foreach($directory as $key => $row) {
-			$tr_link = (permission_exists('extension_edit')) ? " href='/core/users/user_edit.php?id=".$row['user_uuid']."'" : null;
-			echo "<tr ".$tr_link.">\n";
-			echo "	<td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
-			echo "		<input type='checkbox' name='id[]' id='checkbox_".escape($row['user_uuid'])."' value='".escape($row['user_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all').checked = false; }\">";
-			echo "	</td>";
-			$user_ids[] = 'checkbox_'.$row['user_uuid'];
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['username'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['user_status'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>";
-				if (sizeof($user_groups[$row['user_uuid']]) > 0) {
-					echo implode(', ', $user_groups[$row['user_uuid']]);
-				}
-				echo "&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>";
-				if (isset($user_time_zone[$row['user_uuid']]) && sizeof($user_time_zone[$row['user_uuid']]) > 0) {
-					echo implode(', ', $user_time_zone[$row['user_uuid']]);
-				}
-				echo "&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['user_enabled'])."&nbsp;</td>\n";
-			echo "</tr>\n";
-			$c = ($c) ? 0 : 1;
-		}
-		unset($directory, $row);
-	}
-	echo "</table>";
-	echo "</form>";
-
-	if (strlen($paging_controls) > 0) {
-		echo "<br />";
-		echo $paging_controls."\n";
-	}
-
-	echo "<br /><br />".((is_array($directory)) ? "<br /><br />" : null);
-
-	// check or uncheck all checkboxes
-	if (sizeof($user_ids) > 0) {
-		echo "<script>\n";
-		echo "	function check(what) {\n";
-		echo "		document.getElementById('chk_all').checked = (what == 'all') ? true : false;\n";
-		foreach ($user_ids as $user_id) {
-			echo "		document.getElementById('".$user_id."').checked = (what == 'all') ? true : false;\n";
-		}
-		echo "	}\n";
-		echo "</script>\n";
-	}
-
-	if (is_array($directory)) {
-		// check all checkboxes
-		key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true);
-
-		// delete checked
-		key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true);
-	}
-
-//show the footer
-	require_once "resources/footer.php";
-
-?>

+ 0 - 119
bulk_account_settings/bulk_account_settings_users_update.php

@@ -1,119 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('bulk_account_settings_users')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//check for the ids
-	if (is_array($_REQUEST) && sizeof($_REQUEST) > 0) {
-
-		$user_uuids = $_REQUEST["id"];
-		$option_selected = $_REQUEST["option_selected"];
-		$new_setting = $_REQUEST["new_setting"];
-		foreach($user_uuids as $user_uuid) {
-			$user_uuid = check_str($user_uuid);
-			if ($user_uuid != '') {
-			//get the users array
-				$sql = "select * from v_users ";
-				$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-				$sql .= "and user_uuid = '".$user_uuid."' ";
-				$database = new database;
-				$users = $database->select($sql, 'all');
-				if (is_array($users)) { 
-					foreach ($users as &$row) {
-						$user = $row["user"];
-					}
-					unset ($prep_statement);
-				}
-				
-				//user_status or user_enabled
-				if($option_selected == "user_status" || $option_selected == "user_enabled"){
-					$array["users"][$i]["domain_uuid"] = $domain_uuid;
-					$array["users"][$i]["user_uuid"] = $user_uuid;
-					$array["users"][$i][$option_selected] = $new_setting;
-				}
-
-				//password
-				if($option_selected == "password"){
-					$salt = uuid();
-					$array["users"][$i]["domain_uuid"] = $domain_uuid;
-					$array["users"][$i]["user_uuid"] = $user_uuid;
-					$array['users'][$i]['password'] = md5($salt.$new_setting);
-					$array['users'][$i]['salt'] = $salt;				
-				}
-
-				//timezone
-				if($option_selected == "time_zone"){
-					$sql = "select * from v_user_settings ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and user_uuid = '".$user_uuid."' ";
-					$sql .= "and user_setting_subcategory = 'time_zone' ";
-					$database = new database;
-					$users = $database->select($sql, 'all');
-					if (is_array($users)) { 
-						foreach ($users as &$row) {
-							$user_setting_uuid = $row["user_setting_uuid"];
-						}
-						unset ($prep_statement);
-					}
-				
-					$array["user_settings"][$i]["domain_uuid"] = $domain_uuid;
-					$array["user_settings"][$i]["user_uuid"] = $user_uuid;
-					$array["user_settings"][$i]["user_setting_uuid"] = $user_setting_uuid;
-					$array["user_settings"][$i]["user_setting_value"] = $new_setting;
-
-				}
-
-				$database = new database;
-				$database->app_name = 'bulk_account_settings';
-				$database->app_uuid = null;
-				$database->save($array);
-				$message = $database->message;
-				unset($database,$array,$i);
-			}
-		}
-	}
-
-//redirect the browser
-	$_SESSION["message"] = $text['message-update'];
-	header("Location: bulk_account_settings_users.php?option_selected=".$option_selected."");
-	return;
-
-?>

+ 0 - 469
bulk_account_settings/bulk_account_settings_voicemails.php

@@ -1,469 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
-
-//includes files
-	require_once "resources/require.php";
-	require_once "resources/check_auth.php";
-	require_once "resources/paging.php";
-
-//include the class
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('bulk_account_settings_voicemails')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-	
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get the http values and set them as variables
-	$order_by = check_str($_GET["order_by"]);
-	$order = check_str($_GET["order"]);
-	$option_selected = check_str($_GET["option_selected"]);
-	$option_action = check_str($_GET["option_action"]);
-	
-//handle search term
-	$search = check_str($_GET["search"]);
-	if (strlen($search) > 0) {
-		$sql_mod = "and ( ";
-		$sql_mod .= "CAST(voicemail_id AS TEXT) LIKE '%".$search."%' ";
-		$sql_mod .= "or voicemail_description ILIKE '%".$search."%' ";		
-		$sql_mod .= ") ";
-	}
-	if (strlen($order_by) < 1) {
-		$order_by = "voicemail_id";
-		$order = "ASC";
-	}
-
-	$domain_uuid = $_SESSION['domain_uuid'];
-
-//get total voicemail count from the database
-	$sql = "select count(*) as num_rows from v_voicemails where domain_uuid = '".$_SESSION['domain_uuid']."' ".$sql_mod." ";
-	$prep_statement = $db->prepare($sql);
-	if ($prep_statement) {
-		$prep_statement->execute();
-		$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-		$total_voicemails = $row['num_rows'];
-		if (($db_type == "pgsql") or ($db_type == "mysql")) {
-			$numeric_voicemails = $row['num_rows'];
-		}
-	}
-	unset($prep_statement, $row);
-
-//prepare to page the results
-	$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
-	$param = "&search=".$search."&option_selected=".$option_selected;
-	if (!isset($_GET['page'])) { $_GET['page'] = 0; }
-	$_GET['page'] = check_str($_GET['page']);
-	list($paging_controls_mini, $rows_per_page, $var_3) = paging($total_voicemails, $param, $rows_per_page, true); //top
-	list($paging_controls, $rows_per_page, $var_3) = paging($total_voicemails, $param, $rows_per_page); //bottom
-	$offset = $rows_per_page * $_GET['page'];
-
-//voicemail options
-	if (preg_match ('/option_(.)/',$option_selected)) {
-		preg_match ('/option_(.)/',$option_selected, $matches);
-		$option_number = $matches[1];
-	}
-
-//get all the voicemails from the database
-	$sql = "SELECT \n";
-	$sql .= "v.voicemail_description, \n";
-	$sql .= "v.voicemail_id, \n";
-	$sql .= "v.voicemail_uuid, \n";
-	$sql .= "v.voicemail_file, \n";
-	$sql .= "v.voicemail_enabled, \n";	
-	$sql .= "v.voicemail_local_after_email, \n";
-	$sql .= "v.voicemail_transcription_enabled \n";
-	$sql .= "FROM v_voicemails as v \n";
-	$sql .= "WHERE v.domain_uuid = '$domain_uuid' \n";
-	$sql .= $sql_mod; //add search mod from above
-	$sql .= "ORDER BY ".$order_by." ".$order." \n";
-	$sql .= "limit $rows_per_page offset $offset ";
-	$database = new database;
-	$directory = $database->select($sql, 'all');
-
-	$sql_view = $sql;
-	unset($database,$result);
-
-//lookup the options
-	$x = 0;
-	foreach ($directory as $key => $row) {
-		$sql = "SELECT voicemail_option_param, voicemail_option_order \n";
-		$sql .= "FROM v_voicemail_options \n";
-		$sql .= "WHERE domain_uuid = '$domain_uuid' \n";
-		$sql .= "and voicemail_uuid = '".$row['voicemail_uuid']."' ";
-		$sql .= "and voicemail_option_digits = '".$option_number."' ";
-		$database = new database;
-		$result = $database->select($sql, 'all');
-		$directory[$key]['option_db_value'] = $result;		
-		unset($result, $database);
-		$x++;
-	}
-	
-//additional includes
-	require_once "resources/header.php";
-	$document['title'] = $text['title-voicemails_settings'];
-
-//set the alternating styles
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//initialize the destinations object
-	$destination = new destinations;
-
-//show the content
-	echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
-	echo "  <tr>\n";
-	echo "	<td align='left' width='100%'>\n";
-	echo "		<b>".$text['header-voicemails']." (".$numeric_voicemails.")</b><br>\n";
-
-//options list
-	echo "<form name='frm' method='get' id=option_selected>\n";
-	echo "    <select class='formfld' name='option_selected'  onchange=\"this.form.submit();\">\n";
-	echo "    <option value=''>".$text['label-voicemail_null']."</option>\n";
-	if ($option_selected == "voicemail_file") {
-		echo "    <option value='voicemail_file' selected='selected'>".$text['label-voicemail_file']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_file'>".$text['label-voicemail_file']."</option>\n";
-	}
-	if ($option_selected == "voicemail_enabled") {
-		echo "    <option value='voicemail_enabled' selected='selected'>".$text['label-voicemail_enabled']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_enabled'>".$text['label-voicemail_enabled']."</option>\n";
-	}
-	if ($option_selected == "voicemail_local_after_email") {
-		echo "    <option value='voicemail_local_after_email' selected='selected'>".$text['label-voicemail_local_after_email']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_local_after_email'>".$text['label-voicemail_local_after_email']."</option>\n";
-	}
-	if ($option_selected == "voicemail_password") {
-		echo "    <option value='voicemail_password' selected='selected'>".$text['label-voicemail_password']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_password'>".$text['label-voicemail_password']."</option>\n";
-	}
-	if($_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") {
-		if ($option_selected == "voicemail_transcription_enabled") {
-			echo "    <option value='voicemail_transcription_enabled' selected='selected'>".$text['label-voicemail_transcription_enabled']."</option>\n";
-		}
-		else {
-			echo "    <option value='voicemail_transcription_enabled'>".$text['label-voicemail_transcription_enabled']."</option>\n";
-		}
-	}
-	if ($option_selected == "voicemail_option_0") {
-		echo "    <option value='voicemail_option_0' selected='selected'>".$text['label-voicemail_option_0']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_0'>".$text['label-voicemail_option_0']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_1") {
-		echo "    <option value='voicemail_option_1' selected='selected'>".$text['label-voicemail_option_1']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_1'>".$text['label-voicemail_option_1']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_2") {
-		echo "    <option value='voicemail_option_1' selected='selected'>".$text['label-voicemail_option_2']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_2'>".$text['label-voicemail_option_2']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_3") {
-		echo "    <option value='voicemail_option_3' selected='selected'>".$text['label-voicemail_option_3']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_3'>".$text['label-voicemail_option_3']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_4") {
-		echo "    <option value='voicemail_option_4' selected='selected'>".$text['label-voicemail_option_4']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_4'>".$text['label-voicemail_option_4']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_5") {
-		echo "    <option value='voicemail_option_5' selected='selected'>".$text['label-voicemail_option_5']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_5'>".$text['label-voicemail_option_5']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_6") {
-		echo "    <option value='voicemail_option_6' selected='selected'>".$text['label-voicemail_option_6']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_6'>".$text['label-voicemail_option_6']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_7") {
-		echo "    <option value='voicemail_option_7' selected='selected'>".$text['label-voicemail_option_7']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_7'>".$text['label-voicemail_option_7']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_8") {
-		echo "    <option value='voicemail_option_8' selected='selected'>".$text['label-voicemail_option_8']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_8'>".$text['label-voicemail_option_8']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_9") {
-		echo "    <option value='voicemail_option_9' selected='selected'>".$text['label-voicemail_option_9']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_9'>".$text['label-voicemail_option_9']."</option>\n";
-	}
-	if ($option_selected == "voicemail_option_star") {
-		echo "    <option value='voicemail_option_star' selected='selected'>".$text['label-voicemail_option_star']."</option>\n";
-	}
-	else {
-		echo "    <option value='voicemail_option_star'>".$text['label-voicemail_option_star']."</option>\n";
-	}
-	if (permission_exists('bulk_account_settings_pound')) {
-		if ($option_selected == "voicemail_option_pound") {
-			echo "    <option value='voicemail_option_pound' selected='selected'>".$text['label-voicemail_option_pound']."</option>\n";
-		}
-		else {
-			echo "    <option value='voicemail_option_pound'>".$text['label-voicemail_option_pound']."</option>\n";
-		}
-	}
-	echo "    </select>\n";
-	echo "    </form>\n";
-	echo "<br />\n";
-	echo $text['description-voicemail_settings_description']."\n";
-	echo "</td>\n";
-	
-	echo "		<td align='right' width='100%' style='vertical-align: top;'>";
-	echo "		<form method='get' action=''>\n";
-	echo "			<td style='vertical-align: top; text-align: right; white-space: nowrap;'>\n";
-	echo "				<input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='bulk_account_settings.php'\" value='".$text['button-back']."'>\n";	
-	echo "				<input type='text' class='txt' style='width: 150px' name='search' id='search' value='".$search."'>";
-	echo "				<input type='hidden' class='txt' style='width: 150px' name='option_selected' id='option_selected' value='".$option_selected."'>";
-	echo "				<input type='submit' class='btn' name='submit' value='".$text['button-search']."'>";
-	if ($paging_controls_mini != '') {
-		echo 			"<span style='margin-left: 15px;'>".$paging_controls_mini."</span>\n";
-	}
-	echo "			</td>\n";
-	echo "		</form>\n";	
-	echo "  </tr>\n";
-	
-	echo "	<tr>\n";
-	echo "		<td colspan='2'>\n";
-	echo "			".$text['description-voicemails_settings']."\n";
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-	echo "<br />";
-
-	if (strlen($option_selected) > 0) {
-		echo "<form name='voicemails' method='post' action='bulk_account_settings_voicemails_update.php'>\n";
-		echo "<input class='formfld' type='hidden' name='option_selected' maxlength='255' value=\"$option_selected\">\n";
-		echo "<table width='auto' border='0' cellpadding='0' cellspacing='0'>\n";
-		echo "<tr>\n";
-		//option is Password
-		if($option_selected == 'voicemail_password') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <input class='formfld' type='password' name='new_setting' id='password' autocomplete='off' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" autocomplete='off' maxlength='50' value=\"$new_setting\">\n";
-			
-			echo "<br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-		//option is voicemail_enabled or voicemail_local_after_email or voicemail_transcription_enabled
-		if($option_selected == 'voicemail_enabled' || $option_selected == 'voicemail_local_after_email' || $option_selected == 'voicemail_transcription_enabled') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='true'>".$text['label-true']."</option>\n";
-			echo "    <option value='false'>".$text['label-false']."</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-		//option is voicemail_file
-		if($option_selected == 'voicemail_file') {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='new_setting'>\n";
-			echo "    <option value='listen'>".$text['option-voicemail_file_listen']."</option>\n";
-			echo "    <option value='link'>".$text['option-voicemail_file_link']."</option>\n";
-			echo "    <option value='attach'>".$text['option-voicemail_file_attach']."</option>\n";
-			echo "    </select>\n";
-			echo "    <br />\n";
-			echo $text["description-".$option_selected.""]."\n";
-			echo "</td>\n";
-		}
-		//option is voicemail_option
-		if (preg_match ('/option_/',$option_selected)) {
-			echo "<td class='vtable' align='left'>\n";
-			echo "    <select class='formfld' name='option_action' onchange=\"$('.add_option').slideToggle();\">\n";
-			echo "    <option value='add'>".$text['label-add']."</option>\n";
-			echo "    <option value='remove'>".$text['label-remove']."</option>\n";
-			echo "    </select><br>\n";
-			echo "	  ".$text["label-".$option_selected.""]."\n";
-			echo "</td>\n";
-
-			echo "<td class='vtable add_option' align='left' nowrap='nowrap'>\n";
-			echo $destination->select('ivr', 'voicemail_option_param', '');
-			echo "<br>".$text['label-destination']."</td>\n";
-			echo "<td class='vtable add_option' align='left'>\n";
-			echo "	<select name='voicemail_option_order' class='formfld' style='width:55px'>\n";
-			if (strlen(htmlspecialchars($voicemail_option_order))> 0) {
-				echo "	<option selected='yes' value='".htmlspecialchars($voicemail_option_order)."'>".htmlspecialchars($voicemail_option_order)."</option>\n";
-			}
-			$i=0;
-			while($i<=999) {
-				if (strlen($i) == 1) {
-					echo "	<option value='00$i'>00$i</option>\n";
-				}
-				if (strlen($i) == 2) {
-					echo "	<option value='0$i'>0$i</option>\n";
-				}
-				if (strlen($i) == 3) {
-					echo "	<option value='$i'>$i</option>\n";
-				}
-				$i++;
-			}
-			echo "	</select><br>\n";
-			echo "".$text['label-order']."</td>\n";
-			echo "<td class='vtable add_option' align='left'>\n";
-			echo "	<input class='formfld' style='width:100px' type='text' name='voicemail_option_description' maxlength='255' value=\"".$voicemail_option_description."\">\n";
-			echo "<br>".$text['label-description']."</td>\n";
-		}
-		
-		echo "<td align='left'>\n";
-		echo "<input type='button' class='btn' alt='".$text['button-submit']."' onclick=\"if (confirm('".$text['confirm-update']."')) { document.forms.voicemails.submit(); }\" value='".$text['button-submit']."'>\n";
-		echo "</td>\n";
-		echo "</tr>\n";
-		echo "</table>";
-		echo "<br />";
-	}
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	if (is_array($directory)) {
-		echo "<th style='width: 30px; text-align: center; padding: 0px;'><input type='checkbox' id='chk_all' onchange=\"(this.checked) ? check('all') : check('none');\"></th>";
-	}
-	echo th_order_by('voicemail_id', $text['label-voicemail_id'], $order_by,$order,'','',"option_selected=".$option_selected."&search=".$search."");
-	if (preg_match ('/option_/',$option_selected)) {
-		echo th_order_by('voicemail_id', $text["label-".$option_selected.""], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");	
-	}
-	else {
-		echo th_order_by('voicemail_id', $text['label-voicemail_file'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-		echo th_order_by('voicemail_id', $text['label-voicemail_local_after_email'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-		if($_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") {
-			echo th_order_by('voicemail_id', $text['label-voicemail_transcription_enabled'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");	
-		}
-	}
-	echo th_order_by('voicemail_id', $text['label-voicemail_enabled'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");	
-	echo th_order_by('voicemail_id', $text['label-voicemail_description'], $order_by, $order,'','',"option_selected=".$option_selected."&search=".$search."");
-	echo "</tr>\n";
-
-
-
-if (is_array($directory)) {
-
-		foreach($directory as $key => $row) {
-			$tr_link = (permission_exists('voicemail_edit')) ? " href='/app/voicemails/voicemail_edit.php?id=".escape($row['voicemail_uuid'])."'" : null;
-			echo "<tr ".$tr_link.">\n";
-
-			echo "	<td valign='top' class='".$row_style[$c]." tr_link_void' style='text-align: center; vertical-align: middle; padding: 0px;'>";
-			echo "		<input type='checkbox' name='id[]' id='checkbox_".escape($row['voicemail_uuid'])."' value='".escape($row['voicemail_uuid'])."' onclick=\"if (!this.checked) { document.getElementById('chk_all').checked = false; }\">";
-			echo "	</td>";
-			$ext_ids[] = 'checkbox_'.$row['voicemail_uuid'];
-
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_id'])."&nbsp;</td>\n";
-			if (preg_match ('/option_/',$option_selected)) {
-				echo "	<td valign='top' class='".$row_style[$c]."'>\n";
-					$x = 0;
-					foreach($row['option_db_value'] as $key => $value) {
-						if ($x > 0) {
-							echo ", ";
-						}
-						echo $value['voicemail_option_param']." (Order: ".$value['voicemail_option_order'].")";
-						$x++;
-					}
-				echo "&nbsp;</td>\n";
-			}				
-
-			else {
-				echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_file'])."&nbsp;</td>\n";
-				echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_local_after_email'])."&nbsp;</td>\n";
-				if($_SESSION['voicemail']['transcribe_enabled']['boolean'] == "true") {
-					echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_transcription_enabled'])."&nbsp;</td>\n";			
-				}
-			}
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_enabled'])."&nbsp;</td>\n";			
-			echo "	<td valign='top' class='".$row_style[$c]."'> ".escape($row['voicemail_description'])."</td>\n";
-			echo "</tr>\n";
-			$c = ($c) ? 0 : 1;
-		}
-
-		unset($directory, $row);
-	}
-
-	echo "</table>";
-	echo "</form>";
-
-	if (strlen($paging_controls) > 0) {
-		echo "<br />";
-		echo $paging_controls."\n";
-	}
-	echo "<br /><br />".((is_array($directory)) ? "<br /><br />" : null);
-
-	// check or uncheck all checkboxes
-	if (sizeof($ext_ids) > 0) {
-		echo "<script>\n";
-		echo "	function check(what) {\n";
-		echo "		document.getElementById('chk_all').checked = (what == 'all') ? true : false;\n";
-		foreach ($ext_ids as $ext_id) {
-			echo "		document.getElementById('".$ext_id."').checked = (what == 'all') ? true : false;\n";
-		}
-		echo "	}\n";
-		echo "</script>\n";
-	}
-
-	if (is_array($directory)) {
-		// check all checkboxes
-		key_press('ctrl+a', 'down', 'document', null, null, "check('all');", true);
-
-		// delete checked
-		key_press('delete', 'up', 'document', array('#search'), $text['confirm-delete'], 'document.forms.frm.submit();', true);
-	}
-
-//show the footer
-	require_once "resources/footer.php";
-
-?>

+ 0 - 157
bulk_account_settings/bulk_account_settings_voicemails_update.php

@@ -1,157 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2016
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	KonradSC <[email protected]>
-*/
-
-//set the include path
-	$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
-	set_include_path(parse_ini_file($conf[0])['document.root']);
-
-//includes files
-	require_once "resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('bulk_account_settings_voicemails')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//check for the ids
-	if (is_array($_REQUEST) && sizeof($_REQUEST) > 0) {
-
-		$voicemail_uuids = $_REQUEST["id"];
-		$option_selected = $_REQUEST["option_selected"];
-		$new_setting = $_REQUEST["new_setting"];
-		$option_action = $_REQUEST["option_action"];
-		$voicemail_option_param = $_REQUEST["voicemail_option_param"];
-		$voicemail_option_order = (int)$_REQUEST["voicemail_option_order"];
-		$voicemail_option_description = $_REQUEST["voicemail_option_description"];
-
-		//seperate the action and the param
-		$option_array = explode(":", $voicemail_option_param);
-		$voicemail_option_action = array_shift($option_array);
-		$voicemail_option_param = join(':', $option_array);
-		preg_match ('/voicemail_option_(.)/',$option_selected, $matches);
-		$voicemail_option_digits = $matches[1];
-		
-		foreach($voicemail_uuids as $voicemail_uuid) {
-			$voicemail_uuid = check_str($voicemail_uuid);
-			if ($voicemail_uuid != '') {
-			//Voicemail Options
-				if (preg_match ('/voicemail_option_/',$option_selected)) {
-					//Add Options
-					if ($option_action == 'add'){
-
-						$sql = "select * from v_voicemail_options ";
-						$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-						$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
-						$sql .= "and voicemail_option_digits = '".$voicemail_option_digits."' ";
-						$sql .= "and voicemail_option_order = '".$voicemail_option_order."' ";
-						$database = new database;
-						$voicemails = $database->select($sql, 'all');
-						unset ($database);
-						if (is_array($voicemails)) { 
-							foreach ($voicemails as &$row) {
-								$voicemail_option_uuid = $row["voicemail_option_uuid"];
-							}
-							unset ($prep_statement);
-						}
-						if (empty($voicemail_option_uuid)) {
-							$voicemail_option_uuid = uuid();
-						}
-						
-						$i=0;
-						$array["voicemail_options"][$i]["voicemail_option_uuid"] = $voicemail_option_uuid;
-						$array["voicemail_options"][$i]["domain_uuid"] = $_SESSION['domain_uuid'];
-						$array["voicemail_options"][$i]["voicemail_uuid"] = $voicemail_uuid;
-						$array["voicemail_options"][$i]["voicemail_option_digits"] = $voicemail_option_digits;
-						$array["voicemail_options"][$i]["voicemail_option_description"] = $voicemail_option_description;
-						$array["voicemail_options"][$i]["voicemail_option_order"] = (int)$voicemail_option_order;
-						$array["voicemail_options"][$i]["voicemail_option_action"] = trim($voicemail_option_action);
-						$array["voicemail_options"][$i]["voicemail_option_param"] = trim($voicemail_option_param);
-						
-						$database = new database;
-						$database->app_name = 'bulk_account_settings';
-						$database->app_uuid = null;
-						$database->save($array);
-						$message = $database->message;
-						
-						unset($database,$array,$i,$voicemail_option_uuid);	
-
-					} elseif ($option_action == 'remove') {
-					//delete the voicemail option
-						$sql = "delete from v_voicemail_options ";
-						$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-						$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
-						$sql .= "and voicemail_option_digits = '".$voicemail_option_digits."' ";
-						$prep_statement = $db->prepare(check_sql($sql));
-						$prep_statement->execute();
-						unset($prep_statement, $sql);							
-					}
-					
-				} else {
-				//All other Voicemail properties	
-				//get the voicemails array
-					$sql = "select * from v_voicemails ";
-					$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
-					$sql .= "and voicemail_uuid = '".$voicemail_uuid."' ";
-					$database = new database;
-					$voicemails = $database->select($sql, 'all');
-					if (is_array($voicemails)) { 
-						foreach ($voicemails as &$row) {
-							$voicemail = $row["voicemail"];
-						}
-						unset ($prep_statement);
-					}
-
-						$array["voicemails"][$i]["domain_uuid"] = $domain_uuid;
-						$array["voicemails"][$i]["voicemail_uuid"] = $voicemail_uuid;
-						$array["voicemails"][$i][$option_selected] = $new_setting;
-	
-						$database = new database;
-						$database->app_name = 'bulk_account_settings';
-						$database->app_uuid = null;
-						$database->save($array);
-						$message = $database->message;
-
-						unset($database,$array,$i);
-				}
-			}
-		}
-	}
-
-//redirect the browser
-	$_SESSION["message"] = $text['message-update'];
-	header("Location: bulk_account_settings_voicemails.php?option_selected=".$option_selected."");
-	return;
-
-?>

+ 0 - 264
invoices/app_config.php

@@ -1,264 +0,0 @@
-<?php
-
-	//application details
-		$apps[$x]['name'] = 'Invoices';
-		$apps[$x]['uuid'] = 'e5a1f4f5-7766-ec9c-118b-50f76b0788c0';
-		$apps[$x]['category'] = '';
-		$apps[$x]['subcategory'] = '';
-		$apps[$x]['version'] = '';
-		$apps[$x]['license'] = 'Mozilla Public License 1.1';
-		$apps[$x]['contact_url'] = 'http://www.fusionpbx.com';
-		$apps[$x]['description']['en-us'] = '';
-		$apps[$x]['description']['es-mx'] = '';
-		$apps[$x]['description']['de'] = '';
-		$apps[$x]['description']['de-ch'] = '';
-		$apps[$x]['description']['de-at'] = '';
-		$apps[$x]['description']['fr'] = '';
-		$apps[$x]['description']['fr-ca'] = '';
-		$apps[$x]['description']['fr-ch'] = '';
-		$apps[$x]['description']['pt-pt'] = '';
-		$apps[$x]['description']['pt-br'] = '';
-
-	//permission details
-		$y = 0;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_view';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'user';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_add';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_edit';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'user';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_item_view';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'user';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_item_add';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_item_edit';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'user';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_item_delete';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-		$y++;
-		$apps[$x]['permissions'][$y]['name'] = 'invoice_delete';
-		$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
-		//$apps[$x]['permissions'][$y]['groups'][] = 'admin';
-
-	//schema details
-		$y=0;
-		$apps[$x]['db'][$y]['table']['name'] = "v_invoices";
-		$apps[$x]['db'][$y]['table']['parent'] = "";
-		$z=0;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'invoice_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'domain_id ';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'v_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'contact_uuid_from';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'contact_id_from';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_contacts';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'contact_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Contact ID invoice is sent from';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'contact_uuid_to';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'contact_id_to';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_contacts';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'contact_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Contact ID invoice is sent to';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_number';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter the invoice number.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_type';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Select the record type.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_date';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamp with time zone';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'datetime';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'timestamp';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_purchase_order_number';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'purchase order number';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_currency';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter invoice currency.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_notes';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter invoice notes.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_paid';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Check if invoice has been paid';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_paid_date';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'timestamp';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Date the invoice was paid.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_paid_method';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Select the payment method used.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_paid_method_ref';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter a payment method reference number.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_user";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "update_date";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "update_user";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-		$y++;
-		$apps[$x]['db'][$y]['table']['name'] = "v_invoice_items";
-		$apps[$x]['db'][$y]['table']['parent'] = "v_invoices";
-		$z=0;
-		$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
-		$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'invoice_item_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_item_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_id';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'invoice_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_invoices';
-		$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'invoice_uuid';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = '';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'item_qty';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter the Quantity';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'item_desc';
-		$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter the description.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = 'item_unit_price';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'numeric';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'decimal(10,2)';
-		$apps[$x]['db'][$y]['fields'][$z]['description'] = 'Enter the unit price.';
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_user";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "update_date";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'date';
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-		$z++;
-		$apps[$x]['db'][$y]['fields'][$z]['name'] = "update_user";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
-		$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
-		$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
-
-?>

+ 0 - 177
invoices/app_languages.php

@@ -1,177 +0,0 @@
-<?php
-
-	//Invoices
-		$text['title-invoices']['en-us'] = 'Invoices';
-		$text['title-invoices']['pt-pt'] = '';
-
-		$text['title-invoice']['en-us'] = 'Invoice';
-		$text['title-invoice']['pt-pt'] = '';
-
-		$text['description-invoice']['en-us'] = '';
-		$text['description-invoice']['pt-pt'] = '';
-
-		$text['label-contact_uuid_from']['en-us'] = 'From';
-		$text['label-contact_uuid_from']['pt-pt'] = '';
-
-		$text['description-contact_uuid_from']['en-us'] = 'Select the Contact to send the send the invoice from.';
-		$text['description-contact_uuid_from']['pt-pt'] = '';
-
-		$text['label-contact_uuid_to']['en-us'] = 'To';
-		$text['label-contact_uuid_to']['pt-pt'] = '';
-
-		$text['label-contact_to_organization']['en-us'] = 'Organization';
-		$text['label-contact_to_organization']['pt-pt'] = '';
-
-		$text['label-contact_to_given_name']['en-us'] = 'Given Name';
-		$text['label-contact_to_given_name']['pt-pt'] = '';
-
-		$text['label-contact_to_family_name']['en-us'] = 'Family Name';
-		$text['label-contact_to_family_name']['pt-pt'] = '';
-
-		$text['description-contact_uuid_to']['en-us'] = 'Select the Contact to send the send the invoice to.';
-		$text['description-contact_uuid_to']['pt-pt'] = '';
-
-		$text['label-invoice_number']['en-us'] = 'Number';
-		$text['label-invoice_number']['pt-pt'] = '';
-
-		$text['description-invoice_number']['en-us'] = 'Enter the invoice number.';
-		$text['description-invoice_number']['pt-pt'] = '';
-
-		$text['label-invoice_purchase_order_number']['en-us'] = 'Purchase Order';
-		$text['label-invoice_purchase_order_number']['pt-pt'] = '';
-
-		$text['description-invoice_purchase_order_number']['en-us'] = 'Enter the purchase order number.';
-		$text['description-invoice_purchase_order_number']['pt-pt'] = '';
-
-		$text['label-invoice_currency']['en-us'] = 'Currency';
-		$text['label-invoice_currency']['pt-pt'] = '';
-
-		$text['label-invoice_type']['en-us'] = 'Type';
-		$text['label-invoice_type']['pt-pt'] = '';
-
-		$text['description-invoice_type']['en-us'] = 'Select the record type.';
-		$text['description-invoice_type']['pt-pt'] = '';
-
-		$text['label-invoice_type_invoice']['en-us'] = 'Invoice';
-		$text['label-invoice_type_invoice']['pt-pt'] = '';
-
-		$text['label-invoice_type_quote']['en-us'] = 'Quote';
-		$text['label-invoice_type_quote']['pt-pt'] = '';
-
-		$text['label-invoice_created']['en-us'] = 'Created';
-		$text['label-invoice_created']['pt-pt'] = '';
-
-		$text['label-invoice_paid']['en-us'] = 'Paid';
-		$text['label-invoice_paid']['pt-pt'] = '';
-
-		$text['label-invoice_method_paypal']['en-us'] = 'PayPal';
-		$text['label-invoice_method_paypal']['pt-pt'] = '';
-
-		$text['label-invoice_method_check']['en-us'] = 'Check';
-		$text['label-invoice_method_check']['pt-pt'] = '';
-
-		$text['label-invoice_method_credit_card']['en-us'] = 'Credit Card';
-		$text['label-invoice_method_credit_card']['pt-pt'] = '';
-
-		$text['label-invoice_method_cash']['en-us'] = 'Cash';
-		$text['label-invoice_method_cash']['pt-pt'] = '';
-
-		$text['label-invoice_notes']['en-us'] = 'Invoice Notes';
-		$text['label-invoice_notes']['pt-pt'] = '';
-
-	//Invoice Items
-		$text['title-invoice_items']['en-us'] = 'Items';
-		$text['title-invoice_items']['pt-pt'] = '';
-
-		$text['title-invoice_item']['en-us'] = 'Invoice Item';
-		$text['title-invoice_item']['pt-pt'] = '';
-
-		$text['description-invoice_item']['en-us'] = '';
-		$text['description-invoice_item']['pt-pt'] = '';
-
-		$text['label-item_qty']['en-us'] = 'Quantity';
-		$text['label-item_qty']['pt-pt'] = '';
-
-		$text['description-item_qty']['en-us'] = 'Enter the quantity.';
-		$text['description-item_qty']['pt-pt'] = '';
-
-		$text['label-item_unit_price']['en-us'] = 'Unit Price';
-		$text['label-item_unit_price']['pt-pt'] = '';
-
-		$text['description-item_unit_price']['en-us'] = 'Enter the unit price';
-		$text['description-item_unit_price']['pt-pt'] = '';
-
-		$text['label-item_amount']['en-us'] = 'Amount';
-		$text['label-item_amount']['pt-pt'] = '';
-
-		$text['label-item_desc']['en-us'] = 'Description';
-		$text['label-item_desc']['pt-pt'] = '';
-
-		$text['button-pdf']['en-us'] = 'PDF';
-		$text['button-back']['pt-pt'] = '';
-
-		$text['label-true']['en-us'] = 'true';
-		$text['label-true']['pt-pt'] = '';
-
-		$text['label-false']['en-us'] = 'false';
-		$text['label-false']['pt-pt'] = 'falso';
-
-		$text['button-add']['en-us'] = 'Add';
-		$text['button-add']['pt-pt'] = '';
-
-		$text['button-edit']['en-us'] = 'Edit';
-		$text['button-edit']['pt-pt'] = '';
-
-		$text['button-delete']['en-us'] = 'Delete';
-		$text['button-delete']['pt-pt'] = '';
-
-		$text['button-save']['en-us'] = 'Save';
-		$text['button-save']['pt-pt'] = 'Guardar';
-
-		$text['button-view']['en-us'] = 'View';
-		$text['button-view']['pt-pt'] = '';
-
-		$text['button-back']['en-us'] = 'Back';
-		$text['button-back']['pt-pt'] = 'Voltar';
-
-		$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
-		$text['confirm-delete']['pt-pt'] = '';
-
-		$text['message-add']['en-us'] = 'Add Completed';
-		$text['message-add']['pt-pt'] = '';
-
-		$text['message-update']['en-us'] = 'Update Completed';
-		$text['message-update']['pt-pt'] = '';
-
-		$text['message-delete']['en-us'] = 'Delete Completed';
-		$text['message-delete']['pt-pt'] = '';
-
-		$text['message-required']['en-us'] = 'Please provide: ';
-		$text['message-required']['pt-pt'] = '';
-
-	//PDF
-		$text['label-invoice']['en-us'] = 'INVOICE';
-		$text['label-invoice']['pt-pt'] = '';
-
-		$text['label-quote']['en-us'] = 'QUOTE';
-		$text['label-quote']['pt-pt'] = '';
-
-		$text['label-estimate']['en-us'] = 'ESTIMATE';
-		$text['label-estimate']['pt-pt'] = '';
-
-		$text['label-invoice_date']['en-us'] = 'Date';
-		$text['label-invoice_date']['pt-pt'] = '';
-
-		$text['label-invoice_number']['en-us'] = 'Number';
-		$text['label-invoice_number']['pt-pt'] = '';
-
-		$text['label-invoice_notes']['en-us'] = 'Note';
-		$text['label-invoice_notes']['pt-pt'] = '';
-
-		$text['label-invoice_total']['en-us'] = 'Total';
-		$text['label-invoice_total']['pt-pt'] = '';
-
-		$text['label-invoice_total']['en-us'] = 'Total';
-		$text['label-invoice_total']['pt-pt'] = '';
-
-?>

+ 0 - 22
invoices/app_menu.php

@@ -1,22 +0,0 @@
-<?php
-
-	$y = 0;
-	$apps[$x]['menu'][$y]['title']['en-us'] = 'Invoices';
-	$apps[$x]['menu'][$y]['title']['es-mx'] = '';
-	$apps[$x]['menu'][$y]['title']['de'] = '';
-	$apps[$x]['menu'][$y]['title']['de-ch'] = '';
-	$apps[$x]['menu'][$y]['title']['de-at'] = '';
-	$apps[$x]['menu'][$y]['title']['fr'] = '';
-	$apps[$x]['menu'][$y]['title']['fr-ca'] = '';
-	$apps[$x]['menu'][$y]['title']['fr-ch'] = '';
-	$apps[$x]['menu'][$y]['title']['pt-pt'] = '';
-	$apps[$x]['menu'][$y]['title']['pt-br'] = '';
-	$apps[$x]['menu'][$y]['uuid'] = '6ebe753b-0f83-dc34-1c0b-51df2c6f0c3b';
-	$apps[$x]['menu'][$y]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
-	$apps[$x]['menu'][$y]['category'] = 'internal';
-	$apps[$x]['menu'][$y]['path'] = '/app/invoices/invoices.php';
-	//$apps[$x]['menu'][$y]['groups'][] = 'user';
-	//$apps[$x]['menu'][$y]['groups'][] = 'admin';
-	$apps[$x]['menu'][$y]['groups'][] = 'superadmin';
-
-?>

+ 0 - 65
invoices/invoice_delete.php

@@ -1,65 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('invoice_delete')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get the id
-	if (count($_GET) > 0) {
-		$id = check_str($_GET["id"]);
-		$contact_uuid = check_str($_GET["contact_uuid"]);
-		$back = check_str($_GET["back"]);
-	}
-
-//delete invoice
-	if (strlen($id )> 0) {
-		$sql = "delete from v_invoices ";
-		$sql .= "where domain_uuid = '$domain_uuid' ";
-		$sql .= "and invoice_uuid = '$id' ";
-		$prep_statement = $db->prepare(check_sql($sql));
-		$prep_statement->execute();
-		unset($sql);
-	}
-
-//redirect the user
-	$_SESSION['message'] = $text['message-delete'];
-	header("Location: ".(($back != '') ? $back : "invoices.php?id=".$contact_uuid));
-	exit;
-?>

+ 0 - 544
invoices/invoice_edit.php

@@ -1,544 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('invoice_add') || permission_exists('invoice_edit')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//action add or update
-	if (is_uuid($_REQUEST["id"])) {
-		$action = "update";
-		$invoice_uuid = $_REQUEST["id"];
-		$back = $_REQUEST['back'];
-	}
-	else {
-		$action = "add";
-	}
-
-//get http post variables and set them to php variables
-	if (is_array($_REQUEST)) {
-		//$invoice_uuid = $_REQUEST["invoice_uuid"];
-		$contact_uuid_from = $_REQUEST["contact_uuid_from"];
-		$contact_uuid_to = $_REQUEST["contact_uuid_to"];
-		$invoice_number = $_REQUEST["invoice_number"];
-		//$invoice_date = $_REQUEST["invoice_date"];
-		$invoice_type = $_REQUEST["invoice_type"];
-		$invoice_purchase_order_number = $_REQUEST["invoice_purchase_order_number"];
-		$invoice_currency = $_REQUEST["invoice_currency"];
-		$invoice_notes = $_REQUEST["invoice_notes"];
-		$invoice_paid = $_REQUEST["invoice_paid"];
-		$invoice_paid_date = $_REQUEST["invoice_paid_date"];
-		$invoice_paid_method = $_REQUEST["invoice_paid_method"];
-		$invoice_paid_method_ref = $_REQUEST["invoice_paid_method_ref"];
-	}
-
-//process the user data and save it to the database
-	if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
-
-		//validate the token
-			$token = new token;
-			if (!$token->validate($_SERVER['PHP_SELF'])) {
-				message::add($text['message-invalid_token'],'negative');
-				header('Location: invoices.php');
-				exit;
-			}
-
-		//process the http post data by submitted action
-			if ($_POST['action'] != '' && strlen($_POST['action']) > 0) {
-
-				//prepare the array(s)
-				//send the array to the database class
-				switch ($_POST['action']) {
-					case 'copy':
-						if (permission_exists('invoice_add')) {
-							$obj = new database;
-							$obj->copy($array);
-						}
-						break;
-					case 'delete':
-						if (permission_exists('invoice_delete')) {
-							$obj = new database;
-							$obj->delete($array);
-						}
-						break;
-					case 'toggle':
-						if (permission_exists('invoice_update')) {
-							$obj = new database;
-							$obj->toggle($array);
-						}
-						break;
-				}
-
-				//redirect the user
-				if (in_array($_POST['action'], array('copy', 'delete', 'toggle'))) {
-					header('Location: invoice_edit.php?id='.$id);
-					exit;
-				}
-			}
-
-		//check for all required data
-			$msg = '';
-			//if (strlen($invoice_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_uuid']."<br>\n"; }
-			//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
-			//if (strlen($contact_uuid_from) == 0) { $msg .= $text['message-required']." ".$text['label-contact_uuid_from']."<br>\n"; }
-			//if (strlen($contact_uuid_to) == 0) { $msg .= $text['message-required']." ".$text['label-contact_uuid_to']."<br>\n"; }
-			//if (strlen($invoice_number) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_number']."<br>\n"; }
-			//if (strlen($invoice_date) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_date']."<br>\n"; }
-			//if (strlen($invoice_notes) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_notes']."<br>\n"; }
-			//if (strlen($invoice_type) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_type']."<br>\n"; }
-			//if (strlen($invoice_purchase_order_number) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_purchase_order_number']."<br>\n"; }
-			//if (strlen($invoice_currency) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_currency']."<br>\n"; }
-			//if (strlen($invoice_paid) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_paid']."<br>\n"; }
-			//if (strlen($invoice_paid_date) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_paid_date']."<br>\n"; }
-			//if (strlen($invoice_paid_method) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_paid_method']."<br>\n"; }
-			//if (strlen($invoice_paid_method_ref) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_paid_method_ref']."<br>\n"; }
-			if (!empty($msg) && strlen($_POST["persistformvar"]) == 0) {
-				require_once "resources/header.php";
-				require_once "resources/persist_form_var.php";
-				echo "<div align='center'>\n";
-				echo "<table><tr><td>\n";
-				echo $msg."<br />";
-				echo "</td></tr></table>\n";
-				persistformvar($_POST);
-				echo "</div>\n";
-				require_once "resources/footer.php";
-				return;
-			}
-
-		//add the invoice_uuid
-			if (!is_uuid($_POST["invoice_uuid"])) {
-				$invoice_uuid = uuid();
-			}
-
-		//set defaults
-			$invoice_paid = ($invoice_paid != '1') ? null : $invoice_paid;
-			$invoice_paid_date = ($invoice_paid_date == '') ? null : "'".$invoice_paid_date."'";
-			$invoice_paid_method = ($invoice_paid_method == '') ? null : "'".$invoice_paid_method."'";
-			$invoice_paid_method_ref = ($invoice_paid_method_ref == '') ? null : "'".$invoice_paid_method_ref."'";
-
-		//prepare the array
-			$array['invoices'][0]['invoice_uuid'] = $invoice_uuid;
-			$array['invoices'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
-			$array['invoices'][0]['invoice_uuid'] = $invoice_uuid;
-			$array['invoices'][0]['domain_uuid'] = $domain_uuid;
-			$array['invoices'][0]['contact_uuid_from'] = $contact_uuid_from;
-			$array['invoices'][0]['contact_uuid_to'] = $contact_uuid_to;
-			$array['invoices'][0]['invoice_number'] = $invoice_number;
-			$array['invoices'][0]['invoice_date'] = 'now()';
-			$array['invoices'][0]['invoice_notes'] = $invoice_notes;
-			$array['invoices'][0]['invoice_type'] = $invoice_type;
-			$array['invoices'][0]['invoice_purchase_order_number'] = $invoice_purchase_order_number;
-			$array['invoices'][0]['invoice_currency'] = $invoice_currency;
-			$array['invoices'][0]['invoice_paid'] = $invoice_paid;
-			$array['invoices'][0]['invoice_paid_date'] = $invoice_paid_date;
-			$array['invoices'][0]['invoice_paid_method'] = $invoice_paid_method;
-			$array['invoices'][0]['invoice_paid_method_ref'] = $invoice_paid_method_ref;
-
-		//save the data
-			$database = new database;
-			$database->app_name = 'invoices';
-			$database->app_uuid = 'e5a1f4f5-7766-ec9c-118b-50f76b0788c0';
-			$result = $database->save($array);
-			//view_array($result);
-
-		//set redirect
-			$_SESSION['message'] = $text['message-update'];
-			header("Location: ".(($back != '') ? $back : "invoices.php"));
-			return;
-
-	} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
-
-//pre-populate the form
-	if (is_array($_GET) && $_POST["persistformvar"] != "true") {
-		$sql = "select ";
-		$sql .= " invoice_uuid, ";
-		$sql .= " invoice_uuid, ";
-		$sql .= " domain_uuid, ";
-		$sql .= " contact_uuid_from, ";
-		$sql .= " contact_uuid_to, ";
-		$sql .= " invoice_number, ";
-		$sql .= " invoice_date, ";
-		$sql .= " invoice_notes, ";
-		$sql .= " invoice_type, ";
-		$sql .= " invoice_purchase_order_number, ";
-		$sql .= " invoice_currency, ";
-		$sql .= " invoice_paid, ";
-		$sql .= " invoice_paid_date, ";
-		$sql .= " invoice_paid_method, ";
-		$sql .= " invoice_paid_method_ref ";
-		$sql .= "from v_invoices ";
-		$sql .= "where invoice_uuid = :invoice_uuid ";
-		//$sql .= "and domain_uuid = :domain_uuid ";
-		//$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-		$parameters['invoice_uuid'] = $invoice_uuid;
-		$database = new database;
-		$row = $database->select($sql, $parameters, 'row');
-		if (is_array($row) && @sizeof($row) != 0) {
-			$invoice_uuid = $row["invoice_uuid"];
-			$contact_uuid_from = $row["contact_uuid_from"];
-			$contact_uuid_to = $row["contact_uuid_to"];
-			$invoice_number = $row["invoice_number"];
-			$invoice_date = $row["invoice_date"];
-			$invoice_notes = $row["invoice_notes"];
-			$invoice_type = $row["invoice_type"];
-			$invoice_purchase_order_number = $row["invoice_purchase_order_number"];
-			$invoice_currency = $row["invoice_currency"];
-			$invoice_paid = $row["invoice_paid"];
-			$invoice_paid_date = $row["invoice_paid_date"];
-			$invoice_paid_method = $row["invoice_paid_method"];
-			$invoice_paid_method_ref = $row["invoice_paid_method_ref"];
-		}
-		unset($sql, $parameters, $row);
-	}
-
-//format paid date (if any)
-	if ($invoice_paid_date != '') {
-		$tmp = explode(' ',$invoice_paid_date);
-		$invoice_paid_date = $tmp[0];
-	}
-
-//set the default currency
-	if (strlen($invoice_currency) == 0) {
-		$invoice_currency = 'USD';
-	}
-
-//get the list of contacts
-	$sql = "select contact_uuid, contact_organization, contact_name_given, contact_name_family from v_contacts ";
-	$sql .= "where domain_uuid = :domain_uuid ";
-	$sql .= "order by contact_organization asc ";
-	$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-	$contacts = $database->select($sql, $parameters, 'all');
-	unset ($prep_statement, $sql);
-
-//get the contact from name
-	if (!empty($contact_uuid_from)) {
-		foreach($contacts as $row) {
-			if ($row['contact_uuid'] == $contact_uuid_from) {
-				$contact_name_from = $row['contact_organization'].", ".$row['contact_name_given'].", ".$row['contact_name_family'];
-				break;
-			}
-		}
-	}
-
-//get the contact to name
-	if (!empty($contact_uuid_to)) {
-		foreach($contacts as $row) {
-			if ($row['contact_uuid'] == $contact_uuid_to) {
-				$contact_name_to = $row['contact_organization'].", ".$row['contact_name_given'].", ".$row['contact_name_family'];
-				break;
-			}
-		}
-	}
-
-//get the default invoice number and contact_uuid_from
-	if ($action == "add") {
-		$sql = "select * from v_invoices ";
-		$sql .= "where domain_uuid = :domain_uuid ";
-		$sql .= "order by invoice_number desc ";
-		$sql .= "limit 1 ";
-		$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-		$row = $database->select($sql, $parameters, 'row');
-		$invoice_number = $row['invoice_number'] + 1;
-		$contact_uuid_from = $row['contact_uuid_from'];
-		unset ($prep_statement);
-	}
-
-//set the contact 'to' when adding an invoice
-	if ($action == "add") {
-		$contact_uuid_to = $_REQUEST['contact_uuid'];
-	}
-
-//show the header
-	require_once "resources/header.php";
-
-?>
-
-<script type="text/javascript">
-	function get_contacts(element_id, id, search) {
-		var xhttp = new XMLHttpRequest();
-		xhttp.onreadystatechange = function() {
-			if (this.readyState == 4 && this.status == 200) {
-				//create a handle for the contact select object
-				select = document.getElementById(element_id);
-
-				//remove current options
-				while (select.options.length > 0) {
-					select.remove(0);
-				}
-
-				//add an empty row
-				//select.add(new Option('', ''));
-
-				//add new options from the json results
-				obj = JSON.parse(this.responseText);
-				for (var i=0; i < obj.length; i++) {
-					select.add(new Option(obj[i].name, obj[i].id));
-				}
-			}
-		};
-		if (search) {
-			xhttp.open("GET", "/app/contacts/contact_json.php?search="+search, true);
-		}
-		else {
-			xhttp.open("GET", "/app/contacts/contact_json.php", true);
-		}
-		xhttp.send();
-	}
-</script>
-
-<?php
-
-//create token
-	$object = new token;
-	$token = $object->create($_SERVER['PHP_SELF']);
-
-//show the content
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<table width='100%'  border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' valign='top' nowrap='nowrap'><b>".$text['title-invoice']."</b></td>\n";
-	echo "<td width='70%' align='right' valign='top'>\n";
-	echo "	<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='".(($back != '') ? $back : "invoices.php")."'\" value='".$text['button-back']."'>\n";
-	if ($action == "update") {
-		echo "	<input type='button' class='btn' name='' alt='".$text['button-pdf']."' onclick=\"window.open('invoice_pdf.php?id=".$_GET["id"]."&type=' + document.getElementById('invoice_type').options[document.getElementById('invoice_type').selectedIndex].value);\" value='".$text['button-pdf']."'>\n";
-	}
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-invoice_number']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <input class='formfld' type='text' name='invoice_number' maxlength='255' value='".escape($invoice_number)."'>\n";
-	echo "<br />\n";
-	echo $text['description-invoice_number']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-invoice_type']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<select name='invoice_type' id='invoice_type' class='formfld'>\n";
-	echo "		<option value='invoice' ".(($invoice_type == 'invoice') ? "selected" : null).">".$text['label-invoice_type_invoice']."</option>";
-	echo "		<option value='quote' ".(($invoice_type == 'quote') ? "selected" : null).">".$text['label-invoice_type_quote']."</option>";
-	echo "	</select>";
-	echo "<br />\n";
-	echo $text['description-invoice_type']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-contact_uuid_from']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<input class=\"formfld\" type=\"text\" name=\"contact_search\" placeholder=\"".$text['label-search']."\" style=\"width: 80px;\" onkeyup=\"get_contacts('contact_from_select', 'contact_from_uuid', this.value);\" maxlength=\"255\" value=\"\">\n";
-	echo "	<select class='formfld' style=\"width: 150px;\" id=\"contact_from_select\" name=\"contact_uuid_from\" >\n";
-	echo "		<option value='".escape($contact_uuid_from)."'>".escape($contact_name_from ?? '')."</option>\n";
-	echo "	</select>\n";
-	/*
-	echo "<select name=\"contact_uuid_from\" id=\"contact_uuid_from\" class=\"formfld\">\n";
-	echo "<option value=\"\"></option>\n";
-	foreach($contacts as $row) {
-		$contact_name = '';
-		if (strlen($row['contact_organization']) > 0) {
-			$contact_name = $row['contact_organization'];
-		}
-		if (strlen($row['contact_name_family']) > 0) {
-			if (strlen($contact_name) > 0) { $contact_name .= ", "; }
-			$contact_name .= $row['contact_name_family'];
-		}
-		if (strlen($row['contact_name_given']) > 0) {
-			if (strlen($contact_name) > 0) { $contact_name .= ", "; }
-			$contact_name .= $row['contact_name_given'];
-		}
-		if ($row['contact_uuid'] == $contact_uuid_from) {
-			echo "<option value=\"".escape($row['contact_uuid'])."\" selected=\"selected\">".escape($contact_name)." ".escape($contact_uuid)."</option>\n";
-		}
-		else {
-			echo "<option value=\"".escape($row['contact_uuid'])."\">".escape($contact_name)."</option>\n";
-		}
-	}
-	unset($sql, $result, $row_count);
-	echo "</select>\n";
-	*/
-	echo "<br />\n";
-	echo $text['description-contact_uuid_from']." \n";
-	echo "<a href='".PROJECT_PATH."/app/contacts/contact_edit.php?id=".escape($contact_uuid_from)."'>".$text['button-view']."</a>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-contact_uuid_to']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-
-	echo "	<input class=\"formfld\" type=\"text\" name=\"contact_search\" placeholder=\"".$text['label-search']."\" style=\"width: 80px;\" onkeyup=\"get_contacts('contact_to_select', 'contact_to_uuid', this.value);\" maxlength=\"255\" value=\"\">\n";
-	echo "	<select class='formfld' style=\"width: 150px;\" id=\"contact_to_select\" name=\"contact_uuid_to\" >\n";
-	echo "		<option value='".escape($contact_uuid_to)."'>".escape($contact_name_to ?? '')."</option>\n";
-	echo "	</select>\n";
-	/*
-	echo "<select name=\"contact_uuid_to\" id=\"contact_uuid_to\" class=\"formfld\">\n";
-	echo "<option value=\"\"></option>\n";
-	foreach($contacts as $row) {
-		$contact_name = '';
-		if (strlen($row['contact_organization']) > 0) {
-			$contact_name = $row['contact_organization'];
-		}
-		if (strlen($row['contact_name_family']) > 0) {
-			if (strlen($contact_name) > 0) { $contact_name .= ", "; }
-			$contact_name .= $row['contact_name_family'];
-		}
-		if (strlen($row['contact_name_given']) > 0) {
-			if (strlen($contact_name) > 0) { $contact_name .= ", "; }
-			$contact_name .= $row['contact_name_given'];
-		}
-		if ($row['contact_uuid'] == $contact_uuid_to) {
-			echo "<option value=\"".escape($row['contact_uuid'])."\" selected=\"selected\">".escape($contact_name)." ".escape($contact_uuid)."</option>\n";
-		}
-		else {
-			echo "<option value=\"".escape($row['contact_uuid'])."\">".escape($contact_name)."</option>\n";
-		}
-	}
-	unset($sql, $result, $row_count);
-	echo "</select>\n";
-	*/
-	echo "<br />\n";
-	echo $text['description-contact_uuid_to']." \n";
-	echo "<a href='".PROJECT_PATH."/app/contacts/contact_edit.php?id=".escape($contact_uuid_to)."'>".$text['button-view']."</a>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-invoice_purchase_order_number']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <input class='formfld' type='text' name='invoice_purchase_order_number' maxlength='255' value='".escape($invoice_purchase_order_number)."'>\n";
-	echo "<br />\n";
-	echo $text['description-invoice_purchase_order_number']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-invoice_currency']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <input class='formfld' type='text' name='invoice_currency' maxlength='255' value='".escape($invoice_currency)."'>\n";
-	echo "<br />\n";
-	echo $text['description-invoice_currency']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	if ($action == "update") {
-		//prepare the invoice date
-			$invoice_date = date("d", strtotime($invoice_date)).' '.date("M", strtotime($invoice_date)).' '.date("Y", strtotime($invoice_date));
-		//show the formatted date
-			echo "<tr>\n";
-			echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-			echo "	".$text['label-invoice_created']."\n";
-			echo "</td>\n";
-			echo "<td class='vtable' align='left'>\n";
-			echo "  ".$invoice_date."\n";
-			echo "</td>\n";
-			echo "</tr>\n";
-
-			echo "<tr>\n";
-			echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-			echo "	".$text['label-invoice_paid']."\n";
-			echo "</td>\n";
-			echo "<td class='vtable' align='left'>\n";
-			echo "	<table cellpadding='0' cellspacing='0' border='0'>";
-			echo "		<tr>";
-			echo "			<td><input type='checkbox' class='formfld' name='invoice_paid' id='invoice_paid' value='1' ".(($invoice_paid) ? "checked='checked'" : null)." onchange=\"$('#td_paid_details').fadeToggle('fast');\"></td>";
-			echo "			<td id='td_paid_details' style='".((!$invoice_paid) ? "display: none;" : null)." padding: 0px 3px 0px 8px;'>";
-			echo "				<input type='text' class='formfld' style='min-width: 85px; max-width: 85px;' name='invoice_paid_date' data-calendar=\"{format: '%Y-%m-%d', listYears: true, hideOnPick: true, fxName: null, showButtons: true}\" placeholder='Date' value='".$invoice_paid_date."'>";
-			echo "				<select name='invoice_paid_method' id='invoice_paid_method' class='formfld' onchange=\"document.getElementById('invoice_paid_method_ref').focus();\">\n";
-			echo "					<option value=''></option>";
-			echo "					<option value='pp' ".(($invoice_paid_method == 'pp') ? "selected" : null).">".$text['label-invoice_method_paypal']."</option>";
-			echo "					<option value='chk' ".(($invoice_paid_method == 'chk') ? "selected" : null).">".$text['label-invoice_method_check']."</option>";
-			echo "					<option value='cc' ".(($invoice_paid_method == 'cc') ? "selected" : null).">".$text['label-invoice_method_credit_card']."</option>";
-			echo "					<option value='csh' ".(($invoice_paid_method == 'csh') ? "selected" : null).">".$text['label-invoice_method_cash']."</option>";
-			echo "				</select>";
-			echo "				<input type='text' class='formfld' style='min-width: 85px;' name='invoice_paid_method_ref' id='invoice_paid_method_ref' placeholder='Ref #' value='".escape($invoice_paid_method_ref)."'>";
-			echo "			</td>";
-			echo "		</tr>";
-			echo "	</table>";
-			echo "</td>\n";
-			echo "</tr>\n";
-	}
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-invoice_notes']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "	<textarea class='formfld' type='text' name='invoice_notes'>".escape($invoice_notes)."</textarea>\n";
-	echo "<br />\n";
-	echo $text['description-invoice_notes']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	if ($action == "update") {
-		if ($back != '') {
-			echo "		<input type='hidden' name='back' value='".escape($back)."'>";
-		}
-		echo "		<input type='hidden' name='invoice_uuid' value='".escape($invoice_uuid)."'>\n";
-	}
-	echo "			<br><input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
-	echo "</form>";
-
-	if ($action == "update") {
-		require "invoice_items.php";
-	}
-
-//include the footer
-	require_once "resources/footer.php";
-?>

+ 0 - 69
invoices/invoice_item_delete.php

@@ -1,69 +0,0 @@
-<?php
-/* $Id$ */
-/*
-	Copyright (C) 2008-2013 Mark J Crane
-	All rights reserved.
-
-	Redistribution and use in source and binary forms, with or without
-	modification, are permitted provided that the following conditions are met:
-
-	1. Redistributions of source code must retain the above copyright notice,
-	   this list of conditions and the following disclaimer.
-
-	2. Redistributions in binary form must reproduce the above copyright
-	   notice, this list of conditions and the following disclaimer in the
-	   documentation and/or other materials provided with the distribution.
-
-	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-	POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//get permissions
-	if (permission_exists('invoice_item_delete')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//get the http variables
-	if (count($_GET) > 0) {
-		$id = check_str($_GET["id"]);
-		$invoice_uuid = check_str($_GET["invoice_uuid"]);
-		$contact_uuid = check_str($_GET["contact_uuid"]);
-		$back = check_str($_GET["back"]);
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//delete invoice_item
-	if (strlen($id) > 0) {
-			$sql = "delete from v_invoice_items ";
-			$sql .= "where domain_uuid = '$domain_uuid' ";
-			$sql .= "and invoice_item_uuid = '$id' ";
-			$prep_statement = $db->prepare(check_sql($sql));
-			$prep_statement->execute();
-			unset($sql);
-	}
-
-//redirect the user
-	$_SESSION['message'] = $text['message-delete'];
-	$back = ($back != '') ? "&back=".$back : null;
-	header("Location: invoice_edit.php?id=".$invoice_uuid."&contact_uuid=".$contact_uuid.$back);
-	exit;
-?>

+ 0 - 220
invoices/invoice_item_edit.php

@@ -1,220 +0,0 @@
-<?php
-/* $Id$ */
-/*
-	Copyright (C) 2008-2013 Mark J Crane
-	All rights reserved.
-
-	Redistribution and use in source and binary forms, with or without
-	modification, are permitted provided that the following conditions are met:
-
-	1. Redistributions of source code must retain the above copyright notice,
-	   this list of conditions and the following disclaimer.
-
-	2. Redistributions in binary form must reproduce the above copyright
-	   notice, this list of conditions and the following disclaimer in the
-	   documentation and/or other materials provided with the distribution.
-
-	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-	POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-	
-//check permissionss
-	if (permission_exists('invoice_item_add') || permission_exists('invoice_item_edit')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//action add or update
-	if (isset($_REQUEST["id"])) {
-		$action = "update";
-		$invoice_item_uuid = $_REQUEST["id"];
-		$back = $_REQUEST['back'];
-	}
-	else {
-		$action = "add";
-		$back = $_REQUEST['back'];
-	}
-
-//get http post variables and set them to php variables
-	if (strlen(count($_REQUEST)) > 0) {
-		$contact_uuid = $_REQUEST["contact_uuid"];
-		$invoice_uuid = $_REQUEST["invoice_uuid"];
-	}	
-	if (count($_POST) > 0) {
-		$item_qty = $_POST["item_qty"];
-		$item_desc = $_POST["item_desc"];
-		$item_unit_price = $_POST["item_unit_price"];
-	}
-
-//process the data from the http post
-	if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
-
-		//get the id
-			if ($action == "update") {
-				$invoice_item_uuid = $_POST["invoice_item_uuid"];
-			}
-
-		//check for all required data
-			$msg = '';
-			//if (strlen($invoice_item_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_item_uuid']."<br>\n"; }
-			//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."<br>\n"; }
-			//if (strlen($invoice_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-invoice_uuid']."<br>\n"; }
-			if (strlen($item_qty) == 0) { $msg .= $text['message-required']." ".$text['label-item_qty']."<br>\n"; }
-			//if (strlen($item_desc) == 0) { $msg .= $text['message-required']." ".$text['label-item_desc']."<br>\n"; }
-			//if (strlen($item_unit_price) == 0) { $msg .= $text['message-required']." ".$text['label-item_unit_price']."<br>\n"; }
-			if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
-				require_once "resources/header.php";
-				require_once "resources/persist_form_var.php";
-				echo "<div align='center'>\n";
-				echo "<table><tr><td>\n";
-				echo $msg."<br />";
-				echo "</td></tr></table>\n";
-				persistformvar($_POST);
-				echo "</div>\n";
-				require_once "resources/footer.php";
-				return;
-			}
-
-		//add the invoice_uuid
-			if (!is_uuid($_POST["invoice_item_uuid"])) {
-				$invoice_item_uuid = uuid();
-			}
-
-		//prepare the array
-			$array['invoice_items'][0]['invoice_item_uuid'] = $invoice_item_uuid;
-			$array['invoice_items'][0]['invoice_uuid'] = $invoice_uuid;
-			$array['invoice_items'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
-			$array['invoice_items'][0]['item_qty'] = $item_qty;
-			$array['invoice_items'][0]['item_desc'] = $item_desc;
-			$array['invoice_items'][0]['item_unit_price'] = $item_unit_price;
-
-		//save the data
-			$database = new database;
-			$database->app_name = 'invoices';
-			$database->app_uuid = 'e5a1f4f5-7766-ec9c-118b-50f76b0788c0';
-			$result = $database->save($array);
-			//view_array($result);
-
-		//redirect the browser
-			if ($action == "add" && permission_exists('invoice_item_add')) {
-				$_SESSION['message'] = $text['message-add'];
-				$back = ($back != '') ? "&back=".$back : null;
-				header("Location: invoice_edit.php?id=".$invoice_uuid."&contact_uuid=".$contact_uuid.$back);
-				return;
-			}
-
-			if ($action == "update" && permission_exists('invoice_item_edit')) {
-				$_SESSION['message'] = $text['message-update'];
-				$back = ($back != '') ? "&back=".$back : null;
-				header("Location: invoice_edit.php?id=".$invoice_uuid."&contact_uuid=".$contact_uuid.$back);
-				return;
-			}
-
-	}
-
-//pre-populate the form
-	if (is_array($_GET) && $_POST["persistformvar"] != "true") {
-		$invoice_item_uuid = $_GET["id"];
-		$sql = "select * from v_invoice_items ";
-		$sql .= "where domain_uuid = :domain_uuid ";
-		$sql .= "and invoice_item_uuid = :invoice_item_uuid ";
-		$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-		$parameters['invoice_item_uuid'] = $invoice_item_uuid;
-		$database = new database;
-		$result = $database->select($sql, $parameters, 'all');
-		if (!empty($result)) {
-			foreach ($result as &$row) {
-				$item_qty = $row["item_qty"];
-				$item_desc = $row["item_desc"];
-				$item_unit_price = $row["item_unit_price"];
-			}
-		}
-		unset ($prep_statement);
-	}
-
-//show the header
-	require_once "resources/header.php";
-
-//show the content
-	echo "<form method='post' name='frm' action=''>\n";
-	echo "<table width='100%'  border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<td align='left' width='30%' valign='top' nowrap='nowrap'><b>".$text['title-invoice_item']."</b></td>\n";
-	echo "<td width='70%' align='right' valign='top'>\n";
-	echo "	<input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"history.go(-1);\" value='".$text['button-back']."'>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-item_qty']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <input class='formfld' type='text' name='item_qty' maxlength='255' value='".escape($item_qty)."'>\n";
-	echo "<br />\n";
-	echo $text['description-item_qty']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-item_unit_price']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <input class='formfld' type='text' name='item_unit_price' maxlength='255' value='".escape($item_unit_price)."'>\n";
-	echo "<br />\n";
-	echo $text['description-item_unit_price']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "<tr>\n";
-	echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
-	echo "	".$text['label-item_desc']."\n";
-	echo "</td>\n";
-	echo "<td class='vtable' align='left'>\n";
-	echo "  <textarea class='formfld' type='text' rows='15' name='item_desc'>".$item_desc."</textarea>\n";
-	echo "<br />\n";
-	//echo $text['description-item_desc']."\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "	<tr>\n";
-	echo "		<td colspan='2' align='right'>\n";
-	echo "			<input type='hidden' name='invoice_uuid' value='".escape($invoice_uuid)."'>\n";
-	echo "			<input type='hidden' name='contact_uuid' value='".escape($contact_uuid)."'>\n";
-	if ($action == "update") {
-		if ($back != '') {
-			echo "		<input type='hidden' name='back' value='".escape($back)."'>";
-		}
-		echo "		<input type='hidden' name='invoice_item_uuid' value='".escape($invoice_item_uuid)."'>\n";
-	}
-	echo "			<br><input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
-	echo "		</td>\n";
-	echo "	</tr>";
-	echo "</table>";
-	echo "<br><br>";
-	echo "</form>";
-
-//include the footer
-	require_once "resources/footer.php";
-
-?>

+ 0 - 159
invoices/invoice_items.php

@@ -1,159 +0,0 @@
-<?php
-/* $Id$ */
-/*
-	Copyright (C) 2008-2013 Mark J Crane
-	All rights reserved.
-
-	Redistribution and use in source and binary forms, with or without
-	modification, are permitted provided that the following conditions are met:
-
-	1. Redistributions of source code must retain the above copyright notice,
-	   this list of conditions and the following disclaimer.
-
-	2. Redistributions in binary form must reproduce the above copyright
-	   notice, this list of conditions and the following disclaimer in the
-	   documentation and/or other materials provided with the distribution.
-
-	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-	POSSIBILITY OF SUCH DAMAGE.
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('invoice_item_view')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//get variables used to control the order
-	$order_by = $_GET["order_by"];
-	$order = $_GET["order"];
-
-//show the content
-	echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='50%' align='left' nowrap='nowrap'><b>".$text['title-invoice_items']."</b><br><br></td>\n";
-	echo "		<td width='50%' align='right'>&nbsp;</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-
-//prepare to page the results
-	$sql = "select count(*) as num_rows from v_invoice_items ";
-	$sql .= "where domain_uuid = :domain_uuid ";
-	$sql .= " and invoice_uuid = :invoice_uuid ";
-	if (!empty($order_by)) { $sql .= "order by $order_by $order "; }
-	$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-	$parameters['invoice_uuid'] = $invoice_uuid;
-	$row = $database->select($sql, $parameters, 'row');
-	if ($row['num_rows'] > 0) {
-		$num_rows = $row['num_rows'];
-	}
-	else {
-		$num_rows = '0';
-	}
-
-//prepare to page the results
-	$rows_per_page = 10000;
-	$param = "";
-	$page = $_GET['page'];
-	if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
-	//list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
-	$offset = $rows_per_page * $page;
-
-//get the list
-	$sql = "select * from v_invoice_items ";
-	$sql .= "where domain_uuid = :domain_uuid ";
-	$sql .= " and invoice_uuid = :invoice_uuid ";
-	if (!empty($order_by)) { $sql .= "order by $order_by $order "; }
-	$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
-	$parameters['invoice_uuid'] = $invoice_uuid;
-	$result = $database->select($sql, $parameters, 'all');
-	unset ($prep_statement, $sql);
-
-//set the row style
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//show the items
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo th_order_by('item_qty', $text['label-item_qty'], $order_by, $order);
-	echo th_order_by('item_unit_price', $text['label-item_unit_price'], $order_by, $order);
-	echo th_order_by('item_desc', $text['label-item_desc'], $order_by, $order);
-	echo "<th nowrap='nowrap'>".$text['label-item_amount']."</th>\n";
-	echo "<td align='right' width='42'>\n";
-	$back = ($back != '') ? "&back=".$back : null;
-	if (permission_exists('invoice_item_add')) {
-		echo "	<a href='invoice_item_edit.php?invoice_uuid=".$_GET['id']."&contact_uuid=".escape($contact_uuid_to).escape($back)."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-	}
-	else {
-		echo "	&nbsp;\n";
-	}
-	echo "</td>\n";
-	echo "<tr>\n";
-
-	if (!empty($result)) {
-		foreach($result as $row) {
-			$item_desc = $row['item_desc'];
-			$item_desc = str_replace("\n", "<br />", $item_desc);
-			$tr_link = (permission_exists('invoice_item_edit')) ? "href='invoice_item_edit.php?invoice_uuid=".escape($row['invoice_uuid'])."&id=".escape($row['invoice_item_uuid'])."&contact_uuid=".escape($contact_uuid_to).escape($back)."'" : null;
-			echo "<tr ".$tr_link.">\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$row['item_qty']."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".number_format($row['item_unit_price'], 2)."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$item_desc."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".number_format(($row['item_qty'] * $row['item_unit_price']), 2)."&nbsp;</td>\n";
-			echo "	<td class='list_control_icons'>\n";
-			if (permission_exists('invoice_item_edit')) {
-				echo 	"<a href='invoice_item_edit.php?invoice_uuid=".escape($row['invoice_uuid'])."&id=".escape($row['invoice_item_uuid'])."&contact_uuid=".escape($contact_uuid_to).escape($back)."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
-			}
-			if (permission_exists('invoice_item_delete')) {
-				echo 	"<a href='invoice_item_delete.php?invoice_uuid=".escape($row['invoice_uuid'])."&id=".escape($row['invoice_item_uuid'])."&contact_uuid=".escape($contact_uuid_to).escape($back)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
-			}
-			echo "	</td>\n";
-			echo "</tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		} //end foreach
-		unset($sql, $result, $row_count);
-	} //end if results
-
-	echo "<tr>\n";
-	echo "<td colspan='6' align='left'>\n";
-	echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
-	echo "		<td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
-	echo "		<td width='33.3%' align='right'>\n";
-	if (permission_exists('invoice_item_add')) {
-		echo "			<a href='invoice_item_edit.php?invoice_uuid=".$_GET['id']."&contact_uuid=".escape($contact_uuid_to).escape($back)."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-	}
-	else {
-		echo "			&nbsp;\n";
-	}
-	echo "		</td>\n";
-	echo "	</tr>\n";
- 	echo "	</table>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	echo "<br /><br />";
-
-//include the footer
-	require_once "resources/footer.php";
-
-?>

+ 0 - 347
invoices/invoice_pdf.php

@@ -1,347 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (if_group("admin") || if_group("superadmin")) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//action invoice_uuid
-	if (isset($_REQUEST["id"])) {
-		$invoice_uuid = check_str($_REQUEST["id"]);
-		$type = check_str($_REQUEST["type"]);
-	}
-
-//get the invoice details
-	$sql = "select * from v_invoices ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and invoice_uuid = '$invoice_uuid' ";
-	$sql .= "order by invoice_uuid desc ";
-	$sql .= "limit 1 ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	if ($prep_statement) {
-		$prep_statement->execute();
-		$row = $prep_statement->fetch();
-		$invoice_number = $row['invoice_number'];
-		$contact_uuid_from = $row['contact_uuid_from'];
-		$contact_uuid_to = $row['contact_uuid_to'];
-		$invoice_date = $row['invoice_date'];
-		$invoice_purchase_order_number = $row['invoice_purchase_order_number'];
-		$invoice_currency = $row['invoice_currency'];
-		$invoice_note = $row['invoice_note'];
-		unset ($prep_statement);
-	}
-
-//set the default currency
-	if (strlen($invoice_currency) == 0) {
-		$invoice_currency = 'USD';
-	}
-
-//prepare the invoice date
-	$invoice_date = date("d", strtotime($invoice_date)).' '.date("M", strtotime($invoice_date)).' '.date("Y", strtotime($invoice_date));
-
-//prepare to use fpdf
-	define('FPDF_FONTPATH',$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/fpdf/font/');
-	require('resources/fpdf/fpdf.php');
-
-//create the fpdf object and add the first page
-	$pdf = new FPDF();
-	$pdf->AddPage();
-	$pdf->SetFont('Arial','B',9);
-
-//get contact from name
-	$sql = "select * from v_contacts ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and contact_uuid = '$contact_uuid_from' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$from_contact_organization = $row["contact_organization"];
-		$from_contact_name_given = $row["contact_name_given"];
-		$from_contact_name_family = $row["contact_name_family"];
-		break; //limit to 1 row
-	}
-	unset ($prep_statement);
-
-//get contact from address
-	$sql = "select * from v_contact_addresses ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and contact_uuid = '$contact_uuid_from' ";
-	$sql .= "order by address_primary desc ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$from_address_type = $row["address_type"];
-		$from_address_street = $row["address_street"];
-		$from_address_extended = $row["address_extended"];
-		$from_address_locality = $row["address_locality"];
-		$from_address_region = $row["address_region"];
-		$from_address_postal_code = $row["address_postal_code"];
-		$from_address_country = $row["address_country"];
-		break; //limit to 1 row
-	}
-	unset ($prep_statement);
-	$pdf->SetY(10);
-	$pdf->SetFont('Arial','B',9);
-	if (strlen($from_contact_organization) > 0) {
-		$pdf->Cell(40,5,$from_contact_organization);
-		$pdf->Ln();
-	}
-	else {
-		if (strlen($from_contact_name_given.$from_contact_name_family) > 0) {
-			$pdf->Cell(40,5,$from_contact_name_given.' '.$from_contact_name_family);
-			$pdf->Ln();
-		}
-	}
-	$pdf->SetFont('Arial','',9);
-	$pdf->Cell(40,5,$from_address_street.' '.$from_address_extended);
-	$pdf->Ln();
-	$pdf->Cell(40,5,$from_address_locality.', '.$from_address_region.' '.$from_address_country.' '.$from_address_postal_code);
-	$pdf->Ln();
-	$pdf->Ln();
-
-//get contact to name
-	$sql = "select * from v_contacts ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and contact_uuid = '$contact_uuid_to' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$to_contact_organization = $row["contact_organization"];
-		$to_contact_name_given = $row["contact_name_given"];
-		$to_contact_name_family = $row["contact_name_family"];
-	}
-	unset ($prep_statement);
-
-//get contact to address
-	$sql = "select * from v_contact_addresses ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and contact_uuid = '$contact_uuid_to' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	foreach ($result as &$row) {
-		$to_address_type = $row["address_type"];
-		$to_address_street = $row["address_street"];
-		$to_address_extended = $row["address_extended"];
-		$to_address_locality = $row["address_locality"];
-		$to_address_region = $row["address_region"];
-		$to_address_postal_code = $row["address_postal_code"];
-		$to_address_country = $row["address_country"];
-		$to_address_description = $row["address_description"];
-		break; //limit to 1 row
-	}
-	unset ($prep_statement);
-	$pdf->SetY(40);
-	$pdf->SetFont('Arial','B',9);
-	if (strlen($to_contact_organization) > 0) {
-		$pdf->Cell(40,5,$to_contact_organization);
-		$pdf->Ln();
-	}
-	else {
-		if (strlen($to_contact_name_given.$to_contact_name_family) > 0) {
-			$pdf->Cell(40,5,$to_contact_name_given.' '.$to_contact_name_family);
-			$pdf->Ln();
-		}
-	}
-	$pdf->SetFont('Arial','',9);
-	$pdf->Cell(40,5,$to_address_street.' '.$to_address_extended);
-	$pdf->Ln();
-	if (strtolower($to_address_country) == 'portugal') {
-		$pdf->Cell(40,5,$to_address_postal_code.' '.$to_address_locality.' '.$to_address_region.' '.$to_address_country);
-	}
-	else {
-		$pdf->Cell(40,5,$to_address_locality.', '.$to_address_region.' '.$to_address_country.' '.$to_address_postal_code);
-	}
-	$pdf->Ln();
-	$pdf->Cell(40,5,$to_address_description);
-	$pdf->Ln();
-	$pdf->Ln();
-	$pdf->Ln();
-
-//invoice info
-	$pdf->SetY(10);
-	$pdf->Cell(150,10,'');
-	$pdf->SetFont('Arial','',23);
-	if ($type == "quote") {
-		$pdf->Cell(40,10,$text['label-quote']);	
-	}
-	else {
-		$pdf->Cell(40,10,$text['label-invoice']);
-	}
-	$pdf->Ln();
-	$pdf->SetFont('Arial','',9);
-	$pdf->Cell(150,5,'');
-	$pdf->Cell(40,5,$text['label-invoice_date'].' '.$invoice_date);
-	$pdf->Ln();
-	$pdf->Cell(150,5,'');
-	$pdf->Cell(40,5,$text['label-invoice_number'].' '.$invoice_number);
-	$pdf->Ln();
-	if (strlen($invoice_purchase_order_number) > 0) {
-		$pdf->Cell(150,5,'');
-		$pdf->Cell(40,5,$text['label-invoice_purchase_order_number'].' '.$invoice_purchase_order_number);
-		$pdf->Ln();
-	}
-
-	$pdf->Ln();
-	$pdf->Ln();
-
-//set the vertical position
-	$pdf->SetY(65);
-
-//table headers array
-	$header = array($text['label-item_qty'], $text['label-item_desc'], $text['label-item_unit_price'], $text['label-item_amount']);
-
-//set the table header styles
-	$pdf->SetFillColor(200,200,200);
-	//$pdf->SetTextColor(255);
-	$pdf->SetDrawColor(220,220,220);
-	$pdf->SetLineWidth(0.3);
-
-//set the table cell widths
-	$w[0] = 20;
-	$w[1] = 120;
-	$w[2] = 25;
-	$w[3] = 25;
-	for($i=0;$i<count($header);$i++) {
-		if ($header[$i] == $text['label-item_desc']) {
-			//left align
-			$pdf->Cell($w[$i],5,$header[$i],1,0,'L',true);
-		}
-		else {
-			//center
-			$pdf->Cell($w[$i],5,$header[$i],1,0,'C',true);
-		}
-	}
-	$pdf->Ln();
-
-//set the text and background color
-	$pdf->SetFillColor(224,235,255);
-	$pdf->SetTextColor(0);
-	$pdf->SetFont('Arial','',9);
-
-//itemized list
-	$sql = "select * from v_invoice_items ";
-	$sql .= "where domain_uuid = '$domain_uuid' ";
-	$sql .= "and invoice_uuid = '$invoice_uuid' ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	$fill = false;
-	$total = 0;
-	foreach ($result as &$row) {
-		$item_qty = $row["item_qty"];
-		$item_desc = $row["item_desc"];
-		//$item_desc = str_replace("\n", "<br />", $item_desc);
-		$item_desc = wordwrap($item_desc, 70, "\n");
-		$item_unit_price = $row["item_unit_price"];
-		$item_sub_total = $item_qty * $item_unit_price;
-
-		$item_desc_array = explode ("\n", $item_desc);
-		$x = 0;
-		foreach ($item_desc_array as $line) {
-			//quantity
-				if ($x == 0) {
-					$pdf->Cell($w[0],6,$item_qty,'LR',0,'C',$fill);
-				}
-				else {
-					$pdf->Cell($w[0],6," ",'LR',0,'C',$fill);
-				}
-			//description
-				$pdf->Cell($w[1],6,$line,'LR',0,'L',$fill);
-			//unit price
-				if ($x == 0) {
-					$pdf->Cell($w[2],6,$item_unit_price,'LR',0,'R',$fill);
-				}
-				else {
-					$pdf->Cell($w[2],6," ",'LR',0,'R',$fill);
-				}
-			//amount
-				if ($x == 0) {
-					$pdf->Cell($w[3],6,number_format($item_sub_total,2),'LR',0,'R',$fill);
-				}
-				else {
-					$pdf->Cell($w[3],6," ",'LR',0,'R',$fill);
-				}
-			//line feed
-				$pdf->Ln(6);
-				$x++;
-		}
-		//line seperator
-			//$pdf->Cell(($w[0]+$w[1]+$w[2]+$w[3]),0.3," ",'TBRL',1,'R',$fill);
-		//alternate the fill
-			if ($fill) {
-				$fill = false;
-			}
-			else {
-				$fill = true;
-			}
-		//sub total
-			$total = $total + $item_sub_total;
-	}
-	unset ($prep_statement);
-	//line seperator
-	$pdf->Cell(($w[0]+$w[1]+$w[2]+$w[3]),0.1," ",'TBRL',1,'R',$fill);
-
-//show the total
-	$pdf->Ln();
-	$pdf->SetFont('Arial','B',9);
-	$pdf->Cell($w[0],6,'','',0,'L','');
-	$pdf->Cell($w[1],6,'','',0,'L','');
-	$pdf->Cell($w[2],6,'','',0,'R','');
-	$pdf->Cell($w[3],6,$text['label-invoice_total'].' $'.number_format($total,2).' '.$invoice_currency,'',0,'R','');
-	$pdf->Ln();
-
-	if (strlen($invoice_note) > 0) {
-		$pdf->SetFont('Arial','B',9);
-		$pdf->Cell($w[0],6,$text['label-invoice_notes'],'',0,'L',$fill);
-		$pdf->Ln();
-		$pdf->Cell($w[0],6,''.$invoice_note,'',0,'L',$fill);
-		$pdf->Ln();
-	}
-
-//closing line
-	//$pdf->Cell(array_sum($w),0,'','T');
-
-//show the pdf
-	$pdf->Output();
-
-?>

+ 0 - 198
invoices/invoices.php

@@ -1,198 +0,0 @@
-<?php
-/*
-	FusionPBX
-	Version: MPL 1.1
-
-	The contents of this file are subject to the Mozilla Public License Version
-	1.1 (the "License"); you may not use this file except in compliance with
-	the License. You may obtain a copy of the License at
-	http://www.mozilla.org/MPL/
-
-	Software distributed under the License is distributed on an "AS IS" basis,
-	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-	for the specific language governing rights and limitations under the
-	License.
-
-	The Original Code is FusionPBX
-
-	The Initial Developer of the Original Code is
-	Mark J Crane <[email protected]>
-	Portions created by the Initial Developer are Copyright (C) 2008-2023
-	the Initial Developer. All Rights Reserved.
-
-	Contributor(s):
-	Mark J Crane <[email protected]>
-*/
-
-//includes files
-	require_once dirname(__DIR__, 2) . "/resources/require.php";
-	require_once "resources/check_auth.php";
-
-//check permissions
-	if (permission_exists('invoice_view')) {
-		//access granted
-	}
-	else {
-		echo "access denied";
-		exit;
-	}
-
-//additional includes
-	require_once "resources/header.php";
-	require_once "resources/paging.php";
-
-//add multi-lingual support
-	$language = new text;
-	$text = $language->get();
-
-//get variables used to control the order
-	$order_by = $_GET["order_by"];
-	$order = $_GET["order"];
-
-//get the contact id
-	$contact_uuid = check_str($_REQUEST["id"]);
-
-//show the content
-	echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='50%' align='left' valign='top' nowrap='nowrap'><b>".$text['title-invoices']."</b><br><br></td>\n";
-	echo "		<td width='50%' align=\"right\" valign='top'>\n";
-	if ($contact_uuid != '') {
-		echo "			<input type='button' class='btn' name='' alt='back' onclick=\"history.go(-1);\" value='Back'>\n";
-	}
-	echo "		</td>\n";
-	echo "	</tr>\n";
-	echo "</table>\n";
-
-//prepare to page the results
-	$sql = "SELECT count(*) as num_rows FROM v_invoices ";
-	$sql .= "LEFT OUTER JOIN v_contacts ";
-	$sql .= "ON v_invoices.contact_uuid_to = v_contacts.contact_uuid ";
-	$sql .= "where v_invoices.domain_uuid = '$domain_uuid' ";
-	if (strlen($contact_uuid) > 0) {
-		$sql .= "and v_invoices.contact_uuid_to = '$contact_uuid' ";
-	}
-	$prep_statement = $db->prepare($sql);
-	if ($prep_statement) {
-	$prep_statement->execute();
-		$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
-		if ($row['num_rows'] > 0) {
-			$num_rows = $row['num_rows'];
-		}
-		else {
-			$num_rows = '0';
-		}
-	}
-
-//prepare to page the results
-	$rows_per_page = 150;
-	$param = "";
-	$page = $_GET['page'];
-	if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
-	list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
-	$offset = $rows_per_page * $page;
-
-//get the list
-	$sql = "SELECT * FROM v_invoices ";
-	$sql .= "LEFT OUTER JOIN v_contacts ";
-	$sql .= "ON v_invoices.contact_uuid_to = v_contacts.contact_uuid ";
-	$sql .= "where v_invoices.domain_uuid = '$domain_uuid' ";
-	if (strlen($contact_uuid) > 0) {
-		$sql .= "and v_invoices.contact_uuid_to = '$contact_uuid' ";
-	}
-	if (strlen($order_by) == 0) {
-		$sql .= "order by v_invoices.invoice_number desc ";
-	}
-	else {
-		$sql .= "order by v_invoices.$order_by $order ";
-	}
-	$sql .= "limit $rows_per_page offset $offset ";
-	$prep_statement = $db->prepare(check_sql($sql));
-	$prep_statement->execute();
-	$invoices = $prep_statement->fetchAll(PDO::FETCH_NAMED);
-	unset ($prep_statement, $sql);
-
-//set the row style
-	$c = 0;
-	$row_style["0"] = "row_style0";
-	$row_style["1"] = "row_style1";
-
-//show the invoices
-	echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
-	echo "<tr>\n";
-	echo "<th>&nbsp;</th>\n";
-	echo th_order_by('invoice_number', $text['label-invoice_number'], $order_by, $order);
-	echo th_order_by('invoice_type', $text['label-invoice_type'], $order_by, $order);
-	echo th_order_by('contact_organization', $text['label-contact_to_organization'], $order_by, $order);
-	echo th_order_by('contact_name_given', $text['label-contact_to_given_name'], $order_by, $order);
-	echo th_order_by('contact_name_family', $text['label-contact_to_family_name'], $order_by, $order);
-	echo th_order_by('invoice_date', $text['label-invoice_date'], $order_by, $order);
-	echo "<td align='right' width='42'>\n";
-	if (permission_exists('invoice_add')) {
-		echo "	<a href='invoice_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-	}
-	else {
-		echo "	&nbsp;\n";
-	}
-	echo "</td>\n";
-	echo "<tr>\n";
-
-	if (is_array($invoices)) {
-		foreach($invoices as $row) {
-			$back = ($contact_uuid != '') ? "&back=".urlencode("invoices.php?id=".$contact_uuid) : null;
-			$tr_link = (permission_exists('invoice_edit')) ? "href='invoice_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['invoice_uuid']).escape($back)."'" : null;
-			echo "<tr ".$tr_link.">\n";
-			echo "	<td align='center' valign='middle' class='".$row_style[$c]."' style='padding: 0px 0px 0px 5px;'>";
-			if ($row['invoice_paid'] == 1) {
-				echo "<img src='paid.png' style='width: 16px; height: 16px; border; none;'>";
-			}
-			else {
-				echo "<img src='unpaid.png' style='width: 16px; height: 16px; border; none;'>";
-			}
-			echo "	</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'><a href='invoice_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['invoice_uuid']).escape($back)."' alt='".$text['button-edit']."'>".escape($row['invoice_number'])."</a>&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".$text['label-invoice_type_'.escape($row['invoice_type'])]."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".escape($row['contact_organization'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".escape($row['contact_name_given'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".escape($row['contact_name_family'])."&nbsp;</td>\n";
-			echo "	<td valign='top' class='".$row_style[$c]."'>".escape($row['invoice_date'])."&nbsp;</td>\n";
-			echo "	<td class='list_control_icons'>\n";
-			if (permission_exists('invoice_edit')) {
-				echo 	"<a href='invoice_edit.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['invoice_uuid']).escape($back)."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
-			}
-			if (permission_exists('invoice_delete')) {
-				echo 	"<a href='invoice_delete.php?contact_uuid=".escape($row['contact_uuid'])."&id=".escape($row['invoice_uuid']).escape($back)."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
-			}
-			echo 	"</td>\n";
-			echo "</tr>\n";
-			if ($c==0) { $c=1; } else { $c=0; }
-		} //end foreach
-		unset($invoices);
-	} //end if results
-
-	echo "<tr>\n";
-	echo "<td colspan='10' align='left'>\n";
-	echo "	<table width='100%' cellpadding='0' cellspacing='0'>\n";
-	echo "	<tr>\n";
-	echo "		<td width='33.3%' nowrap='nowrap'>&nbsp;</td>\n";
-	echo "		<td width='33.3%' align='center' nowrap='nowrap'>$paging_controls</td>\n";
-	echo "		<td width='33.3%' align='right'>\n";
-	if (permission_exists('invoice_add')) {
-	echo "			<a href='invoice_edit.php?contact_uuid=".$_GET['id']."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
-	}
-	else {
-		echo "		&nbsp;\n";
-	}
-	echo "		</td>\n";
-	echo "	</tr>\n";
- 	echo "	</table>\n";
-	echo "</td>\n";
-	echo "</tr>\n";
-
-	echo "</table>";
-	echo "<br /><br />";
-
-//include the footer
-	require_once "resources/footer.php";
-
-?>

BIN
invoices/paid.png


BIN
invoices/unpaid.png