odoo/addons/survey/wizard/survey_email_compose_messag...

105 lines
6.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--Survey send invitation Email template -->
<record id="email_template_survey" model="email.template">
<field name="name">Survey - Send by Email</field>
<field name="model_id" ref="model_survey"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); ">
<p>Hello,</p>
<p>We are conducting a survey, and you response would be appreciated.</p>
<p><a href="__URL__">Please, click here to take survey</a></p>
<p>Thanks for your participation!</p>
</div>
]]></field>
</record>
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
<act_window name="Partner Survey Mailing"
res_model="survey.mail.compose.message"
src_model="res.partner"
view_mode="form"
multi="True"
target="new"
key2="client_action_multi"
id="survey.action_partner_survey_mail"
context="{
'default_use_template': True,
'default_template_id': ref('email_template_survey'),
}"/>
<!--Survey send
Context['survey_resent_token'], if True, hidde share option, emails list and partner_ids
-->
<record model="ir.ui.view" id="survey_email_compose_message">
<field name="name">survey.mail.compose.message.form</field>
<field name="model">survey.mail.compose.message</field>
<field name="arch" type="xml">
<form string="Compose Email" version="7.0">
<field name="composition_mode" invisible="1"/>
<field name="model" invisible="1"/>
<field name="res_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
<group col="2">
<field name="survey_id" readonly="context.get('default_survey_id')" on_change="onchange_survey_id(survey_id)"/>
<field name="public" widget="radio" invisible="context.get('survey_resent_token')"/>
</group>
<group col="1" invisible="context.get('survey_resent_token')" attrs="{'invisible':[('public','in',['email_private', 'email_public_link'])]}" class="oe_survey_email_public">
<div>
You can share your survey web public link and/or send private invitations to your audience.<br/>
People can response once per invitation, and whenever they want with the public web link.
</div>
<div class="oe_survey_url_label">Copy, paste and share the web link below to your audience.</div>
<div class="oe_survey_url">
<field name="public_url"/>
</div>
<div class="oe_survey_url_label">Copy and paste the HTML code below to add this web link to any webpage.</div>
<div class="oe_survey_url">
<field name="public_url_html"/>
</div>
</group>
<group col="1" attrs="{'invisible':['|',('public','=',False),('public','in',['public_link'])]}">
<group col="2">
<field invisible="context.get('survey_resent_token')" name="partner_ids" widget="many2many_tags_email" placeholder="Add list of existing contacts..." context="{'force_email':True, 'show_email':True}"/>
<field invisible="context.get('survey_resent_token')" name="multi_email" placeholder="Add list of email of recipients (will not converted in partner), separated by commas, semicolons or newline..." on_change="onchange_multi_email(multi_email)" no_resize="1"/>
<field name="subject" placeholder="Subject..."/>
</group>
<field name="body" help="__URL__ will be automatically transformed into web address (public or private, depending on your choice). You can click on 'Show Source' button to see __URL__ in the link tag on the email template."/>
<group col="2">
<div>
<label for="attachment_ids"/>
<field name="attachment_ids" widget="many2many_binary"/>
</div>
<div class="oe_survey_date_deadline">
<label for="date_deadline"/>
<field name="date_deadline"/>
</div>
</group>
</group>
<footer attrs="{'invisible':[('public','in',['email_private', 'email_public_link'])]}">
<button string="Close" class="oe_link" special="cancel" />
</footer>
<footer attrs="{'invisible':['|',('public','=',False),('public','in',['public_link'])]}">
<button string="Send" name="send_mail" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
<group class="oe_right" col="1">
<div>Use template
<field name="template_id" nolabel="1"
on_change="onchange_template_id(template_id, composition_mode, model, res_id, context)"/>
</div>
<button icon="/email_template/static/src/img/email_template_save.png"
type="object" name="save_as_template" string="Save as new template" class="oe_link"
help="Save as a new template"/>
</group>
</footer>
</form>
</field>
</record>
</data>
</openerp>