# --
# AgentTicketNote.dtl - provides HTML form for note mask
# Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketNote.dtl,v 1.26 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.
# --

<!-- dtl:block:Properties -->
<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;
    }
<!-- dtl:block:NoteJs -->
    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:NoteJs -->
<!-- dtl:block:TicketFreeTextCheckJs -->
    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 -->
    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 -->
<!-- dtl:block:TimeUnitsJs -->
    if (document.compose.TimeUnits.value != "") {
        var reg = /^-{0,1}\d+?((\.|,){0,1}\d+?){0,1}$/;
        if (reg.test(document.compose.TimeUnits.value) == false) {
            alert('$JSText{"Invalid time!"}');
            document.compose.TimeUnits.focus();
            return false;
        }
    }
    else if (document.compose.TimeUnits.value == "" && $Config{"Ticket::Frontend::NeedAccountedTime"}) {
        alert('$JSText{"You need to account time!"}');
        document.compose.TimeUnits.focus();
        return false;
    }
<!-- dtl:block:TimeUnitsJs -->
    return true;
}
//-->
</script>

<script language="JavaScript" type="text/javascript">
<!--
function SpellCheckSubmit() {
    document.spelling.Body.value = document.compose.Body.value;
    window.open('', 'spelling', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=700,height=550,left=100,top=100');
    document.spelling.submit()
}
// -->
</script>

<!-- dtl:block:OwnerJs -->
<script language="JavaScript" type="text/javascript">
<!--
function change_selected(sel) {
    start_elements = (sel + 4);
    if (document.compose.elements[0].name == "$Config{"SessionName"}") {
        start_elements = start_elements + 1;
    }
    if (!document.compose.elements[start_elements].checked) {
        document.compose.elements[start_elements].checked = true;
    }
}
//-->
</script>
<!-- dtl:block:OwnerJs -->

<table border="0" width="100%" cellspacing="0" cellpadding="3">
  <tr>
    <td class="mainhead">
      $Env{"Box0"}$Text{"Add note to ticket"}: $Data{"TicketNumber"}$Env{"Box1"}
    </td>
  </tr>
  <tr>
    <td class="menu">
<!-- dtl:block:TicketBack -->
      <a href="$Env{"Baselink"}$Env{"LastScreenView"}" onmouseover="window.status='$JSText{"Back"}'; return true;" onmouseout="window.status='';" class="menuitem">$Text{"Back"}</a>
<!-- dtl:block:TicketBack -->
<!-- dtl:block:PropertiesLock -->
      <img border="0" src="$Env{"Images"}warning.png" alt="$Text{"Info"}">: <font color="red">$Text{"Ticket locked!"}</font> (<a href="$Env{"Baselink"}Action=AgentTicketLock&Subaction=Unlock&TicketID=$Data{"TicketID"}" onmouseover="window.status='$JSText{"Ticket unlock!"}'; return true;" onmouseout="window.status='';">$Text{"Ticket unlock!"}</a>)
<!-- dtl:block:PropertiesLock -->
    </td>
  </tr>
  <tr>
    <td class="mainbody">
      <br/>
      <form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="compose">
        <input type="hidden" name="Action" value="$Env{"Action"}"/>
        <input type="hidden" name="Subaction" value="Store"/>
        <input type="hidden" name="TicketID" value="$QData{"TicketID"}"/>
        <input type="hidden" name="Expand" value=""/>
        <input type="hidden" name="FormID" value="$QData{"FormID"}"/>
        <table border="0" width="800" align="center" cellspacing="0" cellpadding="4">
          <tr>
            <td colspan="2" class="contenthead">$Text{"Options"}</td>
          </tr>
          <tr>
            <td class="contentbody">
              <table border="0" width="100%">
<!-- dtl:block:Title -->
                <tr>
                  <td colspan="2" width="20%" class="contentkey">$Text{"Title"}:</td>
                  <td width="80%" class="contentvalue">
                    <input type="text" name="Title" value="$QData{"Title"}" size="70"/>
                    <font color="red" size="-2">$Text{"$Data{"Title invalid"}"}</font>
                  </td>
                </tr>
<!-- dtl:block:Title -->
<!-- dtl:block:Type -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Type"}:</td>
                  <td class="contentvalue">$Data{"TypeStrg"}</td>
                </tr>
<!-- dtl:block:Type -->
<!-- dtl:block:Service -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Service"}:</td>
                  <td class="contentvalue">$Data{"ServiceStrg"} <font color="red" size="-2">$Text{"$Data{"Service invalid"}"}</font></td>
                </tr>
<!-- dtl:block:Service -->
<!-- dtl:block:SLA -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"SLA"}:</td>
                  <td class="contentvalue">$Data{"SLAStrg"} <font color="red" size="-2">$Text{"$Data{"SLA invalid"}"}</font></td>
                </tr>
<!-- dtl:block:SLA -->
<!-- dtl:block:Owner -->
                <tr>
                  <td width="18%" class="contentkey">$Text{"New Owner"}:</td>
                  <td width="2%" class="contentvalue">
                    <input type="radio" name="NewOwnerType" value="New" $Data{"NewOwnerType::New"}/>
                  </td>
                  <td width="80%" class="contentvalue">$Data{"OwnerStrg"}</td>
                </tr>
                <tr>
                  <td class="contentkey">$Text{"Previous Owner"}:</td>
                  <td class="contentvalue">
                    <input type="radio" name="NewOwnerType" value="Old" $Data{"NewOwnerType::Old"}/>
                  </td>
                  <td class="contentvalue">$Data{"OldOwnerStrg"}</td>
                </tr>
<!-- dtl:block:Owner -->
<!-- dtl:block:Responsible -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Responsible"}:</td>
                  <td class="contentvalue">$Data{"ResponsibleStrg"}</td>
                </tr>
<!-- dtl:block:Responsible -->
<!-- dtl:block:Note -->
<!-- dtl:block:InformAgent -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Inform Agent"}: ($Text{"Optional"})</td>
                  <td class="contentvalue">$Data{"OptionStrg"}</td>
                </tr>
<!-- dtl:block:InformAgent -->
<!-- dtl:block:InvolvedAgent -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Inform involved Agents"}:</td>
                  <td class="contentvalue">$Data{"InvolvedAgentStrg"}</td>
                </tr>
<!-- dtl:block:InvolvedAgent -->
                <tr>
                  <td colspan="2" width="20%" class="contentkey">$Text{"Subject"}:</td>
                  <td width="80%" 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 colspan="2" class="contentkey">$Text{"Options"}:</td>
                  <td class="contentvalue">
<!-- dtl:block:SpellCheck -->
                    $Env{"Box0"}<a href="" onclick="SpellCheckSubmit(); return false;" onmouseover="window.status='$JSText{"Spell Check"}'; return true;" onmouseout="window.status='';"><img border="0" src="$Env{"Images"}spell.png">$Text{"Spell Check"}</a>$Env{"Box1"}
<!-- dtl:block:SpellCheck -->
                    $Env{"Box0"}<a href="#attachment" onmouseover="window.status='$JSText{"Attachments"}'; return true;" onmouseout="window.status='';"><img border="0" src="$Env{"Images"}attach.png">$Text{"Attachments"}</a>$Env{"Box1"}
                  </td>
                </tr>
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Text"}:</td>
                  <td class="contentvalue">
                    <textarea name="Body" rows="16" cols="$Config{"Ticket::Frontend::TextAreaNote"}">$QData{"Body"}</textarea>
                    <font color="red" size="-2">$Text{"$Data{"Body invalid"}"}</font>
                  </td>
                </tr>
                <tr>
                  <td colspan="2" 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:ArticleType -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Note type"}:</td>
                  <td class="contentvalue">$Data{"ArticleTypeStrg"}</td>
                </tr>
<!-- dtl:block:ArticleType -->
<!-- dtl:block:Note -->
<!-- dtl:block:State -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Next state"}:</td>
                  <td class="contentvalue">$Data{"StateStrg"}</td>
                </tr>
<!-- dtl:block:StatePending -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Pending date"}:</td>
                  <td class="contentvalue">$Data{"DateString"} <font color="red" size="-2">$Text{"$Data{"Date invalid"}"}</font></td>
                </tr>
<!-- dtl:block:StatePending -->
<!-- dtl:block:State -->
<!-- dtl:block:Priority -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Priority"}:</td>
                  <td class="contentvalue">$Data{"PriorityStrg"}</td>
                </tr>
<!-- dtl:block:Priority -->
<!-- dtl:block:TicketFreeText -->
                <tr>
                  <td colspan="2" class="contentkey">$Data{"TicketFreeKeyField"}:</td>
                  <td class="contentvalue">$Data{"TicketFreeTextField"}</td>
                </tr>
<!-- dtl:block:TicketFreeText -->
#<!-- dtl:block:TicketFreeText1 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Data{"TicketFreeKeyField1"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField1"}</td>
#                </tr>
#<!-- dtl:block:TicketFreeText1 -->
#<!-- dtl:block:TicketFreeText2 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Data{"TicketFreeKeyField2"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTextField2"}</td>
#                </tr>
#<!-- dtl:block:TicketFreeText2 -->
<!-- dtl:block:TicketFreeTime -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"$QData{"TicketFreeTimeKey"}"}:</td>
                  <td class="contentvalue">$Data{"TicketFreeTime"}</td>
                </tr>
<!-- dtl:block:TicketFreeTime -->
#<!-- dtl:block:TicketFreeTime1 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Text{"$Config{"TicketFreeTimeKey1"}"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTime1"}</td>
#                </tr>
#<!-- dtl:block:TicketFreeTime1 -->
#<!-- dtl:block:TicketFreeTime2 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Text{"$Config{"TicketFreeTimeKey2"}"}:</td>
#                  <td class="contentvalue">$Data{"TicketFreeTime2"}</td>
#                </tr>
#<!-- dtl:block:TicketFreeTime2 -->
<!-- dtl:block:ArticleFreeText -->
                <tr>
                  <td colspan="2" class="contentkey">$Data{"ArticleFreeKeyField"}:</td>
                  <td class="contentvalue">$Data{"ArticleFreeTextField"}</td>
                </tr>
<!-- dtl:block:ArticleFreeText -->
#<!-- dtl:block:ArticleFreeText1 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Data{"ArticleFreeKeyField1"}:</td>
#                  <td class="contentvalue">$Data{"ArticleFreeTextField1"}</td>
#                </tr>
#<!-- dtl:block:ArticleFreeText1 -->
#<!-- dtl:block:ArticleFreeText2 -->
#                <tr>
#                  <td colspan="2" class="contentkey">$Data{"ArticleFreeKeyField2"}:</td>
#                  <td class="contentvalue">$Data{"ArticleFreeTextField2"}</td>
#                </tr>
#<!-- dtl:block:ArticleFreeText2 -->
<!-- dtl:block:TimeUnits -->
                <tr>
                  <td colspan="2" class="contentkey">$Text{"Time units"}$Text{"$Config{"Ticket::Frontend::TimeUnits"}"}:</td>
                  <td class="contentvalue"><input type="text" name="TimeUnits" value="$QData{"TimeUnits"}" size="3"/></td>
                </tr>
<!-- dtl:block:TimeUnits -->
              </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>
      <form action="$Env{"CGIHandle"}" method="post" name="spelling" target="spelling">
        <input type="hidden" name="Action" value="AgentSpelling"/>
        <input type="hidden" name="Body" value=""/>
        <input type="hidden" name="spell_lang" value=""/>
      </form>
      <br/>
    </td>
  </tr>
</table>
<!-- dtl:block:Properties -->
