Merge lp:~graeme-acm/sahana-eden/RMS into lp:sahana-eden
- RMS
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~graeme-acm/sahana-eden/RMS |
Merge into: | lp:sahana-eden |
Diff against target: |
478 lines (+226/-39) 6 files modified
controllers/survey.py (+50/-20) models/01_menu.py (+1/-1) models/survey.py (+166/-12) modules/s3/s3import.py (+4/-1) private/prepopulate/demo/ADAT/questionnaire24H.csv (+1/-1) private/prepopulate/demo/ADAT/questionnaire72H.csv (+4/-4) |
To merge this branch: | bzr merge lp:~graeme-acm/sahana-eden/RMS |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Fran Boon | Pending | ||
Review via email: mp+72342@code.launchpad.net |
This proposal has been superseded by a proposal from 2011-08-21.
Commit message
Description of the change
Crud strings added
Removed Crud buttons where not required
Improved work flow by using a fake component
- 1994. By Fran Boon
-
merge Trunk: ADAT progress
- 1995. By Fran Boon
-
merge Trunk: ADAT progress
- 1996. By Fran Boon
-
merge Trunk: Fix HRM site_orgs check
- 1997. By Fran Boon
-
Fix DateWidget in HRM - display 100 years in dropdown
- 1998. By Fran Boon
-
merge Trunk: ADAT progress
- 1999. By Fran Boon
-
pre-merge commit: Survey permissions
- 2000. By Fran Boon
-
merge Trunk: Survey debug
- 2001. By Fran Boon
-
merge Trunk: survey diagnostics to try and workout why the import is not working on the server
- 2002. By Fran Boon
-
merge Trunk: change test for MatPlotLib imported to a try except
- 2003. By Fran Boon
-
merge Trunk: ADAT
- 2004. By Fran Boon
-
merge Trunk: Survey progress inc XLS
- 2005. By Fran Boon
-
merge Trunk: Survey debug
- 2006. By Fran Boon
-
merge Trunk: Survey Map
- 2007. By Fran Boon
-
merge Trunk: Fix Map bounds being clobbered
- 2008. By Fran Boon
-
en-gb as default language (Movement std)
- 2009. By Fran Boon
-
Change source of TRMM layers to the new IFRC Prod box
- 2010. By Fran Boon
-
merge Trunk: more en-gb: catalogue
- 2011. By Fran Boon
-
merge Trunk: Asset fixes, S3Search enhancements
- 2012. By Fran Boon
-
merge Trunk: S3Search - Disable the dataTables search box to avoid duplicate/confusion
- 2013. By Fran Boon
-
merge Trunk: Asset fixes, ADAT progress
- 2014. By Fran Boon
-
Merge Trunk: Asset tweaks - Import shouldn't have response.s3.actions clobbered, add to Index page
- 2015. By Fran Boon
-
merge Trunk: mail.server_tls deployment_setting (needs to be False for default Debian)
- 2016. By Fran Boon
-
merge Trunk: Fix to Add Item Category (colorbox) link
- 2017. By Fran Boon
-
merge Trunk: Fixes for Asset log site/location toggle; add Oxfam Hong Kong to prepop
- 2018. By Fran Boon
-
merge Trunk: Fix import of Assets - Rooms & Dedup
- 2019. By Fran Boon
-
merge Trunk: Bug fixes in Colorboxes
- 2020. By Fran Boon
-
merge Trunk: mandatory last_name as conditional validator instead of DB constraint
- 2021. By Fran Boon
-
merge Trunk: Tweak Python version test & clarify warning message
- 2022. By Fran Boon
-
Map: HRM Popup now has an Edit button
- 2023. By Fran Boon
-
merge Trunk: Don't cache options() as otherwise Colorbox 'Add XXX' can't refresh the dropdown reliably
- 2024. By Fran Boon
-
Map: Cluster Popups should show all records, not just 1st 10
- 2025. By Fran Boon
-
merger Trunk: ADAT fixes/enhancements
- 2026. By Fran Boon
-
Remove duplicate menu entry
- 2027. By Fran Boon
-
Catalogue in en-gb
- 2028. By Fran Boon
-
Office controller filters-out warehouses
- 2029. By Fran Boon
-
Filter is only when inv enabled
- 2030. By Fran Boon
-
merge Trunk
- 2031. By Fran Boon
-
New theme - 1st cut
- 2032. By Fran Boon
-
Theme progress
- 2033. By Fran Boon
-
build
- 2034. By Fran Boon
-
Org: Add Region, Prepopulate countries, style tweaks
- 2035. By Fran Boon
-
merge Trunk: Org import templates
- 2036. By Fran Boon
-
All offices on the starting Map, Tweak Org RHeader & theme
- 2037. By Fran Boon
-
merge Trunk (SUrvey & code2 for GADM import)
- 2038. By Fran Boon
-
Some more CSS updates
- 2039. By Fran Boon
-
Style/content tweaks
- 2040. By Fran Boon
-
merge trunk: S3Cube works with Python 2.6
- 2041. By Fran Boon
-
Tweak default Map settings
- 2042. By Fran Boon
-
merge Trunk: S3Cube tweaks
- 2043. By Fran Boon
-
GIS: Improve error reporting when layer loading fails
- 2044. By Fran Boon
-
merge Trunk: HRM report on expiring contracts
- 2045. By Fran Boon
-
Style/Menu/Label updates
- 2046. By Fran Boon
-
Custom Ext Theme (& also Tabs & Action buttons harmonised with the rest of the IFRC theme)
- 2047. By Fran Boon
-
Map: New Markers
- 2048. By Fran Boon
-
Tweak map legend
- 2049. By Fran Boon
-
Don't hide Map popup links!
- 2050. By Fran Boon
-
GIS: Deprecate Yahoo layers, Hide Assessments from the Map Legend as we have no way of showing these easily on the main map right now
- 2051. By Fran Boon
-
merge Trunk: Project, Cube & Prepop
- 2052. By Fran Boon
-
Fixes to MapConfig handling
- 2053. By Fran Boon
-
prepop of Courses
- 2054. By Fran Boon
-
Tweaks to Permissions, Menus, HRM
- 2055. By Fran Boon
-
Assets as components of (HR) persons
- 2056. By Fran Boon
-
Fix s3_asset_prep's hiding of fields
- 2057. By Fran Boon
-
merge Trunk: S3CSV common templates, ReplaceOption for upload form, HR de-duplicator
- 2058. By Fran Boon
-
Training Report: 1st cut
- 2059. By Fran Boon
-
merge nursix: Organisation ID in warehouse upload form defaults to current user's org.
- 2060. By Fran Boon
-
Fix GeoRSS Layers, merge Graeme: inv_item stylesheet enhancements, speed up inv_item search (don't include site in simple)
- 2061. By Fran Boon
-
Menu Entry for inv_item, hide uploaded files in Importer
- 2062. By Fran Boon
-
RemoveOption for Stock items
- 2063. By Fran Boon
-
Not that simple to disable the dataTable of uploaded Imports :/
- 2064. By Fran Boon
-
Remove Default for warehouse Data (preventing Imports)
- 2065. By Fran Boon
-
merge nursix: S3Cube fix represent, HR Training report: aggregate by month
- 2066. By graeme-acm
-
ifrc base
- 2067. By graeme-acm
-
merge with ifrc
- 2068. By graeme-acm
-
merge with ifrc
- 2069. By graeme-acm
-
fix map pop up and some css styling
- 2070. By graeme-acm
-
map legend issue
- 2071. By graeme-acm
-
merge trunk
Unmerged revisions
- 2071. By graeme-acm
-
merge trunk
- 2070. By graeme-acm
-
map legend issue
- 2069. By graeme-acm
-
fix map pop up and some css styling
- 2068. By graeme-acm
-
merge with ifrc
- 2067. By graeme-acm
-
merge with ifrc
- 2066. By graeme-acm
-
ifrc base
- 2065. By Fran Boon
-
merge nursix: S3Cube fix represent, HR Training report: aggregate by month
- 2064. By Fran Boon
-
Remove Default for warehouse Data (preventing Imports)
- 2063. By Fran Boon
-
Not that simple to disable the dataTable of uploaded Imports :/
- 2062. By Fran Boon
-
RemoveOption for Stock items
Preview Diff
1 | === modified file 'controllers/survey.py' | |||
2 | --- controllers/survey.py 2011-08-20 09:29:54 +0000 | |||
3 | +++ controllers/survey.py 2011-08-21 15:15:26 +0000 | |||
4 | @@ -42,24 +42,8 @@ | |||
5 | 42 | tablename = "%s_%s" % (prefix, resourcename) | 42 | tablename = "%s_%s" % (prefix, resourcename) |
6 | 43 | s3mgr.load(tablename) | 43 | s3mgr.load(tablename) |
7 | 44 | table = db[tablename] | 44 | table = db[tablename] |
8 | 45 | |||
9 | 45 | 46 | ||
10 | 46 | # CRUD Strings | ||
11 | 47 | s3.crud_strings[tablename] = Storage( | ||
12 | 48 | title_create = T("Add Survey Template"), | ||
13 | 49 | title_display = T("Survey Template Details"), | ||
14 | 50 | title_list = T("List Survey Templates"), | ||
15 | 51 | title_update = T("Edit Survey Template"), | ||
16 | 52 | subtitle_create = T("Add New Survey Template"), | ||
17 | 53 | subtitle_list = T("Survey Templates"), | ||
18 | 54 | label_list_button = T("List Survey Templates"), | ||
19 | 55 | label_create_button = T("Add Survey Template"), | ||
20 | 56 | label_delete_button = T("Delete Survey Template"), | ||
21 | 57 | msg_record_created = T("Survey Template added"), | ||
22 | 58 | msg_record_modified = T("Survey Template updated"), | ||
23 | 59 | msg_record_deleted = T("Survey Template deleted"), | ||
24 | 60 | msg_list_empty = T("No Survey Template currently registered")) | ||
25 | 61 | |||
26 | 62 | |||
27 | 63 | def prep(r): | 47 | def prep(r): |
28 | 64 | s3_action_buttons(r) | 48 | s3_action_buttons(r) |
29 | 65 | query = (r.table.status == 1) # Status of Pending | 49 | query = (r.table.status == 1) # Status of Pending |
30 | @@ -158,7 +142,7 @@ | |||
31 | 158 | 142 | ||
32 | 159 | def prep(r): | 143 | def prep(r): |
33 | 160 | if r.interactive: | 144 | if r.interactive: |
35 | 161 | if r.id and (r.method == "update" or r.method == "create"): | 145 | if r.id and (r.method == "update"): |
36 | 162 | if "post_vars" in current.request and len(current.request.post_vars) > 0: | 146 | if "post_vars" in current.request and len(current.request.post_vars) > 0: |
37 | 163 | series_id = r.id | 147 | series_id = r.id |
38 | 164 | complete_id = r.component_id | 148 | complete_id = r.component_id |
39 | @@ -175,8 +159,11 @@ | |||
40 | 175 | return True | 159 | return True |
41 | 176 | 160 | ||
42 | 177 | def postp(r, output): | 161 | def postp(r, output): |
45 | 178 | response.s3.survey_answerlist_dataTable_post(r) | 162 | if r.component_name == None: |
46 | 179 | if r.id and (r.method == "update" or r.method == "create"): | 163 | response.s3.survey_serieslist_dataTable_post(r) |
47 | 164 | elif r.component_name == "complete": | ||
48 | 165 | response.s3.survey_answerlist_dataTable_post(r) | ||
49 | 166 | if r.id and (r.method == "update"): | ||
50 | 180 | series_id = r.id | 167 | series_id = r.id |
51 | 181 | complete_id = r.component_id | 168 | complete_id = r.component_id |
52 | 182 | form = response.s3.survey_build_series_questions(series_id, complete_id) | 169 | form = response.s3.survey_build_series_questions(series_id, complete_id) |
53 | @@ -184,6 +171,8 @@ | |||
54 | 184 | return output | 171 | return output |
55 | 185 | 172 | ||
56 | 186 | # remove CRUD generate buttons in the tabs | 173 | # remove CRUD generate buttons in the tabs |
57 | 174 | s3mgr.configure("survey_series", | ||
58 | 175 | deletable = False,) | ||
59 | 187 | s3mgr.configure("survey_complete", | 176 | s3mgr.configure("survey_complete", |
60 | 188 | listadd=False, | 177 | listadd=False, |
61 | 189 | deletable=False) | 178 | deletable=False) |
62 | @@ -203,6 +192,7 @@ | |||
63 | 203 | 192 | ||
64 | 204 | def prep(r): | 193 | def prep(r): |
65 | 205 | s3mgr.configure(r.tablename, | 194 | s3mgr.configure(r.tablename, |
66 | 195 | deletable = False, | ||
67 | 206 | orderby = r.tablename+".posn", | 196 | orderby = r.tablename+".posn", |
68 | 207 | ) | 197 | ) |
69 | 208 | return True | 198 | return True |
70 | @@ -273,6 +263,40 @@ | |||
71 | 273 | output = s3_rest_controller(prefix, resourcename) | 263 | output = s3_rest_controller(prefix, resourcename) |
72 | 274 | return output | 264 | return output |
73 | 275 | 265 | ||
74 | 266 | def newAssessment(): | ||
75 | 267 | # Load Model | ||
76 | 268 | prefix = "survey" | ||
77 | 269 | resourcename = "complete" | ||
78 | 270 | tablename = "%s_%s" % (prefix, resourcename) | ||
79 | 271 | s3mgr.load(tablename) | ||
80 | 272 | table = db[tablename] | ||
81 | 273 | |||
82 | 274 | def prep(r): | ||
83 | 275 | if r.interactive: | ||
84 | 276 | if "post_vars" in current.request and len(current.request.post_vars) > 0: | ||
85 | 277 | dummy, series_id = current.request.vars.viewing.split(".") | ||
86 | 278 | id = response.s3.survey_save_answers_for_series(series_id, | ||
87 | 279 | None, # Insert | ||
88 | 280 | current.request.post_vars) | ||
89 | 281 | response.flash = response.s3.crud_strings["survey_complete"].msg_record_created | ||
90 | 282 | return True | ||
91 | 283 | |||
92 | 284 | def postp(r, output): | ||
93 | 285 | response.s3.survey_answerlist_dataTable_post(r) | ||
94 | 286 | tablename, series_id = current.request.vars.viewing.split(".") | ||
95 | 287 | form = response.s3.survey_build_series_questions(series_id, None) | ||
96 | 288 | output["form"] = form | ||
97 | 289 | return output | ||
98 | 290 | |||
99 | 291 | response.s3.prep = prep | ||
100 | 292 | response.s3.postp = postp | ||
101 | 293 | output = s3_rest_controller(prefix, | ||
102 | 294 | resourcename, | ||
103 | 295 | method = "create", | ||
104 | 296 | rheader=response.s3.survey_series_rheader | ||
105 | 297 | ) | ||
106 | 298 | return output | ||
107 | 299 | |||
108 | 276 | def complete(): | 300 | def complete(): |
109 | 277 | """ RESTful CRUD controller """ | 301 | """ RESTful CRUD controller """ |
110 | 278 | # Load Model | 302 | # Load Model |
111 | @@ -304,6 +328,9 @@ | |||
112 | 304 | response.s3.survey_answerlist_dataTable_post(r) | 328 | response.s3.survey_answerlist_dataTable_post(r) |
113 | 305 | return output | 329 | return output |
114 | 306 | 330 | ||
115 | 331 | s3mgr.configure("survey_complete", | ||
116 | 332 | listadd=False, | ||
117 | 333 | deletable=False) | ||
118 | 307 | response.s3.prep = prep | 334 | response.s3.prep = prep |
119 | 308 | response.s3.postp = postp | 335 | response.s3.postp = postp |
120 | 309 | output = s3_rest_controller(prefix, resourcename) | 336 | output = s3_rest_controller(prefix, resourcename) |
121 | @@ -329,5 +356,8 @@ | |||
122 | 329 | template_id = request.args[0] | 356 | template_id = request.args[0] |
123 | 330 | except: | 357 | except: |
124 | 331 | pass | 358 | pass |
125 | 359 | s3mgr.configure("survey_complete", | ||
126 | 360 | listadd=False, | ||
127 | 361 | deletable=False) | ||
128 | 332 | output = s3_rest_controller(prefix, "complete") | 362 | output = s3_rest_controller(prefix, "complete") |
129 | 333 | return output | 363 | return output |
130 | 334 | 364 | ||
131 | === modified file 'models/01_menu.py' | |||
132 | --- models/01_menu.py 2011-08-20 22:11:46 +0000 | |||
133 | +++ models/01_menu.py 2011-08-21 15:15:26 +0000 | |||
134 | @@ -865,7 +865,7 @@ | |||
135 | 865 | ]], | 865 | ]], |
136 | 866 | [T("Response"), False, aURL(f="complete"), [ | 866 | [T("Response"), False, aURL(f="complete"), [ |
137 | 867 | # [T("New"), False, aURL(p="create", f="complete", args="create")], | 867 | # [T("New"), False, aURL(p="create", f="complete", args="create")], |
139 | 868 | [T("List All"), False, aURL(f="complete")], | 868 | # [T("List All"), False, aURL(f="complete")], |
140 | 869 | [T("Import Completed Responses"), False, aURL(f="complete", args="import.xml")] | 869 | [T("Import Completed Responses"), False, aURL(f="complete", args="import.xml")] |
141 | 870 | ]], | 870 | ]], |
142 | 871 | ] | 871 | ] |
143 | 872 | 872 | ||
144 | === modified file 'models/survey.py' | |||
145 | --- models/survey.py 2011-08-20 13:25:04 +0000 | |||
146 | +++ models/survey.py 2011-08-21 15:15:26 +0000 | |||
147 | @@ -66,7 +66,24 @@ | |||
148 | 66 | readable=True, | 66 | readable=True, |
149 | 67 | writable=False), | 67 | writable=False), |
150 | 68 | *s3_meta_fields()) | 68 | *s3_meta_fields()) |
152 | 69 | 69 | ||
153 | 70 | # CRUD Strings | ||
154 | 71 | s3.crud_strings[tablename] = Storage( | ||
155 | 72 | title_create = T("Add Survey Template"), | ||
156 | 73 | title_display = T("Survey Template Details"), | ||
157 | 74 | title_list = T("List of Survey Templates"), | ||
158 | 75 | title_update = T("Edit Survey Template"), | ||
159 | 76 | subtitle_create = T("Add a new Survey Template"), | ||
160 | 77 | subtitle_list = T("Survey Templates"), | ||
161 | 78 | label_list_button = T("List all Survey Templates"), | ||
162 | 79 | label_create_button = T("Add a new Survey Template"), | ||
163 | 80 | label_delete_button = T("Delete this Survey Template"), | ||
164 | 81 | msg_record_created = T("Survey Template added"), | ||
165 | 82 | msg_record_modified = T("Survey Template updated"), | ||
166 | 83 | msg_record_deleted = T("Survey Template deleted"), | ||
167 | 84 | msg_list_empty = T("No Survey Template currently registered")) | ||
168 | 85 | |||
169 | 86 | |||
170 | 70 | def survey_template_rheader(r, tabs=[]): | 87 | def survey_template_rheader(r, tabs=[]): |
171 | 71 | if r.representation == "html": | 88 | if r.representation == "html": |
172 | 72 | 89 | ||
173 | @@ -80,8 +97,12 @@ | |||
174 | 80 | rheader_tabs = s3_rheader_tabs(r, tabs) | 97 | rheader_tabs = s3_rheader_tabs(r, tabs) |
175 | 81 | 98 | ||
176 | 82 | sectionTable = db["survey_section"] | 99 | sectionTable = db["survey_section"] |
179 | 83 | query = (sectionTable.template_id == record.id) | 100 | qlistTable = db["survey_question_list"] |
180 | 84 | rows = db(query).select(orderby = sectionTable.posn) | 101 | query = (qlistTable.template_id == r.id) & \ |
181 | 102 | (qlistTable.section_id == sectionTable.id) | ||
182 | 103 | rows = db(query).select(sectionTable.id, | ||
183 | 104 | sectionTable.name, | ||
184 | 105 | orderby = qlistTable.posn) | ||
185 | 85 | tsection = TABLE(_class="survey-section-list") | 106 | tsection = TABLE(_class="survey-section-list") |
186 | 86 | lblSection = SPAN(T("Sections that are part of this template"), | 107 | lblSection = SPAN(T("Sections that are part of this template"), |
187 | 87 | _style="font-weight:bold;") | 108 | _style="font-weight:bold;") |
188 | @@ -90,11 +111,15 @@ | |||
189 | 90 | else: | 111 | else: |
190 | 91 | rsection = TR() | 112 | rsection = TR() |
191 | 92 | count = 0 | 113 | count = 0 |
192 | 114 | lastSection = "" | ||
193 | 93 | for section in rows: | 115 | for section in rows: |
194 | 116 | if section.name == lastSection: | ||
195 | 117 | continue | ||
196 | 94 | rsection.append(TD(A(section.name, | 118 | rsection.append(TD(A(section.name, |
197 | 95 | _href=URL(c="survey", | 119 | _href=URL(c="survey", |
198 | 96 | f="section", | 120 | f="section", |
199 | 97 | args="%s" % section.id)))) | 121 | args="%s" % section.id)))) |
200 | 122 | lastSection = section.name | ||
201 | 98 | count += 1 | 123 | count += 1 |
202 | 99 | if count % 4 == 0: | 124 | if count % 4 == 0: |
203 | 100 | tsection.append(rsection) | 125 | tsection.append(rsection) |
204 | @@ -161,7 +186,24 @@ | |||
205 | 161 | ), | 186 | ), |
206 | 162 | template_id(), | 187 | template_id(), |
207 | 163 | *s3_meta_fields()) | 188 | *s3_meta_fields()) |
209 | 164 | 189 | ||
210 | 190 | # CRUD Strings | ||
211 | 191 | s3.crud_strings[tablename] = Storage( | ||
212 | 192 | title_create = T("Add Template Section"), | ||
213 | 193 | title_display = T("Template Section Details"), | ||
214 | 194 | title_list = T("List of Template Sections"), | ||
215 | 195 | title_update = T("Edit Template Section"), | ||
216 | 196 | subtitle_create = T("Add a new Template Section"), | ||
217 | 197 | subtitle_list = T("Template Sections"), | ||
218 | 198 | label_list_button = T("List all Template Sections"), | ||
219 | 199 | label_create_button = T("Add a new Template Section"), | ||
220 | 200 | label_delete_button = T("Delete this Template Section"), | ||
221 | 201 | msg_record_created = T("Template Section added"), | ||
222 | 202 | msg_record_modified = T("Template Section updated"), | ||
223 | 203 | msg_record_deleted = T("Template Section deleted"), | ||
224 | 204 | msg_list_empty = T("No Template Section currently registered")) | ||
225 | 205 | |||
226 | 206 | |||
227 | 165 | s3mgr.configure(tablename, orderby = tablename+".posn") | 207 | s3mgr.configure(tablename, orderby = tablename+".posn") |
228 | 166 | 208 | ||
229 | 167 | # Section as component of Template | 209 | # Section as component of Template |
230 | @@ -270,6 +312,23 @@ | |||
231 | 270 | *s3_meta_fields() | 312 | *s3_meta_fields() |
232 | 271 | ) | 313 | ) |
233 | 272 | 314 | ||
234 | 315 | # CRUD Strings | ||
235 | 316 | s3.crud_strings[tablename] = Storage( | ||
236 | 317 | title_create = T("Add an Assessment Question"), | ||
237 | 318 | title_display = T("Assessment Question Details"), | ||
238 | 319 | title_list = T("List of Assessment Questions"), | ||
239 | 320 | title_update = T("Edit Assessment Question"), | ||
240 | 321 | subtitle_create = T("Add a new Assessment Question"), | ||
241 | 322 | subtitle_list = T("Survey Templates"), | ||
242 | 323 | label_list_button = T("List all Assessment Questions"), | ||
243 | 324 | label_create_button = T("Add a new Assessment Question"), | ||
244 | 325 | label_delete_button = T("Delete this Assessment Question"), | ||
245 | 326 | msg_record_created = T("Assessment Question added"), | ||
246 | 327 | msg_record_modified = T("Assessment Question updated"), | ||
247 | 328 | msg_record_deleted = T("Assessment Question deleted"), | ||
248 | 329 | msg_list_empty = T("No Assessment Question currently registered")) | ||
249 | 330 | |||
250 | 331 | |||
251 | 273 | 332 | ||
252 | 274 | # Question Metadata | 333 | # Question Metadata |
253 | 275 | """ This table is referenced by the questions table and is used to manage | 334 | """ This table is referenced by the questions table and is used to manage |
254 | @@ -304,9 +363,25 @@ | |||
255 | 304 | *s3_meta_fields() | 363 | *s3_meta_fields() |
256 | 305 | ) | 364 | ) |
257 | 306 | 365 | ||
261 | 307 | 366 | # CRUD Strings | |
262 | 308 | 367 | s3.crud_strings[tablename] = Storage( | |
263 | 309 | 368 | title_create = T("Add Question Meta-Data"), | |
264 | 369 | title_display = T("Question Meta-Data Details"), | ||
265 | 370 | title_list = T("List of Question Meta-Data"), | ||
266 | 371 | title_update = T("Edit Question Meta-Data"), | ||
267 | 372 | subtitle_create = T("Add new Question Meta-Data"), | ||
268 | 373 | subtitle_list = T("Question Meta-Data"), | ||
269 | 374 | label_list_button = T("List all Question Meta-Data"), | ||
270 | 375 | label_create_button = T("Add new Question Meta-Data"), | ||
271 | 376 | label_delete_button = T("Delete this Question Meta-Data"), | ||
272 | 377 | msg_record_created = T("Question Meta-Data added"), | ||
273 | 378 | msg_record_modified = T("Question Meta-Data updated"), | ||
274 | 379 | msg_record_deleted = T("Question Meta-Data deleted"), | ||
275 | 380 | msg_list_empty = T("No Question Meta-Data currently registered"), | ||
276 | 381 | uploadTitle = T("Upload a Question List import file") | ||
277 | 382 | ) | ||
278 | 383 | |||
279 | 384 | |||
280 | 310 | # Question Types | 385 | # Question Types |
281 | 311 | def survey_stringType(): | 386 | def survey_stringType(): |
282 | 312 | return S3QuestionTypeStringWidget() | 387 | return S3QuestionTypeStringWidget() |
283 | @@ -366,6 +441,11 @@ | |||
284 | 366 | *s3_meta_fields() | 441 | *s3_meta_fields() |
285 | 367 | ) | 442 | ) |
286 | 368 | 443 | ||
287 | 444 | # CRUD Strings | ||
288 | 445 | s3.crud_strings[tablename] = Storage( | ||
289 | 446 | uploadTitle = T("Upload a Survey Template import file") | ||
290 | 447 | ) | ||
291 | 448 | |||
292 | 369 | def getAllQuestionsForTemplate(template_id): | 449 | def getAllQuestionsForTemplate(template_id): |
293 | 370 | """ | 450 | """ |
294 | 371 | function to return the list of questions for the given template | 451 | function to return the list of questions for the given template |
295 | @@ -528,7 +608,24 @@ | |||
296 | 528 | Field("start_date", "date", default=None), | 608 | Field("start_date", "date", default=None), |
297 | 529 | Field("end_date", "date", default=None), | 609 | Field("end_date", "date", default=None), |
298 | 530 | *s3_meta_fields()) | 610 | *s3_meta_fields()) |
300 | 531 | 611 | ||
301 | 612 | # CRUD Strings | ||
302 | 613 | s3.crud_strings[tablename] = Storage( | ||
303 | 614 | title_create = T("Add Survey Series"), | ||
304 | 615 | title_display = T(" Survey Series Details"), | ||
305 | 616 | title_list = T("List of Survey Series"), | ||
306 | 617 | title_update = T("Edit Survey Series"), | ||
307 | 618 | subtitle_create = T("Add a new Survey Series"), | ||
308 | 619 | subtitle_list = T("Survey Series"), | ||
309 | 620 | label_list_button = T("List all Survey Series"), | ||
310 | 621 | label_create_button = T("Add a new Survey Series"), | ||
311 | 622 | label_delete_button = T("Delete this Survey Series"), | ||
312 | 623 | msg_record_created = T("Survey Series added"), | ||
313 | 624 | msg_record_modified = T("Survey Series updated"), | ||
314 | 625 | msg_record_deleted = T("Survey Series deleted"), | ||
315 | 626 | msg_list_empty = T("No Survey Series currently registered")) | ||
316 | 627 | |||
317 | 628 | |||
318 | 532 | def survey_series_rheader(r, tabs=[]): | 629 | def survey_series_rheader(r, tabs=[]): |
319 | 533 | if r.representation == "html": | 630 | if r.representation == "html": |
320 | 534 | 631 | ||
321 | @@ -536,9 +633,9 @@ | |||
322 | 536 | if tablename == "survey_series" and record: | 633 | if tablename == "survey_series" and record: |
323 | 537 | 634 | ||
324 | 538 | # Tabs | 635 | # Tabs |
326 | 539 | tabs = [#(T("New Response"), "complete"), | 636 | tabs = [(T("New Assessment"), "newAssessment/"), |
327 | 637 | (T("Completed Assessments"), "complete"), | ||
328 | 540 | (T("Series Details"), None), | 638 | (T("Series Details"), None), |
329 | 541 | (T("Completed Questionnaires"), "complete"), | ||
330 | 542 | ] | 639 | ] |
331 | 543 | rheader_tabs = s3_rheader_tabs(r, tabs) | 640 | rheader_tabs = s3_rheader_tabs(r, tabs) |
332 | 544 | 641 | ||
333 | @@ -602,10 +699,32 @@ | |||
334 | 602 | list_fields = ["created_on", "series_id", "answer_list"] | 699 | list_fields = ["created_on", "series_id", "answer_list"] |
335 | 603 | s3mgr.configure("survey_complete", list_fields=list_fields) | 700 | s3mgr.configure("survey_complete", list_fields=list_fields) |
336 | 604 | 701 | ||
337 | 702 | def survey_serieslist_dataTable_post(r): | ||
338 | 703 | s3_action_buttons(r) | ||
339 | 704 | response.s3.actions = [ | ||
340 | 705 | dict(label=str(T("Open")), | ||
341 | 706 | _class="action-btn", | ||
342 | 707 | url=URL(c=module, | ||
343 | 708 | f="newAssessment", | ||
344 | 709 | vars={"viewing":"survey_series.[id]"}) | ||
345 | 710 | ), | ||
346 | 711 | dict(label=str(T("Analysis")), | ||
347 | 712 | _class="action-btn", | ||
348 | 713 | url=URL(c=module, | ||
349 | 714 | f="analysis", | ||
350 | 715 | args=["[id]"]) | ||
351 | 716 | ), | ||
352 | 717 | ] | ||
353 | 718 | |||
354 | 605 | def survey_answerlist_dataTable_post(r): | 719 | def survey_answerlist_dataTable_post(r): |
355 | 606 | s3_action_buttons(r) | 720 | s3_action_buttons(r) |
358 | 607 | response.s3.actions = \ | 721 | response.s3.actions = [ |
359 | 608 | response.s3.actions + [ | 722 | dict(label=str(T("Open")), |
360 | 723 | _class="action-btn", | ||
361 | 724 | url=URL(c=module, | ||
362 | 725 | f="series", | ||
363 | 726 | args=[r.id,"complete","[id]","update"]) | ||
364 | 727 | ), | ||
365 | 609 | dict(label=str(T("Analysis")), | 728 | dict(label=str(T("Analysis")), |
366 | 610 | _class="action-btn", | 729 | _class="action-btn", |
367 | 611 | url=URL(c=module, | 730 | url=URL(c=module, |
368 | @@ -630,6 +749,24 @@ | |||
369 | 630 | ), | 749 | ), |
370 | 631 | *s3_meta_fields()) | 750 | *s3_meta_fields()) |
371 | 632 | 751 | ||
372 | 752 | # CRUD Strings | ||
373 | 753 | s3.crud_strings[tablename] = Storage( | ||
374 | 754 | title_create = T("Complete a new Assessment"), | ||
375 | 755 | title_display = T("Completed Assessment Details"), | ||
376 | 756 | title_list = T("List of Completed Assessments"), | ||
377 | 757 | title_update = T("Edit Completed Assessment"), | ||
378 | 758 | subtitle_create = T("Add a new Completed Assessment"), | ||
379 | 759 | subtitle_list = T("Completed Assessment"), | ||
380 | 760 | label_list_button = T("List all Completed Assessment"), | ||
381 | 761 | label_create_button = T("Add a new Completed Assessment"), | ||
382 | 762 | label_delete_button = T("Delete this Completed Assessment"), | ||
383 | 763 | msg_record_created = T("Completed Assessment added"), | ||
384 | 764 | msg_record_modified = T("Completed Assessment updated"), | ||
385 | 765 | msg_record_deleted = T("Completed Assessment deleted"), | ||
386 | 766 | msg_list_empty = T("No Completed Assessments currently registered"), | ||
387 | 767 | uploadTitle = T("Upload the Completed Assessments import file") | ||
388 | 768 | ) | ||
389 | 769 | |||
390 | 633 | def survey_complete_onaccept(form): | 770 | def survey_complete_onaccept(form): |
391 | 634 | """ | 771 | """ |
392 | 635 | All of the answers will be stored in the answer_list in the format | 772 | All of the answers will be stored in the answer_list in the format |
393 | @@ -701,6 +838,22 @@ | |||
394 | 701 | *s3_meta_fields()) | 838 | *s3_meta_fields()) |
395 | 702 | 839 | ||
396 | 703 | 840 | ||
397 | 841 | # CRUD Strings | ||
398 | 842 | s3.crud_strings[tablename] = Storage( | ||
399 | 843 | title_create = T("Add Assessment Answer"), | ||
400 | 844 | title_display = T("Assessment Answer Details"), | ||
401 | 845 | title_list = T("List of Assessment Answers"), | ||
402 | 846 | title_update = T("Edit Assessment Answer"), | ||
403 | 847 | subtitle_create = T("Add a new Assessment Answer"), | ||
404 | 848 | subtitle_list = T("Assessment Answer"), | ||
405 | 849 | label_list_button = T("List all Assessment Answer"), | ||
406 | 850 | label_create_button = T("Add a new Assessment Answer"), | ||
407 | 851 | label_delete_button = T("Delete this Assessment Answer"), | ||
408 | 852 | msg_record_created = T("Assessment Answer added"), | ||
409 | 853 | msg_record_modified = T("Assessment Answer updated"), | ||
410 | 854 | msg_record_deleted = T("Assessment Answer deleted"), | ||
411 | 855 | msg_list_empty = T("No Assessment Answers currently registered")) | ||
412 | 856 | |||
413 | 704 | 857 | ||
414 | 705 | 858 | ||
415 | 706 | 859 | ||
416 | @@ -816,6 +969,7 @@ | |||
417 | 816 | survey_answer_list_represent = survey_answer_list_represent, | 969 | survey_answer_list_represent = survey_answer_list_represent, |
418 | 817 | survey_answerlist_dataTable_pre = survey_answerlist_dataTable_pre, | 970 | survey_answerlist_dataTable_pre = survey_answerlist_dataTable_pre, |
419 | 818 | survey_answerlist_dataTable_post = survey_answerlist_dataTable_post, | 971 | survey_answerlist_dataTable_post = survey_answerlist_dataTable_post, |
420 | 972 | survey_serieslist_dataTable_post = survey_serieslist_dataTable_post, | ||
421 | 819 | survey_save_answers_for_series = survey_save_answers_for_series, | 973 | survey_save_answers_for_series = survey_save_answers_for_series, |
422 | 820 | survey_build_series_questions = survey_build_series_questions, | 974 | survey_build_series_questions = survey_build_series_questions, |
423 | 821 | survey_build_template_questions = survey_build_template_questions, | 975 | survey_build_template_questions = survey_build_template_questions, |
424 | 822 | 976 | ||
425 | === modified file 'modules/s3/s3import.py' | |||
426 | --- modules/s3/s3import.py 2011-08-20 13:47:18 +0000 | |||
427 | +++ modules/s3/s3import.py 2011-08-21 15:15:26 +0000 | |||
428 | @@ -197,7 +197,10 @@ | |||
429 | 197 | self.ErrorUploadFileMissing = T("The file to upload is missing") | 197 | self.ErrorUploadFileMissing = T("The file to upload is missing") |
430 | 198 | self.WarningNoRecords = T("No records to import") | 198 | self.WarningNoRecords = T("No records to import") |
431 | 199 | self.WarningNoJobToDelete = T("No job to delete, maybe it has already been deleted.") | 199 | self.WarningNoJobToDelete = T("No job to delete, maybe it has already been deleted.") |
433 | 200 | self.uploadTitle = T("Upload a %s import file" % r.function) | 200 | if "uploadTitle" in current.response.s3.crud_strings[self.tablename]: |
434 | 201 | self.uploadTitle = current.response.s3.crud_strings[self.tablename].uploadTitle | ||
435 | 202 | else: | ||
436 | 203 | self.uploadTitle = T("Upload a %s import file" % r.function) | ||
437 | 201 | self.displayJobTitle = T("Details of the selected import job") | 204 | self.displayJobTitle = T("Details of the selected import job") |
438 | 202 | self.displayJobListTitle = T("List of import items") | 205 | self.displayJobListTitle = T("List of import items") |
439 | 203 | self.fileUploaded = T("Import file uploaded") | 206 | self.fileUploaded = T("Import file uploaded") |
440 | 204 | 207 | ||
441 | === modified file 'private/prepopulate/demo/ADAT/questionnaire24H.csv' | |||
442 | --- private/prepopulate/demo/ADAT/questionnaire24H.csv 2011-08-20 09:29:54 +0000 | |||
443 | +++ private/prepopulate/demo/ADAT/questionnaire24H.csv 2011-08-21 15:15:26 +0000 | |||
444 | @@ -45,7 +45,7 @@ | |||
445 | 45 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Is the community responding to the disaster?","YesNoDontKnow",,44,"24H-Re-2",,,,,, | 45 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Is the community responding to the disaster?","YesNoDontKnow",,44,"24H-Re-2",,,,,, |
446 | 46 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Are NGOs responding in the disaster area?","YesNoDontKnow",,45,"24H-Re-3",,,,,, | 46 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Are NGOs responding in the disaster area?","YesNoDontKnow",,45,"24H-Re-3",,,,,, |
447 | 47 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Which NGOs responding in the disaster area?","Text",,46,"24H-Re-4",,,,,, | 47 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Which NGOs responding in the disaster area?","Text",,46,"24H-Re-4",,,,,, |
449 | 48 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Expected needs","Option",,47,"24H-Re-5","Length",3,1,"Rural",2,"Peri–Urban" | 48 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Expected needs","Option",,47,"24H-Re-5","Length",3,1,"Rural",2,"Peri-Urban" |
450 | 49 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Expected needs","Option",,47,"24H-Re-5",3,"Urban ",,,, | 49 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Response",7,"Expected needs","Option",,47,"24H-Re-5",3,"Urban ",,,, |
451 | 50 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Risks",5,"Concerns for Toxic spills","YesNo",,48,"24H-Ri-1",,,,,, | 50 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Risks",5,"Concerns for Toxic spills","YesNo",,48,"24H-Ri-1",,,,,, |
452 | 51 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Risks",5,"Concerns for Oil spills","YesNo",,49,"24H-Ri-2",,,,,, | 51 | "24Hour","Rapid onset disaster. First 24 hours, rapid field assessment form (B)","Risks",5,"Concerns for Oil spills","YesNo",,49,"24H-Ri-2",,,,,, |
453 | 52 | 52 | ||
454 | === modified file 'private/prepopulate/demo/ADAT/questionnaire72H.csv' | |||
455 | --- private/prepopulate/demo/ADAT/questionnaire72H.csv 2011-08-19 04:23:49 +0000 | |||
456 | +++ private/prepopulate/demo/ADAT/questionnaire72H.csv 2011-08-21 15:15:26 +0000 | |||
457 | @@ -39,11 +39,11 @@ | |||
458 | 39 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Explain","String",,38,"72B12.3.1",,,,,, | 39 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Explain","String",,38,"72B12.3.1",,,,,, |
459 | 40 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Is this food accessible to all the affected people, or do only a few have access?","String",,39,"72B12.4",,,,,, | 40 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Is this food accessible to all the affected people, or do only a few have access?","String",,39,"72B12.4",,,,,, |
460 | 41 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Do people have access to cooking facilities? ","YesNo",,40,"72B12.5",,,,,, | 41 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Do people have access to cooking facilities? ","YesNo",,40,"72B12.5",,,,,, |
462 | 42 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Utensils:","Option",,41,"72B12.5.1","Length",3,1,"“None”",2,"Few" | 42 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Utensils:","Option",,41,"72B12.5.1","Length",3,1,"'None'",2,"Few" |
463 | 43 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Utensils:","Option",,41,"72B12.5.1",3,"Many",,,, | 43 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Utensils:","Option",,41,"72B12.5.1",3,"Many",,,, |
465 | 44 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Fuel","Option",,42,"72B12.5.2","Length",3,1,"“None”",2,"Few" | 44 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Fuel","Option",,42,"72B12.5.2","Length",3,1,"'None'",2,"Few" |
466 | 45 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Fuel","Option",,42,"72B12.5.2",3,"Many",,,, | 45 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Fuel","Option",,42,"72B12.5.2",3,"Many",,,, |
468 | 46 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Pots","Option",,43,"72B12.5.3","Length",3,1,"“None”",2,"Few" | 46 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Pots","Option",,43,"72B12.5.3","Length",3,1,"None",2,"Few" |
469 | 47 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Pots","Option",,43,"72B12.5.3",3,"Many",,,, | 47 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Pots","Option",,43,"72B12.5.3",3,"Many",,,, |
470 | 48 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Other","String",,44,"72B12.5.4",,,,,, | 48 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Other","String",,44,"72B12.5.4",,,,,, |
471 | 49 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Do people have access to a safe place to prepare food and eat it?","YesNo",,45,"72B12.6",,,,,, | 49 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Nutrition",6,"Do people have access to a safe place to prepare food and eat it?","YesNo",,45,"72B12.6",,,,,, |
472 | @@ -155,5 +155,5 @@ | |||
473 | 155 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Is the community responding to the disaster? ","YesNoDontKnow",,143,"72B19.2",,,,,, | 155 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Is the community responding to the disaster? ","YesNoDontKnow",,143,"72B19.2",,,,,, |
474 | 156 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Are NGOs responding in the disaster area? ","YesNoDontKnow",,144,"72B19.3",,,,,, | 156 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Are NGOs responding in the disaster area? ","YesNoDontKnow",,144,"72B19.3",,,,,, |
475 | 157 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Which ones","String",,145,"72B19.3.1",,,,,, | 157 | "72Hour","Rapid onset disaster. First 72 hours, rapid field assessment form (B)","Response",12,"Which ones","String",,145,"72B19.3.1",,,,,, |
477 | 158 | "24Hour",,"Response",7,"Expected needs","Option",,146,"72H-Re-5","Length",3,1,"Rural",2,"Peri–Urban" | 158 | "24Hour",,"Response",7,"Expected needs","Option",,146,"72H-Re-5","Length",3,1,"Rural",2,"Peri-Urban" |
478 | 159 | "24Hour",,"Response",7,"Expected needs","Option",,146,"72H-Re-5",3,"Urban ",,,, | 159 | "24Hour",,"Response",7,"Expected needs","Option",,146,"72H-Re-5",3,"Urban ",,,, |