- Bug Fix. Create addons information
This commit is contained in:
parent
2faf6e1200
commit
e2761e5bdd
|
@ -738,18 +738,31 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
return array('status' => true, 'table_reload' => true, 'message' => 'HW is Delete ! ');
|
return array('status' => true, 'table_reload' => true, 'message' => 'HW is Delete ! ');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
// ------------- Create device tftp configuration
|
||||||
case 'create_hw_tftp':
|
case 'create_hw_tftp':
|
||||||
$ver_id = ' Test !';
|
$ver_id = ' Test !';
|
||||||
$this->sccp_delete_device_XML('all'); // Концы в вводу !!
|
if (!empty($request['idn'])) {
|
||||||
$this->sccp_create_tftp_XML();
|
$models = array();
|
||||||
$models = $this->dbinterface->get_db_SccpTableData("SccpDevice");
|
foreach ($request['idn'] as $idv) {
|
||||||
|
$this->sccp_delete_device_XML($idv);
|
||||||
|
$models []= array('name'=>$idv);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->sccp_delete_device_XML('all');
|
||||||
|
$models = $this->dbinterface->get_db_SccpTableData("SccpDevice");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->sccp_create_tftp_XML(); // Default XML
|
||||||
$ver_id = ' on found active model !';
|
$ver_id = ' on found active model !';
|
||||||
//return array('status' => false, 'message' => 'Error :'. print_r($models,1));
|
//return array('status' => false, 'message' => 'Error :'. print_r($models,1));
|
||||||
foreach ($models as $data) {
|
foreach ($models as $data) {
|
||||||
$ver_id = $this->sccp_create_device_XML($data['name']);
|
$ver_id = $this->sccp_create_device_XML($data['name']);
|
||||||
};
|
};
|
||||||
// !TODO!: -TODO-: Check SIP Suport Enabled
|
|
||||||
$this->sccp_create_xmlSoftkey(); // Create Softkey Sets for SIP
|
if ($this->sccpvalues['siptftp']['data'] == 'on') { // Check SIP Suport Enabled
|
||||||
|
$this->sccp_create_xmlSoftkey(); // Create Softkey Sets for SIP
|
||||||
|
}
|
||||||
|
|
||||||
// !TODO!: -TODO-: Do these returned message strings work with i18n ?
|
// !TODO!: -TODO-: Do these returned message strings work with i18n ?
|
||||||
// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg)
|
// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg)
|
||||||
return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')');
|
return array('status' => true, 'message' => 'Create new config files (version:' . $ver_id . ')');
|
||||||
|
|
|
@ -324,11 +324,16 @@ class xmlinterface {
|
||||||
if (!empty($dev_config['addon'])) {
|
if (!empty($dev_config['addon'])) {
|
||||||
$xnode = $xml_work->addChild('addOnModules');
|
$xnode = $xml_work->addChild('addOnModules');
|
||||||
$ti = 1;
|
$ti = 1;
|
||||||
foreach ($dev_config['addon_info'] as $add_key => $add_val) {
|
$hw_addon = explode(',', $dev_config['addon']);
|
||||||
$xnode_obj = $xnode->addChild('addOnModule');
|
foreach ($hw_addon as $add_key) {
|
||||||
$xnode_obj->addAttribute('idx', $ti);
|
// foreach ($dev_config['addon_info'] as $add_key => $add_val) {
|
||||||
$xnode_obj->addChild('loadInformation', $add_val);
|
if (!empty($dev_config['addon_info'][$add_key])) {
|
||||||
$ti ++;
|
$add_val = $dev_config['addon_info'][$add_key];
|
||||||
|
$xnode_obj = $xnode->addChild('addOnModule');
|
||||||
|
$xnode_obj->addAttribute('idx', $ti);
|
||||||
|
$xnode_obj->addChild('loadInformation', $add_val);
|
||||||
|
$ti ++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// $this->appendSimpleXmlNode($xml_work , $xnode_obj);
|
// $this->appendSimpleXmlNode($xml_work , $xnode_obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -571,12 +571,29 @@ $(document).ready(function () {
|
||||||
// ----------------------- form ----------------
|
// ----------------------- form ----------------
|
||||||
if ($(this).data('id') === 'create-cnf') {
|
if ($(this).data('id') === 'create-cnf') {
|
||||||
var dev_cmd = 'create_hw_tftp';
|
var dev_cmd = 'create_hw_tftp';
|
||||||
|
var datas = '';
|
||||||
|
var i = 0;
|
||||||
|
$('#table-sccp').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
datas = datas + 'idn[' + i + ']=' + entry['name'] + '&';
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
$('#table-sip').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
datas = datas + 'idn[' + i + ']=' + entry['name'] + '&';
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
console.log(datas);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($(this).data('id') === 'delete_hardware') {
|
if ($(this).data('id') === 'delete_hardware') {
|
||||||
var dev_cmd = $(this).data('id');
|
var dev_cmd = $(this).data('id');
|
||||||
var datas = '';
|
var datas = '';
|
||||||
var i = 0;
|
var i = 0;
|
||||||
$('table').bootstrapTable('getSelections').forEach(function (entry) {
|
// $('table').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
$('#table-sccp').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
datas = datas + 'idn[' + i + ']=' + entry['name'] + '&';
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
$('#table-sip').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
datas = datas + 'idn[' + i + ']=' + entry['name'] + '&';
|
datas = datas + 'idn[' + i + ']=' + entry['name'] + '&';
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
@ -599,10 +616,16 @@ $(document).ready(function () {
|
||||||
if ($(this).data('id') === 'update_button_label') {
|
if ($(this).data('id') === 'update_button_label') {
|
||||||
conf_msg = 'Update Butons Labels on All device ?';
|
conf_msg = 'Update Butons Labels on All device ?';
|
||||||
}
|
}
|
||||||
$('table').bootstrapTable('getSelections').forEach(function (entry) {
|
// $('table').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
$('#table-sccp').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
datas = datas + 'name[' + i + ']=' + entry['name'] + '&';
|
datas = datas + 'name[' + i + ']=' + entry['name'] + '&';
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
$('#table-sip').bootstrapTable('getSelections').forEach(function (entry) {
|
||||||
|
datas = datas + 'name[' + i + ']=' + entry['name'] + '&';
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
|
||||||
if (datas === '') {
|
if (datas === '') {
|
||||||
if (confirm(conf_msg)) {
|
if (confirm(conf_msg)) {
|
||||||
datas = 'name[0]=all';
|
datas = 'name[0]=all';
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Token Device') ?></span>
|
<i class="glyphicon glyphicon-ok"></i> <span><?php echo _('Reset Token Device') ?></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=sccp" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sip" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-sip" data-id="mac">
|
<table data-cookie="true" data-cookie-id-table="sccp-phone" data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=sccp" data-cache="false" data-show-refresh="true" data-toolbar="#toolbar-sccp" data-maintain-selected="true" data-show-columns="true" data-show-toggle="true" data-toggle="table" data-pagination="true" data-search="true" class="table table-striped ext-list" id="table-sccp" data-id="mac">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-checkbox="true"></th>
|
<th data-checkbox="true"></th>
|
||||||
|
|
Loading…
Reference in a new issue