Disable TZ selection
TZ is a FreePBX property and should be only changed there. Now only display for info with help Ensure that at each initiation, we load the system value
This commit is contained in:
parent
3fee812cc6
commit
007330159e
|
@ -140,7 +140,6 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); // Overwrite Exist
|
$this->sccpvalues = $this->dbinterface->get_db_SccpSetting(); // Overwrite Exist
|
||||||
// $this->getSccpSetingINI(false); // get from sccep.ini
|
|
||||||
$this->initializeSccpPath();
|
$this->initializeSccpPath();
|
||||||
$this->initVarfromDefs();
|
$this->initVarfromDefs();
|
||||||
$this->initTftpLang();
|
$this->initTftpLang();
|
||||||
|
@ -202,6 +201,10 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
$this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');
|
$this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Check timezone has not been changed in FreePBX and update if has
|
||||||
|
if ($this->sccpvalues['ntp_timezone'] != \date_default_timezone_get()) {
|
||||||
|
$this->sccpvalues['ntp_timezone'] = array('keyword' => 'ntp_timezone', 'seq'=>95, 'type' => 2, 'data' => \date_default_timezone_get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -492,7 +492,7 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<default>off</default>
|
<default>off</default>
|
||||||
<button value="on">Yes</button>
|
<button value="on">Yes</button>
|
||||||
<button value="off">No</button>
|
<button value="off">No</button>
|
||||||
<help>Enabling NTP settings in device configuration.</help>
|
<help>Enable NTP settings in device configuration.</help>
|
||||||
</item>
|
</item>
|
||||||
<item type="IE" id="2" seq="10">
|
<item type="IE" id="2" seq="10">
|
||||||
<label>NTP Server name (ip)</label>
|
<label>NTP Server name (ip)</label>
|
||||||
|
@ -501,7 +501,7 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<default>pool.ntp.org</default>
|
<default>pool.ntp.org</default>
|
||||||
<value>pool.ntp.org</value>
|
<value>pool.ntp.org</value>
|
||||||
</input>
|
</input>
|
||||||
<help>NTP Server name or IP</help>
|
<help>NTP Server name or IP address</help>
|
||||||
</item>
|
</item>
|
||||||
<item type="IS" id="3" seq="10">
|
<item type="IS" id="3" seq="10">
|
||||||
<name>ntp_server_mode</name>
|
<name>ntp_server_mode</name>
|
||||||
|
@ -532,7 +532,7 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<select>
|
<select>
|
||||||
<default>UTC</default>
|
<default>UTC</default>
|
||||||
</select>
|
</select>
|
||||||
<help>Date Format: Time zone</help>
|
<help>System Time zone - this is set by FreePBX and can be changed in Settings : Advanced Settings</help>
|
||||||
</item>
|
</item>
|
||||||
</page_group>
|
</page_group>
|
||||||
|
|
||||||
|
|
|
@ -946,13 +946,6 @@ foreach ($items as $child) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$time_regions = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Russian', 'Indian', 'Pacific');
|
|
||||||
$time_zone_global = DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC);
|
|
||||||
$time_zone_ru = array('Russian/Kaliningrad', 'Russian/Moscow', 'Russian/St.Peterburg', 'Russian/Samara', 'Russian/Novosibirsk', 'Russian/Ekaterinburg', 'Russian/Irkutsk', 'Russian/Yakutsk', 'Russian/Khabarovsk', 'Russian/Vladivostok', 'Russian/Sakhalin', 'Russian/Magadan', 'Russian/Kamchatka');
|
|
||||||
$time_zone_list = array_merge($time_zone_global, $time_zone_ru);
|
|
||||||
$optgroup = '';
|
|
||||||
sort($time_zone_list);
|
|
||||||
|
|
||||||
if (empty($child->class)) {
|
if (empty($child->class)) {
|
||||||
$child->class = 'form-control';
|
$child->class = 'form-control';
|
||||||
}
|
}
|
||||||
|
@ -963,45 +956,23 @@ foreach ($items as $child) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($child->value)) {
|
$child->value = \date_default_timezone_get();
|
||||||
$child->value = \date_default_timezone_get();
|
|
||||||
// if (!empty($child->default)){
|
|
||||||
// $child->value = $child->default;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<!-- Begin '.$child->label.' -->';
|
echo '<!-- Begin '.$child->label.' -->';
|
||||||
?>
|
?>
|
||||||
<div class="element-container">
|
<div class="element-container">
|
||||||
<div class="row"> <div class="form-group">
|
<div class="row">
|
||||||
|
<div class="form-group">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
|
<label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
|
||||||
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
|
<i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-9"> <!-- <div class = "lnet form-group form-inline" data-nextid=1> --> <?php
|
<div class="col-md-9"> <?php
|
||||||
echo '<select name="'.$res_id.'" class="'. $child->class . '" id="' . $res_id . '">';
|
echo $child->value;
|
||||||
foreach ($time_zone_list as $opt_key) {
|
?>
|
||||||
$z = explode('/', $opt_key, 2);
|
</div>
|
||||||
if (count($z) != 2 || !in_array($z[0], $time_regions)) {
|
</div>
|
||||||
continue;
|
</div>
|
||||||
}
|
|
||||||
if ($optgroup != $z[0]) {
|
|
||||||
if ($optgroup !== '') {
|
|
||||||
echo '</optgroup>';
|
|
||||||
}
|
|
||||||
$optgroup = $z[0];
|
|
||||||
echo '<optgroup label="' . htmlentities($z[0]) . '">';
|
|
||||||
}
|
|
||||||
echo '<option value="' . htmlentities($opt_key) . '" label="' . htmlentities(str_replace('_', ' ', $z[1])) . '"' . ($opt_key == $child->value ? ' selected="selected" >' : '>'). htmlentities(str_replace('_', ' ', $opt_key)) . '</option>';
|
|
||||||
}
|
|
||||||
if ($optgroup !== '') {
|
|
||||||
echo '</optgroup>';
|
|
||||||
}
|
|
||||||
|
|
||||||
?> </select>
|
|
||||||
<!-- </div> --> </div>
|
|
||||||
</div></div>
|
|
||||||
<div class="row"><div class="col-md-12">
|
<div class="row"><div class="col-md-12">
|
||||||
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
|
<span id="<?php echo $res_id;?>-help" class="help-block fpbx-help-block"><?php echo _($child->help);?></span>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
Loading…
Reference in a new issue