diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 00fcc80..86ca9e0 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -1069,6 +1069,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } $driver = $this->FreePBX->Core->getAllDriversInfo(); + // Below is always set to replace; good for Develop, but needs to be updated for release $sccp_driver_replace = ''; if (empty($driver['sccp'])) { $sccp_driver_replace = 'yes'; @@ -1084,7 +1085,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { $this->sccpvalues['sccp_compatible'] = array('keyword' => 'sccp_compatible', 'data' => $ver_id, 'type' => '1', 'seq' => '99'); $this->sccppath = $this->extconfigs->validate_init_path($confDir, $this->sccpvalues, $sccp_driver_replace); - $driver = $this->FreePBX->Core->getAllDriversInfo(); // ?????? + $driver = $this->FreePBX->Core->getAllDriversInfo(); // Check that Sccp Driver has been updated by above $read_config = $this->cnf_read->getConfig('sccp.conf'); $this->sccp_conf_init['general'] = $read_config['general']; diff --git a/sccpManClasses/extconfigs.class.php b/sccpManClasses/extconfigs.class.php index 52a5abd..928b900 100644 --- a/sccpManClasses/extconfigs.class.php +++ b/sccpManClasses/extconfigs.class.php @@ -14,15 +14,13 @@ class extconfigs $this->paren_class = $parent_class; } - public function info() - { - $Ver = '13.0.3'; + public function info() { + $Ver = '13.1.1'; return array('Version' => $Ver, 'about' => 'Default Setings and Enums ver: ' . $Ver); } - public function getextConfig($id = '', $index = '') - { + public function getextConfig($id = '', $index = '') { switch ($id) { case 'keyset': $result = $this->keysetdefault; @@ -47,7 +45,7 @@ class extconfigs return $tmp_ofset / 60; break; - case 'sccp_timezone': // Sccp manafer: 1400 (+ Id) :2007 (+ Id) + case 'sccp_timezone': // Sccp manager: 1303; server_info: 122 $result = array(); if (empty($index)) { @@ -59,15 +57,26 @@ class extconfigs $timezone_abbreviations = \DateTimeZone::listAbbreviations(); $tz_tmp = array(); - foreach ($timezone_abbreviations as $subArray) { + foreach ($timezone_abbreviations as $key=>$subArray) { $tf_idt = array_search($index, array_column($subArray, 'timezone_id')); if (!empty($tf_idt)) { - $tz_tmp[] = $subArray[$tf_idt]; + $tz_tmp[$key] = $subArray[$tf_idt]; } } + if (empty($tz_tmp)) { return array('offset' => '00', 'daylight' => '', 'cisco_code' => 'Greenwich'); } + + // as php DateTimeZone::listAbbreviations() has multiple historic Values + // Need to find one that matches this machine offset. + + //Now find out if DST is used here. Test if DST setting is different in 6 months + $haveDstNow = date('I'); + $futureDate = (new \DateTime(null,new \DateTimeZone($index)))->modify('+6 months'); + dbug('now is',$haveDstNow); + dbug('future date', $futureDate->format('I')); + if (count($tz_tmp)==1) { $time_set = $tz_tmp[0]; @@ -81,6 +90,8 @@ class extconfigs } } } + + // Should now have a match on offset. $tmp_ofset = $time_set['offset'] / 60; $tmp_dli = (empty($time_set['dst']) ? '' : 'Daylight' ); foreach ($this->cisco_timezone as $key => $value) { @@ -109,11 +120,6 @@ class extconfigs private function get_cisco_time_zone($tzc) { - - if ((empty($tzc)) or (!array_key_exists($tzc, $this->cisco_timezone))) { -// return array('offset' => '00', 'daylight' => '', 'cisco_code' => 'Greenwich'); - return array(); - } $tzdata = $this->cisco_timezone[$tzc]; $cisco_code = $tzc . ' Standard' . ((empty($tzdata['daylight'])) ? '' : '/' . $tzdata['daylight']) . ' Time'; if (isset($tzdata['cisco_code'])) { diff --git a/views/server.info.php b/views/server.info.php index c338ed2..de80df4 100644 --- a/views/server.info.php +++ b/views/server.info.php @@ -117,7 +117,7 @@ if ($mysql_info['Value'] <= '2000') { } -// Check Time Zone comatable +// Check Time Zone compatibility $conf_tz = $this->sccpvalues['ntp_timezone']['data']; $cisco_tz = $this->extconfigs->getextConfig('sccp_timezone', $conf_tz); if ($cisco_tz['offset'] == 0) {