<div class="container-fluid" style="width: 90%">
    <ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-3" style="margin-left: -3rem !important;">
        [% foreach from=$tickets item=ticket %]
            <li>
                <a href="index.php?module=ticket&event=show&id=[% $ticket.id %]" style="text-decoration: none; color: #000;">  
                    <div class="card panel-info shadow-sm rounded" style="">
                        <div class="card-header">
                            <div class="row">
                                <div class="col-lg-6">
                                    <span class="fcs-card-title h5">
                                        [% if !$TRefID && !$iframe && !$ContactID %]
                                            <input type="checkbox" value="[% $ticket.id %]" class="selectTicket" name="Basket[]" />
                                        [% /if %] (#[%$ticket.id%]) [% $ticket.ticketdescr %]
                                    </span>
                                    [% if  $listview.Columns.ProjectName %]
                                        [% if $ticket.projectname %]
                                            <p class="small">[% $ticket.projectname %]</p>
                                        [% else %]
                                            <p class="small">[% $user->gettext('Keinem Projekt zugewiesen') %]</p>
                                        [% /if %]
                                    [% /if %]
                                </div>
                                <div class="col-lg-6 text-end">
                                    <span class="prio[% $ticket.ticketprioid %]">[% $user->gettext($ticket.tstatus) %]</span>
                                </div>
                            </div>

                        </div>
                        <div class="card-body">
                            <div class="form-horizontal form-label-left">
                                [% if  $listview.Columns.Contact %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Kontakt') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> [%$ticket.contact%]</p>
                                            [% if $listview.Columns.ContactBuilding || $listview.Columns.ContactRoom || $listview.Columns.ContactFloor || $listview.Columns.ContactCostCenter || $listview.Columns.ContactDepartment %]
                                                <p class="small">
                                                    [% $ticket.contactbuilding %]
                                                    [% if $ticket.contactroom != "" %] [% $user->gettext('Raum') %]: [% $ticket.contactroom %][% /if %]
                                                    &nbsp;
                                                    [% if $ticket.ContactFloor != "" %] [% $user->gettext('Stockwerk') %]: [% $ticket.contactfloor %][% /if %]
                                                    &nbsp;
                                                    [% if $ticket.ContactCostCenter != "" %] [% $user->gettext('Kostenstelle') %]: [% $ticket.conctactcostcenter %][% /if %]
                                                    &nbsp;
                                                    [% if $ticket.ContactDepartment != "" %] [% $user->gettext('Abteilung') %]: [% $ticket.conctactdepartment %][% /if %]
                                                </p>
                                            [% /if %]
                                            [% if $listview.Columns.ContactPhone || $listview.Columns.ContactMobile %]
                                                <p class="small">
                                                    [% if $ticket.contactphone != "" %] [% $user->gettext('Tel') %]: [% $ticket.contactphone %][% /if %]
                                                    &nbsp;
                                                    [% if $ticket.contactmobile != "" %] [% $user->gettext('Mobil') %]: [% $ticket.contactmobile %][% /if %]
                                                </p>
                                            [% /if %]
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.CreateDate ||  $listview.Columns.CreateUser %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Erstellt') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">[% if  $listview.Columns.CreateDate %] [%$ticket.createdate %][% /if %][% if  $listview.Columns.CreateUser %] [%$user->gettext('von') %] [%$ticket.createusername  %] [% /if %]</p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.DesireDate || $listview.Columns.OnHold || $listview.Columns.WorkOnDate   %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Termine') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> 
                                                [% if  $listview.Columns.DesireDate && $ticket.ticketdesiredate %]
                                                    [% $user->gettext('Fällig am') %] [% $ticket.ticketdesiredate %]&nbsp;
                                                [% /if %]
                                                [% if  $listview.Columns.OnHold && $ticket.onhold %]
                                                    [% $user->gettext('zurückgestellt bis') %] [% $ticket.onhold %]&nbsp;
                                                [% /if %]
                                                [% if  $listview.Columns.WorkOnDate && $ticket.workondate %]
                                                    [% $user->gettext('zu bearbeiten am') %] [% $ticket.workondate %]
                                                [% /if %]
                                            </p>

                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.UpdateDate || $listview.Columns.UpdateUser %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Letzte Änderung') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> [% if  $listview.Columns.UpdateDate %][%$ticket.updatedate %][% /if %] [% if  $listview.Columns.UpdateUser %][%$user->gettext('von') %] [%$ticket.updateusername %][% /if %]</p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.Gruppe %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Gruppe') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> [% if $ticket.groups.groupnames != "" %][% $ticket.groups.groupnames %][%else%][% $user->gettext('Keine') %][%/if%]</p>
                                        </div>
                                    </div>
                                [% /if %]

                                [% if  $listview.Columns.Supporter %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Supporter') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> [% if $ticket.supporters.supporternames != "" %][% $ticket.supporters.supporternames %][% else %][% $user->gettext('Keine') %][%/if%]</p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.Category1 || $listview.Columns.Category2  %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Kategorie') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"> [% if $listview.Columns.Category1  %]<b>1:</b>[% if $ticket.category1 %][% $ticket.category1 %][% else %][% $user->gettext('Keine') %][% /if %][% /if %] [% if $listview.Columns.Category2  %]<b>2:</b>[% if $ticket.category2 %][% $ticket.category2 %][% else %][% $user->gettext('Keine') %][% /if %][% /if %]</p>
                                        </div>
                                    </div>
                                [% /if %]

                                [% if  $listview.Columns.TicketRefID  %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Ticketreferenz') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">[% if $ticket.ticketreferenzid  %]#[% $ticket.ticketreferenzid %][% else %][% $user->gettext('Keine') %][% /if %]</p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.Expense || $listview.Columns.UsedExpense  %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Aufwand') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static"><b>[% $user->gettext('Erwartete') %]:</b> [% $ticket.expexpense %]<b>[% $user->gettext('Verbuchte') %]:</b>[% $ticket.usedexpense  %]</p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.ADRoom || $listview.Columns.ADFloor || $listview.Columns.ADBuilding || $listview.Columns.ADLocation  %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Ort') %] (Ticket):</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">
                                                [% if $ticket.adbuilding %] [% $ticket.adbuilding %][% /if %]
                                                [% if $ticket.adroom  %] [% $user->gettext('Raum') %]: [% $ticket.adroom %][% /if %]
                                                &nbsp;
                                                [% if $ticket.adfloor %] [% $user->gettext('Stockwerk') %]: [% $ticket.adfloor %][% /if %]
                                                &nbsp;
                                                [% if $ticket.adlocation %] [% $ticket.adlocation %][% /if %]
                                                &nbsp;
                                            </p>
                                        </div>
                                    </div>
                                [% /if %]
                                [% if  $listview.Columns.Mandant   %]
                                    <div class="form-group row mb-3">
                                        <label class="control-label col-sm-3" for="">[% $user->gettext('Mandant') %]:</label>
                                        <div class="col-sm-9">
                                            <p class="form-control-static">
                                                [% $ticket.mandant %]
                                            </p>
                                        </div>
                                    </div>
                                [% /if %]

                            </div>
                        </div>
                    </div>
                </a>
            </li>
        [% /foreach %]

    </ul>
    <div class="col-3">
        <strong>[% $TicketsCountFrom %] - [% $TicketsCountTo %] [% $user->gettext('von') %] [% $entries %]</strong>
        [%*
        <input type="button" value="[% $user->gettext('Bearbeitung schlie&szlig;en') %]" class="btn btn-outline-primary" id="ToggleTicketCollection_Off" style="display:none; height: 27px;"/>
        *%]
    </div>
    <div class="col-lg-12 col-sm-12 hidden-sm hidden-xs">
        <div class="col-lg-2 col-sm-2" style="margin-left: -15px !important;" data-toggle="tooltip" title="[% $user->gettext('Markieren Sie Tickets um diese gesammelt zu bearbeiten') %]">
            <a title="[% $user->gettext('Auswahl bearbeiten') %]" class="btn btn-outline-primary disabled" id="ToggleTicketCollection_On" style="margin:20px 0;" ><span class='fa fa-pencil'></span> [% $user->gettext('Auswahl bearbeiten') %]</a>
            <a title="[% $user->gettext('Tickets zusammenführen') %]" class="btn btn-outline-primary disabled" id="MergeTickets" style="margin:20px 0;" >[% $user->gettext('Tickets zusammenführen')%]</a>
        </div>
        <div class="col-lg-4 col-sm-4"></div>
        <div class="col-lg-6 col-sm-6 text-end">
            [% $Paging %]
        </div>
    </div>
    <div class="col-12 hidden-lg hidden-md">
        [% $Paging %]
    </div>

    <div class="col-9 hidden-print">

    </div><!-- nav -->
</div>
