<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->

<?xml-stylesheet type="text/css" href="chrome://global/skin/global.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-alarms.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-attendees.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/calendar-event-dialog.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/skin/common/dialogs/calendar-event-dialog.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/datetimepickers/datetimepickers.css"?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/calendar-bindings.css"?>

<!DOCTYPE dialog [
  <!ENTITY % globalDTD SYSTEM "chrome://calendar/locale/global.dtd" >
  <!ENTITY % calendarDTD SYSTEM "chrome://calendar/locale/calendar.dtd" >
  <!ENTITY % dialogDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd" >
  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
  %globalDTD;
  %calendarDTD;
  %dialogDTD;
  %brandDTD;
]>     

<!-- Dialog id is changed during excution to allow different Window-icons
     on this dialog. document.loadOverlay() will not work on this one. -->
<dialog id="calendar-summary-dialog"
        windowtype="Calendar:EventSummaryDialog"
        onload="onLoad()"
        ondialogaccept="return onAccept();"
        ondialogcancel="return onCancel();"
        onresize="fixAttendeesListbox()"
        persist="screenX screenY width height"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Javascript includes -->
  <script type="application/javascript"
          src="chrome://calendar/content/calendar-summary-dialog.js"/>
  <script type="application/javascript"
          src="chrome://calendar/content/calendar-dialog-utils.js"/>
  <script type="application/javascript"
          src="chrome://calendar/content/calUtils.js"/>
  <script type="application/javascript"
          src="chrome://calendar/content/calendar-ui-utils.js"/>
  <script type="application/javascript"
          src="chrome://calendar/content/calendar-item-editing.js"/>
  <script type="application/javascript"
          src="chrome://calendar/content/calApplicationUtils.js"/>

  <!-- General -->
  <box id="item-general-box" orient="vertical">
    <calendar-caption label="&read.only.general.label;"/>
    <box orient="horizontal">
      <spacer class="default-spacer"/>
      <grid flex="1">
        <columns>
          <column/>
          <column/>
        </columns>
        <rows>
          <row align="top">
            <label value="&read.only.title.label;" class="headline"/>
            <label id="item-title"/>
          </row>
          <row class="item-date-row"
               id="item-start-row"
               mode="start"
               taskStartLabel="&read.only.task.start.label;"
               eventStartLabel="&read.only.event.start.label;"
               align="start"/>
          <row class="item-date-row"
               id="item-end-row"
               mode="end"
               taskDueLabel="&read.only.task.due.label;"
               eventEndLabel="&read.only.event.end.label;"
               align="start"/>
          <row id="repeat-row" align="top" hidden="true">
            <label value="&read.only.repeat.label;" class="headline"/>
            <box id="repeat-details" orient="vertical">
              <label/>
            </box>
          </row>
          <row id="location-row" align="top" hidden="true">
            <label value="&read.only.location.label;" class="headline"/>
            <label id="item-location"/>
          </row>
          <row id="category-row" align="top" hidden="true">
            <label value="&read.only.category.label;" class="headline"/>
            <label id="item-category"/>
          </row>
          <row id="organizer-row" align="top" hidden="true">
            <label value="&read.only.organizer.label;" class="headline"/>
            <hbox>
              <label id="item-organizer"
                     class="text-link"
                     crop="right"
                     onclick="sendMailToOrganizer()"/>
              <spacer flex="1"/>
            </hbox>
          </row>
          <row id="status-row" align="top" hidden="true">
            <label value="&task.status.label;" class="headline"/>
            <label value="&newevent.status.tentative.label;" hidden="true" status="TENTATIVE"/>
            <label value="&newevent.status.confirmed.label;" hidden="true" status="CONFIRMED"/>
            <label value="&newevent.eventStatus.cancelled.label;" hidden="true" status="CANCELLED"/>
            <label value="&newevent.todoStatus.cancelled.label;" hidden="true" status="CANCELLED"/>
            <label value="&newevent.status.needsaction.label;" hidden="true" status="NEEDS-ACTION"/>
            <label value="&newevent.status.inprogress.label;" hidden="true" status="IN-PROCESS"/>
            <label value="&newevent.status.completed.label;" hidden="true" status="COMPLETED"/>
          </row>
          <separator id="item-main-separator" flex="1" class="groove" hidden="true"/>
          <row id="invitation-row" hidden="true" align="center">
            <label value="&read.only.reply.label;" control="item-participation"/>
            <hbox pack="start">
              <menulist id="item-participation" oncommand="updatePartStat()">
                <menupopup>
                  <menuitem label="&read.only.accept.label;" value="ACCEPTED"/>
                  <menuitem label="&read.only.tentative.label;" value="TENTATIVE"/>
                  <menuitem label="&read.only.decline.label;" value="DECLINED"/>
                  <menuitem label="&read.only.needs.action.label;" value="NEEDS-ACTION"
                            hidden="true" id="item-participation-needs-action"/>
                </menupopup>
              </menulist>
            </hbox>
          </row>
          <row id="reminder-row" hidden="true" align="center">
            <label value="&read.only.reminder.label;" control="item-alarm"/>
              <hbox id="event-grid-alarm-picker-box"
                    align="center">
                <menulist id="item-alarm"
                          disable-on-readonly="true"
                          oncommand="updateReminder()">
                  <menupopup id="item-alarm-menupopup">
                    <menuitem id="reminder-none-menuitem"
                              label="&event.reminder.none.label;"
                              selected="true"
                              value="none"/>
                    <menuseparator id="reminder-none-separator"/>
                    <menuitem id="reminder-0minutes-menuitem"
                              label="&event.reminder.0minutes.before.label;"
                              length="0"
                              origin="before"
                              relation="START"
                              unit="minutes"/>
                    <menuitem id="reminder-5minutes-menuitem"
                              label="&event.reminder.5minutes.before.label;"
                              length="5"
                              origin="before"
                              relation="START"
                              unit="minutes"/>
                    <menuitem id="reminder-15minutes-menuitem"
                              label="&event.reminder.15minutes.before.label;"
                              length="15"
                              origin="before"
                              relation="START"
                              unit="minutes"/>
                    <menuitem id="reminder-30minutes-menuitem"
                              label="&event.reminder.30minutes.before.label;"
                              length="30"
                              origin="before"
                              relation="START"
                              unit="minutes"/>
                    <menuseparator id="reminder-minutes-separator"/>
                    <menuitem id="reminder-1hour-menuitem"
                              label="&event.reminder.1hour.before.label;"
                              length="1"
                              origin="before"
                              relation="START"
                              unit="hours"/>
                    <menuitem id="reminder-2hours-menuitem"
                              label="&event.reminder.2hours.before.label;"
                              length="2"
                              origin="before"
                              relation="START"
                              unit="hours"/>
                    <menuitem id="reminder-12hours-menuitem"
                              label="&event.reminder.12hours.before.label;"
                              length="12"
                              origin="before"
                              relation="START"
                              unit="hours"/>
                    <menuseparator id="reminder-hours-separator"/>
                    <menuitem id="reminder-1day-menuitem"
                              label="&event.reminder.1day.before.label;"
                              length="1"
                              origin="before"
                              relation="START"
                              unit="days"/>
                    <menuitem id="reminder-2days-menuitem"
                              label="&event.reminder.2days.before.label;"
                              length="2"
                              origin="before"
                              relation="START"
                              unit="days"/>
                    <menuitem id="reminder-1week-menuitem"
                              label="&event.reminder.1week.before.label;"
                              length="7"
                              origin="before"
                              relation="START"
                              unit="days"/>
                    <menuseparator id="reminder-custom-separator"/>
                    <menuitem id="reminder-custom-menuitem"
                              label="&event.reminder.custom.label;"
                              value="custom"/>
                  </menupopup>
                </menulist>
                <hbox id="reminder-details">
                  <hbox id="reminder-icon-box"
                        class="alarm-icons-box"
                        align="center"/>
                  <!-- TODO oncommand? onkeypress? -->
                  <label id="reminder-multiple-alarms-label"
                         hidden="true"
                         value="&event.reminder.multiple.label;"
                         class="text-link"
                         disable-on-readonly="true"
                         flex="1"
                         hyperlink="true"
                         onclick="updateReminder()"/>
                  <label id="reminder-single-alarms-label"
                         hidden="true"
                         class="text-link"
                         disable-on-readonly="true"
                         flex="1"
                         hyperlink="true"
                         onclick="updateReminder()"/>
                </hbox>
             </hbox>
          </row>
        </rows>
      </grid>
    </box>
  </box>

  <!-- Attendees -->
  <box id="item-attendees" hidden="true" orient="vertical">
    <spacer class="default-spacer"/>
    <calendar-caption label="&read.only.attendees.label;"
                      control="item-attendee-listbox"/>
    <box orient="horizontal">
      <spacer class="default-spacer"/>
      <listbox id="item-attendee-listbox" rows="6" flex="1" disabled="true">
        <listcols>
          <listcol id="item-attendee-left-col" flex="1"/>
          <listcol id="item-attendee-right-col" flex="1"/>
        </listcols>
        <listitem>
          <listcell class="listcell-iconic status-icon" crop="end" hidden="true"/>
          <listcell class="listcell-iconic status-icon" crop="end" hidden="true"/>
        </listitem>
      </listbox>
    </box>
  </box>

  <!-- Description -->
  <box id="item-description-box" hidden="true" orient="vertical" flex="1">
    <spacer class="default-spacer"/>
    <calendar-caption label="&read.only.description.label;"
                      control="item-description"/>
    <box orient="horizontal" flex="1">
      <spacer class="default-spacer"/>
      <textbox id="item-description"
               multiline="true"
               rows="6"
               flex="1"/>
    </box>
  </box>

  <!-- URL link -->
  <box id="event-grid-link-row" hidden="true" orient="vertical">
    <spacer class="default-spacer"/>
    <calendar-caption label="&read.only.link.label;"
                      control="url-link"/>
    <label id="url-link"
           class="text-link default-indent"
           onclick="launchBrowser(this.getAttribute('href'), event)"
           oncommand="launchBrowser(this.getAttribute('href'), event)"
           crop="end"/>
  </box>

</dialog>
