This commit is contained in:
2024-10-14 00:08:40 +02:00
parent dbfba56f66
commit 1462d52e13
4572 changed files with 2658864 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
#
# This module allows for some configuration, which can be added to the include code:
#
# Single: whether it should be allowed to upload only one file (difference to MaxFiles: if Single, the user can't *select* more than one file from the start) (e.g. true)
# MaxFiles: Maximum number of files which should be allowed to be uploaded (e.g. 2)
# MaxSizePerFile: the maximum file size per file (in bytes, e.g. 20000)
# FileTypes: a comma-separated list of file extensions which should be allowed (e.g. pdf, jpeg)
# Mandatory: if it should be mandatory to upload at least one file (e.g. true)
# FieldID: the value for the HTML ID attribute the file input should receive (defaults to FileUpload)
# FieldName: the value for the HTML name attribute the file input should receive (defaults to FileUpload)
# FormID: a custom FormID if needed. Otherwise the FormID of the surrounding form is considered for the uploads.
#
# Example:
#
# [% INCLUDE "FormElements/AttachmentList.tt"
# Single="true"
# FieldID="MyID"
# FieldName="MyName"
# MaxFiles="2"
# Mandatory="true"
# FileTypes="pdf,jpg,jpeg"
# FormID="3849738474.3343434"
# %]
#
# Please note: all validation is done in JavaScript only. Please take care of any backend validation on your own.
# Please note: A drag & drop upload field must be a child element of a <div class="Field" />
# Please note: If you want to use multiple drag & drop upload fields on the same page, they must not be child elements of the same <div class="Field" />
#
<div class="AttachmentListContainer">
<table class="Hidden Small DataTable AttachmentList">
<thead>
<th class="Filename">[% Translate("Filename") | html %]</th>
<th class="Filetype">[% Translate("Type") | html %]</th>
<th class="Filesize">[% Translate("Size") | html %]</th>
<th class="Delete"></th>
</thead>
<tbody>
[% FOREACH Data IN Data.AttachmentList %]
<tr>
<td class="Filename">[% Data.Filename | html %]</td>
<td class="Filetype">[% Data.ContentType | html %]</td>
<td class="Filesize" data-file-size="[% Data.Filesize | html %]">[% Data.Filesize | Localize('Filesize') | html %]</td>
<td class="Delete">
<a href="#" class="AttachmentDelete" aria-label="[% Translate("Click to delete this attachment.") | html %]" tabindex="0" data-file-id="[% Data.FileID | html %]" data-object-id="[% Data.ObjectID | html %]" data-field-id="[% Data.FieldID | html %]" data-delete-action="[% Data.DeleteAction | html %]">
<i class="fa fa-trash"></i>
</a>
</td>
</tr>
[% END %]
</tbody>
</table>
<span class="Busy">
<i class="fa fa-spinner fa-spin"></i>
</span>
</div>
<input
class="AjaxDnDUpload [% IF Mandatory %]Validate_DnDUpload[% END %]"
[% IF !Single %] multiple="multiple"[% END %]
id="[% IF FieldID %][% FieldID | html %][% ELSE %]FileUpload[% END %]"
name="[% IF FieldName %][% FieldName | html %][% ELSE %]FileUpload[% END %]"
data-max-files="[% MaxFiles | html %]"
data-file-types="[% FileTypes | html %]"
data-max-size-per-file="[% MaxSizePerFile | html %]"
data-max-size-per-file-hr="[% IF MaxSizePerFile %][% MaxSizePerFile | Localize('Filesize') | html %][% END %]"
data-form-id="[% FormID | html %]"
type="file"
size="40"
/>

View File

@@ -0,0 +1,20 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
[% IF Data.FormDraftID %]
&nbsp;[% Translate("or") | html %]&nbsp;
<button class="CallForAction" id="FormDraftUpdate" accesskey="u" title="[% Translate("Update draft") | html %] (u)">
<span><i class="fa fa-pencil-square-o"></i> [% Translate("Update draft") | html %]</span>
</button>
[% END %]
[% IF Data.FormDraft %]
&nbsp;[% Translate("or") | html %]&nbsp;
<button class="CallForAction" id="FormDraftSave" accesskey="s" title="[% Translate("Save as new draft") | html %] (s)">
<span><i class="fa fa-pencil-square-o"></i> [% Translate("Save as new draft") | html %]</span>
</button>
[% END %]

View File

@@ -0,0 +1,30 @@
# --
# Copyright (C) 2001-2019 OTRS AG, https://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.
# --
[% IF Data.FormDraftTitle %]
<div class="MessageBox Info">
<p>
[% IF Data.FormDraftMeta.ChangeTime == Data.FormDraftMeta.CreateTime %]
[% Translate("You have loaded the draft \"%s\".", Data.FormDraftTitle) | html %]
[% ELSE %]
[% IF Data.FormDraftMeta.ChangeBy == Env('UserID') %]
[% Translate("You have loaded the draft \"%s\". You last changed it %s.", Data.FormDraftTitle, Localize(Data.FormDraftMeta.ChangeTime, 'TimeShort') ) | html %]
[% ELSE %]
[% Translate("You have loaded the draft \"%s\". It was last changed %s by %s.", Data.FormDraftTitle, Localize(Data.FormDraftMeta.ChangeTime, 'TimeShort'), Data.FormDraftMeta.ChangeByName ) | html %]
[% END %]
[% END %]
</p>
</div>
[% END %]
[% IF Data.FormDraftOutdated %]
<div class="MessageBox Warning">
<p>
[% Translate("Please note that this draft is outdated because the ticket was modified since this draft was created.") | html %]
</p>
</div>
[% END %]