Skip to content

Commit 5750df6

Browse files
author
Ronaldo Richieri
committed
first commit
0 parents  commit 5750df6

4 files changed

Lines changed: 708 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<otrs_package version="1.0">
3+
<Name>MultilevelServiceSelection</Name>
4+
<Version>5.0.6</Version>
5+
<Framework>5.0.x</Framework>
6+
<Vendor>Complemento [Free]</Vendor>
7+
<URL>http://www.complemento.net.br/</URL>
8+
<ChangeLog Date="2017-01-16 11:50:00" Version="5.0.5">Add search box for OTRS 5.0. Also, create parameters to show it on Customer or Agent interfaces.</ChangeLog>
9+
<License>GNU GENERAL PUBLIC LICENSE Version 2, June 1991</License>
10+
<Description Lang="en">Complemento Multi Level Service Selection.</Description>
11+
<IntroInstall Type="post" Lang="en" Title="Attention!">Try on a test system before uploading an production server.</IntroInstall>
12+
<Filelist>
13+
<File Permission="644" Location="Custom/MultilevelServiceSelection.sopm"></File>
14+
<File Permission="644" Location="Kernel/Output/HTML/MultilevelServiceSelection/OutputJavascriptServiceID.pm"></File>
15+
<File Permission="644" Location="Kernel/Output/HTML/Templates/Standard/JsServiceID.tt"></File>
16+
<File Permission="644" Location="Kernel/Config/Files/Complemento.ServiceID.xml"></File>
17+
</Filelist>
18+
</otrs_package>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<otrs_config version="1.0" init="Application">
3+
<ConfigItem Name="Frontend::Output::FilterElementPost###OutputJavascriptServiceID" Required="0" Valid="1">
4+
<Description Translatable="1">Multi Level Service ID.</Description>
5+
<Group>Complemento-MultilevelServiceSelection</Group>
6+
<SubGroup>OutputFilter</SubGroup>
7+
<Setting>
8+
<Hash>
9+
<Item Key="Module">Kernel::Output::HTML::MultilevelServiceSelection::OutputJavascriptServiceID</Item>
10+
<Item Key="Templates">
11+
<Hash>
12+
<Item Key="CustomerTicketMessage">1</Item>
13+
<Item Key="AgentTicketEmail">1</Item>
14+
<Item Key="AgentTicketPhone">1</Item>
15+
<Item Key="AgentTicketFreeText">1</Item>
16+
<Item Key="AgentTicketNote">1</Item>
17+
</Hash>
18+
</Item>
19+
</Hash>
20+
</Setting>
21+
</ConfigItem>
22+
<ConfigItem Name="Complemento::MultilevelServiceSelect::SetField" Required="1" Valid="1">
23+
<Description Translatable="1">DOM ID of item which you want to set with the selected service, ex: #Subject. Leave it blank if you want.</Description>
24+
<Group>Complemento-MultilevelServiceSelection</Group>
25+
<SubGroup>SetField</SubGroup>
26+
<Setting>
27+
<String></String>
28+
</Setting>
29+
</ConfigItem>
30+
<ConfigItem Name="Complemento::MultilevelServiceSelect::SearchBoxInAgent" Required="1" Valid="1">
31+
<Description Translatable="1">Shows search box on Agent Interface.</Description>
32+
<Group>Complemento-MultilevelServiceSelection</Group>
33+
<SubGroup>SearchBox</SubGroup>
34+
<Setting>
35+
<Option SelectedID="1">
36+
<Item Key="0" Translatable="1">No</Item>
37+
<Item Key="1" Translatable="1">Yes</Item>
38+
</Option>
39+
</Setting>
40+
</ConfigItem>
41+
<ConfigItem Name="Complemento::MultilevelServiceSelect::SearchBoxInCustomer" Required="1" Valid="1">
42+
<Description Translatable="1">Shows search box on Agent Interface.</Description>
43+
<Group>Complemento-MultilevelServiceSelection</Group>
44+
<SubGroup>SearchBox</SubGroup>
45+
<Setting>
46+
<Option SelectedID="1">
47+
<Item Key="0" Translatable="1">No</Item>
48+
<Item Key="1" Translatable="1">Yes</Item>
49+
</Option>
50+
</Setting>
51+
</ConfigItem>
52+
53+
</otrs_config>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# --
2+
# --
3+
package Kernel::Output::HTML::MultilevelServiceSelection::OutputJavascriptServiceID;
4+
5+
use strict;
6+
use warnings;
7+
8+
sub new {
9+
my ( $Type, %Param ) = @_;
10+
11+
# allocate new hash for object
12+
my $Self = {};
13+
bless( $Self, $Type );
14+
15+
# get needed objects
16+
# for my $Object (
17+
# qw(MainObject ConfigObject LogObject LayoutObject ParamObject)
18+
# )
19+
# {
20+
# $Self->{$Object} = $Param{$Object} || die "Got no $Object!";
21+
# }
22+
return $Self;
23+
}
24+
25+
sub Run {
26+
my ( $Self, %Param ) = @_;
27+
my %Data = ();
28+
my $LayoutObject = $Kernel::OM->Get('Kernel::Output::HTML::Layout');
29+
30+
my $SetField = $Kernel::OM->Get('Kernel::Config')->Get( 'Complemento::MultilevelServiceSelect::SetField' );
31+
my $SearchBoxInAgent = $Kernel::OM->Get('Kernel::Config')->Get( 'Complemento::MultilevelServiceSelect::SearchBoxInAgent' );
32+
my $SearchBoxInCustomer = $Kernel::OM->Get('Kernel::Config')->Get( 'Complemento::MultilevelServiceSelect::SearchBoxInCustomer' );
33+
34+
if ($SetField ne '') {
35+
$LayoutObject->Block(
36+
Name => 'SetField',
37+
Data => {
38+
Field => $SetField,
39+
},
40+
);
41+
$LayoutObject->Block(
42+
Name => 'SetFieldAjax',
43+
Data => {
44+
Field => $SetField,
45+
},
46+
);
47+
};
48+
49+
if ($SearchBoxInAgent eq '1') {
50+
$LayoutObject->Block(
51+
Name => 'SearchBoxInAgent',
52+
Data => {},
53+
);
54+
};
55+
56+
if ($SearchBoxInCustomer eq '1') {
57+
$LayoutObject->Block(
58+
Name => 'SearchBoxInCustomer',
59+
Data => {},
60+
);
61+
};
62+
63+
my $Templatename = $Param{TemplateFile} || '';
64+
return 1 if !$Templatename;
65+
my $iFrame = $LayoutObject->Output(
66+
TemplateFile => 'JsServiceID',
67+
);
68+
${ $Param{Data} } .= $iFrame ;
69+
70+
}
71+
1;

0 commit comments

Comments
 (0)