diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433
index 4967003..22b2846 100644
--- a/conf/sccpgeneral.xml.v433
+++ b/conf/sccpgeneral.xml.v433
@@ -1196,7 +1196,7 @@ and open the template in the editor. Base Version before all crash :-)
Support the use of regular-expression-based filename remapping
-
+
devicetablesccpdevice
@@ -1205,7 +1205,7 @@ and open the template in the editor. Base Version before all crash :-)
Device Table: This is the devicetable for your realtime configuration. Don't change this unless you know what you are doing and have made all the appropriate changes in the rest of your Asterisk config files. There are two reasonable settings for this - the sccpdevice table or the sccpdeviceconfig view. If you do not want to use the realtime database anymore, you can set this to blank. NOT RECOMMENDED.
-
+
linetablesccpline
diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php
index 530c226..3531a66 100644
--- a/sccpManTraits/helperFunctions.php
+++ b/sccpManTraits/helperFunctions.php
@@ -164,6 +164,14 @@ trait helperfunctions {
return $result;
}
+ function is_assoc($array) {
+ foreach (array_keys($array) as $k => $v) {
+ if ($k !== $v)
+ return true;
+ }
+ return false;
+ }
+
function tftpReadTestFile($remoteFileName, $host = "127.0.0.1")
{
// https://datatracker.ietf.org/doc/html/rfc1350
diff --git a/views/formShowSysDefs.php b/views/formShowSysDefs.php
index f7f4da4..8b2a78f 100644
--- a/views/formShowSysDefs.php
+++ b/views/formShowSysDefs.php
@@ -473,72 +473,70 @@ $thisSccpView = new class{
}
function addElementSL($child, $fvalues, $sccp_defaults, $npref) {
+ // TODO: Unused function. Integrated into SL2. To be removed after full testing.
/*
* Input element Select SLD - Date format
- * SLZ - Time Zone
- *
* SLM - Music on hold
* SLK - System KeySet
* SLP - Dial Paterns
*/
- $day_format = array("D.M.Y", "D.M.YA", "Y.M.D", "YA.M.D", "M-D-Y", "M-D-YA", "D-M-Y", "D-M-YA", "Y-M-D", "YA-M-D", "M/D/Y", "M/D/YA",
- "D/M/Y", "D/M/YA", "Y/M/D", "YA/M/D", "M/D/Y", "M/D/YA");
$res_n = (string)$child ->name;
$res_id = $npref.$res_n;
+ // $select_opt is a simple array for these types.
$select_opt = array();
- $softKeyList = array();
- $dialplan_list = array();
- if (function_exists('music_list')) {
- $moh_list = music_list();
- }
- if (!is_array($moh_list)) {
- $moh_list = array('default');
- }
+
if (!empty($metainfo[$res_n])) {
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metaInfo[$res_n];
}
}
-
if (empty($child->class)) {
$child->class = 'form-control';
}
-
- if ($child['type'] == 'SLD') {
- $select_opt= $day_format;
- }
-
- if ($child['type'] == 'SLM') {
- $select_opt= $moh_list;
- }
- if ($child['type'] == 'SLK') {
- if (empty($softKeyList)) {
+ switch ($child['type']) {
+ case 'SLD':
+ $day_format = array("D.M.Y", "D.M.YA", "Y.M.D", "YA.M.D", "M-D-Y", "M-D-YA", "D-M-Y", "D-M-YA", "Y-M-D", "YA-M-D", "M/D/Y", "M/D/YA",
+ "D/M/Y", "D/M/YA", "Y/M/D", "YA/M/D", "M/D/Y", "M/D/YA");
+ $select_opt= $day_format;
+ break;
+ case 'SLM':
+ if (function_exists('music_list')) {
+ $moh_list = music_list();
+ }
+ if (!is_array($moh_list)) {
+ $moh_list = array('default');
+ }
+ $select_opt= $moh_list;
+ break;
+ case 'SLK':
$softKeyList = \FreePBX::Sccp_manager()->aminterface->sccp_list_keysets();
- }
- $select_opt= $softKeyList;
+ $select_opt= $softKeyList;
+ break;
+ case 'SLP':
+ $dialplan_list = array();
+ foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) {
+ $tmp_id = $tmpkey['id'];
+ $dialplan_list[$tmp_id] = $tmp_id;
+ }
+ $select_opt= $dialplan_list;
+ break;
}
- if ($child['type'] == 'SLP') {
- foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) {
- $tmp_id = $tmpkey['id'];
- $dialplan_list[$tmp_id] = $tmp_id;
+ if (!empty($fvalues[$res_n])) {
+ if (!empty($fvalues[$res_n]['data'])) {
+ $child->value = $fvalues[$res_n]['data'];
}
- $select_opt= $dialplan_list;
}
?>
-
-
+ class . '" id="' . $res_id . '">';
- if (!empty($fvalues[$res_n])) {
- if (!empty($fvalues[$res_n]['data'])) {
- $child->value = $fvalues[$res_n]['data'];
- }
- }
+
foreach ($select_opt as $key) {
echo '';
}
- ?>
-
-
+ ?>
+
+
+
+
+
help);?>
-
+
+
name;
$res_id = $npref.$res_n;
$child->value ='';
+ // $select_opt is an associative array for these types.
if (!empty($metainfo[$res_n])) {
if ($child->meta_help == '1' || $child->help == 'Help!') {
$child->help = $metaInfo[$res_n];
@@ -575,6 +578,15 @@ $thisSccpView = new class{
}
}
$select_opt= $syslangs;
+
+ foreach (array_keys($select_opt) as $k => $v) {
+ if ($k !== $v) {
+ dbug('sys list is an associative array');
+ } else {
+ dbug('sys list is a simple array');
+ }
+ }
+
break;
case 'SLT':
$select_opt= $tftp_lang;
@@ -601,6 +613,32 @@ $thisSccpView = new class{
$select_opt[$key]= $key;
}
}
+ case 'SLM':
+ if (function_exists('music_list')) {
+ $moh_list = music_list();
+ }
+ if (!is_array($moh_list)) {
+ $moh_list = array('default');
+ }
+ $select_opt= $moh_list;
+ break;
+ case 'SLD':
+ $day_format = array("D.M.Y", "D.M.YA", "Y.M.D", "YA.M.D", "M-D-Y", "M-D-YA", "D-M-Y", "D-M-YA", "Y-M-D", "YA-M-D", "M/D/Y", "M/D/YA",
+ "D/M/Y", "D/M/YA", "Y/M/D", "YA/M/D", "M/D/Y", "M/D/YA");
+ $select_opt= $day_format;
+ break;
+ case 'SLK':
+ $softKeyList = \FreePBX::Sccp_manager()->aminterface->sccp_list_keysets();
+ $select_opt= $softKeyList;
+ break;
+ case 'SLP':
+ $dialplan_list = array();
+ foreach (\FreePBX::Sccp_manager()->getDialPlanList() as $tmpkey) {
+ $tmp_id = $tmpkey['id'];
+ $dialplan_list[$tmp_id] = $tmp_id;
+ }
+ $select_opt= $dialplan_list;
+ break;
}
if (empty($child->class)) {
$child->class = 'form-control';
@@ -618,20 +656,25 @@ $thisSccpView = new class{
?>