diff --git a/Dashboard/app/js/lib/views/reports/export-reports-views.js b/Dashboard/app/js/lib/views/reports/export-reports-views.js index 3add2bd38a..a2ec4dee3f 100644 --- a/Dashboard/app/js/lib/views/reports/export-reports-views.js +++ b/Dashboard/app/js/lib/views/reports/export-reports-views.js @@ -126,57 +126,56 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ showComprehensiveDialog: false, showRawDataImportApplet: false, showGoogleEarthButton: false, - selectedSurvey:null, didInsertElement: function () { + FLOW.selectedControl.set('selectedSurvey', null); FLOW.uploader.registerEvents(); }, + selectedSurvey: function () { + return FLOW.selectedControl.selectedSurvey.get('keyId'); + }.property(), + showRawDataReport: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('RAW_DATA', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('RAW_DATA', sId); }, showRawTextFileExport: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('RAW_DATA_TEXT', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('RAW_DATA_TEXT', sId); }, showComprehensiveReport: function () { - var opts = {}; + var opts = {}, sId = this.get('selectedSurvey'); this.set('showComprehensiveDialog', false); opts.performRollup = '' + FLOW.editControl.summaryPerGeoArea; opts.nocharts = '' + FLOW.editControl.omitCharts; - FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', this.selectedSurvey.get('id'), opts); - }, - - showGoogleEarthFile: function () { - if (!this.get('selectedSurvey')) { - this.showWarning(); - return; - } - this.renderApplet('showGoogleEarthFileApplet', true); + FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', sId, opts); }, showSurveyForm: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } - FLOW.ReportLoader.load('SURVEY_FORM', this.selectedSurvey.get('id')); + FLOW.ReportLoader.load('SURVEY_FORM', sId); }, importFile: function () { - var file; - if (!this.get('selectedSurvey')) { + var file, sId = this.get('selectedSurvey'); + if (!sId) { this.showImportWarning(Ember.String.loc('_import_select_survey')); return; } @@ -193,7 +192,8 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({ }, showComprehensiveOptions: function () { - if (!this.get('selectedSurvey')) { + var sId = this.get('selectedSurvey'); + if (!sId) { this.showWarning(); return; } diff --git a/Dashboard/app/js/templates/navData/data-cleaning.handlebars b/Dashboard/app/js/templates/navData/data-cleaning.handlebars index a4d1059376..f1c2ed1257 100644 --- a/Dashboard/app/js/templates/navData/data-cleaning.handlebars +++ b/Dashboard/app/js/templates/navData/data-cleaning.handlebars @@ -12,7 +12,7 @@ {{view Ember.Select contentBinding="FLOW.surveyControl.arrangedContent" - selectionBinding="view.selectedSurvey" + selectionBinding="FLOW.selectedControl.selectedSurvey" optionLabelPath="content.code" optionValuePath="content.keyId" prompt="" diff --git a/Dashboard/app/js/templates/navReports/export-reports.handlebars b/Dashboard/app/js/templates/navReports/export-reports.handlebars index 71900fa6ad..c703a2df59 100644 --- a/Dashboard/app/js/templates/navReports/export-reports.handlebars +++ b/Dashboard/app/js/templates/navReports/export-reports.handlebars @@ -12,7 +12,7 @@ {{view Ember.Select contentBinding="FLOW.surveyControl.arrangedContent" - selectionBinding="view.selectedSurvey" + selectionBinding="FLOW.selectedControl.selectedSurvey" optionLabelPath="content.code" optionValuePath="content.keyId" prompt="" diff --git a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java index 7fd2503268..6e8ff17bcf 100644 --- a/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java +++ b/GAE/src/org/waterforpeople/mapping/app/web/RawDataRestServlet.java @@ -80,12 +80,46 @@ protected RestResponse handleRequest(RestRequest req) throws Exception { .getAction())) { List dtoList = new ArrayList(); boolean isNew = false; + if (importReq.getSurveyInstanceId() == null && importReq.getSurveyId() != null) { // if the instanceID is null, we need to create one createInstance(importReq); isNew = true; } + + if (importReq.getSurveyInstanceId() != null + && importReq.getSurveyId() != null) { + + SurveyInstance si = new SurveyInstanceDAO().getByKey(importReq + .getSurveyInstanceId()); + + if (si == null) { + MessageDao mDao = new MessageDao(); + Message message = new Message(); + + message.setObjectId(importReq.getSurveyInstanceId()); + message.setActionAbout("importData"); + message.setShortMessage("Survey instance id [" + + importReq.getSurveyInstanceId() + + "] doesn't exist"); + mDao.save(message); + return null; + } + + if (!si.getSurveyId().equals(importReq.getSurveyId())) { + MessageDao mDao = new MessageDao(); + Message message = new Message(); + + message.setObjectId(importReq.getSurveyInstanceId()); + message.setActionAbout("importData"); + message.setShortMessage("Wrong survey selected when importing instance id [" + + importReq.getSurveyInstanceId() + "]"); + mDao.save(message); + return null; + } + } + for (Map.Entry item : importReq .getQuestionAnswerMap().entrySet()) { QuestionAnswerStoreDto qasDto = new QuestionAnswerStoreDto(); diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 11fa73c6f0..c1e8f6925d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,33 @@ Read more about the [Akvo Platform](http://www.akvo.org/blog/?p=4822). Akvo FLOW Dashboard release notes ---- +# 1.6.6 + +Release Date: 18 October 2013 + +## Enhancements +Thanks to the efforts of the Water for People team, we now have a complete set of Spanish translations of the dashboard. + +## Resolved issues +* Fixed: Chart Builder should clean the previous chart on each question. (#365) +* Fixed: 'No data available' warning still shown when data is available for chart. (#388) +* Fixed: Increase performance of loading questions for charts. (#379) +* Fixed: When showing a surveyGroup with a lot of surveys, scrolling behaviour is strange. (#387) +* Fixed: Make summary count more robust to possible QAS duplicates. (#385) +* Fixed: Trim user email address when creating a new user. (#384, #366) +* Fixed: Make reports support languages other than english. (#381) +* Fixed: Update FLOW logo. (#378) +* Fixed: Move copy survey functionality to backend to avoid timeouts on large surveys. (#377) +* Fixed: Bring back language dropdown and incorporate new spanish translations. (#376) +* Fixed: Update instance creation templates with latest config. (#374) +* Fixed: Improve efficiency in saving of surveyedLocales. (#373) +* Fixed: Translations does not get copied when we copy a Survey. (#357) +* Fixed: Prevent user from going to translations when there are unsaved changes. (#389) +* Fixed: Better implementation of sort functions. (#394) +* Fixed: Opt in a UUID implementation for `generateUniqueIdentifier` (#391) +* Fixed: Fix faulty sort functions (#394) + + # 1.6.5 Release Date: 30 September 2013