# --
# CustomerTicketMessage.dtl - provides HTML form for customer message
# Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id: CustomerTicketMessage.dtl,v 1.15 2008/05/08 22:52:35 martin Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
# --

<!-- start form -->
<script language="JavaScript" type="text/javascript">
<!--
function submit_compose() {
    if (document.compose.TypeID && document.compose.TypeID.value == "") {
        alert('$JSText{"Ticket Type is required!"}');
        document.compose.TypeID.focus();
        return false;
    }
    else if (document.compose.Subject.value == "") {
        alert('$JSText{"A message should have a subject!"}');
        document.compose.Subject.focus();
        return false;
    }
    else if (document.compose.Body.value == "") {
        alert('$JSText{"A message should have a body!"}');
        document.compose.Body.focus();
        return false;
    }
<!-- dtl:block:TicketFreeTextCheckJs -->
    else if (document.compose.$Data{"TicketFreeTextField"}.value == "") {
        alert('$JSText{"A required field is:"} ' + document.compose.$Data{"TicketFreeKeyField"}.value + '!');
        document.compose.$Data{"TicketFreeTextField"}.focus();
        return false;
    }
<!-- dtl:block:TicketFreeTextCheckJs -->
<!-- dtl:block:TicketFreeTimeCheckJs -->
    else if (document.compose.$Data{"TicketFreeTimeCheck"} && document.compose.$Data{"TicketFreeTimeCheck"}.checked == false) {
        alert('$JSText{"A required field is:"} $QData{"TicketFreeTimeKey"}!');
        document.compose.$Data{"TicketFreeTimeCheck"}.focus();
        return false;
    }
<!-- dtl:block:TicketFreeTimeCheckJs -->
    else {
        return true;
    }
}
//-->
</script>

<table border="0" width="100%" cellspacing="0" cellpadding="3">
  <tr>
    <td class="mainhead">
      $Env{"Box0"}$Text{"new ticket"}$Env{"Box1"}
    </td>
  </tr>
  <tr>
    <td class="mainbody">
      <br/>
      <table border="0" width="680" align="center" cellspacing="0" cellpadding="4">
        <tr>
          <td colspan="2" class="contenthead">$Text{"Options"}</td>
        </tr>
        <tr>
          <td class="contentbody">
            <form action="$Env{"CGIHandle"}" method="post" name="compose" enctype="multipart/form-data">
              <input type="hidden" name="Action" value="$Env{"Action"}"/>
              <input type="hidden" name="Subaction" value="StoreNew"/>
              <input type="hidden" name="Expand" value=""/>
              <input type="hidden" name="FormID" value="$QData{"FormID"}"/>
              <table border="0">
<!-- dtl:block:TicketType -->
                <tr>
                  <td class="contentkey">$Text{"Type"}:</td>
                  <td class="contentvalue"> $Data{"TypeStrg"}</td>
                </tr>
<!-- dtl:block:TicketType -->
                <tr>
                  <td width="15%" class="contentkey">$Text{"To"}:</td>
                  <td width="85%" class="contentvalue">
                    $Data{"ToStrg"}
                    <font color="red" size="-2">$Text{"$Data{"Queue invalid"}"}</font>
                  </td>
                </tr>
<!-- dtl:block:TicketService -->
                <tr>
                  <td class="contentkey">$Text{"Service"}:</td>
                  <td class="contentvalue"> $Data{"ServiceStrg"}</td>
                </tr>
<!-- dtl:block:TicketService -->
<!-- dtl:block:TicketSLA -->
                <tr>
                  <td class="contentkey">$Text{"SLA"}:</td>
                  <td class="contentvalue"> $Data{"SLAStrg"}</td>
                </tr>
<!-- dtl:block:TicketSLA -->
                <tr>
                  <td class="contentkey">$Text{"Subject"}:</td>
                  <td class="contentvalue">
                    <input type="text" name="Subject" value="$QData{"Subject"}" size="70"/>
                    <font color="red" size="-2">$Text{"$Data{"Subject invalid"}"}</font>
                  </td>
                </tr>
                <tr>
                  <td class="contentkey">$Text{"Text"}:</td>
                  <td class="contentvalue">
                    <textarea name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaNote"}" wrap="$Env{"BrowserWrap"}">$QData{"Body"}</textarea>
                    <font color="red" size="-2">$Text{"$Data{"Body invalid"}"}</font>
                  </td>
                </tr>
                <tr>
                  <td class="contentkey">$Text{"Attachment"}:</td>
                  <td class="contentvalue">
                    <table cellspacing="0" cellpadding="0" width="400">
<!-- dtl:block:Attachment -->
                      <tr>
                        <td>$QData{"Filename"}</td>
                        <td>$QData{"Filesize"}</td>
                        <td align="right">
                          <input class="button" type="submit" name="AttachmentDelete$QData{"FileID"}" value="$Text{"Delete"}"/>
                        </td>
                      </tr>
<!-- dtl:block:Attachment -->
                      <tr>
                        <td colspan="2"><input name="file_upload" type="file" size="40" class="fixed"/></td>
                        <td align="right">
                          <input class="button" type="submit" name="AttachmentUpload" value="$Text{"Attach"}"/>
                          <a name="attachment"></a>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
<!-- dtl:block:Priority -->
                <tr>
                  <td class="contentkey">$Text{"Priority"}:</td>
                  <td class="contentvalue"> $Data{"PriorityStrg"}</td>
                </tr>
<!-- dtl:block:Priority -->
<!-- dtl:block:FreeText -->
                <tr>
                  <td class="contentkey">$Data{"TicketFreeKeyField"}:</td>
                  <td class="contentvalue">$Data{"TicketFreeTextField"}</td>
                </tr>
<!-- dtl:block:FreeText -->
#                <tr>
#                  <td class="contentkey">$Data{"TicketFreeKeyField1"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField1"}</td>
#                </tr>
#                <tr>
#                  <td class="contentkey">$Data{"TicketFreeKeyField2"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField2"}</td>
#                </tr>
#                <tr>
#                  <td class="contentkey">$Data{"TicketFreeKeyField3"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField3"}</td>
#                </tr>
#                <tr>
#                  <td class="contentkey">$Data{"TicketFreeKeyField4"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField4"}</td>
#                </tr>
<!-- dtl:block:FreeTime -->
                <tr>
                  <td class="contentkey">$Text{"$QData{"TicketFreeTimeKey"}"}:</td>
                  <td class="contentvalue">$Data{"TicketFreeTime"}</td>
                </tr>
<!-- dtl:block:FreeTime -->
#                <tr>
#                  <td class="contentkey">$Text{"$Config{"TicketFreeTimeKey1"}"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTime1"}</td>
#                </tr>
#                <tr>
#                  <td class="contentkey">$Text{"$Config{"TicketFreeTimeKey2"}"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTime2"}</td>
#                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td class="contentfooter">
              <input class="button" accesskey="g" type="submit" value="$Text{"Submit"}" onclick="return submit_compose();"/>
            </td>
          </tr>
        </table>
      </form>
      <br/>
    </td>
  </tr>
</table>
<!-- end form -->
