Skip to content

Commit 9c0a44e

Browse files
committed
Merge branch 'develop'
2 parents 4970a3e + 2a1479f commit 9c0a44e

File tree

12 files changed

+104
-23
lines changed

12 files changed

+104
-23
lines changed

Dashboard/app/js/lib/models/models.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ FLOW.Question = FLOW.BaseModel.extend({
107107
allowSign: DS.attr('boolean', {
108108
defaultValue: false
109109
}),
110+
geoLocked: DS.attr('boolean', {
111+
defaultValue: false
112+
}),
110113
collapseable: DS.attr('boolean', {
111114
defaultValue: false
112115
}),

Dashboard/app/js/lib/views/reports/export-reports-views.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,57 +126,56 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({
126126
showComprehensiveDialog: false,
127127
showRawDataImportApplet: false,
128128
showGoogleEarthButton: false,
129-
selectedSurvey:null,
130129

131130
didInsertElement: function () {
131+
FLOW.selectedControl.set('selectedSurvey', null);
132132
FLOW.uploader.registerEvents();
133133
},
134134

135+
selectedSurvey: function () {
136+
return FLOW.selectedControl.selectedSurvey.get('keyId');
137+
}.property(),
138+
135139
showRawDataReport: function () {
136-
if (!this.get('selectedSurvey')) {
140+
var sId = this.get('selectedSurvey');
141+
if (!sId) {
137142
this.showWarning();
138143
return;
139144
}
140-
FLOW.ReportLoader.load('RAW_DATA', this.selectedSurvey.get('id'));
145+
FLOW.ReportLoader.load('RAW_DATA', sId);
141146
},
142147

143148
showRawTextFileExport: function () {
144-
if (!this.get('selectedSurvey')) {
149+
var sId = this.get('selectedSurvey');
150+
if (!sId) {
145151
this.showWarning();
146152
return;
147153
}
148-
FLOW.ReportLoader.load('RAW_DATA_TEXT', this.selectedSurvey.get('id'));
154+
FLOW.ReportLoader.load('RAW_DATA_TEXT', sId);
149155
},
150156

151157
showComprehensiveReport: function () {
152-
var opts = {};
158+
var opts = {}, sId = this.get('selectedSurvey');
153159
this.set('showComprehensiveDialog', false);
154160

155161
opts.performRollup = '' + FLOW.editControl.summaryPerGeoArea;
156162
opts.nocharts = '' + FLOW.editControl.omitCharts;
157163

158-
FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', this.selectedSurvey.get('id'), opts);
159-
},
160-
161-
showGoogleEarthFile: function () {
162-
if (!this.get('selectedSurvey')) {
163-
this.showWarning();
164-
return;
165-
}
166-
this.renderApplet('showGoogleEarthFileApplet', true);
164+
FLOW.ReportLoader.load('GRAPHICAL_SURVEY_SUMMARY', sId, opts);
167165
},
168166

169167
showSurveyForm: function () {
170-
if (!this.get('selectedSurvey')) {
168+
var sId = this.get('selectedSurvey');
169+
if (!sId) {
171170
this.showWarning();
172171
return;
173172
}
174-
FLOW.ReportLoader.load('SURVEY_FORM', this.selectedSurvey.get('id'));
173+
FLOW.ReportLoader.load('SURVEY_FORM', sId);
175174
},
176175

177176
importFile: function () {
178-
var file;
179-
if (!this.get('selectedSurvey')) {
177+
var file, sId = this.get('selectedSurvey');
178+
if (!sId) {
180179
this.showImportWarning(Ember.String.loc('_import_select_survey'));
181180
return;
182181
}
@@ -193,7 +192,8 @@ FLOW.ExportReportsAppletView = FLOW.View.extend({
193192
},
194193

195194
showComprehensiveOptions: function () {
196-
if (!this.get('selectedSurvey')) {
195+
var sId = this.get('selectedSurvey');
196+
if (!sId) {
197197
this.showWarning();
198198
return;
199199
}

Dashboard/app/js/lib/views/surveys/question-view.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FLOW.QuestionView = FLOW.View.extend({
1111
allowDecimal: null,
1212
allowMultipleFlag: null,
1313
allowOtherFlag: null,
14+
geoLocked: null,
1415
dependentFlag: false,
1516
dependentQuestion: null,
1617
optionList: null,
@@ -79,11 +80,19 @@ FLOW.QuestionView = FLOW.View.extend({
7980
}
8081
}.property('this.type').cacheable(),
8182

83+
amGeoType: function () {
84+
if (this.type) {
85+
return this.type.get('value') == 'GEO';
86+
} else {
87+
return false;
88+
}
89+
}.property('this.type').cacheable(),
90+
8291
amNoOptionsType: function () {
8392
var val;
8493
if (!Ember.none(this.type)) {
8594
val = this.type.get('value');
86-
return val == 'GEO' || val == 'FREE_TEXT' || val == 'PHOTO' || val == 'VIDEO' || val == 'BARCODE';
95+
return val == 'FREE_TEXT' || val == 'PHOTO' || val == 'VIDEO' || val == 'BARCODE';
8796
}
8897
}.property('this.type').cacheable(),
8998

@@ -113,6 +122,7 @@ FLOW.QuestionView = FLOW.View.extend({
113122
this.set('allowDecimal', FLOW.selectedControl.selectedQuestion.get('allowDecimal'));
114123
this.set('allowMultipleFlag', FLOW.selectedControl.selectedQuestion.get('allowMultipleFlag'));
115124
this.set('allowOtherFlag', FLOW.selectedControl.selectedQuestion.get('allowOtherFlag'));
125+
this.set('geoLocked', FLOW.selectedControl.selectedQuestion.get('geoLocked'));
116126
this.set('includeInMap', FLOW.selectedControl.selectedQuestion.get('includeInMap'));
117127
this.set('dependentFlag', FLOW.selectedControl.selectedQuestion.get('dependentFlag'));
118128
this.set('optionList', FLOW.selectedControl.selectedQuestion.get('questionOptionList'));
@@ -219,6 +229,9 @@ FLOW.QuestionView = FLOW.View.extend({
219229
this.set('allowSign', false);
220230
this.set('allowDecimal', false);
221231
}
232+
if (this.type.get('value') !== 'GEO') {
233+
this.set('geoLocked', false);
234+
}
222235
path = FLOW.selectedControl.selectedSurveyGroup.get('code') + "/" + FLOW.selectedControl.selectedSurvey.get('name') + "/" + FLOW.selectedControl.selectedQuestionGroup.get('code');
223236
FLOW.selectedControl.selectedQuestion.set('text', this.get('text'));
224237
FLOW.selectedControl.selectedQuestion.set('tip', this.get('tip'));
@@ -234,6 +247,7 @@ FLOW.QuestionView = FLOW.View.extend({
234247
FLOW.selectedControl.selectedQuestion.set('allowDecimal', this.get('allowDecimal'));
235248
FLOW.selectedControl.selectedQuestion.set('allowMultipleFlag', this.get('allowMultipleFlag'));
236249
FLOW.selectedControl.selectedQuestion.set('allowOtherFlag', this.get('allowOtherFlag'));
250+
FLOW.selectedControl.selectedQuestion.set('geoLocked', this.get('geoLocked'));
237251
FLOW.selectedControl.selectedQuestion.set('includeInMap', this.get('includeInMap'));
238252

239253
dependentQuestionAnswer = "";

Dashboard/app/js/templates/navData/data-cleaning.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{{view Ember.Select
1414
contentBinding="FLOW.surveyControl.arrangedContent"
15-
selectionBinding="view.selectedSurvey"
15+
selectionBinding="FLOW.selectedControl.selectedSurvey"
1616
optionLabelPath="content.code"
1717
optionValuePath="content.keyId"
1818
prompt=""

Dashboard/app/js/templates/navReports/export-reports.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
{{view Ember.Select
1414
contentBinding="FLOW.surveyControl.arrangedContent"
15-
selectionBinding="view.selectedSurvey"
15+
selectionBinding="FLOW.selectedControl.selectedSurvey"
1616
optionLabelPath="content.code"
1717
optionValuePath="content.keyId"
1818
prompt=""

Dashboard/app/js/templates/navSurveys/question-view.handlebars

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
<label class="minValNumb">{{t _min_val}}: {{view Ember.TextField valueBinding="view.minVal" size=10 }}</label>
4747
<label class="maxValNumb">{{t _max_val}}: {{view Ember.TextField valueBinding="view.maxVal" size=10 }}</label>
4848
{{/if}}
49+
{{#if view.amGeoType}}
50+
<h1 class="answerNbr">{{t _geo_details}}: </h1>
51+
<label class="labelcheckbox"> {{view Ember.Checkbox checkedBinding="view.geoLocked"}}{{t _disable_manual_geo_edit}} </label>
52+
{{/if}}
4953

5054
{{#if view.amNoOptionsType}}
5155
<p class="noOptions">

GAE/src/com/gallatinsystems/survey/domain/Question.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public enum Type {
5050
private Boolean allowMultipleFlag = null;
5151
private Boolean allowOtherFlag = null;
5252
private Boolean collapseable = false;
53+
private Boolean geoLocked = null;
5354
private Boolean immutable = false;
5455
private Long dependentQuestionId;
5556
private String dependentQuestionAnswer;
@@ -323,4 +324,12 @@ public void setImmutable(Boolean immutable) {
323324
public Boolean getImmutable() {
324325
return immutable;
325326
}
327+
328+
public Boolean getGeoLocked() {
329+
return geoLocked;
330+
}
331+
332+
public void setGeoLocked(Boolean geoLocked) {
333+
this.geoLocked = geoLocked;
334+
}
326335
}

GAE/src/locale/en.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Device\ id = Device id
8989
Devices = Devices
9090
Devices\ list = Devices list
9191
Disable\ devices = Disable devices
92+
Disable\ manual\ editing\ of\ geo\ values\ on\ device = Disable manual editing of geo values on device
9293
Do\ not\ navigate\ away\ from\ this\ page\ while\ the\ upload\ is\ in\ progress = Do not navigate away from this page while the upload is in progress
9394
Documentation\ and\ user\ guides = Documentation and user guides
9495
Drop\ files\ here\ to\ upload\ or = Drop files here to upload or
@@ -126,6 +127,7 @@ Free\ Text = Free Text
126127
Generate\ Summary\ Sheets\ for\ each\ Geographic\ Area = Generate Summary Sheets for each Geographic Area
127128
Generates\ a\ printable\ survey\ form\ in\ excel\ that\ can\ be\ used\ to\ conduct\ a\ paper-based\ survey.\ must\ be\ saved\ as\ an\ .xls\ or\ .xlsx = Generates a printable survey form in excel that can be used to conduct a paper-based survey. must be saved as an .xls or .xlsx
128129
Geolocation = Geolocation
130+
Geolocation\ settings = Geolocation settings
129131
Go\ back\ to\ assignment\ list = Go back to assignment list
130132
Go\ back\ to\ survey\ overview = Go back to survey overview
131133
Google\ Earth\ file = Google Earth file

GAE/src/locale/ui-strings.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ _device_id = Device id
9393
_devices = Devices
9494
_devices_list = Devices list
9595
_disable_devices = Disable devices
96+
_disable_manual_geo_edit = Disable manual editing of geo values on device
9697
_do_not_navigate_away = Do not navigate away from this page while the upload is in progress
9798
_documentation_and_user_guides = Documentation and user guides
9899
_drop_files = Drop files here to upload or
@@ -125,6 +126,7 @@ _find = Find
125126
_free_text = Free Text
126127
_gelocation = Geolocation
127128
_generate_summary_per_geo_area = Generate Summary Sheets for each Geographic Area
129+
_geo_details = Geolocation settings
128130
_go_back_to_assignment_list = Go back to assignment list
129131
_go_back_to_survey_overview = Go back to survey overview
130132
_google_earth_applet_text_ = Exports a Google Earth file that shows the location and survey data for every surveyed point in your dashboard. can be opened in Google Earth, and must be saved as a .kmz file

GAE/src/org/waterforpeople/mapping/app/gwt/client/survey/QuestionDto.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class QuestionDto extends BaseDto implements NamedObject {
4040
private List<Long> questionOptions = null;
4141
private Boolean mandatoryFlag = null;
4242
private Boolean dependentFlag = null;
43+
private Boolean geoLocked = null;
4344
private Long dependentQuestionId;
4445
private String dependentQuestionAnswer;
4546
private Long metricId;
@@ -369,4 +370,12 @@ public Long getSourceId() {
369370
public void setSourceId(Long sourceId) {
370371
this.sourceId = sourceId;
371372
}
373+
374+
public Boolean getGeoLocked() {
375+
return geoLocked;
376+
}
377+
378+
public void setGeoLocked(Boolean geoLocked) {
379+
this.geoLocked = geoLocked;
380+
}
372381
}

0 commit comments

Comments
 (0)