I am trying to add a menu in the ticketzoom view that would have the same behavior as the menu close but with another default status.
I followed the example of the OTRS documentation: https://doc.otrs.com/doc/manual/develop ... -otrs.html
But I can not make it work. My HelloWorld menu appears but when we click on a server error appears:
“Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.”
below the details of my files :
AgentHelloWorld.pm
Code: Select all
# --
# Kernel/Modules/AgentHelloWorld.pm - frontend module
# Copyright (C) (year) (name of author) (email of author)
# --
# 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::Modules::AgentHelloWorld;
use strict;
use warnings;
# Frontend modules are not handled by the ObjectManager.
our $ObjectManagerDisabled = 1;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless ($Self, $Type);
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
my %Data = ();
my $HelloWorldObject = $Kernel::OM->Get('Kernel::System::HelloWorld');
my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
$Data{HelloWorldText} = $HelloWorldObject->GetHelloWorldText();
# build output
my $Output = $LayoutObject->Header(Title => "HelloWorld");
$Output .= $LayoutObject->NavigationBar();
$Output .= $LayoutObject->Output(
Data => \%Data,
TemplateFile => 'AgentHelloWorld',
);
$Output .= $LayoutObject->Footer();
return $Output;
}
1;
Code: Select all
# --
# Kernel/Output/HTML/Templates/Standard/AgentHelloWorld.tt - overview
# Copyright (C) (year) (name of author) (email of author)
# --
# 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.
# --
<h1>[% Translate("Overview") | html %]: [% Translate("HelloWorld") %]</h1>
<p>
[% Data.HelloWorldText | Translate() | html %]
</p>
Code: Select all
# --
# Kernel/System/HelloWorld.pm - core module
# Copyright (C) (year) (name of author) (email of author)
# --
# 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::System::HelloWorld;
use strict;
use warnings;
# list your object dependencies (e.g. Kernel::System::DB) here
our @ObjectDependencies = (
# 'Kernel::System::DB',
);
=head1 NAME
HelloWorld - Little "Hello World" module
=head1 DESCRIPTION
Little OTRS module that displays the text 'Hello World' when called up.
=head2 new()
Create an object. Do not use it directly, instead use:
my $HelloWorldObject = $Kernel::OM->Get('Kernel::System::HelloWorld');
=cut
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless ($Self, $Type);
return $Self;
}
=head2 GetHelloWorldText()
Return the "Hello World" text.
my $HelloWorldText = $HelloWorldObject->GetHelloWorldText();
=cut
sub GetHelloWorldText {
my ( $Self, %Param ) = @_;
# Get the DBObject from the central object manager
# my $DBObject = $Kernel::OM->Get('Kernel::System::DB');
my $HelloWorld = $Self->_FormatHelloWorldText(
String => 'Hello World',
);
return $HelloWorld;
}
=begin Internal:
=cut
=head2 _FormatHelloWorldText()
Format "Hello World" text to uppercase
my $HelloWorld = $Self->_FormatHelloWorldText(
String => 'Hello World',
);
sub _FormatHelloWorldText{
my ( $Self, %Param ) = @_;
my $HelloWorld = uc $Param{String};
return $HelloWorld;
}
=end Internal:
1;
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<otrs_config version="2.0" init="Application">
<Setting Name="Frontend::Module###AgentHelloWorld" Required="1" Valid="1">
<Description Translatable="1">FrontendModuleRegistration for HelloWorld module.</Description>
<Navigation>Frontend::Agent::ModuleRegistration</Navigation>
<Value>
<Item ValueType="FrontendRegistration">
<Hash>
<Item Key="Group">
<Array>
<Item>users</Item>
</Array>
</Item>
<Item Key="GroupRo">
<Array>
</Array>
</Item>
<Item Key="Description" Translatable="1">HelloWorld.</Item>
<Item Key="Title" Translatable="1">HelloWorld</Item>
<Item Key="NavBarName">HelloWorld</Item>
</Hash>
</Item>
</Value>
</Setting>
<Setting Name="Loader::Module::AgentHelloWorld###002-Filename" Required="0" Valid="1">
<Description Translatable="1">Loader module registration for the agent interface.</Description>
<Navigation>Frontend::Agent::ModuleRegistration::Loader</Navigation>
<Value>
<Hash>
<Item Key="CSS">
<Array>
</Array>
</Item>
<Item Key="JavaScript">
<Array>
</Array>
</Item>
</Hash>
</Value>
</Setting>
<Setting Name="Frontend::Navigation###AgentHelloWorld###002-Filename" Required="0" Valid="1">
<Description Translatable="1">Main menu item registration.</Description>
<Navigation>Frontend::Agent::ModuleRegistration::MainMenu</Navigation>
<Value>
<Array>
<DefaultItem ValueType="FrontendNavigation">
<Hash>
</Hash>
</DefaultItem>
<Item>
<Hash>
<Item Key="Group">
<Array>
<Item>users</Item>
</Array>
</Item>
<Item Key="GroupRo">
<Array>
</Array>
</Item>
<Item Key="Description" Translatable="1">HelloWorld.</Item>
<Item Key="Name" Translatable="1">HelloWorld</Item>
<Item Key="Link">Action=AgentHelloWorld</Item>
<Item Key="LinkOption"></Item>
<Item Key="NavBar">HelloWorld</Item>
<Item Key="Type">Menu</Item>
<Item Key="Block"></Item>
<Item Key="AccessKey"></Item>
<Item Key="Prio">8400</Item>
</Hash>
</Item>
</Array>
</Value>
</Setting>
</otrs_config>