I have just created a link in a my app. I don't know if you still needing help.
But the process I'have made is to insert a file called TicketMenuSomething.pm at Output/HTML Folder with this content:
# --
# Kernel/Output/HTML/TicketMenuSomething.pm
# --
package Kernel::Output::HTML::TicketMenuSomething;
use strict;
use vars qw($VERSION);
$VERSION = '$Revision: 1.26 $';
$VERSION =~ s/^\$.*:\W(.*)\W.+?$/$1/;
# --
sub new {
my $Type = shift;
my %Param = @_;
# allocate new hash for object
my $Self = {};
bless ($Self, $Type);
# get needed objects
foreach (qw(ConfigObject LogObject DBObject LayoutObject UserID TicketObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
return $Self;
}
# --
sub Run {
my $Self = shift;
my %Param = @_;
# check needed stuff
if (!$Param{Ticket}) {
$Self->{LogObject}->Log(Priority => 'error', Message => "Need Ticket!");
return;
}
# check permission
if ($Self->{TicketObject}->LockIsTicketLocked(TicketID => $Param{TicketID})) {
my $AccessOk = $Self->{TicketObject}->OwnerCheck(
TicketID => $Param{TicketID},
OwnerID => $Self->{UserID},
);
if (!$AccessOk) {
return $Param{Counter};
}
}
$Self->{LayoutObject}->Block(
Name => 'Menu',
Data => { },
);
if ($Param{Counter}) {
$Self->{LayoutObject}->Block(
Name => 'MenuItemSplit',
Data => { },
);
}
$Self->{LayoutObject}->Block(
Name => 'MenuItem',
Data => {
%{$Param{Config}},
%{$Param{Ticket}},
%Param,
Name => 'Script',
Description => 'Something bla bla bla!',
Link => 'Action=AgentFAQ&ItemID=$QData{"ServiceID"}',
},
);
$Param{Counter}++;
return $Param{Counter};
}
# --
1;
Then I have created another file that call the first. It's called TicketLinkSomething.pm and it's under Kernel/Config/Files:
# for ticket zoom menu
$Self->{'Ticket::Frontend::MenuModule'}->{'100-Something'} = {
'Action' => 'AgentTicketSomething',
'Module' => 'Kernel::Output::HTML::TicketMenuSomething',
'Name' => 'Something'
};
# for ticket preview menu
$Self->{'Ticket::Frontend::PreMenuModule'}->{'100-Something'} = {
Action => 'AgentTicketSomething',
Module => 'Kernel::Output::HTML::TicketMenuSomething',
Name => 'Something'
};
Hi,
I try to add a link in ticket menu in the right part of display but I don't understand how I can do this action.
I have read the developer book in section 7.10.3 but I don't understand.
Can someone explain to me how to do in a simple way?
Thanks
Fabio
---------------------------------------------------------------------
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/