diff options
author | Abyss777 <abyss@fox5.ru> | 2016-10-17 18:14:13 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-10-17 18:14:13 +0500 |
commit | 65772a1ffbb98a71ce0de2e7fb1a434aaa47b926 (patch) | |
tree | 27df3a78868a3323d500d9e2139b64489dba6a98 /web/app/view | |
parent | be258e48a631254b3f02483a122a46973fccefdf (diff) | |
download | etbsa-traccar-web-65772a1ffbb98a71ce0de2e7fb1a434aaa47b926.tar.gz etbsa-traccar-web-65772a1ffbb98a71ce0de2e7fb1a434aaa47b926.tar.bz2 etbsa-traccar-web-65772a1ffbb98a71ce0de2e7fb1a434aaa47b926.zip |
Use "Export" for button name
Do not pass accept header to function
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/Report.js | 4 | ||||
-rw-r--r-- | web/app/view/ReportController.js | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/web/app/view/Report.js b/web/app/view/Report.js index b07bd1c..a1fbd1b 100644 --- a/web/app/view/Report.js +++ b/web/app/view/Report.js @@ -49,8 +49,8 @@ Ext.define('Traccar.view.Report', { disabled: true, handler: 'onReportClick' }, { - text: Strings.reportXlsx, - reference: 'xlsxButton', + text: Strings.reportExport, + reference: 'exportButton', disabled: true, handler: 'onReportClick' }, { diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 49d6d77..e8198b3 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -74,11 +74,11 @@ Ext.define('Traccar.view.ReportController', { time = this.fromDate && this.fromTime && this.toDate && this.toTime; disabled = !reportType || !devices || !time; this.lookupReference('showButton').setDisabled(disabled); - this.lookupReference('xlsxButton').setDisabled(disabled); + this.lookupReference('exportButton').setDisabled(disabled); }, onReportClick: function (button) { - var reportType, from, to, store, url, accept; + var reportType, from, to, store, url; reportType = this.lookupReference('reportTypeField').getValue(); @@ -102,10 +102,9 @@ Ext.define('Traccar.view.ReportController', { to: to.toISOString() } }); - } else if (button.reference === 'xlsxButton') { + } else if (button.reference === 'exportButton') { url = this.getView().getStore().getProxy().url; - accept = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; - this.downloadFile(url, accept, { + this.downloadFile(url, { deviceId: this.deviceId, groupId: this.groupId, type: this.eventType, @@ -167,13 +166,13 @@ Ext.define('Traccar.view.ReportController', { }); }, - downloadFile: function (requestUrl, acceptHeader, requestParams) { + downloadFile: function (requestUrl, requestParams) { Ext.Ajax.request({ url: requestUrl, method: 'GET', params: requestParams, headers: { - Accept: acceptHeader + Accept: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }, binary: true, success: function (response) { |