Get TZ Offset from timezone
Remove unnecessary methods
This commit is contained in:
parent
bbd811e578
commit
3fee812cc6
|
@ -762,9 +762,9 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
|
|
||||||
case 'sccp_ntp_timezone':
|
case 'sccp_ntp_timezone':
|
||||||
$tz_id = $value;
|
$tz_id = $value;
|
||||||
$TZdata = $this->extconfigs->getextConfig('sccp_timezone_offset', $tz_id);
|
$TZdata = $this->extconfigs->getextConfig('sccp_timezone', $tz_id);
|
||||||
if (!empty($TZdata)) {
|
if (!empty($TZdata)) {
|
||||||
$value = ($TZdata / 60);
|
$value = $TZdata['offset']/60;
|
||||||
if (!($this->sccpvalues['tzoffset']['data'] == $value)) {
|
if (!($this->sccpvalues['tzoffset']['data'] == $value)) {
|
||||||
$save_settings[] = array('keyword' => 'tzoffset', 'data' => $value,
|
$save_settings[] = array('keyword' => 'tzoffset', 'data' => $value,
|
||||||
'seq' => '98',
|
'seq' => '98',
|
||||||
|
@ -774,7 +774,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($save_settings)) {
|
if (!empty($save_settings)) {
|
||||||
$this->saveSccpSettings($save_settings);
|
$this->saveSccpSettings($save_settings);
|
||||||
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
|
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting();
|
||||||
|
|
|
@ -30,20 +30,6 @@ class extconfigs
|
||||||
break;
|
break;
|
||||||
case 'sccpDefaults':
|
case 'sccpDefaults':
|
||||||
$result = $this->sccpDefaults;
|
$result = $this->sccpDefaults;
|
||||||
break;
|
|
||||||
case 'sccp_timezone_offset': // Sccp manafer: 1400 (+ Id) :2007 (+ Id)
|
|
||||||
if (empty($index)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (array_key_exists($index, $this->cisco_timezone)) {
|
|
||||||
$tmp_time = $this->get_cisco_time_zone($index);
|
|
||||||
return $tmp_time['offset'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$tmp_dt = new \DateTime(null, new \DateTimeZone($index));
|
|
||||||
$tmp_ofset = $tmp_dt->getOffset();
|
|
||||||
return $tmp_ofset / 60;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'sccp_timezone': // Sccp manager: 1303; server_info: 122
|
case 'sccp_timezone': // Sccp manager: 1303; server_info: 122
|
||||||
$result = array();
|
$result = array();
|
||||||
|
@ -69,15 +55,18 @@ class extconfigs
|
||||||
// Now look for a match in cisco_tz_array based on offset and DST
|
// Now look for a match in cisco_tz_array based on offset and DST
|
||||||
// First correct offset if we have DST now as cisco offsets are
|
// First correct offset if we have DST now as cisco offsets are
|
||||||
// based on non dst offsets
|
// based on non dst offsets
|
||||||
$tmp_ofset = $thisTzOffset / 60;
|
$tmpOffset = $thisTzOffset / 60;
|
||||||
if ($haveDstNow) {
|
if ($haveDstNow) {
|
||||||
$tmp_ofset = $tmp_ofset - 60;
|
$tmpOffset = $tmpOffset - 60;
|
||||||
}
|
}
|
||||||
foreach ($this->cisco_timezone as $key => $value) {
|
foreach ($this->cisco_timezone as $key => $value) {
|
||||||
if (($value['offset'] == $tmp_ofset) and ( $value['daylight'] == $usesDaylight )) {
|
if (($value['offset'] == $tmpOffset) and ( $value['daylight'] == $usesDaylight )) {
|
||||||
// This code may not be the one typically used, but it has the correct values.
|
// This code may not be the one typically used, but it has the correct values.
|
||||||
$cisco_code = $key . ' Standard' . (($usesDaylight) ? '/Daylight' : '') . ' Time';
|
$cisco_code = $key . ' Standard' . (($usesDaylight) ? '/Daylight' : '') . ' Time';
|
||||||
return array('offset' => $tmp_ofset, 'daylight' => ($usesDaylight) ? 'Daylight' : '', 'cisco_code' => $cisco_code);
|
|
||||||
|
$this->sccpvalues['tzoffset']['data'] = $tmpOffset;
|
||||||
|
|
||||||
|
return array('offset' => $tmpOffset, 'daylight' => ($usesDaylight) ? 'Daylight' : '', 'cisco_code' => $cisco_code);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -357,7 +346,6 @@ class extconfigs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
|
$dst = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/core/functions.inc/drivers/Sccp.class.php';
|
||||||
if (!file_exists($dst) || $sccp_driver_replace == 'yes') {
|
if (!file_exists($dst) || $sccp_driver_replace == 'yes') {
|
||||||
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v' . $db_vars['sccp_compatible']['data'];
|
$src_path = $_SERVER['DOCUMENT_ROOT'] . '/admin/modules/sccp_manager/conf/' . basename($dst) . '.v' . $db_vars['sccp_compatible']['data'];
|
||||||
|
|
Loading…
Reference in a new issue