Skip to content

Commit

Permalink
fix: Revert userTasksReport grid change
Browse files Browse the repository at this point in the history
- Revert to use regular grid panel and the download csv functionality just in this file and remove Total Hours from csv export
  • Loading branch information
dmtrek14 authored and anarute committed Apr 3, 2024
1 parent 574c8e8 commit 415f7fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
6 changes: 3 additions & 3 deletions web/js/include/ExportableGridPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
30 changes: 25 additions & 5 deletions web/js/userTasksReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 415f7fa

Please sign in to comment.