From fbbbc25251408a8687585a3a5adffa90d66bff06 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Sun, 16 May 2021 20:32:07 +0200 Subject: [PATCH] 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 --- share/templates/customer/details.tt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/share/templates/customer/details.tt b/share/templates/customer/details.tt index 7646d67903..164e179349 100644 --- a/share/templates/customer/details.tt +++ b/share/templates/customer/details.tt @@ -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' },