From 93fe6d45e1771f0cfc46b31e3e753166f2e8b696 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Fri, 2 Jul 2021 12:27:06 +0200 Subject: [PATCH] Extend defaults to all pages Change enum in installer to correspond to chan-sccp --- Sccp_manager.class.php | 4 +++- assets/js/sccp_manager.js | 1 - conf/sccpgeneral.xml.v433 | 4 ++-- install.php | 6 +++--- views/formShowSysDefs.php | 9 ++++++--- views/server.device.php | 11 ++++++----- views/server.setting.php | 2 +- 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 2dcb4d1..4a31bbf 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -169,7 +169,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { if ((array) $this->xml_data) { foreach ($this->xml_data->xpath('//page_group[@name="' . $group_name . '"]') as $item) { // TODO: Clean up below after debug - if (($group_name == 'sccp_general') || ($group_name == 'sccp_qos_config') || ($group_name =='sccp_dev_config')) { + if (($group_name == 'sccp_general') || ($group_name == 'sccp_qos_config') || + ($group_name =='sccp_dev_config') || ($group_name =='sccp_dev_group_config') || + ($group_name =='sccp_hotline_config') || ($group_name =='sccp_dev_softkey') || ($group_name =='sccp_dev_advconfig')) { $htmlret = load_view(__DIR__ . '/views/formShowSysDefs.php', array( 'itm' => $item, 'h_show' => $show_Header, diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index c8633b3..5e14d6a 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -1075,7 +1075,6 @@ $(".sccp-restore").click(function() { edit_style.display = 'block'; if ($(this).data("type") === 'radio') { // simulate read only for checkboxes - $(':radio:not(:checked)').attr('disabled', true) return; } diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 5cfe3dc..6569390 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -342,8 +342,8 @@ and open the template in the editor. Base Version before all crash :-) echocancel off - - + + Echo Cancel: Echo Cancellation (On or Off). diff --git a/install.php b/install.php index 2c658d3..33a2c48 100644 --- a/install.php +++ b/install.php @@ -171,7 +171,7 @@ function Get_DB_config($sccp_compatible) 'disallow' => array('create' => "VARCHAR(255) NULL DEFAULT NULL"), 'allow' => array('create' => "VARCHAR(255) NULL DEFAULT NULL"), 'id' => array('create' => 'MEDIUMINT(9) NOT NULL AUTO_INCREMENT, ADD UNIQUE(id);', 'modify' => "MEDIUMINT(9)", 'index' => 'id'), - 'echocancel' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), + 'echocancel' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), 'silencesuppression' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), 'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' => "reject") ), @@ -253,7 +253,7 @@ function Get_DB_config($sccp_compatible) '_callwaiting_tone' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_callanswerorder' => array('create' => "enum('oldestfirst','latestfirst') NOT NULL default 'latestfirst'", 'modify' => "enum('oldestfirst','latestfirst')"), - '_echocancel' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"), + '_echocancel' => array('create' => "enum('yes','no') NOT NULL default 'yes'", 'modify' => "enum('yes','no')"), '_silencesuppression' => array('create' => "VARCHAR(20) NULL default null", 'modify' => "VARCHAR(20)"), '_sccp_tos' => array('create' => "VARCHAR(11) NOT NULL default '0x68'", 'modify' => "VARCHAR(11)"), '_sccp_cos' => array('create' => "VARCHAR(11) NOT NULL default '0x4'", 'modify' => "VARCHAR(11)"), @@ -443,7 +443,7 @@ function InstallDB_updateSchema($db_config) } } if (!empty($sql_modify)) { - outn("
  • " . _("Modifying table columns") . $tabl_name ."
  • "); + outn("
  • " . _("Modifying table columns ") . $tabl_name ."
  • "); $sql_modify = "ALTER TABLE {$tabl_name} " . substr($sql_modify, 0, -2); try { diff --git a/views/formShowSysDefs.php b/views/formShowSysDefs.php index a22e7cd..32f793a 100644 --- a/views/formShowSysDefs.php +++ b/views/formShowSysDefs.php @@ -118,16 +118,16 @@ foreach ($items as $child) {
    xpath('input') as $value) { $res_n = (string)$value->name; $res_name = $npref . $res_n; //if (!empty($fvalues[$res_n])) { + $value->value = $fvalues[$res_n]['data']; if (!empty($fvalues[$res_n]['data'])) { if (!empty($sccp_defaults[$res_n]['systemdefault']) && ($sccp_defaults[$res_n]['systemdefault'] != $fvalues[$res_n]['data'])) { $usingSysDefaults = false; - } - $value->value = $fvalues[$res_n]['data']; + } } //} // Default to chan-sccp defaults, not xml defaults. @@ -144,6 +144,9 @@ foreach ($items as $child) { echo $child->nameseparator; } // Output current value + if (empty($value->value)) { + echo "Value not found for {$res_n}"; + } echo $value->value; $i ++; } diff --git a/views/server.device.php b/views/server.device.php index 21838cb..dc4f74a 100644 --- a/views/server.device.php +++ b/views/server.device.php @@ -22,10 +22,11 @@ $def_val_line = $this->getTableDefaults('sccpline'); $def_val_device = $this->getTableDefaults('sccpdevice'); - echo $this->showGroup('sccp_dev_config', 1, 'sccpdevice', $def_val_device); - echo $this->showGroup('sccp_dev_group_config', 1, 'sccpline', $def_val_line); - echo $this->showGroup('sccp_dev_advconfig', 1, 'sccpdevice', $def_val_device); - echo $this->showGroup('sccp_dev_softkey', 1, 'sccpdevice', $def_val_device); - echo $this->showGroup('sccp_hotline_config', 1, 'sccpdevice', $def_val_device); + //echo $this->showGroup('sccp_dev_config', 1, 'sccpdevice', $def_val_device); + echo $this->showGroup('sccp_dev_config', 1); + echo $this->showGroup('sccp_dev_group_config', 1); + echo $this->showGroup('sccp_dev_advconfig', 1); + echo $this->showGroup('sccp_dev_softkey', 1); + echo $this->showGroup('sccp_hotline_config', 1); ?> diff --git a/views/server.setting.php b/views/server.setting.php index c2ca156..8de4a20 100644 --- a/views/server.setting.php +++ b/views/server.setting.php @@ -41,7 +41,7 @@