<!-- Component editList.tpl begin -->
<form action="" method="get" name="hm" id="hm" enctype="multipart/form-data" class="form-horizontal form-label-left">

    <script language="javascript" type="text/javascript">
<!--

        function move($var)
        {
            var frm = document.forms.hm;
            frm.hdnAction.value = $var;
            frm.event.value = 'edit';
            frm.submit();
        }


        //-->
    </script>
<input type="hidden" name="ConfigurationID" value="[% $TicketLists.configurationid %]" />
<input type="hidden" name="id" value="[% $TicketLists.configurationid %]" />
<input type="hidden" name="hdnAction" value="">
<input type="hidden" name="event" id="event" value="">
<input type="hidden" name="id" id="id" value="[% $id %]">
<input type="hidden" name="list" id="list" value="[% $list %]">
<input type="hidden" name="user" id="user" value="[% $target %]">
<input type="hidden" name="restore" id="restore" value="">
<input type="hidden" name="delete" id="delete" value="">
<input type="hidden" name="module" id="module" value="selectablelistview">



<div class="card panel-fcs-border shadow-sm">
    <div class="card-header">
        <span class="fcs-card-title h2">[% $user->gettext('Standardliste') %]</span>
    </div>
    <div class="card-body">

        <div class="card panel-info shadow-sm rounded">
            <div class="card-body">
                <div class="row">
                    <div class="col-lg-8">

                    </div>
                    <div class="col-lg-4 text-end">
                        <div class="btn-group">

                            <input type="hidden" name="actiontype" value="save" />
                            <input type="button" onclick="window.location.href = 'index.php?module=selectablelistview&event=[% $target %]';" value="[% $user->gettext('Liste') %]" class="btn btn-outline-secondary"  />
                                   <input type="button" onclick="document.getElementById('event').value = 'save';
                            document.getElementById('user').value = '[% $target %]';
                                    submitForm();" value="[% $user->gettext('Speichern') %]" class="btn btn-outline-primary"  />
                            [% if $target == 'user' %]
                                   <input type="button" onclick="bootbox.confirm('[% $user->gettext('Liste wirklich l&ouml;schen?') %]', function(result){if(result){
                                        document.getElementById('event').value = 'save';
                                        document.getElementById('delete').value = '1';
                                        document.getElementById('user').value = 'user';
                                        submitForm();    
                                    } })" value="[% $user->gettext('L&ouml;schen') %]" class="btn btn-outline-primary"  />
                            [% /if %]

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

    <div class="card panel-info shadow-sm rounded">
        <div class="card-header">
            <span class="fcs-card-title h3">
                [% $user->gettext($id) %][% $user->gettext(' bearbeiten') %]
            </span>
        </div>
        <div class="card-body">
            [% if $error == 4 %]
                <div class="alert alert-danger">[% $user->gettext('Liste konnte aus unbekannten Gr&uuml;nden nicht gespeichert werden') %]</div>
            [% /if %]      

            [% if $Tools->FCS_Count($choosen_options) %]
                <div class="card panel-info shadow-sm rounded">
                    <div class="card-header">
                        <h3 class="card-title">[% $user->gettext('Folgende Spalten werden angezeigt, wenn der Anwender keine eigene Konfiguration hat') %]</h3>
                    </div>
                    <div class="card-body">
                        <table width="100%" class="listview" cellspacing="0">
                            <thead>

                                <tr>
                                    <th>
                                        [% $user->gettext('Status') %]
                                    </th>
                                    <th width="16">&nbsp;</th>
                                        [% foreach from=$choosen_options item=Spalte key=Key %]
                                        <th>
                                            [% $user->gettext($Spalte) %]
                                            

                                        </th>
                                    [% /foreach %]
                                </tr>
                            </thead>
                        </table>

                    </div>
                </div>
            [% /if %]
            <div class="row">
                <div class="col-md-6">
                    <div class="card panel-info shadow-sm rounded">
                        <div class="card-header">
                            <h3 class="card-title">[% $user->gettext('Ausgew&auml;hlte Spalten') %]</h3>
                        </div>
                        <div class="card-body">
                            <select name="choosen" size="17" class="form-control" style="overflow-x: hidden;" ondblclick="move('removeCell');">
                                [% html_options values=$choosen_id options=$choosen_options selected="$choosen" %]
                            </select>
                            <br />
                            <a href="#" onclick="move('removeCell');"><span class="fa fa-times"></span></a>
                            &nbsp;
                                                   
                            <a href="#" onclick="move('moveUp');"><span class="fa fa-chevron-up"></span></a>
                            &nbsp;
                            <a href="#" onclick="move('moveDown');"><span class="fa fa-chevron-down"></span></a>
                          
                        </div>
                    </div> 
                </div>
                <div class="col-md-6">
                    <div class="card panel-info shadow-sm rounded">
                        <div class="card-header">
                            <h3 class="card-title">[% $user->gettext('Verf&uuml;gbare Spalten') %]</h3>
                        </div>
                        <div class="card-body">
                            <select name="available" size="17" class="form-control" scrolling=no onclick="move('addCell');">
                                [% html_options values=$available_id options= $available_options  %]
                            </select>
                        </div>
                    </div> 
                </div>
   
            </div>
        </div>
    </div>
</div>
</div>
</form>
<!-- Component SelectableListViews end -->
