Fix update button labels
Convert modal responses to Toast Correct reload parameters to stay on page and redraw table Correct output text
This commit is contained in:
parent
d7bc3e500b
commit
707371cb92
|
@ -1182,7 +1182,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
|||
$buton_list = $this->dbinterface->HWextension_db_SccpTableData("get_sccpdevice_buttons", array('buttontype' => 'speeddial'));
|
||||
}
|
||||
if (empty($buton_list)) {
|
||||
return array('Response' => ' Found 0 device ', 'data' => '');
|
||||
return array('Response' => ' 0 buttons found ', 'data' => '');
|
||||
}
|
||||
$copy_fld = array('ref', 'reftype', 'instance', 'buttontype');
|
||||
$user_list = $user_list = $this->dbinterface->get_db_SccpTableByID("SccpExtension", array(), 'name');
|
||||
|
|
|
@ -586,7 +586,7 @@ $(document).ready(function () {
|
|||
conf_msg = 'Reset Token on All device ?';
|
||||
}
|
||||
if ($(this).data('id') === 'update_button_label') {
|
||||
conf_msg = 'Update Butons Labels on All device ?';
|
||||
conf_msg = 'Update Button Labels on ALL devices ?';
|
||||
}
|
||||
$('#table-sccp').bootstrapTable('getSelections').forEach(function (entry) {
|
||||
datas = datas + 'name[' + i + ']=' + entry['name'] + '&';
|
||||
|
@ -615,14 +615,15 @@ $(document).ready(function () {
|
|||
success: function (data) {
|
||||
// console.log(data);
|
||||
if (data.status === true) {
|
||||
if (data.message) {
|
||||
var old_style = bs_alert(data.message, data.status,data.reload);
|
||||
}
|
||||
if (data.table_reload === true) {
|
||||
$('table').bootstrapTable('refresh');
|
||||
}
|
||||
if (data.reload === true && old_style === true) {
|
||||
location.reload();
|
||||
if (data.message) {
|
||||
fpbxToast(data.message,_('Operation Result'), 'success');
|
||||
if (data.reload === true) {
|
||||
//Need setTimout or reload will kill Toast
|
||||
setTimeout(function(){location.reload();},500);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (Array.isArray(data.message)) {
|
||||
|
|
|
@ -185,8 +185,8 @@ trait ajaxHelper {
|
|||
}
|
||||
}
|
||||
$res = $this->updateSccpButtons($hw_list);
|
||||
$msg .= $res['Response'] . ' raw: ' . $res['data'] . ' ';
|
||||
return array('status' => true, 'message' => 'Update Butons Labels Complite ' . $msg, 'reload' => true);
|
||||
$msg .= $res['Response'] . (empty($res['data']) ? '' : ' raw data: ' . $res['data'] . ' ');
|
||||
return array('status' => true, 'message' => 'Update Buttons Labels Complete: ' . $msg, 'reload' => false, 'table_reload' => true);
|
||||
case 'model_add':
|
||||
$save_settings = array();
|
||||
$key_name = array('model', 'vendor', 'dns', 'buttons', 'loadimage', 'loadinformationid', 'nametemplate');
|
||||
|
|
Loading…
Reference in a new issue