# --
# AgentTicketActionCommon.dtl - provides common HTML form for several masks
# Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketActionCommon.dtl,v 1.39 2010/06/17 17:28:14 en 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.
# --

<!-- dtl:block:Properties -->

<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="Store"/>
    <input type="hidden" name="TicketID" value="$QData{"TicketID"}"/>
    <input type="hidden" name="Expand" id="Expand" value=""/>
    <input type="hidden" name="FormID" value="$QData{"FormID"}"/>

    <div class="LayoutPopup ARIARoleMain">
        <div class="Header">
            <h1>

<!-- dtl:block:HeaderAgentTicketFreeText -->
                $Text{"Change Free Text of Ticket"}
<!-- dtl:block:HeaderAgentTicketFreeText -->

<!-- dtl:block:HeaderAgentTicketOwner -->
                $Text{"Change Owner of Ticket"}
<!-- dtl:block:HeaderAgentTicketOwner -->

<!-- dtl:block:HeaderAgentTicketClose -->
                $Text{"Close Ticket"}
<!-- dtl:block:HeaderAgentTicketClose -->

<!-- dtl:block:HeaderAgentTicketNote -->
                $Text{"Add Note to Ticket"}
<!-- dtl:block:HeaderAgentTicketNote -->

<!-- dtl:block:HeaderAgentTicketPending -->
                $Text{"Set Pending"}
<!-- dtl:block:HeaderAgentTicketPending -->

<!-- dtl:block:HeaderAgentTicketPriority -->
                $Text{"Change Priority of Ticket"}
<!-- dtl:block:HeaderAgentTicketPriority -->

<!-- dtl:block:HeaderAgentTicketResponsible -->
                $Text{"Change Responsible of Ticket"}
<!-- dtl:block:HeaderAgentTicketResponsible -->

                : $Data{"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"}">
                    $Text{"Undo & close window"}
                </a>
            </p>
<!-- dtl:block:PropertiesLock -->

        </div>
        <div class="Content">

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

            <fieldset class="TableLike FixedLabel">

<!-- dtl:block:Title -->
                <label class="Mandatory" for="Title"><span class="Marker">*</span>$Text{"Title"}:</label>
                <div class="Field">
                    <input type="text" id="Title" name="Title" value="$QData{"Title"}" class="W75pc Validate_Required $QData{"TitleInvalid"}" />
                    <div id="TitleError" class="TooltipErrorMessage" ><p>$Text{"This field is required."}</p></div>
                    <div id="TitleServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Title -->

<!-- dtl:block:Type -->
                <label class="Mandatory" for="TypeID"><span class="Marker">*</span>$Text{"Type"}:</label>
                <div class="Field">
                    $Data{"TypeStrg"}
                    <div id="TypeIDError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                    <div id="TypeIDServerError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Type -->

<!-- dtl:block:Service -->
                <label for="ServiceID">$Text{"Service"}:</label>
                <div class="Field">
                    $Data{"ServiceStrg"}
                    <div id="ServiceIDServerError" class="TooltipErrorMessage"><p>$Text{"Service invalid."}</p></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#ServiceID').bind('change', function (Event) {
        var $Form = $('#Expand').val('3').closest('form');
        Core.Form.Validate.DisableValidation($Form);
        $Form.submit();
        return false;
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Service -->

<!-- dtl:block:SLA -->
                <label for="SLAID">$Text{"Service Level Agreement"}:</label>
                <div class="Field">
                    $Data{"SLAStrg"}
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#SLAID').bind('change', function (Event) {
        var $Form = $('#Expand').val('3').closest('form');
        Core.Form.Validate.DisableValidation($Form);
        $Form.submit();
        return false;
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>
<!-- dtl:block:SLA -->

<!-- dtl:block:Owner -->
                <label for="NewOwnerID">$Text{"New Owner"}:</label>
                <div class="Field">
                    <input type="radio" name="NewOwnerType" value="New" title="Select new owner" $Data{"NewOwnerType::New"} />
                    $Data{"OwnerStrg"}
                    <div id="NewOwnerIDServerError" class="TooltipErrorMessage"><p>$Text{"Please set a new owner!"}</p></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#NewOwnerID').bind('click', function () {
        Core.Agent.TicketAction.SelectRadioButton('New','NewOwnerType');
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>

                <label for="OldOwnerID">$Text{"Previous Owner"}:</label>
                <div class="Field">
                    <input type="radio" name="NewOwnerType" value="Old" title="Select old owner" $Data{"NewOwnerType::Old"} />
                    $Data{"OldOwnerStrg"}
                    <div id="OldOwnerIDServerError" class="TooltipErrorMessage"><p>$Text{"Please set a new owner!"}</p></div>
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    $('#OldOwnerID').bind('click', function () {
        Core.Agent.TicketAction.SelectRadioButton('Old','NewOwnerType');
    });
//]]></script>
<!--dtl:js_on_document_complete-->
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Owner -->

<!-- dtl:block:Responsible -->
                <label for="NewResponsibleID">$Text{"Responsible"}:</label>
                <div class="Field">
                    $Data{"ResponsibleStrg"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:Responsible -->

<!-- dtl:block:Note -->
<!-- dtl:block:InformAgent -->
                <label for="InformUserID">$Text{"Inform Agent"}: ($Text{"Optional"})</label>
                <div class="Field">
                    $Data{"OptionStrg"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:InformAgent -->

<!-- dtl:block:InvolvedAgent -->
                <label for="InvolvedUserID">$Text{"Inform involved Agents"}:</label>
                <div class="Field">
                    $Data{"InvolvedAgentStrg"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:InvolvedAgent -->

                <label class="Mandatory" for="Subject"><span class="Marker">*</span>$Text{"Subject"}:</label>
                <div class="Field">
                    <input type="text" id="Subject" name="Subject" value="$QData{"Subject"}" class="W75pc Validate_Required $Data{"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: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" class="RichText Validate_Required $Data{"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"><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"}">$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 name="FileUpload" id="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 (Event) {
        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>

<!-- dtl:block:ArticleType -->
                <label for="ArticleTypeID">$Text{"Note type"}:</label>
                <div class="Field">
                    $Data{"ArticleTypeStrg"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:ArticleType -->
<!-- dtl:block:Note -->

<!-- dtl:block:State -->
                <label for="NewStateID">$Text{"Next state"}:</label>
                <div class="Field">
                    $Data{"StateStrg"}
                </div>
                <div class="Clear"></div>

<!-- dtl:block:StatePending -->
                <label>$Text{"Pending date"}:</label>
                <div class="Field">
                    $Data{"DateString"}
                    <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:StatePending -->
<!-- dtl:block:State -->

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

<!-- dtl:block:TicketFreeText -->
                $Data{"TicketFreeKeyField"}
                <div class="Field">
                    $Data{"TicketFreeTextField"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:TicketFreeText -->

# example of how to use fixed ticket freetext blocks for customizations
#<!-- dtl:block:TicketFreeText1 -->
#                $Data{"TicketFreeKeyField1"}
#                <div class="Field">
#                    $Data{"TicketFreeTextField1"}
#                </div>
#                <div class="Clear"></div>
#<!-- dtl:block:TicketFreeText1 -->
#<!-- dtl:block:TicketFreeText2 -->
#                $Data{"TicketFreeKeyField2"}
#                <div class="Field">
#                    $Data{"TicketFreeTextField2"}
#                </div>
#                <div class="Clear"></div>
#<!-- dtl:block:TicketFreeText2 -->

<!-- dtl:block:TicketFreeTime -->
                $Data{"TicketFreeTimeKey"}
                <div class="Field">
                    $Data{"TicketFreeTime"}
                    <div id="TicketFreeTime$Data{"Count"}UsedError" class="TooltipErrorMessage"><p>$Text{"This field is required."}</p></div>
                </div>
                <div class="Clear"></div>
<!-- dtl:block:TicketFreeTime -->

# example of how to use fixed ticket freetime blocks for customizations
#<!-- dtl:block:TicketFreeTime1 -->
#                        <label>$Data{"TicketFreeTimeKey1"}:</label>
#                        <div class="Field">
#                            $Data{"TicketFreeTime1"}
#                        </div>
#                        <div class="Clear"></div>
#<!-- dtl:block:TicketFreeTime1 -->
#<!-- dtl:block:TicketFreeTime2 -->
#                        <label>$Data{"TicketFreeTimeKey2"}:</label>
#                        <div class="Field">
#                            $Data{"TicketFreeTime2"}
#                        </div>
#                        <div class="Clear"></div>
#<!-- dtl:block:TicketFreeTime2 -->

<!-- dtl:block:ArticleFreeText -->
                $Data{"ArticleFreeKeyField"}
                <div class="Field">
                    $Data{"ArticleFreeTextField"}
                </div>
                <div class="Clear"></div>
<!-- dtl:block:ArticleFreeText -->

# example of how to use fixed article freetext blocks for customizations
#<!-- dtl:block:ArticleFreeText1 -->
#                $Data{"ArticleFreeKeyField1"}
#                <div class="Field">
#                    $Data{"ArticleFreeTextField1"}
#                </div>
#                <div class="Clear"></div>
#<!-- dtl:block:ArticleFreeText1 -->
#<!-- dtl:block:ArticleFreeText2 -->
#                $Data{"ArticleFreeKeyField2"}
#                <div class="Field">
#                    $Data{"ArticleFreeTextField2"}
#                </div>
#                <div class="Clear"></div>
#<!-- dtl:block:ArticleFreeText2 -->

<!-- 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="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{"Submit"} (g)" type="submit" value="$Text{"Submit"}">$Text{"Submit"}</button>
        </div>
    </div>
</form>
<!-- dtl:block:Properties -->

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