<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<configuration xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="ringo">
  <source>
    <!-- Define different entity types -->
    <entity id="e1" name="name" label="Title" type="string" required="true"/>
    <entity id="e2" name="deadline" label="Deadline" type="datetime">
      <renderer type="datepicker"/>
      <help>Please give the date and time until this task must be finished.</help>
    </entity>
    <entity id="e3" name="reminder" label="Do you want a reminder?" type="integer">
      <renderer type="dropdown"/>
      <options>
        <option value="0">No</option>
        <option value="1">Yes, show it immediately</option>
        <option value="2">Yes, I will define a remind date</option>
        <option value="3">Yes, after the deadline exeeds (if present or immediately)</option>
      </options>
    </entity>
    <entity id="e4" name="reminddate" label="Remind me from this date on" type="datetime" required="true">
      <renderer type="datepicker"/>
      <help>Please give the date from which you will be reminded (e.g on the dashboad) for this task.</help>
    </entity>
    <entity id="e5" name="priority" label="Priority" type="integer">
      <renderer type="dropdown"/>
      <options>
        <option value="1">Very low</option>
        <option value="2">Low</option>
        <option value="3">Normal</option>
        <option value="4">High</option>
        <option value="5">Very high</option>
      </options>
    </entity>
    <entity id="e6" name="description" label="Description">
      <renderer type="textarea"/>
    </entity>
    <entity id="todostatus" name="todo_state_id" label="Status">
      <renderer type="state"/>
    </entity>
    <entity id="assigned" name="assigned" label="Assigned">
      <help>Please select the users which are responsibly for this task.
      The task will be listed for this users in their Todo
      overview.</help>
    </entity>
  </source>
  <form id="create" autocomplete="off" method="POST" action="" enctype="multipart/form-data">
    <snippet ref="create_snippet"/>
  </form>
  <form id="update" autocomplete="off" method="POST" action="" enctype="multipart/form-data">
    <snippet ref="create_snippet"/>
  </form>
  <form id="read" readonly="true">
    <snippet ref="create_snippet"/>
  </form>

  <!-- Create-->
  <snippet id="create_snippet">
    <snippet ref="s1"/>
  </snippet>

  <!-- Role -->
  <snippet id="s1">
    <row>
      <col width="10"><field ref="e1"/></col>
      <col width="2"><field ref="e5"/></col>
    </row>
    <row>
      <col><field ref="e6"/></col>
    </row>
    <row>
      <col>
        <field ref="todostatus"/>
      </col>
    </row>
    <row>
      <col>
        <row>
          <col>
            <field ref="e2"/>
          </col>
          <col>
            <field ref="assigned"/>
          </col>
        </row>
      </col>
      <col>
        <row>
          <col><field ref="e3"/></col>
        </row>
        <row>
          <col>
            <if expr="$reminder == 2" type="readonly">
              <field ref="e4"/>
            </if>
          </col>
        </row>
      </col>
    </row>
  </snippet>
</configuration>
