TT#122532 Init helper.dt_buttons/top_buttons as empty for each section on Customer->Details

Otherwise we might get elements from the previous table,
the one example has been described in a ticket:

The "Phonebook" datatable had "Download" button from "Invoices".

Change-Id: I6961d7bda209b8ff95600f56036185566b520f52
mr9.5.1
Alexander Lutay 5 years ago
parent abba89443a
commit fbbbc25251

@ -251,6 +251,9 @@ $(function() {
helper.dt_columns = subscriber_dt_columns;
helper.ajax_uri = c.uri_for_action('/customer/subscriber_ajax', [ c.req.captures.0 ]);
helper.top_buttons = [];
helper.dt_buttons = [];
UNLESS c.user.read_only;
helper.dt_buttons = [
{ name = c.loc('Terminate'), uri = "/subscriber/'+full.id+'/terminate", class = 'btn-small btn-secondary', icon = 'icon-remove' },
@ -304,6 +307,9 @@ $(function() {
helper.dt_columns = pbxgroup_dt_columns;
helper.ajax_uri = c.uri_for_action('/customer/pbx_group_ajax', [ c.req.captures.0 ]);
helper.top_buttons = [];
helper.dt_buttons = [];
UNLESS c.user.read_only;
helper.dt_buttons = [
{ name = c.loc('Terminate'), uri = "/subscriber/'+full.id+'/terminate", class = 'btn-small btn-secondary', icon = 'icon-remove' },
@ -411,6 +417,9 @@ $(function() {
helper.dt_columns = soundset_dt_columns;
helper.ajax_uri = c.uri_for_action('/sound/contract_ajax', [ c.req.captures.0 ]);
helper.top_buttons = [];
helper.dt_buttons = [];
UNLESS c.user.read_only;
helper.dt_buttons = [
{ name = c.loc('Edit'), uri = "/sound/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },
@ -717,6 +726,9 @@ $(function() {
helper.dt_columns = location_dt_columns;
helper.ajax_uri = c.uri_for_action('/customer/location_ajax', [ c.req.captures.0 ]);
helper.top_buttons = [];
helper.dt_buttons = [];
helper.tmpuri = c.uri_for(contract.id, 'location');
UNLESS c.user.read_only;
helper.dt_buttons = [
@ -757,6 +769,9 @@ $(function() {
helper.ajax_uri = c.uri_for_action('/customer/phonebook_ajax', [ c.req.captures.0 ]);
helper.tmpuri = c.uri_for_action('/customer/phonebook_root', [ c.req.captures.0 ]);
helper.top_buttons = [];
helper.dt_buttons = [];
UNLESS c.user.read_only;
helper.dt_buttons = [
{ name = c.loc('Edit'), uri = helper.tmpuri _ "/'+full.id+'/edit", class = 'btn-small btn-primary', icon = 'icon-edit' },

Loading…
Cancel
Save