diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-31 15:01:23 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-05-31 15:01:23 +1200 |
commit | b584b73e523729f28cd294fa1c54a1198ddcea30 (patch) | |
tree | b7f982bc02de9bb10d94b2de76c49a8620c5d7ce /web/app/view/ReportController.js | |
parent | 4176894097bb9f3d06ff339e9e845c4969ca6874 (diff) | |
download | trackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.tar.gz trackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.tar.bz2 trackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.zip |
Request report only if device selected
Diffstat (limited to 'web/app/view/ReportController.js')
-rw-r--r-- | web/app/view/ReportController.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 9c2abcc71..4fe7c62b8 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -37,25 +37,27 @@ Ext.define('Traccar.view.ReportController', { fromDate = this.lookupReference('fromDateField').getValue(); fromTime = this.lookupReference('fromTimeField').getValue(); - from = new Date( - fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(), - fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds()); + if (deviceId) { + from = new Date( + fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(), + fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds()); - toDate = this.lookupReference('toDateField').getValue(); - toTime = this.lookupReference('toTimeField').getValue(); + toDate = this.lookupReference('toDateField').getValue(); + toTime = this.lookupReference('toTimeField').getValue(); - to = new Date( - toDate.getFullYear(), toDate.getMonth(), toDate.getDate(), - toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds()); + to = new Date( + toDate.getFullYear(), toDate.getMonth(), toDate.getDate(), + toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds()); - store = Ext.getStore('Positions'); - store.load({ - params: { - deviceId: deviceId, - from: from.toISOString(), - to: to.toISOString() - } - }); + store = Ext.getStore('Positions'); + store.load({ + params: { + deviceId: deviceId, + from: from.toISOString(), + to: to.toISOString() + } + }); + } }, onClearClick: function () { |