Diederik de Groot <dkgroot@talon.nl> 03.11.2017
- Update README.md - Commented out astman_retrieveJSFromMetaData in install.php (was moved to srvinterface) - Addd/Updated some !TODO! entries - Spelling: - devise -> device - Compatable/Comable -> Compatible - Templet -> Template - buton -> button - Templatee -> Template
This commit is contained in:
parent
a382e74490
commit
9a18a0940b
|
@ -608,7 +608,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
$ver_id = $this->sccp_create_device_XML($data['name']);
|
$ver_id = $this->sccp_create_device_XML($data['name']);
|
||||||
};
|
};
|
||||||
/* !TODO!: Do these returned message strings work with i18n ? */
|
/* !TODO!: Do these returned message strings work with i18n ? */
|
||||||
return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')'));
|
return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'reset_token':
|
case 'reset_token':
|
||||||
|
|
|
@ -14,7 +14,9 @@ class dbinterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info() {
|
public function info() {
|
||||||
return Array('Version' => '13.0.2', 'about' =>'Data access interface v. 13.0.2');
|
$Ver = '13.0.2';
|
||||||
|
return Array('Version' => $Ver,
|
||||||
|
'about' =>'Data access interface ver: '.$Ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -9,8 +9,9 @@ class extconfigs {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info() {
|
public function info() {
|
||||||
return Array('Version' => '13.0.2',
|
$Ver = '13.0.2';
|
||||||
'about' =>'Default Setings and Enums ver: 13.0.2');
|
return Array('Version' => $Ver,
|
||||||
|
'about' =>'Default Setings and Enums ver: '.$Ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getextConfig($id = '', $index = '') {
|
public function getextConfig($id = '', $index = '') {
|
||||||
|
@ -25,15 +26,22 @@ class extconfigs {
|
||||||
$result = $this->sccpDefaults;
|
$result = $this->sccpDefaults;
|
||||||
break;
|
break;
|
||||||
case 'sccp_timezone':
|
case 'sccp_timezone':
|
||||||
$result = $this->cisco_timezone;
|
$result = array();
|
||||||
break;
|
foreach ($this->cisco_timezone as $key => $value) {
|
||||||
case 'cisco_time':
|
$cisco_code = $key .' Standard'.((empty($value['daylight']))? '': '/'.$value['daylight']).' Time';
|
||||||
|
if (isset($value['cisco_code'])) {
|
||||||
|
$cisco_code = (empty($value['cisco_code']))? $cisco_code : $value['cisco_code'];
|
||||||
|
}
|
||||||
|
$result[$key] = array('offset' => $value['offset'], 'daylight' => $value['daylight'], 'cisco_code' =>$cisco_code);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
/* case 'cisco_time':
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($this->cisco_timezone as $key => $value) {
|
foreach ($this->cisco_timezone as $key => $value) {
|
||||||
$result[] = array('id'=> ($value['offset']/60) ,'val'=>$key.((empty($value['daylight']))? '': '/'.$value['daylight']));
|
$result[] = array('id'=> ($value['offset']/60) ,'val'=>$key.((empty($value['daylight']))? '': '/'.$value['daylight']));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case 'cisco_timezone':
|
case 'cisco_timezone':
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($this->cisco_timezone as $key => $value) {
|
foreach ($this->cisco_timezone as $key => $value) {
|
||||||
|
@ -165,20 +173,20 @@ class extconfigs {
|
||||||
'Jerusalem' => array('offset' => '120', 'daylight' => 'Daylight'),
|
'Jerusalem' => array('offset' => '120', 'daylight' => 'Daylight'),
|
||||||
'Saudi Arabia' => array('offset' => '180', 'daylight' => ''),
|
'Saudi Arabia' => array('offset' => '180', 'daylight' => ''),
|
||||||
/* Russion Regions */
|
/* Russion Regions */
|
||||||
'Russian/Kaliningrad' => array('offset' => '120', 'daylight' => ''),
|
'Russian/Kaliningrad' => array('offset' => '120', 'daylight' => '', 'cisco_code' => 'South Africa Standard Time'),
|
||||||
'Russian/Moscow' => array('offset' => '180', 'daylight' => ''),
|
'Russian/Moscow' => array('offset' => '180', 'daylight' => '', 'cisco_code' => 'Russian Standard Time'),
|
||||||
'Russian/St.Peterburg' => array('offset' => '180', 'daylight' => ''),
|
'Russian/St.Peterburg' => array('offset' => '180', 'daylight' => '', 'cisco_code' => 'Russian Standard Time'),
|
||||||
'Russian/Samara' => array('offset' => '240', 'daylight' => ''),
|
'Russian/Samara' => array('offset' => '240', 'daylight' => '', 'cisco_code' => 'Arabian Standard Time'),
|
||||||
'Russian/Novosibirsk' => array('offset' => '300', 'daylight' => ''),
|
'Russian/Novosibirsk' => array('offset' => '300', 'daylight' => '', 'cisco_code' => 'Ekaterinburg Standard Time'),
|
||||||
'Russian/Ekaterinburg' => array('offset' => '300', 'daylight' => ''),
|
'Russian/Ekaterinburg' => array('offset' => '300', 'daylight' => '', 'cisco_code' => 'Ekaterinburg Standard Time'),
|
||||||
'Russian/Irkutsk' => array('offset' => '480', 'daylight' => ''),
|
'Russian/Irkutsk' => array('offset' => '480', 'daylight' => '', 'cisco_code' => 'China Standard Time'),
|
||||||
'Russian/Yakutsk' => array('offset' => '540', 'daylight' => ''),
|
'Russian/Yakutsk' => array('offset' => '540', 'daylight' => '', 'cisco_code' => 'Tokyo Standard Time'),
|
||||||
'Russian/Khabarovsk' => array('offset' => '600', 'daylight' => ''),
|
'Russian/Khabarovsk' => array('offset' => '600', 'daylight' => '', 'cisco_code' => 'West Pacific Standard Time'),
|
||||||
'Russian/Vladivostok' => array('offset' => '600', 'daylight' => ''),
|
'Russian/Vladivostok' => array('offset' => '600', 'daylight' => '', 'cisco_code' => 'West Pacific Standard Time'),
|
||||||
'Russian/Sakhalin' => array('offset' => '660', 'daylight' => ''),
|
'Russian/Sakhalin' => array('offset' => '660', 'daylight' => '', 'cisco_code' => 'Central Pacific Standard Time'),
|
||||||
'Russian/Magadan' => array('offset' => '660', 'daylight' => ''),
|
'Russian/Magadan' => array('offset' => '660', 'daylight' => '', 'cisco_code' => 'Central Pacific Standard Time'),
|
||||||
'Russian/Kamchatka' => array('offset' => '720', 'daylight' => ''),
|
'Russian/Kamchatka' => array('offset' => '720', 'daylight' => '', 'cisco_code' => 'Fiji Standard Time'),
|
||||||
/* EnD - Russion Regions */
|
/* EnD - Russion Regions */
|
||||||
|
|
||||||
'Iran' => array('offset' => '210', 'daylight' => 'Daylight'),
|
'Iran' => array('offset' => '210', 'daylight' => 'Daylight'),
|
||||||
'Caucasus' => array('offset' => '240', 'daylight' => 'Daylight'),
|
'Caucasus' => array('offset' => '240', 'daylight' => 'Daylight'),
|
||||||
|
|
|
@ -14,8 +14,9 @@ class srvinterface {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
}
|
}
|
||||||
public function info() {
|
public function info() {
|
||||||
return Array('Version' => '13.0.2',
|
$Ver = '13.0.2';
|
||||||
'about' =>'Server interface data ver 13.0.2');
|
return Array('Version' => $Ver,
|
||||||
|
'about' =>'Server interface data ver: '.$Ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -14,8 +14,9 @@ class xmlinterface {
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
}
|
}
|
||||||
public function info() {
|
public function info() {
|
||||||
return Array('Version' => '13.0.2',
|
$Ver = '13.0.2';
|
||||||
'about' =>'Create XML data interface v. 13.0.2');
|
return Array('Version' => $Ver,
|
||||||
|
'about' =>'Create XML data interface ver: '.$Ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,11 +169,12 @@ class xmlinterface {
|
||||||
$tz_id = $data_values['ntp_timezone'];
|
$tz_id = $data_values['ntp_timezone'];
|
||||||
$TZdata = $data_values['ntp_timezone_id'];
|
$TZdata = $data_values['ntp_timezone_id'];
|
||||||
if (empty($TZdata)){
|
if (empty($TZdata)){
|
||||||
$TZdata = array('offset' => '0', 'daylight' => '');
|
$TZdata = array('offset' => '0', 'daylight' => '', 'cisco_code' => 'Greenwich Standard Time');
|
||||||
}
|
}
|
||||||
$xnode->name = $tz_id;
|
$xnode->name = $tz_id;
|
||||||
$xnode->dateTemplate = $data_values['dateformat'];
|
$xnode->dateTemplate = $data_values['dateformat'];
|
||||||
$xnode->timeZone = $tz_id.' Standard'.((empty($TZdata['daylight']))? '': '/'.$TZdata['daylight']).' Time';
|
$xnode->timeZone = $TZdata['cisco_code'];
|
||||||
|
// $xnode->timeZone = $tz_id.' Standard'.((empty($TZdata['daylight']))? '': '/'.$TZdata['daylight']).' Time';
|
||||||
|
|
||||||
if ($data_values['ntp_config_enabled'] == 'yes') {
|
if ($data_values['ntp_config_enabled'] == 'yes') {
|
||||||
$xnode->ntps->ntp->name = $data_values['ntp_server'];
|
$xnode->ntps->ntp->name = $data_values['ntp_server'];
|
||||||
|
|
|
@ -283,11 +283,10 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
$select[] = array('value' => 'reject', 'text' => 'Reject');
|
$select[] = array('value' => 'reject', 'text' => 'Reject');
|
||||||
$select[] = array('value' => 'silent', 'text' => 'Silent');
|
$select[] = array('value' => 'silent', 'text' => 'Silent');
|
||||||
$select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
|
$select[] = array('value' => 'UserDefined', 'text' => 'UserDefined');
|
||||||
$tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'<br>'.
|
|
||||||
# !TODO!: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour
|
# !TODO!: The next entry should be "null/empty" (not UserDefined) -> to indicate the trie-state behaviour
|
||||||
_("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
|
|
||||||
r
|
|
||||||
# !TODO!: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think)
|
# !TODO!: Userdefined is also a possible state, but it is not used or implemented (and it should not be implemented here, i think)
|
||||||
|
$tt = _("DND: How will dnd react when it is set on the device level dnd can have three states: off / busy(reject) / silent / UserDefined").'<br>'.
|
||||||
|
_("UserDefined - dnd that cycles through all three states off -> reject -> silent -> off (this is the normal behaviour)").'<br>'.
|
||||||
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.
|
_("Reject - Usesr can only switch off and on (in reject/busy mode)").'<br>'.
|
||||||
_("Silent - Usesr can only switch off and on (in silent mode)");
|
_("Silent - Usesr can only switch off and on (in silent mode)");
|
||||||
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'UserDefined', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
|
$tmparr['dnd'] = array('prompttext' => _('DND'), 'value' => 'UserDefined', 'tt' => $tt, 'select' => $select, 'level' => 1, 'type' => 'radio');
|
||||||
|
|
66
install.php
66
install.php
|
@ -19,29 +19,6 @@ if(class_exists($class,false)) {
|
||||||
$srvinterface = new $class();
|
$srvinterface = new $class();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* unused / moved to srvinterface
|
|
||||||
//
|
|
||||||
// Helper function to retrieve SCCPConfigMetaData via ASTMan
|
|
||||||
// segment: ["", "general","device","line","softkey"]}
|
|
||||||
// returns a php variable (array/set)
|
|
||||||
//
|
|
||||||
// Move to seperate helper file
|
|
||||||
function astman_retrieveJSFromMetaData($astman, $segment = "") {
|
|
||||||
$params = array();
|
|
||||||
if ($segment != "") {
|
|
||||||
$params["Segment"] = $segment;
|
|
||||||
}
|
|
||||||
$response = $astman->send_request('SCCPConfigMetaData', $params);
|
|
||||||
if ($response["Response"] == "Success") {
|
|
||||||
//outn(_("JSON-content:").$response["JSON"]);
|
|
||||||
$decode=json_decode($response["JSON"], true);
|
|
||||||
return $decode;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function Get_DB_config($sccp_compatible) {
|
function Get_DB_config($sccp_compatible) {
|
||||||
$db_config_v0 = array(
|
$db_config_v0 = array(
|
||||||
'sccpdevmodel' => array(
|
'sccpdevmodel' => array(
|
||||||
|
@ -348,49 +325,6 @@ function InstallDB_sccpdevmodel() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
function InstallDB_updateEnums($db_config) {
|
|
||||||
global $db;
|
|
||||||
if (!$db_config) {
|
|
||||||
die_freepbx("No db_config provided");
|
|
||||||
}
|
|
||||||
$count_modify = 0;
|
|
||||||
outn("<li>" . _("Update Database Enums") . "</li>");
|
|
||||||
foreach ($db_config as $tabl_name => &$tab_modify) {
|
|
||||||
$sql = "";
|
|
||||||
$sql_r = array();
|
|
||||||
foreach ($tab_modify as $row_fld => $row_data){
|
|
||||||
if (!empty($row_data['crate'])) {
|
|
||||||
if (strpos($row_data['crate'], 'enum') !== false) {
|
|
||||||
$sql_r[] = $row_fld;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$sql = "SELECT " . implode(',', $sql_r) . " from ".$tabl_name;
|
|
||||||
$db_result= $db->getAll($sql);
|
|
||||||
if (DB::IsError($db_result)) {
|
|
||||||
die_freepbx("Can not add get informations from ".$tabl_name." table\n");
|
|
||||||
}
|
|
||||||
$sql_table = '';
|
|
||||||
$enum_data = array('true'=>'on','false'=>'off','yes'=>'on','no'=>'off');
|
|
||||||
foreach ($db_result as $tabl_data){
|
|
||||||
$sql = "";
|
|
||||||
foreach( $tabl_data as $row => $col_val){
|
|
||||||
$val= strtolower($col_val);
|
|
||||||
if (isset($enum_data[$val])) {
|
|
||||||
$sql .= $row.'="'.$enum_data[$val].'",';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!empty($sql)){
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
function InstallDB_updateSchema($db_config) {
|
function InstallDB_updateSchema($db_config) {
|
||||||
global $db;
|
global $db;
|
||||||
if (!$db_config) {
|
if (!$db_config) {
|
||||||
|
|
Loading…
Reference in a new issue