From ee3b4be83314f8594f0afde19142c65c672751e8 Mon Sep 17 00:00:00 2001 From: Danielle Mayabb Date: Tue, 2 Apr 2024 12:47:22 -0700 Subject: [PATCH] fix: Revert userTasksReport grid change - Revert to use regular grid panel and the download csv functionality just in this file and remove Total Hours from csv export --- web/js/include/ExportableGridPanel.js | 6 +++--- web/js/userTasksReport.js | 30 ++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/web/js/include/ExportableGridPanel.js b/web/js/include/ExportableGridPanel.js index 1ac28d815..93fb36c11 100644 --- a/web/js/include/ExportableGridPanel.js +++ b/web/js/include/ExportableGridPanel.js @@ -46,9 +46,9 @@ function fromStoreToCSV(store, columnModel, totalRow = null) { csv += '\n'; }); - if (totalRow) { - csv += `\n\n ${totalRow}`; - } + // if (totalRow) { + // csv += `\n\n ${totalRow}`; + // } return csv; } diff --git a/web/js/userTasksReport.js b/web/js/userTasksReport.js index a504d5154..90b1ae6fa 100644 --- a/web/js/userTasksReport.js +++ b/web/js/userTasksReport.js @@ -521,7 +521,7 @@ Ext.onReady(function () { var columnModel = new Ext.grid.ColumnModel(columnModelItems); // setup the panel for the grid of tasks - var tasksGrid = new Ext.ux.ExportableGridPanel({ + var tasksGrid = new Ext.grid.GridPanel({ id: 'tasksGrid', renderTo: 'content', frame: true, @@ -537,17 +537,37 @@ Ext.onReady(function () { stripeRows: true, colModel: columnModel, columnLines: true, - buttons: [ + bbar: [ { - text: 'Standard view', + xtype: 'button', + text: 'Download as CSV', + handler: function () { + urlParams = 'format=csv&showProjectNames=true'; + for (var parameter in tasksStore.baseParams) { + urlParams += '&' + parameter + '=' + tasksStore.baseParams[parameter]; + } + window.open('services/getTasksFiltered.php?' + urlParams); + } + }, + { + xtype: 'button', + text: 'Standard View', handler: showStandardView }, { - text: 'Extended view', + xtype: 'button', + text: 'Extended View', handler: showExtendedView } ], - footerStyle: 'color: #15428b; font-size: 12px; font-weight: bold; padding-left: 4px' + bbarCfg: { + cls: 'button-bar' + }, + footerCfg: { + tag: 'div', + cls: 'exportable-footer' + }, + footerStyle: 'color: #15428b; font-size: 12px; font-weight: bold; padding: 4px;' }); //function to show only a subset of columns and hide the others