# --
# AgentTicketPhoneCommon.dtl - provides HTML form for phone
# Copyright (C) 2001-2011 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketPhoneCommon.dtl,v 1.7 2011/11/21 14:02:21 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.
# --

<form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="compose" class="Validate PreventMultipleSubmits">
    <input type="hidden" name="Action"    value="$Env{"Action"}"/>
    <input type="hidden" name="Subaction" value="Store"/>
    <input type="hidden" name="FormID"    value="$QData{"FormID"}"/>
    <input type="hidden" name="TicketID"  value="$QData{"TicketID"}"/>
    <div class="LayoutPopup ARIARoleMain">

        <div class="Header">
            <h1>$Text{"Phone call"}: $QData{"TicketNumber"} - $QData{"Title","60"}</h1>

<!-- dtl:block:TicketBack -->
            <p>
                <a class="CancelClosePopup" href="#">$Text{"Cancel & close window"}</a>
            </p>
<!-- dtl:block:TicketBack -->

        </div>

        <div class="LayoutFixedSidebar SidebarLast">

<!-- dtl:block:CustomerTable -->
            <div id="CustomerInfo" class="SidebarColumn WidgetSimple">
                <div class="Header">
                    <h2>$Text{"Customer Information"}</h2>
                </div>
                <div class="Content">
                    $Data{"CustomerTable"}
                </div>
            </div>
<!-- dtl:block:CustomerTable -->

            <div class="ContentColumn">
                <fieldset class="TableLike FixedLabel">
                    <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="Validate_Required $QData{"SubjectInvalid"} W75pc"/>
                        <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: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 -->

<!-- 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" title="Message body" rows="15" cols="$Config{"Ticket::Frontend::TextAreaNote"}" class="RichText Validate_Required $QData{"BodyInvalid"}">$Data{"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="submit" id="AttachmentDelete$QData{"FileID"}" name="AttachmentDelete$QData{"FileID"}" value="$Text{"Delete"}" class="SpacingLeft">$Text{"Delete"}</button>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#AttachmentDelete$QData{"FileID"}').bind('click', function () {
        Core.Form.Validate.DisableValidation($('#AttachmentDelete$QData{"FileID"}').closest('form'));
    });
//]]></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="NextStateID">$Text{"Next ticket state"}:</label>
                    <div class="Field">
                        $Data{"NextStatesStrg"}
                    </div>
                    <div class="Clear"></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#NextStateID').bind('change', function (Event) {
        Core.AJAX.FormUpdate( $(this).parents('form'), 'AJAXUpdate', 'NextStateID', [ $Data{"DynamicFieldNamesStrg"} ]);
    });
//]]></script>
<!--dtl:js_on_document_complete-->

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

<!-- 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="W25pc 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>
        <div class="Footer">
            <button class="Primary" id="submitRichText" accesskey="g" title="$Text{"Submit"} (g)" type="submit" value="$Text{"Submit"}">$Text{"Submit"}</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-->
