diff --git a/addons/survey/controllers/main.py b/addons/survey/controllers/main.py index f942c6a42ce..8c7b20f17eb 100644 --- a/addons/survey/controllers/main.py +++ b/addons/survey/controllers/main.py @@ -47,7 +47,7 @@ class WebsiteSurvey(http.Controller): surveys = survey_obj.browse(cr, uid, survey_ids, context=context) return request.website.render('survey.list', {'surveys': surveys}) - @website.route(['/survey/fill//'], + @website.route(['/survey/fill/'], type='http', auth='public', multilang=True) def fill_survey(self, survey=None, **post): '''Display and validates a survey''' @@ -87,6 +87,18 @@ class WebsiteSurvey(http.Controller): {'survey': survey, 'pagination': pagination}) + # @website.route(['/survey/validate/'], type='json', auth='public', multilang=True): + # return { + # 'error' : {} + # } + + + # @website.route(['/survey/submit/'], type='json', auth='public', multilang=True): + # return { + # 'redirect' : None + # } + + @website.route(['/survey/print//'], type='http', auth='public', multilang=True) def print_empty_survey(self, survey=None, **post): diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index 518ab8d193f..cc4f7be58f3 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -1,5 +1,15 @@ $(document).ready(function () { + var the_form = $('form'); + var prefill_controller = the_form.attr("data-prefill"); + var validate_controller = the_form.attr("data-validate"); + var submit_controller = the_form.attr("data-submit"); + + console.log(prefill_controller); + console.log(validate_controller); + console.log(submit_controller); + + // startsWith compatibility patch with old browsers if (typeof String.prototype.startsWith != 'function') { String.prototype.startsWith = function (str){ @@ -22,7 +32,6 @@ $(document).ready(function () { // check if number of answers is ok // check if answer has good qualities - $('form').submit( function(){ console.debug("[survey] Submit button clicked"); diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 7a9acc2f39d..0ed8f255c29 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -23,7 +23,6 @@ from urlparse import urljoin from openerp.osv import fields, osv from openerp.tools.translate import _ import uuid -import json class survey_survey(osv.osv): diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 954fe5c0e9b..0022407db25 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -54,7 +54,7 @@

-
+ @@ -89,26 +89,11 @@

- - - - + + @@ -124,14 +109,7 @@ -
+

*

@@ -139,25 +117,25 @@
- + - + - + - + - + TODO: replace html5 datetime widget by OpenERP-CMS datetime widget @@ -165,7 +143,7 @@
@@ -173,7 +151,7 @@
- @@ -185,39 +163,13 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - @@ -228,7 +180,7 @@ - Other: + Other: