<style>
    .table.showform td:first-child {
        width: 30%;
    }
    body{
        page-break-after: avoid;
        page-break-inside: avoid;
    }
</style>


<style type="text/css" media="print">
    .dontPrint{
        display:none;
    }
    /*Drucklayout auf A4 anpassen*/
    @page {
        size: A4;
        /* margin: 40px; */
        margin: 0mm;
    }
    html, body {
        width: 1024px;
    }
</style>

<!-- Component Ticket begin -->
<div class="card panel-default">
    <div class="card-header">
        <div class="row">
            <div class="col-sm-6">
                <span class="fcs-card-title h2">[%$user->gettext('Bericht')%]</span>
            </div>
            <div class="col-sm-6 text-end">
                <div class="btn-group dontPrint">
                    <form>
                        [% if !$mail_export %]
                        <input type="button" class="btn btn-outline-primary" onclick="print();" value="[% $user->gettext('Drucken') %]" />
                        [% /if %]
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="card-body">
        <div class="card panel-info shadow-sm rounded">
            <div class="card-header">
                <span class="fcs-card-title h3">
                    [%$user->gettext('Workflow')%]
                </span>
            </div>
            <div class="card-body">
                <div class="form-horizontal form-label-left">
                    <div class="col-sm-6">
                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Bezeichnung') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $WFI.Descr %]</p>
                            </div>
                        </div>

                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Initiator') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $WFI.Username %] ([% $WFI.Name %])</p>
                            </div>
                        </div>

                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Stellvertreter') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $WFI.sUsername %] ([% $WFI.sName %])</p>
                            </div>
                        </div>

                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Status') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $user->gettext($WFI.Status) %]</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Startdatum') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $user->gettext($WFI.StartDate) %]</p>
                            </div>
                        </div>

                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Enddatum') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $user->gettext($WFI.EndDate) %]</p>
                            </div>
                        </div>

                        <div class="form-group row mb-3">
                            <label class="col-sm-4 control-label">
                                [% $user->gettext('Anzahl der Aktivitäten') %]:
                            </label>
                            <div class="col-sm-8">
                                <p class="form-control-static">[% $user->gettext($WFI.countActivities) %]</p>
                            </div>
                        </div>

                        [% if $WFI.TicketID %]
                            <div class="form-group row mb-3">
                                <label class="col-sm-4 control-label">
                                    [% $user->gettext('Gestartet aus Ticket') %]:
                                </label>
                                <div class="col-sm-8">
                                    <p class="form-control-static"><a href='index.php?module=ticket&event=show&id=[% $WFI.TicketID %]'>(#[% $WFI.TicketID %]) [% $WFI.TicketDescr %]</a></p>
                                </div>
                            </div>
                        [% /if %]
                    </div>
                </div>
            </div>
        </div>

        <div class="card panel-info shadow-sm rounded">
            <div class="card-header">
                <span class="fcs-card-title h3">[% $user->gettext('Aktivitäten ')%]</span>
            </div>
        </div>


        [% foreach from=$WFI.aGantt item=activity %]
            [% if $activity.StatusID != 10 && $activity.StatusID != 15 && $activity.StatusID != 14 %]
                <div class="card panel-default">
                    <div class="card-header" >
                        <span class="fcs-card-title h4">[% $activity.Descr %]</span>
                        <ul class="horizontalJustifiedList">
                            <li title="[% $user->gettext('Erstellt am') %]" data-toggle="tooltip"><span class="fa fa-calendar" aria-hidden="true"></span>  [% $activity.StartDate|date_format:"%d.%m.%Y %H:%M" %]</li>
                            <li title="[% $user->gettext('Letzte Bearbeitung') %]" data-toggle="tooltip"><span class="fa fa-calendar" aria-hidden="true"></span> [% $activity.EndDate|date_format:"%d.%m.%Y %H:%M" %]</li>
                            <li title="[% $user->gettext('Adressat') %]" data-toggle="tooltip">      
                                [% if $activity.O->TargetType == 1 %]
                                    <span class="fa fa-user" aria-hidden="true"></span>   
                                    [% $activity.tuser_username %] ([% $activity.tuser_name %])
                                [% else %]
                                    <img src="images/group14.png" alt=""/>
                                    [% $activity.tgroup_name %]
                                [% /if %]</li>
                            <li  title="Status der Bearbeitung" data-toggle="tooltip"> [% $user->gettext($activity.Status) %]  </li>


                        </ul>
                    </div>
                    <div class="card-body">

                        [% if $activity.O->TaskType == 2 %]
                            [% $activity.O->FormClass->showFormContent() %]
                        [% else %]
                            [% $activity.O->TaskText %]
                        [% /if %]
                    </div>
                </div>

            [% /if %]
        [% /foreach %]
    </div>


</div>