[IMP] Link for printing the answers (MERRY CHRISTMAS BABIES)

bzr revid: rim@openerp.com-20131224155940-1jfjrrhclfqyvb9p
This commit is contained in:
Richard Mathot (OpenERP)
2013-12-24 16:59:40 +01:00
parent ac1351c6f3
commit a4cc8618f5
3 changed files with 8 additions and 5 deletions
+5 -2
View File
@@ -165,7 +165,8 @@ class WebsiteSurvey(http.Controller):
data.update({'last': True})
return request.website.render('survey.survey', data)
elif user_input.state == 'done': # Display success message
return request.website.render('survey.finished', {'survey': survey})
return request.website.render('survey.sfinished', {'survey': survey,
'token': token})
elif user_input.state == 'skip':
flag = (True if prev and prev == 'prev' else False)
page, page_nr, last = survey_obj.next_page(cr, uid, user_input, user_input.last_displayed_page_id.id, go_back=flag, context=context)
@@ -278,7 +279,9 @@ class WebsiteSurvey(http.Controller):
'''Display an survey in printable view; if <token> is set, it will
grab the answers of the user_input_id that has <token>.'''
return request.website.render('survey.survey_print',
{'survey': survey, 'page_nr': 0})
{'survey': survey,
'token': token,
'page_nr': 0})
def dict_soft_update(dictionary, key, value):
+2 -1
View File
@@ -23,13 +23,14 @@
</template>
<!-- "Thank you" message when the survey is completed -->
<template id="finished" name="Survey Finished">
<template id="sfinished" name="Survey Finished">
<t t-call="website.layout">
<div class="wrap">
<div class="container">
<div class="jumbotron mt32">
<h1>Thank you!</h1>
<div t-field="survey.thank_you_message" />
<div>If you wish, you can <a t-att-href="'/survey/print/%s/%s' % (survey.id, token)">print your answers</a>.</div>
</div>
</div>
</div>
+1 -2
View File
@@ -82,8 +82,7 @@
<field name="type"/>
<field name="state"/>
<button name="action_survey_resent" states="new,skip" string="Resent the invitation" type="object" icon="gtk-redo"/>
<button name="action_preview" states="done,skip" string="Preview" type="object" icon="gtk-zoom-fit"/>
<button name="action_print_response" states="done,skip" string="Print response" type="object" icon="gtk-print"/>
<button name="action_print_response" states="done,skip" string="Print Answers" type="object" icon="gtk-print"/>
</tree>
</field>
</record>