Fix update settings page on save

This commit is contained in:
stevenA 2022-01-10 11:17:39 +01:00
parent ea6b7b3783
commit a3eb87610c
3 changed files with 20 additions and 7 deletions

View file

@ -110,7 +110,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
if ($freepbx == null) {
throw new Exception("Not given a FreePBX Object");
}
dbug('__construct called', debug_backtrace(2));
$this->class_error = array();
$this->FreePBX = $freepbx;
$this->db = $freepbx->Database;
@ -136,11 +136,20 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
return;
}
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); //Initialise core settings
$this->initializeSccpPath(); //Set required Paths
$this->updateTimeZone(); // Get timezone from FreePBX
//$this->findInstLangs();
$this->saveSccpSettings();
//if (!isset(\FreePBX::create()->Sccp_manager)) {
// This test is a workaround for a bug in BMO/GUIHooks class where
// doBMOConfigPage is called with an incorrect class (class path instead of class)
// The __Get override then determines that the class does not exist and so creates a new class Which
// in turn calls this __construct. This test can be removed when the bug is fixed in FreePBX.
dbug('__construct called', debug_backtrace(2));
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); //Initialise core settings
$this->initializeSccpPath(); //Set required Paths
$this->updateTimeZone(); // Get timezone from FreePBX
//$this->findInstLangs();
$this->saveSccpSettings();
//}
}
/*

View file

@ -15,6 +15,11 @@ if (!defined('FREEPBX_IS_AUTH')) {
// is only for DISPLAYING things. MVC is a cool idea, ya know?
//
dbug(debug_backtrace());
if (isset(\FreePBX::create()->Sccp_manager)) {
dbug('is set');
} else {
dbug('is not set');
}
$spage = FreePBX::create()->Sccp_manager;
if (empty($spage->class_error)) {
$display_page = $spage->phoneShowPage();

View file

@ -6,7 +6,6 @@ trait bmoFunctions {
//Need to reload freePBX for modifications below to work
//want to catch extensions
public static function myConfigPageInits() {
return array('sccpsettings', 'sccp_phone','sccp_adv');
}