From 0bc2eed76baf4a49951b27fba95467aa5e9d2fcb Mon Sep 17 00:00:00 2001 From: stevenA Date: Wed, 29 Dec 2021 12:42:57 +0100 Subject: [PATCH] Fix dndFeature setting not saved dndFeature setting was not saved check for existence of chan-sccp flags add helper to list chan-sccp flags fix version compatibility check update version to 14.3.0.19 --- conf/sccpgeneral.xml.v433 | 2 +- install.php | 8 +++++--- module.xml | 2 +- sccpManClasses/aminterface.class.php | 7 +++---- sccpManTraits/helperFunctions.php | 9 +++++++++ 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/conf/sccpgeneral.xml.v433 b/conf/sccpgeneral.xml.v433 index 5f2d23e..8c99837 100644 --- a/conf/sccpgeneral.xml.v433 +++ b/conf/sccpgeneral.xml.v433 @@ -1452,7 +1452,7 @@ and open the template in the editor. Base Version before all crash :-) Activate the callforward NOANSWER stuff and softkeys. Default is On - dnd + dndFeature off diff --git a/install.php b/install.php index a852db1..2634109 100644 --- a/install.php +++ b/install.php @@ -1109,11 +1109,13 @@ function cleanUpSccpSettings() { // get chan-sccp defaults - foreach (array('general','line', 'device') as $section) { + foreach (array('general','device','line') as $section) { $sysConfig = $aminterface->getSCCPConfigMetaData($section); foreach ($sysConfig['Options'] as $valueArray) { - if ($valueArray['Flags'][0] == 'Obsolete' || $valueArray['Flags'][0] == 'Deprecated') { - continue; + if (isset($valueArray['Flags'])) { + if ($valueArray['Flags'][0] == 'Obsolete' || $valueArray['Flags'][0] == 'Deprecated') { + continue; + } } if (isset($sysConfiguration[$valueArray['Name']])) { continue; diff --git a/module.xml b/module.xml index af2215b..a5776ce 100644 --- a/module.xml +++ b/module.xml @@ -1,7 +1,7 @@ sccp_manager SCCP Manager - 14.3.0.18 + 14.3.0.19 setup SCCP Connectivity Steve Lad, Alex GP diff --git a/sccpManClasses/aminterface.class.php b/sccpManClasses/aminterface.class.php index 5bd6929..6c47547 100644 --- a/sccpManClasses/aminterface.class.php +++ b/sccpManClasses/aminterface.class.php @@ -444,10 +444,9 @@ class aminterface //Initialise result array $result = array( 'RevisionHash' => '', 'vCode' => 0, 'RevisionNum' => 0, 'buildInfo' => '', 'Version' => 0); $metadata = $this->getSCCPConfigMetaData(); - if (isset($metadata['Version'])) { $result['Version'] = $metadata['Version']; - $version_parts = explode('.', $metadata['Version']); + $version_parts = array_map('intval',explode('.', $metadata['Version'])); if ($version_parts[0] === 4) { switch ($version_parts[1]) { case 1: @@ -456,9 +455,9 @@ class aminterface case 2: $result['vCode'] = 420; break; - case 3. . .5: + case 3: $result['vCode'] = 430; - if($version_parts[2] == 3){ + if($version_parts[2] >= 3){ $result['vCode'] = 433; } break; diff --git a/sccpManTraits/helperFunctions.php b/sccpManTraits/helperFunctions.php index f081c57..b30cebb 100644 --- a/sccpManTraits/helperFunctions.php +++ b/sccpManTraits/helperFunctions.php @@ -265,6 +265,15 @@ trait helperfunctions { return true; } + public function getChanSccpSettings() { + // This is a utility function for debug only, and is not used by core code + foreach (array('general','line', 'device') as $section) { + $sysConfig = $this->aminterface->getSCCPConfigMetaData($section); + dbug($sysConfig); + } + unset($sysConfig); + } + public function initVarfromXml() { if ((array) $this->xml_data) { foreach ($this->xml_data->xpath('//page_group') as $item) {