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