# --
# AgentTicketOverviewMedium.dtl - provides HTML Ticket Overview
# Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
# --
# $Id: AgentTicketOverviewMedium.dtl,v 1.74 2013/01/11 12:35:19 mn 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:DocumentActionRow -->
<ul class="Actions">
<!-- dtl:block:DocumentActionRowBulk -->
    <li class="Bulk">
        <span>
            <input type="checkbox" title="$Text{"Select all"}" id="SelectAllTickets" autocomplete="off" />
            <label class="InvisibleText" for="SelectAllTickets">$Text{"Select all"}</label>
        </span>
    </li>
    <li id="BulkAction" class="Bulk Inactive $QData{"CSS"}">
        <a href="#">$Text{"$Data{"Name"}"}</a>
    </li>
<!-- dtl:block:DocumentActionRowBulk -->
<!-- dtl:block:DocumentActionRowItem -->
    <li class="$QData{"CSS"}"><a href="#">$Text{"$Data{"Name"}"}</a></li>
<!-- dtl:block:DocumentActionRowItem -->
</ul>
<!-- dtl:block:DocumentActionRow -->

<!-- dtl:block:DocumentHeader -->
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    Core.UI.ActionRow.Init();
//]]></script>
<!-- dtl:js_on_document_complete -->
<ul id="TicketOverviewMedium" class="Overview OverviewMedium">
<!-- dtl:block:DocumentHeader -->

<!-- dtl:block:NoTicketFound -->
    <li id="EmptyMessageMedium">
        $Text{"No ticket data found."}
    </li>
<!-- dtl:block:NoTicketFound -->

<!-- dtl:block:DocumentContent -->
    <li id="TicketID_$QData{"TicketID"}" class="MasterAction">
        <div class="Content">
<!-- dtl:block:InlineActionRow -->
            <ul class="Actions InlineActions">
<!-- dtl:block:InlineActionRowItem -->
                <li><a class="$QData{"Class"}" href="$QData{"Link"}" title="$QData{"Description"}">$QData{"Name"}</a></li>
<!-- dtl:block:InlineActionRowItem -->
<!-- dtl:block:InlineActionRowItemHTML -->
                $Data{"HTML"}
<!-- dtl:block:InlineActionRowItemHTML -->
            </ul>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    // Shows InlineActionRow on hover
    $('.OverviewMedium > li').bind('mouseenter', function() {
        $(this).find('ul.InlineActions').show();
    }).bind('mouseleave', function() {
        $(this).find('ul.InlineActions').hide();
    });

    // Fix for IE: Hovering the options of the select triggers a mouseleave of the li, so we have to stop the event propagation
    $('.OverviewMedium > li ul.InlineActions li form select').bind('mouseleave', function (Event) {
        Event.stopPropagation();
    });

    // Stop propagation on click on a part of the InlienActionRow without a link
    // Otherwise that would trigger the li-wide link to the ticketzoom
    $('ul.InlineActions').click(function (Event) {
        Event.cancelBubble = true;
        if (Event.stopPropagation) {
            Event.stopPropagation();
        }
    });
//]]></script>
<!-- dtl:js_on_document_complete -->
<!-- dtl:block:InlineActionRow -->
<!-- dtl:block:Bulk -->
            <div class="Checkbox">
                <input class="Checkbox" type="checkbox" name="TicketID" value="$QData{"TicketID"}" autocomplete="off" />
            </div>
<!-- dtl:block:Bulk -->
<!-- dtl:block:Meta -->
<!-- dtl:block:MetaIcon -->
            <div class="$QData{"Class"}" title="$Text{"$Data{"Title"}"}">
                <span class="$QData{"ClassSpan"}">$Text{"$Data{"Title"}"}</span>
            </div>
<!-- dtl:block:MetaIcon -->
<!-- dtl:block:Meta -->
            <h2>
                <a href="$Env{"Baselink"}Action=AgentTicketZoom;TicketID=$LQData{"TicketID"}" class="MasterActionLink">$Config{"Ticket::Hook"}: $Data{"TicketNumber"} &ndash; $QData{"Title","80"}</a>
            </h2>
<!-- dtl:block:MenuItem -->
            <a href="$Env{"Baselink"}$Data{"Link"}" $Data{"LinkParam"} title="$Text{"$Data{"Description"}"}">$Text{"$Data{"Name"}"}</a>
<!-- dtl:block:MenuItem -->
            <table class="Infos">
                <tbody>
                    <tr>
                        <td>
                            <label>$Text{"From"}</label><div title="$QData{"From"}">$QData{"FromRealname","80"}</div>
                        </td>
                        <td>
                            <label>$Text{"Age"}</label>$QData{"Age"}
                        </td>
                        <td>
                            <label>$Text{"Queue"}</label><div title="$QData{"Queue"}">$QData{"Queue","26"}</div>
                        </td>
                        <td>
<!-- dtl:block:CustomerIDRW -->
                            <label>$Text{"CustomerID"}</label><a href="$Config{"CustomerDBLink"}" class="AsPopup PopupType_TicketAction" $Config{"CustomerDBLinkTarget"}>$QData{"CustomerID", "26"}</a>
<!-- dtl:block:CustomerIDRW -->
<!-- dtl:block:CustomerIDRO -->
                            <label>$Text{"CustomerID"}</label>$QData{"CustomerID", "26"}
<!-- dtl:block:CustomerIDRO -->
                            <br /><div title="$QData{"CustomerName"}">$QData{"CustomerName","26"}</div>
                        </td>
# example of how to use fixed dynamic field blocks for customizations
# Note: Field1 is the name of the field and had to be replaced with the actual
# field name
#<!-- dtl:block:DynamicField_Field1 -->
#                        <td>
#                            <label>$Text{"$Data{"Label"}"}</label>
#<!-- dtl:block:DynamicField_Field1Link -->
#                            <div title="$Data{"Title"}"><a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a></div>
#<!-- dtl:block:DynamicField_Field1Link -->
#<!-- dtl:block:DynamicField_Field1Plain -->
#                            <div title="$Data{"Title"}"><span>$Data{"Value"}</span></div>
#<!-- dtl:block:DynamicField_Field1Plain -->
#                        </td>
#<!-- dtl:block:DynamicField_Field1 -->
                        <td>
                            <label>$Text{"First Response Time"}</label>
<!-- dtl:block:FirstResponseTime -->
                            <div title="$Text{"Service Time"}: $QData{"FirstResponseTimeWorkingTime"}" class="$QData{"FirstResponseTimeClass"}">$QData{"FirstResponseTimeHuman"} / $TimeShort{"$QData{"FirstResponseTimeDestinationDate"}"}</div>
<!-- dtl:block:FirstResponseTime -->
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>$Text{"To"}</label><div title="$QData{"To"}">$QData{"ToRealname","80"}</div>
                        </td>
                        <td>
                            <label>$Text{"Created"}</label>$TimeLong{"$Data{"Created"}"}
                        </td>
                        <td>
                            <label>$Text{"State"}</label><div title="$Text{"$Data{"State"}"}">$Text{"$Data{"State"}"}</div>
                        </td>
                        <td>
<!-- dtl:block:Type -->
                            <label>$Text{"Type"}</label><div title="$QData{"Type"}">$QData{"Type","26"}</div>
<!-- dtl:block:Type -->
                        </td>
# example of how to use fixed dynamic field blocks for customizations
# Note: Field2 is the name of the field and had to be replaced with the actual
# field name
#<!-- dtl:block:DynamicField_Field2 -->
#                        <td>
#                            <label>$Text{"$Data{"Label"}"}</label>
#<!-- dtl:block:DynamicField_Field2Link -->
#                            <div title="$Data{"Title"}"><a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a></div>
#<!-- dtl:block:DynamicField_Field2Link -->
#<!-- dtl:block:DynamicField_Field2Plain -->
#                            <div title="$Data{"Title"}"><span>$Data{"Value"}</span></div>
#<!-- dtl:block:DynamicField_Field2Plain -->
#                        </td>
#<!-- dtl:block:DynamicField_Field2 -->
                        <td>
                            <label>$Text{"Update Time"}</label>
<!-- dtl:block:UpdateTime -->
                            <div title="$Text{"Service Time"}: $QData{"UpdateTimeWorkingTime"}" class="$QData{"UpdateTimeClass"}">$QData{"UpdateTimeHuman"} / $TimeShort{"$QData{"UpdateTimeDestinationDate"}"}</div>
<!-- dtl:block:UpdateTime -->
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>$Text{"Subject"}</label><div title="$QData{"Subject"}">$QData{"Subject","80"}</div>
                        </td>
                        <td>
                            <label>$Text{"Owner"}</label><div title="$QData{"UserFirstname"} $QData{"UserLastname"} ($QData{"Owner"})">$QData{"UserFirstname","15"} $QData{"UserLastname","15"}</div>
                        </td>
                        <td>
                            <label>$Text{"Lock"}</label><div title="$Text{"$Data{"Lock"}"}">$Text{"$Data{"Lock"}"}</div>
                        </td>
                        <td>
<!-- dtl:block:Service -->
                            <label>$Text{"Service"}</label><div title="$QData{"Service"}">$QData{"Service","26"}</div>
<!-- dtl:block:Service -->
<!-- dtl:block:SLA -->
                            <label>$Text{"Service Level Agreement"}</label><div title="$QData{"SLA"}">$QData{"SLA","26"}</div>
<!-- dtl:block:SLA -->
                        </td>
# example of how to use fixed dynamic field blocks for customizations
# Note: Field3 is the name of the field and had to be replaced with the actual
# field name
#<!-- dtl:block:DynamicField_Field3 -->
#                        <td>
#                            <label>$Text{"$Data{"Label"}"}</label>
#<!-- dtl:block:DynamicField_Field3Link -->
#                            <div title="$Data{"Title"}"><a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a></div>
#<!-- dtl:block:DynamicField_Field3Link -->
#<!-- dtl:block:DynamicField_Field3Plain -->
#                            <div title="$Data{"Title"}"><span>$Data{"Value"}</span></div>
#<!-- dtl:block:DynamicField_Field3Plain -->
#                        </td>
#<!-- dtl:block:DynamicField_Field3 -->
                        <td>
                            <label>$Text{"Solution Time"}</label>
<!-- dtl:block:SolutionTime -->
                            <div title="$Text{"Service Time"}: $QData{"SolutionTimeWorkingTime"}" class="$QData{"SolutionTimeClass"}">$QData{"SolutionTimeHuman"} / $TimeShort{"$QData{"SolutionTimeDestinationDate"}"}</div>
<!-- dtl:block:SolutionTime -->
                        </td>
                    </tr>
                </tbody>
            </table>

<!-- dtl:block:DynamicFieldTable -->
            <div class="SpacingTop Center DynamicFieldSeparator"></div>
            <table class="Infos">
                <tbody>
<!-- dtl:block:DynamicFieldTableRow -->
                    <tr>
<!-- dtl:block:DynamicFieldTableRowRecord -->
                        <td>
                            <label>$Text{"$Data{"Label"}"}</label>
<!-- dtl:block:DynamicFieldTableRowRecordLink -->
                            <div title="$Data{"Title"}"><a href="$Data{"Link"}" class="DynamicFieldLink">$Data{"Value"}</a></div>
<!-- dtl:block:DynamicFieldTableRowRecordLink -->
<!-- dtl:block:DynamicFieldTableRowRecordPlain -->
                            <div title="$Data{"Title"}"><span>$Data{"Value"}</span></div>
<!-- dtl:block:DynamicFieldTableRowRecordPlain -->
                        </td>
<!-- dtl:block:DynamicFieldTableRowRecord -->
                    </tr>
<!-- dtl:block:DynamicFieldTableRow -->
                </tbody>
            </table>
<!-- dtl:block:DynamicFieldTable -->

            <div class="Shadow"></div>
        </div>
    </li>

<!-- dtl:block:DocumentContent -->

<!-- dtl:block:DocumentFooter -->
</ul>

<form name="bulk" action="">
    <input type="hidden" name="TicketID" value=""/>
</form>

<form action="$Env{"CGIHandle"}" method="post" enctype="multipart/form-data" name="matrix">
    <input type="hidden" name="Action" value="AgentTicketBulk"/>
<!-- dtl:block:DocumentFooterBulkItem -->
    <input type="hidden" name="TicketID" value=""/>
<!-- dtl:block:DocumentFooterBulkItem -->
    <input type="hidden" name="TicketID" value=""/>
</form>
<!-- dtl:block:DocumentFooter -->

<!-- dtl:block:DocumentMenuItem -->
<li id="$QData{"ID"}">
    <a href="#" title="$Text{"$Data{"Description"}"}">$Text{"$Data{"Name"}"}</a>
</li>
<!-- dtl:block:DocumentMenuItem -->
<!-- dtl:block:DocumentMenuItemMoveForm -->
<li class="$QData{"Class"}">
    <form title="$Text{"Move ticket to a different queue"}" action="$Env{"CGIHandle"}" method="post">
        <input type="hidden" name="Action" value="AgentTicketMove"/>
        <input type="hidden" name="QueueID" value="$QData{"QueueID"}"/>
        <input type="hidden" name="TicketID" value="$QData{"TicketID"}"/>
        <label for="DestQueueID" class="InvisibleText">$Text{"Change queue"}:</label>
        $Data{"MoveQueuesStrg"}
    </form>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    $('select[name=DestQueueID]').live('change', function (Event) {
        $(this).closest('form').submit();
    });
//]]></script>
<!-- dtl:js_on_document_complete -->
</li>
<!-- dtl:block:DocumentMenuItemMoveForm -->

<!-- dtl:js_on_document_complete -->
<!-- dtl:block:DocumentReadyActionRowAdd -->
<script type="text/javascript">//<![CDATA[
    Core.UI.ActionRow.AddActions($('#TicketID_$QData{"TicketID"}'), $Data{"Data"});
//]]></script>
<!-- dtl:block:DocumentReadyActionRowAdd -->
<!-- dtl:block:DocumentReadyStart -->
<script type="text/javascript">//<![CDATA[
    Core.UI.StaticTableControl($('#OverviewControl'));
    Core.UI.InitCheckboxSelection($('div.Checkbox'));
    $('.MasterAction').bind('click', function (Event) {
        var $MasterActionLink = $(this).find('.MasterActionLink');
        // only act if the link was not clicked directly
        if (Event.target !== $MasterActionLink.get(0)) {
            window.location = $MasterActionLink.attr('href');
            return false;
        }
    });
//]]></script>
<!-- dtl:block:DocumentReadyStart -->
<!-- dtl:js_on_document_complete -->

<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
    $('a.AsPopup').bind('click', function (Event) {
        var Matches,
            PopupType = 'TicketAction';

        Matches = $(this).attr('class').match(/PopupType_(\w+)/);
        if (Matches) {
            PopupType = Matches[1];
        }

        Core.UI.Popup.OpenPopup($(this).attr('href'), PopupType);
        return false;
    });
    $('a.DynamicFieldLink').bind('click', function (Event) {
        Core.UI.Popup.OpenPopup($(this).attr('href'), 'DynamicFieldLink');
        return false;
    });
//]]></script>
<!-- dtl:js_on_document_complete -->
