diff --git a/addons/portal_anonymous_survey/__init__.py b/addons/portal_anonymous_survey/__init__.py new file mode 100644 index 00000000000..6a3d1a7d32b --- /dev/null +++ b/addons/portal_anonymous_survey/__init__.py @@ -0,0 +1 @@ +import portal_anonymous_survey \ No newline at end of file diff --git a/addons/portal_anonymous_survey/__openerp__.py b/addons/portal_anonymous_survey/__openerp__.py new file mode 100644 index 00000000000..a4594499843 --- /dev/null +++ b/addons/portal_anonymous_survey/__openerp__.py @@ -0,0 +1,18 @@ +{ + 'name': 'Anonymous portal for Survey', + 'version': '0.1', + 'category': 'Tools', + 'complexity': 'easy', + 'description': """ +This module adds authenticate options to survey and portal anonymous are installed. +=================================================================================== + """, + 'author': 'OpenERP SA', + 'depends': ['survey','portal_anonymous'], + 'data': [ + 'portal_anonymous_survey_view.xml', + ], + 'installable': True, + 'auto_install': True, + 'category': 'Hidden', +} \ No newline at end of file diff --git a/addons/portal_anonymous_survey/portal_anonymous_survey.py b/addons/portal_anonymous_survey/portal_anonymous_survey.py new file mode 100644 index 00000000000..38f3aef2d67 --- /dev/null +++ b/addons/portal_anonymous_survey/portal_anonymous_survey.py @@ -0,0 +1,30 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-TODAY OpenERP S.A. +# +# This program is free software: you can redistribute it and / or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +class portal_anonymous_survey(osv.osv): + _inherit = "survey" + _defaults = { + 'authenticate': False, + } + +portal_anonymous_survey() + +# vim: exp and tab: smartindent: tabstop=4: softtabstop=4: shiftwidth=4: diff --git a/addons/portal_anonymous_survey/portal_anonymous_survey_view.xml b/addons/portal_anonymous_survey/portal_anonymous_survey_view.xml new file mode 100644 index 00000000000..9dfdef0afa5 --- /dev/null +++ b/addons/portal_anonymous_survey/portal_anonymous_survey_view.xml @@ -0,0 +1,15 @@ + + + + + portal.anonymous.survey + survey + + + + + + + + + \ No newline at end of file diff --git a/addons/survey/static/src/css/survey.css b/addons/survey/static/src/css/survey.css index 0d71bfdf684..57ddb107025 100644 --- a/addons/survey/static/src/css/survey.css +++ b/addons/survey/static/src/css/survey.css @@ -58,16 +58,26 @@ } .openerp .oe_survey_button { - background-color: #c02c2c; - color: #fff !important; - padding: 3px 4px 4px 4px; - background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); border-radius: 4px; + padding: 3px 8px 4px 8px; border: 1px solid #000; border-width: 1px 1px 0 0; text-shadow: none; text-decoration: none !important; } +.openerp .oe_survey_button, .openerp .oe_form .oe_survey button.oe_highlight { + color: #fff !important; + background-color: #c02c2c; + background-image: -webkit-gradient(linear, left top, left bottom, from(#df3f3f), to(#a21a1a)); + background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -moz-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -ms-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -o-linear-gradient(top, #df3f3f, #a21a1a); + background-image: linear-gradient(to bottom, #df3f3f, #a21a1a); + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; +} .openerp .oe_form .oe_survey_answer .oe_form_sheet label { max-width: 280px; diff --git a/addons/survey/survey.py b/addons/survey/survey.py index cbe062db671..0e9f84770f5 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -90,7 +90,7 @@ class survey(osv.osv): 'date_close': fields.datetime('Survey Close Date', readonly=1), 'max_response_limit': fields.integer('Maximum Answer Limit', help="Set to one if survey is answerable only once"), 'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('close', 'Close'), ('cancel', 'Cancelled')], 'Status', required=1), - 'authenticate': fields.boolean('User must be authentified'), + 'authenticate': fields.boolean('User must be authentified', help="If the user must be authenticate, when the user click on the link, it's redirected to the login page if not authenticated. In otherwise, it may complete the survey directly."), 'tot_start_survey': fields.function(_get_tot_start_survey, string="Total Started Survey", type="integer"), 'tot_comp_survey': fields.function(_get_tot_comp_survey, string="Total Completed Survey", type="integer"), 'note': fields.text('Description', size=128, translate=True), @@ -102,7 +102,7 @@ class survey(osv.osv): } _defaults = { 'state': "draft", - 'authenticate': False, + 'authenticate': True, 'date_open': fields.datetime.now, 'token': lambda s, cr, uid, c: uuid.uuid4(), } diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 1fcfe2c05ae..43005514f2d 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -22,10 +22,9 @@
-
@@ -43,9 +42,13 @@ - +
+ + The Public Portal is not activated; your audience must be authenticated to answer the survey. If you want to make the survey available to everyone, please activate the Public Portal : Settings > General Settings > Activate the public portal + +
@@ -123,7 +126,7 @@ @@ -631,7 +634,7 @@ - Survey Type + Survey Response survey.response form tree,form