<form action="[% $action %]" class="form-horizontal form-label-left" method="post" name="hm" id="hm">
    <input type="hidden" name="pos" id="pos" value="[% $pos %]" />
    <input type="hidden" name="save" id="save" value="0" />
    <input type="hidden" name="edit" id="edit" value="0" />

    <div class="card panel-fcs-border shadow-sm">
        <div class="card-header">
            <div class="row">
                <div class="col-md-6">
                    <span class="fcs-card-title h4">[% $user->gettext('Liste der Benutzer und Kontakte für Kostengruppe ') %]</span>
                </div>
                <div class="col-md-6 text-end">
                    [% if $Default %]
                        <strong>
                            [% $user->gettext('Die Kostengruppe ist als Standardkostengruppe definiert') %]
                        </strong>
                    [% /if %]
                </div>
            </div>
        </div>
        <div class="card-body">

            [% if $user->Security->Projects %]
                <h3>[% $user->gettext('Benutzer:') %]</h3>
                <div class="table-responsive">
                    <table  class="table table-striped table-bordered" >
                        <thead>                
                            <tr>
                                <th>
                                    [% $user->gettext('Benutzername') %]
                                </th>
                                <th>
                                    &nbsp;
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            [% foreach from=$Userlist item=userdata %]
                                <tr>
                                    <td nowrap="nowrap">[% $userdata.name %] ([% $userdata.username %])&nbsp;</td>
                                    <td>
                                        [% if $user->hasRight(40) %]
                                            <a href="index.php?module=user&event=edit&id=[% $userdata.userid  %]&popup=1" class="btn btn-outline-primary">[% $user->gettext('Benutzer bearbeiten') %]</a>
                                        [% /if %]
                                    </td>
                                </tr>
                            [% foreachelse %]
                                <tr class="even">
                                    <td colspan="2">[% $user->gettext('Es sind keine Benutzer mit dieser Kostengruppe verknüpft') %]</td>
                                </tr>
                            [% /foreach %]
                        </tbody>
                    </table>
                </div>
            [% /if %]

            <h3>[% $user->gettext('Kategorie') %]:</h3>
            <div class="table-responsive">
            <table class="table table-striped table-bordered">
                <thead>
                    <tr class="fields">
                        <td>
                            [% $user->gettext('Kategorie') %]
                        </td>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </thead>
                <tbody>
                    [% foreach from=$Catlist item=cat %]
                        <tr>
                            <td nowrap="nowrap">[% $cat.name %]&nbsp;</th>
                            <th>
                                <a href="index.php?module=category&event=edit&id=[% $cat.categoryid %]&popup=1" >
                                    <input type="button" class="btn btn-outline-primary" value="[% $user->gettext('Kategorie bearbeiten') %]" />
                                </a>
                            </th>
                        </tr>
                    [% foreachelse %]
                        <tr>
                            <td colspan="2">[% $user->gettext('Es sind keine Kategorien mit dieser Kostengruppe verknüpft') %]</td>
                        </tr>
                    [% /foreach %]
                </tbody>
            </table>
        </div>

        <h3>[% $user->gettext('Historie') %]:</h3>
        <div class="table-responsive">
            <table class="table table-striped table-bordered">
                <tbody>

                    [% foreach from=$History item=entry %]
                        <tr [% if $entry.aktuelleCR %]style="font-weight:bold;"[% /if %] >
                            <td>
                                [% $user->gettext('Seit') %] [% $entry.startdate|date_format:"%d.%m.%Y %H:%M" %] : [% $entry.costrate %] [% $entry.shortname %]/[% $entry.cedescr %]
                            </td>
                        </tr>
                    [% /foreach %]
                </tbody>
            </table>
        </div>

    </div>
</div>
</form>




