# --
# AgentTicketSearch.dtl - provides HTML form for AgentTicketSearch
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketSearch.dtl,v 1.72.2.1 2012-05-11 12:32:57 mg 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:SearchAJAX -->
<div class="InnerContent">
    <form action="$Env{"CGIHandle"}" method="post" id="SearchForm">
        <input type="hidden" name="Action" value="$Env{"Action"}" id="SearchAction"/>
        <input type="hidden" name="Subaction" value="Search"/>
        <input type="hidden" name="EmptySearch" value="$QData{"EmptySearch"}" id="EmptySearch"/>
        <input type="hidden" name="ShownAttributes" value="" id="ShownAttributes">
        <fieldset class="TableLike">
            <div class="Clear"></div>
            <label>$Text{"Search template"}:</label>
            <div class="Field">
                $Data{"ProfilesStrg"}
                <div id="SearchProfileAddBlock">
                    <input type="text" name="Name" id="SearchProfileAddName"/>
                    <button type="button" title="$Text{"Create Template"}" id="SearchProfileAddAction">$Text{"Add"}</button>
                </div>
            </div>
            <div class="Field">
                <button id="SearchProfileNew" value="$Text{"Create New"}">$Text{"Create New"}</button>
                <button id="SearchProfileDelete" class="Hidden" value="$Text{"Delete"}">$Text{"Delete"}</button>
                <button id="SearchProfileAsLink" class="Hidden" value="$Text{"Profile link"}">$Text{"Profile link"}</button>
            </div>
            <div class="Clear"></div>
            <label>$Text{"Save changes in template"}:</label>
            <div class="Field">
                <input type="checkbox" name="SaveProfile" id="SaveProfile" value="1"/>
            </div>
        </fieldset>
        <fieldset class="TableLike" id="SearchInsert"></fieldset>
        <fieldset class="TableLike">
            <div class="Clear"></div>
            <label>$Text{"Add another attribute"}:</label>
            <div class="Field">
                $Data{"AttributesStrg"}
                <button type="button" class="Add" value="Add" title="Add entry">$Text{"Add"}</button>
            </div>
            <div class="Clear"></div>
            <label>$Text{"Output"}:</label>
            <div class="Field">
                $Data{"ResultFormStrg"}
            </div>
        </fieldset>
    </form>


    <fieldset class="TableLike Hidden" id="SearchAttributesHidden">
        <div class="Clear"></div>
        <label for="Fulltext" id="LabelFulltext">$Text{"Fulltext"}:</label>
        <div class="Field">
            <input type="text" name="Fulltext" value="$QData{"Fulltext"}" class="W50pc" />
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketNumber" id="LabelTicketNumber">$Config{"Ticket::Hook"} $Text{"(e. g. 10*5155 or 105658*)"}:</label>
        <div class="Field">
            <input type="text" name="TicketNumber" value="$QData{"TicketNumber"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="Title" id="LabelTitle">$Text{"Title"}:</label>
        <div class="Field">
            <input type="text" name="Title" value="$QData{"Title"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="CustomerID" id="LabelCustomerID">$Text{"CustomerID"} $Text{"(e. g. 234321)"}:</label>
        <div class="Field">
            <input type="text" name="CustomerID" value="$QData{"CustomerID"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="CustomerUserLogin" id="LabelCustomerUserLogin">$Text{"Customer User Login"} $Text{"(e. g. U5150)"}:</label>
        <div class="Field">
            <input type="text" name="CustomerUserLogin" value="$QData{"CustomerUserLogin"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TypeIDs" id="LabelTypeIDs">$Text{"Type"}:</label>
        <div class="Field">
            $Data{"TypesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="From" id="LabelFrom">$Text{"From"}:</label>
        <div class="Field">
            <input type="text" name="From" value="$QData{"From"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="To" id="LabelTo">$Text{"To"}:</label>
        <div class="Field">
            <input type="text" name="To" value="$QData{"To"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="Cc" id="LabelCc">$Text{"Cc"}:</label>
        <div class="Field">
            <input type="text" name="Cc" value="$QData{"Cc"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="Subject" id="LabelSubject">$Text{"Subject"}:</label>
        <div class="Field">
            <input type="text" name="Subject" value="$QData{"Subject"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="Body" id="LabelBody">$Text{"Text"}:</label>
        <div class="Field">
            <input type="text" name="Body" value="$QData{"Body"}" class="W50pc"/>
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>

<!-- dtl:block:DynamicField -->
        $Data{"Label"}
        <div class="Field">
            $Data{"Field"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
<!-- dtl:block:DynamicField -->

        <label for="ServiceIDs" id="LabelServiceIDs">$Text{"Service"}:</label>
        <div class="Field">
            $Data{"ServicesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="SLAIDs" id="LabelSLAIDs">$Text{"Service Level Agreement"}:</label>
        <div class="Field">
            $Data{"SLAsStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="PriorityIDs" id="LabelPriorityIDs">$Text{"Priority"}:</label>
        <div class="Field">
            $Data{"PrioritiesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="StateIDs" id="LabelStateIDs">$Text{"State"}:</label>
        <div class="Field">
            $Data{"StatesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="QueueIDs" id="LabelQueueIDs">$Text{"Queue"}:</label>
        <div class="Field">
            $Data{"QueuesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="OwnerIDs" id="LabelOwnerIDs">$Text{"Agent"}/$Text{"Owner"}:</label>
        <div class="Field">
            $Data{"UserStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="ResponsibleIDs" id="LabelResponsibleIDs">$Text{"Agent"}/$Text{"Responsible"}:</label>
        <div class="Field">
            $Data{"ResponsibleStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="CreatedQueueIDs" id="LabelCreatedQueueIDs">$Text{"Created in Queue"}:</label>
        <div class="Field">
            $Data{"CreatedQueuesStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="CreatedUserIDs" id="LabelCreatedUserIDs">$Text{"Created by"} $Text{"Agent"}/$Text{"Owner"}:</label>
        <div class="Field">
            $Data{"CreatedUserStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="LockIDs" id="LabelLockIDs">$Text{"Lock state"}:</label>
        <div class="Field">
            $Data{"LocksStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="WatchUserIDs" id="LabelWatchUserIDs">$Text{"Watcher"}:</label>
        <div class="Field">
            $Data{"WatchUserStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="ArticleCreateTimePoint" id="LabelArticleCreateTimePoint">$Text{"Article Create Time (before/after)"}:</label>
        <div class="Field">
            <input type="hidden" name="ArticleTimeSearchType" value="TimePoint" $Data{"ArticleTimeSearchType::TimePoint"}/>
            $Data{"ArticleCreateTimePointStart"} $Data{"ArticleCreateTimePoint"} $Data{"ArticleCreateTimePointFormat"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="ArticleCreateTimeSlot" id="LabelArticleCreateTimeSlot">$Text{"Article Create Time (between)"}:</label>
        <div class="Field">
            <input type="hidden" name="ArticleTimeSearchType" value="TimeSlot" $Data{"ArticleTimeSearchType::TimeSlot"}/>
            $Data{"ArticleCreateTimeStart"} $Text{"and"} $Data{"ArticleCreateTimeStop"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketCreateTimePoint" id="LabelTicketCreateTimePoint">$Text{"Ticket Create Time (before/after)"}:</label>
        <div class="Field">
            <input type="hidden" name="TimeSearchType" value="TimePoint" $Data{"TimeSearchType::TimePoint"}/>
            $Data{"TicketCreateTimePointStart"} $Data{"TicketCreateTimePoint"} $Data{"TicketCreateTimePointFormat"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketCreateTimeSlot" id="LabelTicketCreateTimeSlot">$Text{"Ticket Create Time (between)"}:</label>
        <div class="Field">
            <input type="hidden" name="TimeSearchType" value="TimeSlot" $Data{"TimeSearchType::TimeSlot"}/>
            $Data{"TicketCreateTimeStart"} $Text{"and"} $Data{"TicketCreateTimeStop"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketChangeTimePoint" id="LabelTicketChangeTimePoint">$Text{"Ticket Change Time (before/after)"}:</label>
        <div class="Field">
            <input type="hidden" name="ChangeTimeSearchType" value="TimePoint" $Data{"ChangeTimeSearchType::TimePoint"}/>
            $Data{"TicketChangeTimePointStart"} $Data{"TicketChangeTimePoint"} $Data{"TicketChangeTimePointFormat"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketChangeTimeSlot" id="LabelTicketChangeTimeSlot">$Text{"Ticket Change Time (between)"}:</label>
        <div class="Field">
            <input type="hidden" name="ChangeTimeSearchType" value="TimeSlot" $Data{"ChangeTimeSearchType::TimeSlot"}/>
            $Data{"TicketChangeTimeStart"} $Text{"and"} $Data{"TicketChangeTimeStop"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketCloseTimePoint" id="LabelTicketCloseTimePoint">$Text{"Ticket Close Time (before/after)"}:</label>
        <div class="Field">
            <input type="hidden" name="CloseTimeSearchType" value="TimePoint" $Data{"CloseTimeSearchType::TimePoint"}/>
            $Data{"TicketCloseTimePointStart"} $Data{"TicketCloseTimePoint"} $Data{"TicketCloseTimePointFormat"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="TicketCloseTimeSlot" id="LabelTicketCloseTimeSlot">$Text{"Ticket Close Time (between)"}:</label>
        <div class="Field">
            <input type="hidden" name="CloseTimeSearchType" value="TimeSlot" $Data{"CloseTimeSearchType::TimeSlot"}/>
            $Data{"TicketCloseTimeStart"} $Text{"and"} $Data{"TicketCloseTimeStop"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        <label for="SearchInArchive" id="LabelSearchInArchive">$Text{"Archive Search"}:</label>
        <div class="Field">
            $Data{"SearchInArchiveStrg"}
            <button type="button" class="Remove" value="Remove" title="$Text{"Remove this entry"}">$Text{"Remove"}</button>
        </div>
        <div class="Clear"></div>
        $Data{"AttributesOrigStrg"}
    </fieldset>
</div>

<div class="ContentFooter Center">
    <button id="SearchFormSubmit" class="Primary" value="Run search">$Text{"Run search"}</button>
</div>

<script type="text/javascript">//<![CDATA[
    window.setTimeout(function (){
<!-- dtl:block:SearchAJAXShow -->
        Core.Agent.Search.SearchAttributeAdd("$QData{"Attribute"}");
<!-- dtl:block:SearchAJAXShow -->
        Core.Agent.Search.AdditionalAttributeSelectionRebuild();
    }, 0);
//]]></script>

<!-- dtl:block:SearchAJAX -->



<!-- dtl:block:Search -->

<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
    Core.Agent.Search.OpenSearchDialog( '$Env{"Action"}' );
//]]></script>
<!--dtl:js_on_document_complete-->

<!-- dtl:block:Search -->
