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
This commit is contained in:
stevenA 2021-12-29 12:42:57 +01:00
parent 1489968b9e
commit 0bc2eed76b
5 changed files with 19 additions and 9 deletions

View file

@ -1452,7 +1452,7 @@ and open the template in the editor. Base Version before all crash :-)
<help>Activate the callforward NOANSWER stuff and softkeys. Default is On</help>
</item>
<item type="IS" id="5" seq="99">
<name>dnd</name>
<name>dndFeature</name>
<label>DND Button on Device</label>
<default>off</default>
<button value="on">On</button>

View file

@ -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;

View file

@ -1,7 +1,7 @@
<module>
<rawname>sccp_manager</rawname>
<name>SCCP Manager</name>
<version>14.3.0.18</version>
<version>14.3.0.19</version>
<type>setup</type>
<category>SCCP Connectivity</category>
<publisher>Steve Lad, Alex GP</publisher>

View file

@ -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;

View file

@ -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) {