@reneeb: Firstly i am trying to show hello world on customer interface,,,
I have followed the OTRS developers guide same as it is, I have created a config file in C:\otrs\OTRS\Kernel\Config\Files
Here is the code of this:
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<otrs_config version="1.0" init="Application">
<ConfigItem Name="CustomerFrontend::Module###CustomerDocs" Required="1" Valid="1">
<Description Translatable="1">FrontendModuleRegistration for Docs module.</Description>
<Group>Docs</Group>
<SubGroup>Frontend::Customer::ModuleRegistration</SubGroup>
<Setting>
<FrontendModuleReg>
<Title>Docs</Title>
<Description>Documents</Description>
<NavBarName>Docs</NavBarName>
<NavBar>
<Description>Documents</Description>
<Name>Docs</Name>
<Link>Action=AgentHelloWorld</Link>
<NavBar></NavBar>
<Type></Type>
<Prio>8400</Prio>
<Block></Block>
</NavBar>
</FrontendModuleReg>
</Setting>
</ConfigItem>
</otrs_config>
Then i created a frontend module: Kernel/Modules/AgentHelloWorld.pm (I didnt change the name to customerHelloworld)
Here is the code of this file:
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;
use Kernel::System::HelloWorld;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {%Param};
bless ($Self, $Type);
# check needed objects
for (qw(ParamObject DBObject TicketObject LayoutObject LogObject QueueObject ConfigObject
EncodeObject MainObject)) {
if ( !$Self->{$_} ) {
$Self->{LayoutObject}->FatalError( Message => "Got no $_!" );
}
}
# create needed objects
$Self->{HelloWorldObject} = Kernel::System::HelloWorld->new(%Param);
return $Self;
}
sub Run {
my ( $Self, %Param ) = @_;
my %Data = ();
$Data{HelloWorldText} = $Self->{HelloWorldObject}->GetHelloWorldText();
# build output
my $Output = $Self->{LayoutObject}->Header(Title => "HelloWorld");
$Output .= $Self->{LayoutObject}->NavigationBar();
$Output .= $Self->{LayoutObject}->Output(
Data => \%Data,
TemplateFile => 'AgentHelloWorld',
);
$Output .= $Self->{LayoutObject}->Footer();
return $Output;
}
1;
Then core module: Kernel/System/HelloWorld.pm
Code:
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;
sub new {
my ( $Type, %Param ) = @_;
# allocate new hash for object
my $Self = {};
bless ($Self, $Type);
return $Self;
}
sub GetHelloWorldText {
my ( $Self, %Param ) = @_;
return 'Hello World';
}
1;
And then dtl file: Kernel\Output\HTML\Standard\AgentHelloWorld.dtl
Code:
Code: Select all
# Kernel/Output/HTML/Standard/AgentHelloWorld.dtl - 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.
# --
<!-- start form -->
<table border="0" width="100%" cellspacing="0" cellpadding="3">
<tr>
<td class="mainhead">
$Env{"Box0"}$Text{"Overview"}: $Text{"HelloWorld"}$Env{"Box1"}
</td>
</tr>
<tr>
<td class="mainbody">
<br>
$Text{"$QData{"HelloWorldText"}"}!<br>
<br>
<br>
34
</td>
</tr>
</table>
<!-- end form -->
When i login to customer interface, it shows the new tab named "Helloworld" but when i click on this, error shows: I have attached the screenshot of the error:
You do not have the required permissions to view the files attached to this post.