# --
# AgentNote.dtl - provides HTML form for note mask
# Copyright (C) 2001-2003 Martin Edenhofer <martin+code@otrs.org>
# --
# $Id: AgentNote.dtl,v 1.26 2004/01/23 02:22:28 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.txt.
# --
<!-- start form -->
<script language="JavaScript" type="text/javascript">
<!--
function submit_compose()
{
    if (document.compose.Subject.value == "") {
        alert('$Text{"A message should have a subject!"}');
        document.compose.Subject.focus();
        return false;
    }
    else if (document.compose.Body.value == "") {
        alert('$Text{"A message should have a body!"}');
        document.compose.Body.focus();
        return false;
    } 
    else if (document.compose.TimeUnits.value == "" && $Config{"FrontendNeedAccountedTime"}) {
        alert('$Text{"You need to account time!"}');
        document.compose.TimeUnits.focus();
        return false;
    }
    else {
        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>

<table border="0" width="100%" cellspacing="0" cellpadding="3" cols="2">
<tr> 
  <td align="left" class="table0"> 
    <b>$Env{"Box0"}$Text{"Add note to ticket"}: $Data{"TicketNumber"}$Env{"Box1"}</b>
  </td>
  <td align="right" class="table0">
    <b>-</b>
  </td>
</tr>
<tr>
  <td align="left" colspan="2" class="table2">
    <a href="$Env{"Baselink"}$Env{"LastScreen"}" onmouseover="window.status='$Text{"Back"}'; return true;" onmouseout="window.status='';" class="menuitem">$Text{"Back"}</a>
  </td>
</tr>
<tr>
  <td align="left" valign="top" colspan="2" class="table1">

<p>

<form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="compose">
<input type="hidden" name="Action" value="AgentNote">
<input type="hidden" name="Subaction" value="Store">
<input type="hidden" name="QueueID" value="$Data{"QueueID"}">
<input type="hidden" name="TicketID" value="$Data{"TicketID"}">
<input type="hidden" name="NextScreen" value="$Data{"NextScreen"}">
  <table border="0" width="100%">
  <tr>
    <td width="15%">$Text{"Subject"}:</td>
    <td width="85%"><input type="text" name="Subject" value="$Text{"$Config{"DefaultNoteSubject"}"}" size="70"></td>
  </tr>
  <tr>
    <td>$Text{"Options"}:</td>
    <td>
       $Env{"Box0"}<a href="" onclick="SpellCheckSubmit(); return false;" onmouseover="window.status='$Text{"Spell Check"}'; return true;" onmouseout="window.status='';"><img border="0" src="$Env{"Images"}spell.png">$Text{"Spell Check"}</a>$Env{"Box1"} 
       $Env{"Box0"}<a href="#attachment" onmouseover="window.status='$Text{"Attachments"}'; return true;" onmouseout="window.status='';"><img border="0" src="$Env{"Images"}attach.png">$Text{"Attachments"}</a>$Env{"Box1"}
    </td>
  </tr>
  <tr>
    <td>$Text{"Text"}:</td>
    <td>
<textarea name="Body" rows="16" cols="$Config{"TextAreaNoteWindow"}" wrap="$Env{"BrowserWrap"}">$Text{"$Config{"DefaultNoteText"}"}</textarea>
    </td>
  </tr>
  <tr>
    <td>$Text{"Attachment"}:</td><td><input name="file_upload" type="file" size="40" class="fixed">&nbsp;<!--<input type="button" class="button" onclick="attach()" value="$Text{"Attach"}">--><a name="attachment"></td>
  </tr>
  <tr>
    <td>$Text{"Note type"}:</td>
    <td>$Data{"NoteStrg"}</td>
  </tr>
  <tr>
    <td>$Text{"Time units"}$Text{"$Config{"TimeUnits"}"}:</td>
    <td><input type="text" name="TimeUnits" value="" size="3"></td>
  </tr>
# --
# is ticket state used?
# --
<dtl if ($Config{"NoteSetState"} eq "1") { $Data{"NextStatesString"} = "<tr><td width="20%">$Text{"Next ticket state"}:</td><td width="80%">$Data{"NextStatesStrg"}</td></tr>"; }>
    $Data{"NextStatesString"}
#
  </table>
<br>
<input class="button" type="submit" value="$Text{"submit"}" onclick="return submit_compose();">
</form>

</p>

<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>


  </td> 
</tr>
</table>
<!-- end form -->
