[REV] crm: reverted most changes about stages for this branch.
[odoo/odoo.git] / addons / im_livechat / im_livechat_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4         <menuitem id="im_livechat" name="Live Chat" parent="mail.mail_feeds_main" groups="group_im_livechat"/>
5
6         <record model="ir.actions.act_window" id="action_support_channels">
7             <field name="name">Live Chat Channels</field>
8             <field name="res_model">im_livechat.channel</field>
9             <field name="view_mode">kanban,form</field>
10             <field name="help" type="html">
11               <p class="oe_view_nocontent_create">
12                 Click to define a new live chat channel.
13               </p><p>
14                 You can create channels for each website on which you want
15                 to integrate the live chat widget, allowing you website
16                 visitors to talk in real time with your operators.
17               </p><p>
18                 Each channel has it's own URL that you can send by email to
19                 your customers in order to start chatting with you.
20               </p>
21             </field>
22         </record>
23         <menuitem name="Channels" parent="im_livechat" id="support_channels" action="action_support_channels" groups="group_im_livechat"/>
24
25
26         <record model="ir.ui.view" id="support_channel_kanban">
27             <field name="name">support_channel.kanban</field>
28             <field name="model">im_livechat.channel</field>
29             <field name="arch" type="xml">
30                 <kanban>
31                     <field name="name"/>
32                     <field name="web_page"/>
33                     <field name="are_you_inside"/>
34                     <field name="user_ids"/>
35                     <templates>
36                         <t t-name="kanban-box">
37                             <div class="oe_group_image">
38                                 <a type="open"><img t-att-src="kanban_image('im_livechat.channel', 'image_medium', record.id.value)" class="oe_group_photo"/></a>
39                             </div>
40                             <div class="oe_group_details">
41                                 <h4><a type="open"><field name="name"/></a></h4>
42                                 <div class="oe_kanban_footer_left">
43                                     <span>
44                                         <span class="oe_e">+</span> <t t-esc="(record.user_ids.raw_value || []).length"/>
45                                     </span>
46                                 </div>
47                                 <div class="oe_group_button">
48                                     <button t-if="record.are_you_inside.raw_value" name="quit" type="object" class="oe_group_join">Quit</button>
49                                     <button t-if="! record.are_you_inside.raw_value" name="join" type="object">Join</button>
50                                 </div>
51                             </div>
52                         </t>
53                     </templates>
54                 </kanban>
55             </field>
56         </record>
57
58
59         <record id="support_channel_form" model="ir.ui.view">
60             <field name="name">support_channel.form</field>
61             <field name="model">im_livechat.channel</field>
62             <field name="arch" type="xml">
63                 <form string="Support Channels" version="7.0">
64                 <sheet>
65                     <field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
66                     <div class="oe_title">
67                         <label for="name" class="oe_edit_only"/>
68                         <h1>
69                             <field name="name" placeholder="e.g. YourWebsite.com"/>
70                         </h1>
71                         <div>
72                             <button type="object" name="join" class="oe_highlight" string="Join Channel" attrs='{"invisible": [["are_you_inside", "=", True]]}'/>
73                             <button type="object" name="quit" string="Leave Channel" attrs='{"invisible": [["are_you_inside", "=", False]]}'/>
74                             <button type="object" name="test_channel" string="Test" attrs='{"invisible": [["web_page", "=", False]]}'/>
75                             <field name="are_you_inside" invisible="1"/>
76                         </div>
77                     </div>
78
79                     <group>
80                         <group string="Operators">
81                             <field name="user_ids" widget="many2many_kanban" nolabel="1" colspan="2">
82                                 <kanban>
83                                     <field name="name"/>
84                                     <templates>
85                                         <t t-name="kanban-box">
86                                             <div>
87                                                 <a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
88                                                 <div class="oe_group_details" style="min-height: 40px">
89                                                     <img t-att-src="kanban_image('res.users', 'image', record.id.value)"
90                                                         class="oe_avatar oe_kanban_avatar_smallbox" style="float:left; margin-right: 10px;"/>
91                                                     <h4><field name="name"/></h4>
92                                                 </div>
93                                             </div>
94                                         </t>
95                                     </templates>
96                                 </kanban>
97                             </field>
98                         </group>
99                         <group string="Options">
100                             <field name="button_text"/>
101                             <field name="input_placeholder"/>
102                             <field name="default_message" placeholder="e.g. Hello, how may I help you?"/>
103                         </group>
104                     </group>
105
106                     <div attrs='{"invisible": [["web_page", "=", False]]}'>
107                         <separator string="How to use the Live Chat widget?"/>
108                         <p>
109                             Copy and paste this code into your website, within the &amp;lt;head&amp;gt; tag:
110                         </p>
111                         <field name="script" readonly="1" class="oe_tag"/>
112                         <p>
113                             or copy this url and send it by email to your customers or suppliers:
114                         </p>
115                         <field name="web_page" readonly="1" class="oe_tag"/>
116                     </div>
117
118                 </sheet>
119                 </form>
120             </field>
121         </record>
122
123         <record model="ir.actions.act_window" id="action_history">
124             <field name="name">History</field>
125             <field name="res_model">im.message</field>
126             <field name="view_mode">list</field>
127             <field name="domain">[('session_id.channel_id', '!=', None)]</field>
128         </record>
129         <menuitem name="History" parent="im_livechat" id="history" action="action_history" groups="group_im_livechat_manager"/>
130
131         <record id="im_message_form" model="ir.ui.view">
132             <field name="name">im.message.tree</field>
133             <field name="model">im.message</field>
134             <field name="arch" type="xml">
135                 <tree string="History">
136                     <field name="session_id"/>
137                     <field name="date"/>
138                     <field name="from_id"/>
139                     <field name="message"/>
140                 </tree>
141             </field>
142         </record>
143
144     </data>
145 </openerp>