Reversions and corrections to previous commit
Restore saveSccpSettings to Sccp_Manager construct (deleted in error) Initialise ntp_timezone without check (may have been changed externally) Load xml data in ShowGroup instead of construct.
This commit is contained in:
parent
ff1c451fe1
commit
e841c7cb40
|
@ -143,6 +143,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
$this->initializeSccpPath(); //Set required Paths
|
$this->initializeSccpPath(); //Set required Paths
|
||||||
$this->updateTimeZone(); // Get timezone from FreePBX
|
$this->updateTimeZone(); // Get timezone from FreePBX
|
||||||
$this->initTftpLang();
|
$this->initTftpLang();
|
||||||
|
$this->saveSccpSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -153,6 +154,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
if (empty($form_values)) {
|
if (empty($form_values)) {
|
||||||
$form_values = $this->sccpvalues;
|
$form_values = $this->sccpvalues;
|
||||||
}
|
}
|
||||||
|
// load xml data - moved from Construct to simplify Construct
|
||||||
|
$xml_vars = __DIR__ . '/conf/sccpgeneral.xml.v433';
|
||||||
|
$this->xml_data = simplexml_load_file($xml_vars);
|
||||||
|
|
||||||
if ((array) $this->xml_data) {
|
if ((array) $this->xml_data) {
|
||||||
foreach ($this->xml_data->xpath('//page_group[@name="' . $group_name . '"]') as $item) {
|
foreach ($this->xml_data->xpath('//page_group[@name="' . $group_name . '"]') as $item) {
|
||||||
$htmlret = load_view(__DIR__ . '/views/formShow.php', array(
|
$htmlret = load_view(__DIR__ . '/views/formShow.php', array(
|
||||||
|
@ -176,9 +181,13 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function updateTimeZone() {
|
public function updateTimeZone() {
|
||||||
// Check timezone has not been changed in FreePBX and update if has
|
// Get latest FreePBX time $timeZoneOffsetList
|
||||||
if ($this->sccpvalues['ntp_timezone'] != \date_default_timezone_get()) {
|
$freepbxTZ = \date_default_timezone_get();
|
||||||
$this->sccpvalues['ntp_timezone'] = array('keyword' => 'ntp_timezone', 'seq'=>95, 'type' => 2, 'data' => \date_default_timezone_get());
|
$this->sccpvalues['ntp_timezone'] = array('keyword' => 'ntp_timezone', 'seq'=>95, 'type' => 2, 'data' => $freepbxTZ);
|
||||||
|
$TZdata = $this->extconfigs->getExtConfig('sccp_timezone', $freepbxTZ);
|
||||||
|
if (!empty($TZdata)) {
|
||||||
|
$value = $TZdata['offset']/60; // TODO: Is this correct (storing in hours not minutes)
|
||||||
|
$this->sccpvalues['tzoffset'] = array('keyword' => 'tzoffset', 'seq'=>98, 'type' => 2, 'data' => $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +941,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
function getDialPlan($get_file) {
|
function getDialPlan($get_file) {
|
||||||
$file = $this->sccppath["tftp_dialplan"] . '/' . $get_file . '.xml';
|
$file = $this->sccppath["tftp_dialplan"] . '/' . $get_file . '.xml';
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
// $load_xml_data = simplexml_load_file($file);
|
|
||||||
|
|
||||||
$fileContents = file_get_contents($file);
|
$fileContents = file_get_contents($file);
|
||||||
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
|
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
|
||||||
|
|
|
@ -448,7 +448,7 @@ trait ajaxHelper {
|
||||||
'keyword' => $this->sccpvalues[$key]['keyword'],
|
'keyword' => $this->sccpvalues[$key]['keyword'],
|
||||||
'data' => $value,
|
'data' => $value,
|
||||||
'seq' => $this->sccpvalues[$key]['seq'],
|
'seq' => $this->sccpvalues[$key]['seq'],
|
||||||
'type' => $this->sccpvalues[$key1]['type']
|
'type' => $this->sccpvalues[$key]['type']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<div class="element-container"> <div class="row"> <div class="form-group">
|
<div class="element-container"> <div class="row"> <div class="form-group">
|
||||||
<div class="col-md-3"> <label class="control-label" for="ERROR">Error Load form config </label>
|
<div class="col-md-3"> <label class="control-label" for="ERROR">Error loadinging form configuration </label>
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="ERROR"></i>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="ERROR"></i>
|
||||||
</div></div></div></div>
|
</div></div></div></div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue