line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPM::Maker::Utils::OTRS3; |
2
|
|
|
|
|
|
|
$OPM::Maker::Utils::OTRS3::VERSION = '1.1.1'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Provide helper functions for OTRS <= 3 |
4
|
|
|
|
|
|
|
|
5
|
33
|
|
|
33
|
|
241
|
use strict; |
|
33
|
|
|
|
|
97
|
|
|
33
|
|
|
|
|
1045
|
|
6
|
33
|
|
|
33
|
|
2261
|
use warnings; |
|
33
|
|
|
|
|
1120
|
|
|
33
|
|
|
|
|
8454
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub packagesetup { |
9
|
8
|
|
|
8
|
1
|
56
|
my ($class, $type, $version, $function, $runtype, $package) = @_; |
10
|
|
|
|
|
|
|
|
11
|
8
|
50
|
|
|
|
36
|
$version = $version ? ' Version="' . $version . '"' : ''; |
12
|
|
|
|
|
|
|
|
13
|
8
|
|
100
|
|
|
32
|
$runtype //= 'post'; |
14
|
|
|
|
|
|
|
|
15
|
8
|
50
|
|
|
|
26
|
if ( $package ) { |
16
|
0
|
|
|
|
|
0
|
$package = sprintf "'%s'", $package; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
8
|
|
|
|
|
15
|
$package = '$Param{Structure}->{Name}->{Content}'; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
8
|
|
|
|
|
60
|
return qq~ <$type Type="$runtype"$version>
|
23
|
|
|
|
|
|
|
# define function name |
24
|
|
|
|
|
|
|
my \$FunctionName = '$function'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# create the package name |
27
|
|
|
|
|
|
|
my \$CodeModule = 'var::packagesetup::' . $package; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# load the module |
30
|
|
|
|
|
|
|
if ( \$Self->{MainObject}->Require(\$CodeModule) ) { |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# create new instance |
33
|
|
|
|
|
|
|
my \$CodeObject = \$CodeModule->new( %{\$Self} ); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
if (\$CodeObject) { |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# start methode |
38
|
|
|
|
|
|
|
if ( !\$CodeObject->\$FunctionName(%{\$Self}) ) { |
39
|
|
|
|
|
|
|
\$Self->{LogObject}->Log( |
40
|
|
|
|
|
|
|
Priority => 'error', |
41
|
|
|
|
|
|
|
Message => "Could not call method \$FunctionName() on \$CodeModule.pm." |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# error handling |
47
|
|
|
|
|
|
|
else { |
48
|
|
|
|
|
|
|
\$Self->{LogObject}->Log( |
49
|
|
|
|
|
|
|
Priority => 'error', |
50
|
|
|
|
|
|
|
Message => "Could not call method new() on \$CodeModule.pm." |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
]]>$type>~; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub filecheck { |
59
|
23
|
|
|
23
|
1
|
51
|
return 1; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
__END__ |