Files
2024-10-14 00:08:40 +02:00

213 lines
12 KiB
Plaintext

# --
# 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.
# --
## nofilter(TidyAll::Plugin::OTRS::TT::ScriptUsage)
<div>
<a name="Article[% Data.ArticleID | html %]"></a>
<div class="WidgetSimple Expanded [% Data.SenderType | html %] [% IF Data.SenderType == 'customer' %]Incoming[% ELSE %]Outgoing[% END %] [% IF Data.IsVisibleForCustomer %]VisibleForCustomer[% ELSE %]NotVisibleForCustomer[% END %]">
<div class="Header">
<div class="WidgetAction Toggle">
<a href="#" title="[% Translate("Show or hide the content") | html %]"><i class="fa fa-caret-right"></i><i class="fa fa-caret-down"></i></a>
</div>
<h2>
[% Translate("#%s", Data.ArticleNumber) | html %] &ndash; [% Data.ArticleFields.Subject.Value | truncate(100) | html %]
&ndash; <span class="[% Data.ArticleFields.Sender.ValueHidden | html %]">[% Data.ArticleFields.Sender.Value | html %]</span> <span class="[% Data.ArticleFields.Sender.RealnameHidden | html %]">[% Data.ArticleFields.Sender.Realname | html %]</span>
&ndash; <span title="[% Translate("Created") | html %]: [% Data.CreateTime | Localize("TimeShort") %]">[% Data.CreateTime | Localize("TimeShort") %]</span> [% Translate("via %s", Translate(Data.CommunicationChannel)) | html %]
[% IF Data.CreateByUser %]
[% Translate("by %s", Data.CreateByUser) | html %]
[% END %]
</h2>
<div class="ActionMenu Visible">
<div class="WidgetAction Expand">
<a href="#" title="[% Translate("Toggle article details") | html %]"><i class="fa fa-info"></i></a>
</div>
</div>
</div>
<div class="WidgetMenu [% IF !Config("Ticket::Frontend::ArticleHeadVisibleDefault") %]Hidden[% END %]">
<div class="ArticleMailHeader">
<fieldset class="TableLike FixedLabelSmall">
[% FOREACH ArticleField IN Data.ArticleFields.values.nsort("Prio") %]
[% IF ArticleField.Label == "From" || ArticleField.Label == "To" || ArticleField.Label == "Cc" || ArticleField.Label == "Bcc" %]
<label class="Switchable">[% Translate(ArticleField.Label) | html %]:</label>
<p class="Value" title="[% ArticleField.Value | html %]">
<span class="Switch [% ArticleField.ValueHidden | html %]">[% ArticleField.Value | html %]</span>
<span class="Switch [% ArticleField.RealnameHidden | html %]">[% ArticleField.Realname | html %]</span>
</p>
<div class="Clear"></div>
[% ELSIF ArticleField.Type == "ArticleOption" %]
<!-- show article options like signed, crypted, ...-->
<label>[% Translate(ArticleField.Label) | html %]:</label>
<div title="[% ArticleField.Value | html %]" class="[% ArticleField.Class | html %] Value">
[% Translate(ArticleField.Value) | html %]
</div>
<div class="Clear"></div>
[% ELSIF ArticleField.Label == "Subject" %]
<!-- Include the full subject so that it can be copied. The one in the title bar is shortened. -->
<label>[% Translate("Subject") | html %]:</label>
<p class="Value">[% ArticleField.Value | html %]</p>
<div class="Clear"></div>
[% END %]
[% END %]
[% FOREACH ArticleField IN Data.ArticleMetaFields %]
<!-- show accounted time and dynamic fields -->
<label>[% Translate(ArticleField.value.Label) | html %]:</label>
[% IF ArticleField.value.Link %]
<p class="Value" title="[% ArticleField.value.Title %]">
<a href="[% ArticleField.value.Link | Interpolate %]"
[% IF ArticleField.value.LinkPreview %] data-trigger="floater" data-floater-url="[% ArticleField.value.LinkPreview | Interpolate %]"[% END %]
target="_blank" class="DynamicFieldLink">
[% ArticleField.value.Value %]
</a>
</p>
[% ELSE %]
<p class="Value" title="[% ArticleField.value.Title %]">[% ArticleField.value.Value %]</p>
[% END %]
<div class="Clear"></div>
[% END %]
</fieldset>
</div>
</div>
<div class="Content">
[% RenderBlockStart("TransmissionStatusMessage") %]
[% IF Data.Status == 'Failed' || Data.Status == 'Processing' %]
<div class="WidgetMessage Top [% IF Data.Status == 'Failed' %]Error[% ELSIF Data.Status == 'Processing' %]Warning[% END %]">
<p>
[% IF Data.Status == "Failed" %]
[% Translate("Sending of this message has failed.") | html %]
[[% Data.CreateTime | Localize("TimeShort") %]] [% Data.Message | html %]
[% ELSIF Data.Status == "Processing" %]
[% IF Data.Attempts && Data.DueTime %]
[% Translate("This message is being processed. Already tried to send %s time(s). Next try will be %s.", Data.Attempts, Localize(Data.DueTime, "TimeShort")) | html %]
[% ELSE %]
[% Translate("This message has been queued for sending.") | html %]
[% END %]
[% END %]
</p>
</div>
[% END %]
[% RenderBlockEnd("TransmissionStatusMessage") %]
[% RenderBlockStart("BrowserLinkMessage") %]
# Show info, that links within the iframe must be clicked with strg/cmd/shift (depending on the used browser and os)
# to open the links in a new window without the security permissions given to the iframe
<div class="MessageBrowser">
<p>
[% Translate("To open links in the following article, you might need to press Ctrl or Cmd or Shift key while clicking the link (depending on your browser and OS).") | html %]
</p>
<a class="Close" title="[% Translate("Close this message") | html %]" href="#"><i class="fa fa-times"></i></a>
</div>
[% RenderBlockEnd("BrowserLinkMessage") %]
<div class="ArticleMailContent">
<div class="Avatar">
[% IF Config("Frontend::AvatarEngine") == 'Gravatar' && Data.SenderImage %]
<div class="ArticleSenderImage">
<img src="[% Data.SenderImage | url %]" title="[% Data.From | html %]" />
</div>
[% ELSE %]
<div class="ArticleSenderInitials">
<span>[% Data.SenderInitials | html %]</span>
</div>
[% END %]
</div>
[% PROCESS ArticleActionMenu.tt %]
[% IF Data.HTML %]
<div class="ArticleMailContentHTMLWrapper">
# execute IFrame JS asynchronously. Otherwise it could happen before our API was loaded
# the following JS code must be within the template, otherwise it could happen, that also this code itself is not loaded yet
<script>
function CheckIFrameHeight(IFrameID) {
if (typeof Core === 'object' && typeof Core.Agent === 'object' && typeof Core.Agent.TicketZoom === 'object') {
Core.Agent.TicketZoom.IframeAutoHeight($('#' + IFrameID));
}
else {
window.setTimeout(function () {
CheckIFrameHeight(IFrameID);
}, 500);
}
}
</script>
# Use the HTML5 sandbox attribute to prevent plugins and scripts from being executed in the browser.
# Append session info to URL because IE will not send cookies.
# Set 'allow-popups' to allow IE10+ to open links. ref: http://www.w3.org/html/wg/wiki/ChangeProposals/sandbox_allow_popups
<iframe sandbox="allow-same-origin allow-popups ms-allow-popups allow-popups-to-escape-sandbox" width="100%" frameborder="0" id="Iframe[% Data.ArticleID | html %]" onload="window.setTimeout( function (){ CheckIFrameHeight('Iframe[% Data.ArticleID | html %]'); }, 500);" src="[% Env("Baselink") %]Action=AgentTicketArticleContent;Subaction=HTMLView;TicketID=[% Data.TicketID | html %];ArticleID=[% Data.ArticleID | html %];FileID=[% Data.HTMLBodyAttachmentID | html %];[% IF !Config("SessionUseCookie") %][% Env("SessionName") | html %]=[% Env("SessionID") | html %][% END %]"></iframe>
<script type="text/javascript">
// workaround for firefox, which seems to cache the src attribute of iframes sometimes which leads to
// the wrong iframe content being displayed (see https://bugzilla.mozilla.org/show_bug.cgi?id=356558)
document.getElementById('Iframe[% Data.ArticleID | html %]').contentWindow.location.href = document.getElementById('Iframe[% Data.ArticleID | html %]').src
</script>
</div>
[% ELSE %]
[% Data.BodyNote %]
<div class="ArticleBody">
[% Data.Body %]
</div>
[% END %]
[% IF Data.ArticleModuleMeta && Data.ArticleModuleMeta.size() %]
<div class="ArticleMeta">
[% FOREACH Entry IN Data.ArticleModuleMeta %]
<div>
<h2>[% Entry.Name | html %]</h2>
<ul>
[% FOREACH Item IN Entry.Matches %]
<li><a href="[% Item.URL | html %]"[% IF Item.URLPreview %] data-trigger="floater" data-floater-url="[% Item.URLPreview | html %]"[% END %] target="[% Item.Target | html %]">[% Item.Text | truncate(100) | html %]</a></li>
[% END %]
</ul>
</div>
[% END %]
</div>
[% END %]
[% IF Data.Attachments && Data.Attachments.size() %]
<ul class="ArticleAttachments">
[% FOREACH Attachment IN Data.Attachments %]
<li title="[% Attachment.Filename | html %]">
<h5>[% Attachment.Filename | html %]</h5>
[% IF Attachment.ContentType.match('image') %]
[% Translate("Image") | html %]
[% ELSIF Attachment.ContentType == "application/pdf" %]
[% Translate("PDF") | html %]
[% ELSE %]
[% Translate("Unknown") | html %]
[% END %]
&ndash;
[% Attachment.FilesizeRaw | Localize("Filesize") %]
<div>
[% FOREACH Item IN Attachment.Links %]
[% IF Item.Action == "Download" %]
<a class="[% Item.Class %]" href="[% Item.Link %]" title="[% Translate("Download") | html %] [% Attachment.Filename | html %]" [% Item.Target %]>
<i class="fa fa-download"></i>
</a>
[% ELSIF Item.Link %]
<a class="[% Item.Class %]" href="[% Item.Link %]" title="[% Translate("View") | html %] [% Attachment.Filename | html %]" [% Item.Target %]>
<i class="fa fa-search"></i>
</a>
[% END %]
[% END %]
</div>
</li>
[% END %]
</ul>
[% END %]
</div>
</div>
</div>
</div>