<script>
    var TicketID = [% $tid %];
</script>
<html>
    <head>
        <title>[% $user->gettext('Neues Dokument') %]</title>

    </head>
    <body id="PopUpForm" [% if $reload %]onLoad="self.parent.closeAttachmentPopUp([% if $tid > 0 %][% $tid %][% else %][% if $crid %][% $crid %][% /if %][% /if %]);[% if $activity %]self.parent.location.reload();[% /if %]"[% /if %]>
        <form action="index.php?module=upload" method="POST" enctype="multipart/form-data" id="UploadFile" class="form-horizontal form-label-left">

            [% if $tid > 0 %]<input type="hidden" name="tid" value="[% $tid %]" />[% /if %]
            [% if $kbid > 0 %]<input type="hidden" name="kbid" value="[% $kbid %]" />[% /if %]
            [% if $crid > 0 %]<input type="hidden" name="crid" value="[% $crid %]" />[% /if %]

            [% if $activity %]<input type="hidden" name="activity" value="1" />[% /if %]

            [% if $user->hasRight(10) %]
                <div class="card panel-info shadow-sm rounded">
                    <div class="card-header">
                        <div class="row">
                            <div class="col-sm-6">
                                <span class="fcs-card-title h4">[% $user->gettext('Neues Dokument') %]</span>
                            </div>
                            <div class="col-sm-6 text-end">
                                <div class="btn-group">
                                    [% if $files %]
                                        <input type="button" class="btn btn-outline-secondary" value="[% $user->gettext('Schlie&szlig;en') %]" onclick="self.parent.$.fancybox.close();"/>
                                    [% /if %]
                                    <input type="submit" class="btn btn-outline-primary" value="[% $user->gettext('Speichern') %]">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        [% if $error != '' %]
                            <div class="alert alert-danger">[% $error %]</div>          
                        [% /if %]
                        <div class="form-group row mb-3">
                            <label class="col-sm-3 control-label">[% $user->gettext('Titel') %]</label>
                            <div class="col-sm-9">
                                <input type="text" name="ShortDescr" value="[% $ShortDescr %]" maxlength="100" size="65" class="form-control" />
                            </div>
                        </div>   
                        <div class="form-group row mb-3">
                            <label class="col-sm-3 control-label">[% $user->gettext('Hyperlink') %]</label>
                            <div class="col-sm-9">
                                <input type="text" name="URL" maxlength="255" size="65" value="[% $URL %]" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group row mb-3">
                            <label class="col-sm-3 control-label">[% $user->gettext('Beschreibung') %]</label>
                            <div class="col-sm-9">
                                <textarea id="LongDescr" name="LongDescr" class="form-control" style="width: 95%; height: 5em;" >[% $LongDescr %]</textarea>
                            </div>
                        </div>
                        [% if !$fatalerror %]
                            <div class="form-group row mb-3">
                                <label class="col-sm-3 control-label">[% $user->gettext('Datei') %]</label>
                                <div class="col-sm-9">
                                    <input type="file" class="form-control" name="UploadFile" value="" />
                                </div>
                            </div>
                                
                        [% /if %]
                    </div>
                </div>

            [% /if %]
        </form>
    </body>
</html>
