Labyrinth/Inbox.pm

filter: Statementstmt 71.8% 23 / 32 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 100% 2 / 2 totaltotal 70.4% 31 / 44 CC 2 SCAR 8.0
CC
2
Cov
68%
MessageApproval
6.0
MessageSend
2.0
BEGIN
1.0
CRAP 2.2
« Labyrinth/Constraints/Emails.pm ↑ Summary Labyrinth/Filters.pm »
1 package Labyrinth::Inbox;
2  
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use vars qw($VERSION @ISA %EXPORT_TAGS @EXPORT @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 $VERSION = '5.32';
8  
9 =head1 NAME
10  
11 Labyrinth::Inbox - Inbox Handler for Labyrinth
12  
13 =head1 SYNOPSIS
14  
15 use Labyrinth::Inbox;
16  
17 MessageSend(%hash);
18 MessageApproval($status,$messageid);
19  
20 =head1 DESCRIPTION
21  
22 The Inbox package contains generic functions used for Inbox and Message
23 handling.
24  
25 Currently the full functionality of this package is unused. It was originally
26 developed to store updates for articles, news, events, etc that were submitted
27 as part of the workflow process.
28  
29 At some point this will be reviewed and either deleted or reworked to better
30 fit the workflow process.
31  
32 =head1 EXPORT
33  
34 MessageSend
35 MessageApproval
36  
37 =cut
38  
39 # -------------------------------------
40 # Export Details
41  
42 4 require Exporter;
43 4 @ISA = qw(Exporter);
44 4 @EXPORT = ( qw( MessageSend MessageApproval ) );
45  
46 # -------------------------------------
47 # Library Modules
48  
49 4 ▶use Labyrinth::Globals;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 4 ▶use Labyrinth::DBUtils;
Subroutine BEGIN: called CC=1 SCAR=0.0
51 4 ▶use Labyrinth::Variables;
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 # -------------------------------------
54 # Variables
55  
56 # -------------------------------------
57 # The Subs
58  
59 =head1 FUNCTIONS
60  
61 =over 4
62  
63 =item MessageSend(%hash)
64  
65 Hash table entries should contain:
66  
67 my %hash = (
68 folder => $folder,
69 area => $area,
70 item => $item,
71 title => $title,
72 body => $body
73 url => $url
74 );
75  
76 =cut
77  
78 0 ▶sub MessageSend {
Subroutine MessageSend: not called CC=1 SCAR=6.9
Pod documented
79 0 my %hash = @_;
80  
81 $dbi->DoQuery('AddMessage', $hash{folder}, $hash{area},
82 $hash{item}, $hash{title},
83 $hash{body}, $hash{url},
84 0 formatDate(0), $tvars{loginid});
85 }
86  
87 =item MessageApproval($status,$messageid)
88  
89 Record informational messages to Inbox Log.
90  
91 =cut
92  
93 0 ▶sub MessageApproval {
Subroutine MessageApproval: not called CC=2 SCAR=17.9
Pod documented
94 0 my ($status,$messageid) = @_;
95 0 $tvars{status} = $status;
96  
97 0 my @rows = $dbi->GetQuery('hash','ReadMessage', $messageid);
98 0 ▶ return unless(@rows);
Branch: 1 branch
BranchTrueFalseTotal
unless @rows 0 0 0
99  
100 0 my $action = $rows[0]->{area}.'::Approval';
101 0 $tvars{message} = $rows[0];
102 0 &$action;
103 }
104  
105 4 1;
106  
107 __END__
« Labyrinth/Constraints/Emails.pm ↑ Summary Labyrinth/Filters.pm »