# --
# AgentTicketForward.dtl - provides HTML form for AgentTicketForward
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketForward.dtl,v 1.95.2.4 2012-05-30 20:48:41 cr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

$Include{"AgentCustomerSearch"}
<form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="Compose" id="Compose" class="Validate PreventMultipleSubmits">
    <input type="hidden" name="Action" value="$Env{"Action"}"/>
    <input type="hidden" name="Subaction" value="SendEmail"/>
    <input type="hidden" name="TicketID" value="$QData{"TicketID"}"/>
    <input type="hidden" name="Email" value="$QData{"Email"}"/>
    <input type="hidden" name="InReplyTo" value="$QData{"InReplyTo"}"/>
    <input type="hidden" name="References" value="$QData{"References"}"/>
    <input type="hidden" name="FormID" value="$QData{"FormID"}"/>

    <div class="LayoutPopup ARIARoleMain">
        <div class="Header">
            <h1>$Text{"Forward ticket: %s - %s", "$QData{"TicketNumber"}", "$QData{"Title","60"}"}</h1>

<!-- dtl:block:TicketBack -->
            <p>
                <a class="CancelClosePopup" href="#">$Text{"Cancel & close window"}</a>
            </p>
<!-- dtl:block:TicketBack -->
<!-- dtl:block:PropertiesLock -->
            <p>
                $Text{"The ticket has been locked"}.
                <a class="UndoClosePopup" href="$Env{"Baselink"}Action=AgentTicketLock;Subaction=Unlock;TicketID=$Data{"TicketID"};$QEnv{"ChallengeTokenParam"}">
                    $Text{"Undo & close window"}
                </a>
            </p>
<!-- dtl:block:PropertiesLock -->

        </div>

        <div class="Content">

            <h2>$Text{"Options"}</h2>

            <fieldset class="TableLike FixedLabel">
                <label>$Text{"From"}:</label>
                <div class="Value">
                    $QData{"From"}
                    <input type="hidden" name="From" value="$QData{"From"}"/>
                </div>
                <div class="Clear"></div>

                <label class="Mandatory" for="CustomerAutoComplete"><span class="Marker">*</span>$Text{"To"}:</label>
                <div class="Field">
                    <input type="text" name="To" id="CustomerAutoComplete" value="$QData{"To"}" class="W50pc AutocompleteOff Validate_Required $QData{"ToInvalid"}"/>
                    <div id="CustomerAutoCompleteError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="CustomerAutoCompleteServerError" class="TooltipErrorMessage"><p>$Text{"Need a valid email address or don't use a local email address."}</p></div>
                </div>
                <div class="Clear"></div>

                <label for="Cc">$Text{"Cc"}:</label>
                <div class="Field">
                    <input type="text" name="Cc" id="Cc" value="$QData{"Cc"}"  class="W50pc $QData{"CcInvalid"}" />
                    <div id="CcServerError" class="TooltipErrorMessage"><p>$Text{"Need a valid email address or don't use a local email address"}</p></div>
                </div>
                <div class="Clear"></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
if ($('#CryptKeyID').length){
    $('#Cc').bind('blur', function (Event) {
        Core.AJAX.FormUpdate($('#Compose'), 'AJAXUpdate', 'Cc', ['CryptKeyID']);
    });
}
//]]></script>
<!--dtl:js_on_document_complete-->


                <label for="Bcc">$Text{"Bcc"}:</label>
                <div class="Field">
                    <input type="text" name="Bcc" id="Bcc" value="$QData{"Bcc"}" class="W50pc $QData{"BccInvalid"}" />
                    <div id="BccServerError" class="TooltipErrorMessage"><p>$Text{"Need a valid email address or don't use a local email address"}</p></div>
                </div>
                <div class="Clear"></div>

                <label class="Mandatory" for="Subject"><span class="Marker">*</span>$Text{"Subject"}:</label>
                <div class="Field">
                    <input type="text" name="Subject" id="Subject" value="$QData{"Subject"}" class="W50pc Validate_Required $QData{"SubjectInvalid"}"/>
                    <div id="SubjectError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                    <div id="SubjectServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
if ($('#CryptKeyID').length){
    $('#Bcc').bind('blur', function (Event) {
        Core.AJAX.FormUpdate($('#Compose'), 'AJAXUpdate', 'Bcc', ['CryptKeyID']);
    });
}
//]]></script>
<!--dtl:js_on_document_complete-->

<!-- dtl:block:Option -->
                <label for="$QData{"Name"}">$Text{"$Data{"Key"}"}:</label>
                <div class="Field">
                    $Data{"Value"}
                    <div id="$QData{"Name"}ServerError" class="TooltipErrorMessage"><p>$QData{"Invalid"}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Option -->

<!-- dtl:block:TicketOptions -->
                <label>$Text{"Options"}:</label>
                <div class="Field">

<!-- OutputFilterHook_TicketOptionsBegin -->

<!-- dtl:block:SpellCheck -->
                    <a href="#" id="OptionSpellCheck">[ $Text{"Spell check"} ]</a>
<!-- dtl:block:SpellCheck -->
<!-- dtl:block:AddressBook -->
                    <a href="#" id="OptionAddressBook">[ $Text{"Address book"} ]</a>
<!-- dtl:block:AddressBook -->

<!-- OutputFilterHook_TicketOptionsEnd -->

                </div>
                <div class="Clear"></div>
<!-- dtl:block:TicketOptions -->

<!-- OutputFilterHook_NoTicketOptionsFallback -->

                <label class="Mandatory" for="RichText"><span class="Marker">*</span>$Text{"Text"}:</label>
                <div class="RichTextField">
<!-- dtl:block:RichText -->
$Include{"RichTextEditor"}
<!-- dtl:block:RichText -->
                    <textarea id="RichText" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaEmail"}" class="RichText Validate_Required $QData{"BodyInvalid"}">$QData{"Body"}</textarea>
                    <div id="RichTextError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                    <div id="RichTextServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>

                <label>$Text{"Attachment"}:</label>
                <div class="Field">
                    <ul>
<!-- dtl:block:Attachment -->
                        <li>
                            $QData{"Filename"} ($QData{"Filesize"})
                            <button type="button" id="AttachmentDeleteButton$QData{"FileID"}" name="AttachmentDeleteButton$QData{"FileID"}" value="$Text{"Delete"}" class="SpacingLeft">$Text{"Delete"}</button>
                            <input type="hidden" id="AttachmentDelete$QData{"FileID"}" name="AttachmentDelete$QData{"FileID"}" />
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#AttachmentDeleteButton$QData{"FileID"}').bind('click', function () {
        var $Form = $('#AttachmentDeleteButton$QData{"FileID"}').closest('form');
        $('#AttachmentDelete$QData{"FileID"}').val(1);
        Core.Form.Validate.DisableValidation($Form);
        $Form.trigger('submit');
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                        </li>
<!-- dtl:block:Attachment -->
                        <li>
                            <input id="FileUpload" name="FileUpload" type="file" size="40" />
                            <input type="hidden" id="AttachmentUpload" name="AttachmentUpload" value="0" />
                        </li>
                    </ul>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#FileUpload').bind('change', function () {
        var $Form = $('#FileUpload').closest('form');
        Core.Form.Validate.DisableValidation($Form);
        $Form.find('#AttachmentUpload').val('1').end().submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>

                <label for="ComposeStateID">$Text{"Next ticket state"}:</label>
                <div class="Field">
                    $Data{"NextStatesStrg"}
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#ComposeStateID').bind('change', function (Event) {
        Core.AJAX.FormUpdate($('#Compose'), 'AJAXUpdate', 'ComposeStateID', [ $Data{"DynamicFieldNamesStrg"} ]);
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>

                <label>$Text{"Pending Date"} ($Text{"for pending* states"}):</label>
                <div class="Field">
                    $Data{"PendingDateString"}
                    <div id="DayServerError" class="TooltipErrorMessage"><p>$Text{"Date Invalid!"}</p></div>
                    <div id="HourServerError" class="TooltipErrorMessage"><p>$Text{"Date Invalid!"}</p></div>
                </div>
                <div class="Clear"></div>

                <label for="ArticleTypeID">$Text{"Article type"}:</label>
                <div class="Field">
                    $Data{"ArticleTypesStrg"}
                </div>
                <div class="Clear"></div>

<!-- dtl:block:DynamicField -->
                <div class="Row Row_DynamicField_$QData{"Name"}">
                    $Data{"Label"}
                    <div class="Field">
                        $Data{"Field"}
                    </div>
                    <div class="Clear"></div>
                </div>
<!-- dtl:block:DynamicField -->

# example of how to use fixed dynamic field blocks for customizations
# Note: Field1 and Field2 are the names of the fields and had to be replaced with the actual
# field names
#<!-- dtl:block:DynamicField_Field1 -->
#                <div class="Row Row_DynamicField_$QData{"Name"}">
#                    $Data{"Label"}
#                    <div class="Field">
#                        $Data{"Field"}
#                    </div>
#                    <div class="Clear"></div>
#                </div>
#<!-- dtl:block:DynamicField_Field1 -->
#<!-- dtl:block:DynamicField_Field2 -->
#                <div class="Row Row_DynamicField_$QData{"Name"}">
#                    $Data{"Label"}
#                    <div class="Field">
#                        $Data{"Field"}
#                    </div>
#                    <div class="Clear"></div>
#                </div>
#<!-- dtl:block:DynamicField_Field2 -->

<!-- dtl:block:TimeUnitsLabel -->
                <label for="TimeUnits">$Text{"Time units"}$Text{"$Config{"Ticket::Frontend::TimeUnits"}"}:</label>
<!-- dtl:block:TimeUnitsLabel -->
<!-- dtl:block:TimeUnitsLabelMandatory -->
                <label class="Mandatory" for="TimeUnits"><span class="Marker">*</span>$Text{"Time units"}$Text{"$Config{"Ticket::Frontend::TimeUnits"}"}:</label>
<!-- dtl:block:TimeUnitsLabelMandatory -->
<!-- dtl:block:TimeUnits -->
                <div class="Field">
                    <input type="text" name="TimeUnits" id="TimeUnits" value="$QData{"TimeUnits"}" class="W20pc Validate_TimeUnits $QData{"TimeUnitsRequired"} $QData{"TimeUnitsInvalid"}"/>
                    <div id="TimeUnitsError" class="TooltipErrorMessage"><p>$Text{"Invalid time!"}</p></div>
                    <div id="TimeUnitsServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:TimeUnits -->

            </fieldset>
        </div>
        <div class="Footer">
            <button class="Primary" id="submitRichText" accesskey="g" title="$Text{"Send mail!"} (g)" type="submit" value="$Text{"Send mail!"}" >$Text{"Send mail!"}</button>
        </div>
    </div>
</form>

#Layers
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.TicketAction.Init();
//]]></script>
<!--dtl:js_on_document_complete-->
