# --
# CustomerTicketMessage.dtl - provides HTML form for customer message
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: CustomerTicketMessage.dtl,v 1.66.2.2 2012-07-01 09:14:17 ub 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.
# --
<div id="MainBox" class="TicketCompose ARIARoleMain">
    <div class="Content">
        <form action="$Env{"CGIHandle"}" method="post" name="compose" enctype="multipart/form-data" class="Validate PreventMultipleSubmits">
            <input type="hidden" name="Action" value="$Env{"Action"}" />
            <input type="hidden" name="Subaction" value="StoreNew" />
            <input type="hidden" name="Expand" id="Expand" value="" />
            <input type="hidden" name="FormID" value="$QData{"FormID"}" />
            <fieldset>

<!-- dtl:block:TicketType -->
                <div>
<!--<label for="TicketNumber">$Config{"Ticket::Hook"}</label>
                    <input title="Ticket#" type="text" name="TicketNumber" size="30" value="$QData{"TicketNumber"}" />-->
                    <label for="TypeID" class="Mandatory">
                        <span class="Marker">*</span>
                        $Text{"Type"}:
                    </label>
                    $Data{"TypeStrg"}
                    <div id="TypeIDError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="TypeIDServerError" class="TooltipErrorMessage NoJavaScriptMessage$QData{"TypeIDInvalid"}" ><p>$Text{"This field is required."}</p></div>
                    <div class="Clear"></div>
                </div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#TypeID').bind('change', function (Event) {
        // make sure the ticket is not yet created on type change
        $('input#Expand').val(1);
        Core.Form.Validate.DisableValidation($(this).closest('form'));
        $(this).closest('form').submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:TicketType -->

<!-- dtl:block:Queue -->
                <div>
                    <label for="Dest" class="Mandatory">
                        <span class="Marker">*</span>
                        $Text{"To"}:
                    </label>
                    $Data{"ToStrg"}
                    <div id="DestError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="DestServerError" class="TooltipErrorMessage NoJavaScriptMessage$QData{"QueueInvalid"}" ><p>$Text{"This field is required."}</p></div>
                    <div class="Clear"></div>
                </div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#Dest').bind('change', function (Event) {
        // make sure the ticket is not yet created on queue change
        $('input#Expand').val(1);
        Core.Form.Validate.DisableValidation($(this).closest('form'));
        $(this).closest('form').submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:Queue -->

<!-- dtl:block:TicketService -->
                <div>
                    <label for="ServiceID">$Text{"Service"}:</label>
                    $Data{"ServiceStrg"}
                    <div class="Clear"></div>
                </div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#ServiceID').bind('change', function (Event) {
        // make sure the ticket is not yet created on service change
        $('input#Expand').val(1);
        Core.Form.Validate.DisableValidation($(this).closest('form'));
        $(this).closest('form').submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:TicketService -->

<!-- dtl:block:TicketSLA -->
                <div>
                    <label for="SLAID" title="$Text{"Service level agreement"}">$Text{"SLA"}:</label>
                    $Data{"SLAStrg"}
                    <div class="Clear"></div>
                </div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#SLAID').bind('change', function (Event) {
        // make sure the ticket is not yet created on sla change
        $('input#Expand').val(1);
        Core.Form.Validate.DisableValidation($(this).closest('form'));
        $(this).closest('form').submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:TicketSLA -->

                <div>
                    <label for="Subject" class="Mandatory">
                        <span class="Marker">*</span>
                        $Text{"Subject"}:
                    </label>
                    <input title="Subject" type="text" id="Subject" name="Subject" value="$QData{"Subject"}" class="Validate_Required $QData{"SubjectInvalid"}" />
                    <div id="SubjectError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="SubjectServerError" class="TooltipErrorMessage NoJavaScriptMessage$QData{"SubjectInvalid"}" ><p>$Text{"This field is required."}</p></div>
                    <div class="Clear"></div>
                </div>
                <div class="RichTextHolder">
                    <label for="RichText" class="Mandatory">
                        <span class="Marker">*</span>
                        $Text{"Text"}:
                    </label>
                    <div class="Clear"></div>
<!-- dtl:block:RichText -->
$Include{"CustomerRichTextEditor"}
<!-- dtl:block:RichText -->
                    <textarea id="RichText" class="RichText Validate_Required $QData{"BodyInvalid"}" name="Body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaNote"}">$QData{"Body"}</textarea>
                    <div id="RichTextError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="RichTextServerError" class="TooltipErrorMessage NoJavaScriptMessage$QData{"BodyInvalid"}" ><p>$Text{"This field is required."}</p></div>
                    <div class="Clear"></div>
                </div>
                <div>
                    <label for="Attachment">$Text{"Attachment"}:</label>
                    <input name="file_upload" id="Attachment" title="Attachment" type="file" size="40" />
                    <input type="hidden" id="AttachmentUpload" name="AttachmentUpload" value="0" />
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#Attachment').bind('change', function (Event) {
        var $Form = $('#Attachment').closest('form');
        Core.Form.Validate.DisableValidation($Form);
        $Form.find('#AttachmentUpload').val('1').end().submit();
    });
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:Attachment -->
                    <div class="Attachment" title="$QData{"Filename"} - $QData{"Filesize"}">
                        $QData{"Filename"} ($QData{"Filesize"})
                        <button type="button" id="AttachmentDeleteButton$QData{"FileID"}" name="AttachmentDeleteButton$QData{"FileID"}" value="$Text{"Delete"}">$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-->
                    </div>
<!-- dtl:block:Attachment -->

                    <div class="Clear"></div>
                </div>
<!-- dtl:block:Priority -->
                <div>
                    <label for="PriorityID">$Text{"Priority"}:</label>
                    $Data{"PriorityStrg"}
                    <div class="Clear"></div>
                </div>
<!-- dtl:block:Priority -->

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

            </fieldset>
            <div id="BottomActionRow" class="ActionRow">
                <button id="submitRichText" accesskey="g" title="$Text{"Submit"} (g)" type="submit" value="$Text{"Submit"}">$Text{"Submit"}</button>
            </div>
        </form>
    </div>
</div>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">
    Core.Customer.InitFocus();
</script>
<!-- dtl:js_on_document_complete -->
