Skip to content

Commit

Permalink
Merge pull request #623 from mikopbx/develop
Browse files Browse the repository at this point in the history
Fix drop-down
  • Loading branch information
jorikfon authored Sep 13, 2023
2 parents dc2e12d + d0faa2f commit 7033c3f
Show file tree
Hide file tree
Showing 31 changed files with 258 additions and 76 deletions.
15 changes: 10 additions & 5 deletions sites/admin-cabinet/assets/js/pbx/PbxAPI/extensionsAPI.js

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions sites/admin-cabinet/assets/js/src/PbxAPI/extensionsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@ const Extensions = {
* This function drops all caches if data changes.
*/
cbOnDataChanged() {
sessionStorage.removeItem('/pbxcore/api/extensions/getForSelect?type=all');
sessionStorage.removeItem('/pbxcore/api/extensions/getForSelect?type=route');
sessionStorage.removeItem('/pbxcore/api/extensions/getForSelect?type=internal');
sessionStorage.removeItem('/pbxcore/api/extensions/getForSelect?type=phones');
const pattern = '/pbxcore/api/extensions/getForSelect';
for (let i = 0; i < sessionStorage.length; i++) {
const key = sessionStorage.key(i);

// Check if the key matches the pattern
if (key && key.startsWith(pattern)) {
sessionStorage.removeItem(key);
}
}
},

/**
Expand Down Expand Up @@ -259,7 +264,7 @@ const Extensions = {
* @param {string} userId - The ID of the user associated with the extension.
*/
checkAvailability(oldNumber, newNumber, cssClassName = 'extension', userId = '') {
if (oldNumber === newNumber || newNumber.length===0) {
if (oldNumber === newNumber || newNumber.length === 0) {
$(`.ui.input.${cssClassName}`).parent().removeClass('error');
$(`#${cssClassName}-error`).addClass('hidden');
return;
Expand All @@ -273,19 +278,19 @@ const Extensions = {
},
successTest: PbxApi.successTest,
onSuccess(response) {
if (response.data['available']===true) {
if (response.data['available'] === true) {
$(`.ui.input.${cssClassName}`).parent().removeClass('error');
$(`#${cssClassName}-error`).addClass('hidden');
} else if (userId.length > 0 && response.data['userId'] === userId) {
$(`.ui.input.${cssClassName}`).parent().removeClass('error');
$(`#${cssClassName}-error`).addClass('hidden');
} else {
$(`.ui.input.${cssClassName}`).parent().addClass('error');
let message =`${globalTranslate.ex_ThisNumberIsNotFree}:&nbsp`;
if (globalTranslate[response.data['represent']]!==undefined){
let message = `${globalTranslate.ex_ThisNumberIsNotFree}:&nbsp`;
if (globalTranslate[response.data['represent']] !== undefined) {
message = globalTranslate[response.data['represent']];
} else {
message +=response.data['represent'];
message += response.data['represent'];
}
$(`#${cssClassName}-error`).removeClass('hidden').html(message);
}
Expand Down Expand Up @@ -374,7 +379,7 @@ const Extensions = {

// Fetch phone representations using API call
PbxApi.ExtensionsGetPhonesRepresent(numbers,
(response)=>{
(response) => {
Extensions.cbAfterGetPhonesRepresent(response, htmlClass)
}
);
Expand All @@ -386,7 +391,7 @@ const Extensions = {
* @param {Object} response - The response object from the API call.
* @param {string} htmlClass - The HTML class for element identification.
*/
cbAfterGetPhonesRepresent(response, htmlClass){
cbAfterGetPhonesRepresent(response, htmlClass) {
const $preprocessedObjects = $(`.${htmlClass}`);

// Check if the response is valid and process elements accordingly
Expand All @@ -410,7 +415,7 @@ const Extensions = {
updatePhoneRepresent(number) {
const numbers = [];
numbers.push(number);
PbxApi.ExtensionsGetPhonesRepresent(numbers,(response)=>{
PbxApi.ExtensionsGetPhonesRepresent(numbers, (response) => {
{
// Check if the response is valid and contains the required data
if (response !== undefined
Expand Down
4 changes: 3 additions & 1 deletion src/AdminCabinet/Forms/BaseForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

namespace MikoPBX\AdminCabinet\Forms;


use MikoPBX\Common\Providers\PBXConfModulesProvider;
use MikoPBX\Modules\Config\WebUIConfigInterface;
use Phalcon\Forms\Element\TextArea;
use Phalcon\Forms\Form;

/**
* @property \MikoPBX\Common\Providers\TranslationProvider translation
*/
abstract class BaseForm extends Form
{

Expand Down
2 changes: 1 addition & 1 deletion src/AdminCabinet/Forms/GeneralSettingsEditForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function initialize($entity = null, $options = null): void
case 'PBXFeatureDigitTimeout':
case 'PBXFeatureAtxferNoAnswerTimeout':
case '***ALL NUMBERIC ABOVE***':
$this->add(new Numeric($key, ['value' => $value, 'style'=>'width:100px;']));
$this->add(new Numeric($key, ['value' => $value, 'style'=>'width:130px;']));
break;
case PbxSettingsConstants::SSH_PASSWORD:
$this->add(new Password($key, ['value' => self::HIDDEN_PASSWORD]));
Expand Down
5 changes: 3 additions & 2 deletions src/Common/Messages/az.php
Original file line number Diff line number Diff line change
Expand Up @@ -1116,9 +1116,9 @@
'ex_Danish' => 'Dansk',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 rəqəm',
'cr_pinCode' => 'Konfransın PIN kodu',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipRefresh' => 'Ən son jurnal faylını əldə edin',
'sd_ToolTipAutoUpdate' => 'Ekran məzmununu avtomatik yeniləyin',
'sd_ToolTipErase' => 'Faylı təmizləyin',
'ex_dropdownCategory_PARKING' => 'parkinq yerləri',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'March' => 'Březen',
'April' => 'Duben',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_v2' => 'Chyby autorizace SIP',
'f2b_Jail_asterisk_security_log_v2' => 'Chyby autorizace SIP (security_log)',
'f2b_Jail_asterisk_error_v2' => 'Chyby autorizace SIP (chyba)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 číslic',
'cr_pinCode' => 'Konferenční PIN',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipRefresh' => 'Získejte nejnovější soubor protokolu',
'sd_ToolTipAutoUpdate' => 'Automaticky aktualizovat obsah obrazovky',
'sd_ToolTipErase' => 'Vymazat soubor',
'ex_dropdownCategory_PARKING' => 'parkovací místa',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/da.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'Oct' => 'oktober',
'Nov' => 'november',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'SIP-godkendelsesfejl (security_log)',
'f2b_Jail_asterisk_error_v2' => 'SIP-godkendelsesfejl (fejl)',
'f2b_Jail_asterisk_public_v2' => 'SIP-godkendelsesfejl (offentlige)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 cifre',
'cr_pinCode' => 'Konference PIN',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipErase' => 'Ryd fil',
'sd_ToolTipDownload' => 'Download logfil',
'sd_ToolTipRefresh' => 'Hent den seneste logfil',
'ex_dropdownCategory_PARKING' => 'parkeringspladser',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'January' => 'Januar',
'February' => 'Februar',
Expand Down Expand Up @@ -1121,7 +1121,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'SIP-Autorisierungsfehler (security_log)',
'f2b_Jail_asterisk_error_v2' => 'SIP-Autorisierungsfehler (Fehler)',
'f2b_Jail_asterisk_public_v2' => 'SIP-Autorisierungsfehler (öffentlich)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 Ziffern',
'cr_pinCode' => 'Konferenz-PIN',
Expand Down Expand Up @@ -1203,4 +1203,5 @@
'sd_ToolTipRefresh' => 'Holen Sie sich die neueste Protokolldatei',
'sd_ToolTipAutoUpdate' => 'Bildschirminhalte automatisch aktualisieren',
'sd_ToolTipErase' => 'Datei löschen',
'ex_dropdownCategory_PARKING' => 'Parkplätze',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/el.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'Now' => 'Τώρα',
'Today' => 'Σήμερα',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'Σφάλματα εξουσιοδότησης SIP (security_log)',
'f2b_Jail_asterisk_error_v2' => 'Σφάλματα εξουσιοδότησης SIP (σφάλμα)',
'f2b_Jail_asterisk_public_v2' => 'Σφάλματα εξουσιοδότησης SIP (δημόσια)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 ψηφία',
'cr_pinCode' => 'PIN συνδιάσκεψης',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipRefresh' => 'Λάβετε το πιο πρόσφατο αρχείο καταγραφής',
'sd_ToolTipAutoUpdate' => 'Αυτόματη ενημέρωση περιεχομένου οθόνης',
'sd_ToolTipErase' => 'Καθαρο ΑΡΧΕΙΟ',
'ex_dropdownCategory_PARKING' => 'θέσεις στάθμευσης',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'January' => 'January',
'February' => 'February',
Expand Down Expand Up @@ -1121,7 +1121,7 @@
'f2b_Jail_asterisk_v2' => 'SIP authorization errors',
'f2b_Jail_asterisk_error_v2' => 'SIP authorization errors (error)',
'f2b_Jail_asterisk_public_v2' => 'SIP authorization errors (public)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 digits',
'cr_pinCode' => 'Conference PIN',
Expand Down Expand Up @@ -1203,4 +1203,5 @@
'sd_ToolTipRefresh' => 'Get the latest log file',
'sd_ToolTipAutoUpdate' => 'Automatically update screen content',
'sd_ToolTipErase' => 'Clear file',
'ex_dropdownCategory_PARKING' => 'parking slots',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'mm_SSHConsole' => 'Consola SSH',
'ex_Email' => 'Correo electrónico',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'Errores de autorización SIP (security_log)',
'f2b_Jail_asterisk_error_v2' => 'Errores de autorización SIP (error)',
'f2b_Jail_asterisk_v2' => 'Errores de autorización SIP',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 dígitos',
'cr_pinCode' => 'PIN de conferencia',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipRefresh' => 'Obtenga el archivo de registro más reciente',
'sd_ToolTipAutoUpdate' => 'Actualizar automáticamente el contenido de la pantalla',
'sd_ToolTipErase' => 'Archivo vacio',
'ex_dropdownCategory_PARKING' => 'plazas de aparcamiento',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'January' => 'Janvier',
'sntry_SuccessMessage' => 'Merci pour votre aide!',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_ami_v2' => 'Erreurs d\'autorisation AMI ou AJAM',
'f2b_Jail_asterisk_v2' => 'Erreurs d\'autorisation SIP',
'f2b_Jail_asterisk_security_log_v2' => 'Erreurs d\'autorisation SIP (security_log)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 chiffres',
'cr_pinCode' => 'NIP de la conférence',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipDownload' => 'Télécharger le fichier journal',
'sd_ToolTipRefresh' => 'Obtenez le dernier fichier journal',
'sd_ToolTipAutoUpdate' => 'Mettre à jour automatiquement le contenu de l\'écran',
'ex_dropdownCategory_PARKING' => 'places de stationnement',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/it.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'BreadcrumbAsteriskManagersmodify' => 'Configurazione dell\'account',
'or_PatternToMatch' => 'La regola funzionerà se',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_error_v2' => 'Errori di autorizzazione SIP (errore)',
'f2b_Jail_asterisk_v2' => 'Errori di autorizzazione SIP',
'f2b_Jail_asterisk_public_v2' => 'Errori di autorizzazione SIP (pubblici)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 cifre',
'cr_pinCode' => 'PIN conferenza',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipDownload' => 'Scarica il file di registro',
'sd_ToolTipRefresh' => 'Ottieni il file di registro più recente',
'sd_ToolTipAutoUpdate' => 'Aggiorna automaticamente il contenuto dello schermo',
'ex_dropdownCategory_PARKING' => 'posti auto',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/ja.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'November' => '11月',
'December' => '12月',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'SIP 認証エラー (security_log)',
'f2b_Jail_asterisk_error_v2' => 'SIP認証エラー(エラー)',
'f2b_Jail_asterisk_public_v2' => 'SIP 認証エラー (パブリック)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11桁',
'cr_pinCode' => '会議暗証番号',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipDownload' => 'ログファイルをダウンロードする',
'sd_ToolTipRefresh' => '最新のログファイルを取得する',
'sd_ToolTipErase' => 'クリアファイル',
'ex_dropdownCategory_PARKING' => '駐車スロット',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/ka.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
'qf_Qualify' => 'შეინარჩუნეთ NAT სესია',
'qf_Frequency' => 'გაგზავნის სიხშირე წამებში:',
Expand Down Expand Up @@ -1118,7 +1118,7 @@
'f2b_Jail_asterisk_security_log_v2' => 'SIP ავტორიზაციის შეცდომები (security_log)',
'f2b_Jail_asterisk_error_v2' => 'SIP ავტორიზაციის შეცდომები (შეცდომა)',
'f2b_Jail_asterisk_public_v2' => 'SIP ავტორიზაციის შეცდომები (საჯარო)',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Română',
'gs_ElevenDigthts' => '11 ციფრი',
'cr_pinCode' => 'კონფერენციის PIN',
Expand Down Expand Up @@ -1200,4 +1200,5 @@
'sd_ToolTipRefresh' => 'მიიღეთ უახლესი ჟურნალის ფაილი',
'sd_ToolTipAutoUpdate' => 'ეკრანის შინაარსის ავტომატურად განახლება',
'sd_ToolTipErase' => 'ფაილის გასუფთავება',
'ex_dropdownCategory_PARKING' => 'პარკირების ადგილები',
];
5 changes: 3 additions & 2 deletions src/Common/Messages/nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@
'Subnet masks are to be entered as bit counts (as in CIDR notation).' => 'Subnetmasker in CIDR-indeling (1-32)',
'mm_Update' => 'PBX-update',
'adv_PopupHeader' => 'De volgende problemen zijn gevonden:',
'ex_Azərbaycan' => 'Azərbaycan',
'ex_Azerbaijan' => 'Azərbaycan',
'ex_Romanian' => 'Romana',
'upd_EnterIHaveBackupPhrasePreText' => 'Voer de volgende zin in het invoerveld in om het systeem bij te werken:',
'upd_EnterIHaveBackupPhrase' => 'Ja, ik heb een back-up',
Expand Down Expand Up @@ -1162,7 +1162,7 @@
'ex_Dutch' => 'Nederlands',
'ex_Swedish' => 'Svenska',
'ex_Czech' => 'Čeština',
'ex_Turkish' => 'Türk',
'ex_Turkish' => 'Türkçe',
'ex_Georgian' => 'ქართველი',
/*
* MikoPBX - free phone system for small business
Expand Down Expand Up @@ -1250,4 +1250,5 @@
'sd_ToolTipDownload' => 'Logbestand downloaden',
'sd_ToolTipRefresh' => 'Haal het nieuwste logbestand op',
'sd_ToolTipErase' => 'Bestand wissen',
'ex_dropdownCategory_PARKING' => 'parkeerplaatsen',
];
Loading

0 comments on commit 7033c3f

Please sign in to comment.