my lightbox integration (per: viewtopic.php?f=62&t=24160) don't work. What is wrong? I can't get a preview of my gif Attachement. Thanks!
1. i copied the lightbox directory to C:\OTRS\var\httpd\htdocs\js\thirdparty\lightbox2.6
2. i added code to HTMLHead.dtl at the end
Code: Select all
<script src ="$Config{"Frontend::WebPath"}js/thirdparty/lightbox2.6/js/jquery-1.10.2.min.js"></script>
<script src ="$Config{"Frontend::WebPath"}js/thirdparty/lightbox2.6/js/lightbox-2.6.min.js"></script>
<link href="$Config{"Frontend::WebPath"}js/thirdparty/lightbox2.6/css/lightbox.css" rel="stylesheet" />
</head>
Code: Select all
# --
# Kernel/Output/HTML/ArticleAttachmentDownload.pm
# Copyright (C) 2001-2013 xxx, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
package Kernel::Output::HTML::ArticleAttachmentDownload;
use strict;
use warnings;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless( $Self, $Type );
# get needed objects
for (qw(ConfigObject LogObject DBObject LayoutObject UserID TicketObject ArticleID)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
# check needed stuff
for (qw(File Article)) {
if ( !$Param{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
return;
}
}
# download type
[color=#FF0000] my $EncodedFilename = $Self->{LayoutObject}->LinkEncode( $Param{File}->{Filename} || '' );
my $rel = '';
if (lc $EncodedFilename =~ /\.(tif|jpg|png|gif|jpeg|tiff)$/) {
$rel = '" rel="lightbox';
}
return (
%{ $Param{File} },
Action => 'Download',
Link =>
"\$Env{\"CGIHandle\"}/$EncodedFilename?Action=AgentTicketAttachment;ArticleID=$Param{Article}->{ArticleID};FileID=$Param{File}->{FileID}" . $rel,[/color]
);
}
1;