odoo/addons/live_support/live_support_view.xml

145 lines
7.2 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<openerp>
<data>
<menuitem id="live_support" name="Live Chat" parent="mail.mail_feeds_main" groups="group_live_support"/>
<record model="ir.actions.act_window" id="action_support_channels">
<field name="name">Live Chat Channels</field>
<field name="res_model">live_support.channel</field>
<field name="view_mode">kanban,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new live chat channel.
</p><p>
You can create channels for each website on which you want
to integrate the live chat widget, allowing you website
visitors to talk in real time with your operators.
</p><p>
Each channel has it's own URL that you can send by email to
your customers in order to start chatting with you.
</p>
</field>
</record>
<menuitem name="Channels" parent="live_support" id="support_channels" action="action_support_channels" groups="group_live_support"/>
<record model="ir.ui.view" id="support_channel_kanban">
<field name="name">support_channel.kanban</field>
<field name="model">live_support.channel</field>
<field name="arch" type="xml">
<kanban>
<field name="name"/>
<field name="web_page"/>
<field name="are_you_inside"/>
<field name="user_ids"/>
<templates>
<t t-name="kanban-box">
<div class="oe_group_image">
<a type="open"><img t-att-src="kanban_image('live_support.channel', 'image_medium', record.id.value)" class="oe_group_photo"/></a>
</div>
<div class="oe_group_details">
<h4><a type="open"><field name="name"/></a></h4>
<div class="oe_kanban_footer_left">
<span>
<span class="oe_e">+</span> <t t-esc="(record.user_ids.raw_value || []).length"/>
</span>
</div>
<div class="oe_group_button">
<button t-if="record.are_you_inside.raw_value" name="quit" type="object" class="oe_group_join">Quit</button>
<button t-if="! record.are_you_inside.raw_value" name="join" type="object">Join</button>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="support_channel_form" model="ir.ui.view">
<field name="name">support_channel.form</field>
<field name="model">live_support.channel</field>
<field name="arch" type="xml">
<form string="Support Channels" version="7.0">
<sheet>
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. YourWebsite.com"/>
</h1>
<div>
<button type="object" name="join" class="oe_highlight" string="Join Channel" attrs='{"invisible": [["are_you_inside", "=", True]]}'/>
<button type="object" name="quit" string="Leave Channel" attrs='{"invisible": [["are_you_inside", "=", False]]}'/>
<button type="object" name="test_channel" string="Test" attrs='{"invisible": [["web_page", "=", False]]}'/>
<field name="are_you_inside" invisible="1"/>
</div>
</div>
<group>
<group string="Operators">
<field name="user_ids" widget="many2many_kanban" nolabel="1" colspan="2">
<kanban>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div>
<div class="oe_group_details" style="min-height: 40px">
<img t-att-src="kanban_image('im.user', 'image', record.id.value)"
class="oe_avatar oe_kanban_avatar_smallbox" style="float:left; margin-right: 10px;"/>
<h4><field name="name"/></h4>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</group>
<group string="Options">
<field name="button_text"/>
<field name="input_placeholder"/>
<field name="default_message"/>
</group>
</group>
<div attrs='{"invisible": [["web_page", "=", False]]}'>
<separator string="How to use the Live Chat widget?"/>
<p>
Copy and paste this code into your website, within the &amp;lt;head&amp;gt; tag:
</p>
<field name="script" readonly="1" class="oe_tag"/>
<p>
or copy this url and send it by email to your customers or suppliers:
</p>
<field name="web_page" readonly="1" class="oe_tag"/>
</div>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_history">
<field name="name">History</field>
<field name="res_model">im.message</field>
<field name="view_mode">list</field>
</record>
<menuitem name="History" parent="live_support" id="history" action="action_history" groups="group_live_support_manager"/>
<record id="im_message_form" model="ir.ui.view">
<field name="name">im.message.tree</field>
<field name="model">im.message</field>
<field name="arch" type="xml">
<tree string="History">
<field name="date"/>
<field name="support_member_id"/>
<field name="customer_id"/>
<field name="direction"/>
<field name="message"/>
</tree>
</field>
</record>
</data>
</openerp>