<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="view_project_caldav_task_form" model="ir.ui.view">
            <field name="name">project.task.caldav.form</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <notebook position="inside">
                    <page string="Assignees Detail">
                        <button string="Assign Task"
                            name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
                            icon="terp-partner" type="action"
                            context="{'model' : 'project.task', 'attendee_field':'attendee_ids'}" colspan="2"/>
                            <field name="attendee_ids" colspan="4"
                            nolabel="1" widget="one2many" mode="tree,form">
                            <tree string="Assignees details" editable="top">
                                <field name="sent_by_uid" string="From"/>
                                <field name="user_id" string="To"/>
                                <field name="email" string="Mail TO"/>
                                <field name="role" select="1" />
                                <field name="state" />
                            </tree>
                            <form string="Assignees details">
                                <notebook colspan="4">
                                    <page string="Details">
                                        <field name="email" />
                                        <field name="rsvp" select="1" />
                                        <field name="cutype" select="1" />
                                        <field name="role" select="1" />
                                        <separator colspan="4" string="" />
                                        <field name="state" />
                                    </page>
                                    <page string="Other">
                                        <field name="user_id" select="1" />
                                        <field name="partner_address_id" select="1" />
                                        <newline />
                                    </page>
                                </notebook>
                            </form>
                        </field>
                    </page>
                </notebook>
            </field>
        </record>

        <record id="view_project_caldav_task_form1" model="ir.ui.view">
            <field name="name">project.task.caldav.form1</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2"/>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <field name="sequence" position="after">
                    <field name="class" />
                </field>
            </field>
        </record>
        
        <record id="view_project_caldav_task_form2" model="ir.ui.view">
            <field name="name">project.task.caldav.form2</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2" />
            <field name="type">form</field>
            <field name="arch" type="xml">
                <field name="progress" position="after">
                    <field name="recurrency"/>      
                     <field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
                                on_change="onchange_edit_all(rrule_type,edit_all)"/>                    
                </field>
            </field>
        </record>

        <record id="view_project_caldav_task_form3" model="ir.ui.view">
            <field name="name">project.task.caldav.form3</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2" />
            <field name="type">form</field>
            <field name="arch" type="xml">
                <notebook colspan="4" position="inside">
                    <page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
                        <group colspan="2" col="4" >
                             <field name="rrule_type" string="Recurrency" colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
                        </group>
                        <newline/>
                        <group col="4" colspan="6" name="rrule">
                            <separator string="Recurrency Rule" colspan="8"/>
                            <group col="6" colspan="4">
                                <field name="interval" string="Repeat Times" attrs="{'readonly': [('end_date','!=',False)]}"/>
                                <field name="count" attrs="{'readonly': [('end_date','!=',False)]}"/>
                                <field name="end_date" attrs="{'invisible': [('readonly','!=',False)]}"/>
                            </group>
                            <group col="14" colspan="4" name="Select weekdays" 
                                    attrs="{'invisible' :[('rrule_type','not in', ['weekly','daily_working'])]}">
                                <field name="mo" colspan="1" />
                                <field name="tu" colspan="1" />
                                <field name="we" colspan="1" />
                                <field name="th" colspan="1" />
                                <newline/>
                                <field name="fr" colspan="1" />
                                <field name="sa" colspan="1"  attrs="{'invisible': [('rrule_type','=','daily_working')]}"/>
                                <field name="su" colspan="1"  attrs="{'invisible': [('rrule_type','=','daily_working')]}"/>
                                <newline />
                            </group>
                            <group col="10" colspan="4" attrs="{'invisible': [('rrule_type','!=','monthly'), ('rrule_type','!=','yearly')]}">
                                <group col="2" colspan="1">
                                <field name="select1" />
                                </group>
                                <group col="2" colspan="1" attrs="{'invisible' : [('select1','=','day')]}">
                                <field name="day" attrs="{'required' : [('select1','=','date')]}" />
                                </group>
                                <group col="3" colspan="1" attrs="{'invisible' : [('select1','=','date')]}">
                                <field name="byday" string="The" attrs="{'required' : [('select1','=','day')]}" />
                                <field name="week_list" nolabel="1" attrs="{'required' : [('select1','=','day')]}" />
                                </group>
                                <group col="1" colspan="1" attrs="{'invisible' : [('rrule_type','!=','yearly')]}">
                                <field name="month_list" string="of" colspan="1" attrs="{'required' : [('rrule_type','=','yearly')]}" />
                                </group>
                            </group>
                        </group>
                    </page>
                 </notebook>
            </field>
        </record>

    <record id="view_project_caldav_task_form4" model="ir.ui.view">
            <field name="name">project.task.caldav.form4</field>
            <field name="model">project.task</field>
            <field name="inherit_id" ref="project.view_task_form2" />
            <field name="type">form</field>
            <field name="arch" type="xml">
                <field name="partner_id" position="after">
                    <field name="vtimezone" colspan="2" />
                    <field name="location" colspan="2" />
                    <field name="alarm_id" string="Reminder" widget="selection" />
                    <field name="base_calendar_url" widget="url" />
                    <field name="rrule" invisible="1"/>
                </field>
            </field>
    </record>

    </data>
</openerp>
