mvhub-dev team mailing list archive
-
mvhub-dev team
-
Mailing list archive
-
Message #00076
[Merge] lp:~pulaparti/mvhub/create_email_send_library into lp:mvhub
pulaparti has proposed merging lp:~pulaparti/mvhub/create_email_send_library into lp:mvhub.
Requested reviews:
mvhub-dev (mvhub-dev)
Moved send_program_admin_notification,send_agency_admin_notification, send_agency_confirmation_email subroutines from program.pl and agency_form.pl into Utils/Email/Send.pm
--
https://code.launchpad.net/~pulaparti/mvhub/create_email_send_library/+merge/23123
Your team mvhub-dev is subscribed to branch lp:mvhub.
=== modified file 'app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl'
--- app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl 2009-12-29 17:26:17 +0000
+++ app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl 2010-04-09 16:54:16 +0000
@@ -17,7 +17,8 @@
use MVHub::AgencyFieldDefs;
use MVHub::Common;
use MVHub::Utils::ConfigSimple qw/create_config_from/;
-
+use MVHub::Utils::Email::Send
+ qw/send_agency_admin_notification send_agency_confirmation_email/;
use MVHub::DieHandler;
use MVHub::Utils;
@@ -104,8 +105,10 @@
if ( $agency_id == $MVHub::Common::NO_AGENCY_ID ) {
$agency_id = insert_agency_record($values_href);
if ( !$is_admin ) { # an agency submitted a new record
- send_admin_notification($values_href);
- send_confirmation_email( $cfg, $values_href );
+ MVHub::Utils::Email::Send::send_agency_admin_notification(
+ $values_href);
+ MVHub::Utils::Email::Send::send_agency_confirmation_email(
+ $cfg, $values_href );
# Log them in, and display the First Program wizard page
my $tmpl
@@ -147,69 +150,7 @@
} # else form is submitted
} # main
-sub send_confirmation_email {
- my ( $cfg, $values_href ) = @_;
-
- my %params = build_confirmation_email_params( $cfg, $values_href );
- my $top = MIME::Entity->build(
- Type => "text/plain",
- From => $params{from},
- To => $params{to},
- Subject => $params{subject},
- Data => $params{body}
- );
-
- MVHub::Common::sendmail($top);
-}
-
-sub build_confirmation_email_params {
- my ( $cfg, $values_href ) = @_;
-
- my $from = $cfg->param('NOTIFICATION.team_name')
- or die "bad team name";
- my $admin_email = $cfg->param('NOTIFICATION.admin_email')
- or die "bad admin_email";
- $from .= " <$admin_email>";
-
- my $to = $values_href->{contact_email}
- or die "bad contact_email";
-
- my $subject = "$values_href->{agency_name} added to: ";
- $subject .= $cfg->param('SITE.website_name');
-
- my $body = build_confirmation_email_body( $cfg, $values_href );
- my %params
- = ( from => $from, to => $to, subject => $subject, body => $body, );
- return %params;
-
-}
-
-sub build_confirmation_email_body {
- my ( $cfg, $values_href ) = @_;
-
- my $website_name = $cfg->param('SITE.website_name');
- my $team_name = $cfg->param('NOTIFICATION.team_name');
-
- my $body = << "BODY";
-Hello $values_href->{contact_first_name}
-
-$values_href->{agency_name} was just added to $website_name
-
-You are now listed as our contact for $values_href->{agency_name}.
-If you didn't enter this information and feel that you should
-not be the contact for this agency, please contact us.
-
-For future reference, your agency's password is:
-
- $values_href->{password}
-
-Thank you for registering with $website_name.
-
-$team_name;
-BODY
-
- return $body;
-}
+#Moved send_agency_confirmation_email to Send.pm
# set empty or missing $agency_id to special CONSTANT
sub reset_invalid_agency_id {
@@ -431,35 +372,7 @@
return $return_val;
}
-sub send_admin_notification {
- my $values_href = shift;
- my $body;
-
- foreach my $field (@MVHub::AgencyFieldDefs::FIELDS) {
- if ( exists $values_href->{$field} )
- { # Since we deleted the _verification fields
- $body
- .= uc($field) . ": "
- . (
- ( defined $values_href->{$field} )
- ? $values_href->{$field}
- : ''
- ) . "\n\n";
- }
- }
- my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
- $ENV{MV_CONFIG_FILE} );
- my $to = $cfg->param('NOTIFICATION.admin_email');
- my $website = $cfg->param('SITE.website_name');
- my $subject = "New: $website " . $values_href->{agency_name};
-
- MVHub::Common::notification_email(
- to => $to,
- subject => $subject,
- message =>
- "The following agency was added to the Community Services Directory:\n\n$body"
- );
-}
+# Moved subroutine send_agency_admin_notification to Send.pm
# Returns a FormBuilder object representing the appropriate agency form
# given the user and whether it's a new or existing form.
=== modified file 'app-mvhub/DocumentRoot/cgi-bin/mvhub/program.pl'
--- app-mvhub/DocumentRoot/cgi-bin/mvhub/program.pl 2010-03-31 16:11:24 +0000
+++ app-mvhub/DocumentRoot/cgi-bin/mvhub/program.pl 2010-04-09 16:54:16 +0000
@@ -19,6 +19,7 @@
use MVHub::HTML;
use MVHub::Page;
use MVHub::ProgramFieldDefs;
+use MVHub::Utils::Email::Send qw/send_program_admin_notification/;
my $MODE_PARAM = 'mode';
@@ -305,11 +306,13 @@
$program_id = insert_program_record($values_href);
if ( !$is_admin ) { # an agency submitted a new record
- send_admin_notification(
+
+ MVHub::Utils::Email::Send::send_program_admin_notification(
mode => $MODE_PROGRAM_FORM,
program_id => $program_id,
agency_id => $values_href->{agency_id},
);
+
}
# Redirect to the program category selection page.
@@ -861,11 +864,13 @@
$dbh->do($sql);
if ( !$is_admin ) {
- send_admin_notification(
+
+ MVHub::Utils::Email::Send::send_program_admin_notification(
mode => $MODE_HIDE_PROGRAM,
program_id => $program_id,
agency_id => $agency_id
);
+
}
MVHub::Common::display_agency_home_page_and_exit(
@@ -888,11 +893,13 @@
# Send the e-mail before executing the db query, so we can get the hidden_reason
if ( !$is_admin ) {
- send_admin_notification(
+
+ MVHub::Utils::Email::Send::send_program_admin_notification(
mode => $MODE_UNHIDE_PROGRAM,
program_id => $program_id,
agency_id => $agency_id
);
+
}
$dbh->do($sql);
@@ -928,11 +935,13 @@
# We send the notification before doing the deletion since the following call
# queries the database for that record.
- send_admin_notification(
+
+ MVHub::Utils::Email::Send::send_program_admin_notification(
mode => $MODE_REMOVE_PROGRAM,
program_id => $program_id,
agency_id => $agency_id,
);
+
}
my $rows_affected
@@ -950,99 +959,7 @@
);
}
-sub send_admin_notification {
- my %args = @_;
- my $mode = delete $args{'mode'};
- my $program_id = delete $args{'program_id'};
- my $agency_id = delete $args{'agency_id'};
- MVHub::Utils::assert( ( scalar keys %args ) == 0,
- "Unknown arguments: @{[%args]}" );
-
- my $dbh = MVHub::Utils::DB::get_dbh( $ENV{MV_CONFIG_FILE} );
-
- # Regardless of mode, get the program info and prepare it for display
- my $result_aref = $dbh->selectall_arrayref(
- "SELECT a.agency_name, p.* FROM agency a, program p "
- . "WHERE p.program_id = "
- . $dbh->quote($program_id)
- . "AND a.agency_id = "
- . $dbh->quote($agency_id),
- { Slice => {} }
- );
-
- MVHub::Utils::assert( ( @$result_aref == 1 ),
- "Expected 1 result, got " . scalar @$result_aref );
-
- my $values_href = $$result_aref[0];
-
- my $program_name = $values_href->{program_name};
- my $agency_name = $values_href->{agency_name};
-
- my $subject = "Program [ $program_name ]";
-
- my $body = '';
-
- # Mode-specific actions
- if ( $mode eq $MODE_REMOVE_PROGRAM ) {
- $subject .= " removed";
- $body = "$subject by the agency\n\n";
- }
- elsif ( $mode eq $MODE_HIDE_PROGRAM ) {
- $subject .= " hidden";
- $body = "$subject by the agency\n\n";
- $body
- .= "Reason for hiding program: $values_href->{hidden_reason}\n\n";
- }
- elsif ( $mode eq $MODE_UNHIDE_PROGRAM ) {
- $subject .= " unhidden";
- $body = "$subject by the agency\n\n";
- $body
- .= "Original reason program was hidden: $values_href->{hidden_reason}\n\n";
- }
- elsif ( $mode eq $MODE_PROGRAM_FORM ) {
- $subject .= " added";
- $body = "$subject by ";
- $body .= "the agency \n\n";
- }
- else {
- MVHub::Utils::assert( 0,
- "Unknown mode ($mode) passed to send_admin_notification." );
- }
-
- $body .= "\n-------------------------------------\n\n";
-
- $body .= "Agency Name: $agency_name\n\n";
-
- # Prepare the fields for display
- foreach my $field (@MVHub::ProgramFieldDefs::FIELDS) {
-
- if ( defined $values_href->{$field} ) {
- $values_href->{$field} =~ s/$MVHub::Common::FIELD_DELIMITER/, /g;
- }
-
- if ( exists $values_href->{$field} )
- { # Since we deleted the _verification fields
- $body
- .= uc($field) . ": "
- . (
- ( defined $values_href->{$field} )
- ? $values_href->{$field}
- : ''
- ) . "\n\n";
- }
-
- }
- my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
- $ENV{MV_CONFIG_FILE} );
- my $to = $cfg->param('NOTIFICATION.admin_email');
-
- # Send the e-mail
- MVHub::Common::notification_email(
- to => $to,
- subject => $subject,
- message => $body
- );
-}
+# moved subroutine send_program_admin_notification to MVHub::Utils::Email::Send.pm
# Take the area_type and $AREAS_SERVED_CBOX_PREFIX<area_type-value> fields
# and put them into the record (values_href) that is being prepared for entry
@@ -1343,51 +1260,5 @@
return ( $row[0] != 0 );
}
-sub send_confirmation_email {
- my $values_href = shift;
- my $agency_name
- = MVHub::Utils::DB::get_full_name( $values_href->{agency_id} );
-
- # So these can be tweaked as necessary. For example, we may want to
- # change the $from address according to who submits the form.
- my $from;
- my $to;
- my $subject;
- my $body;
- my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
- $ENV{MV_CONFIG_FILE} );
- my $team_name = $cfg->param('NOTIFICATION.team_name');
- my $admin_email = $cfg->param('NOTIFICATION.admin_email');
-
- $from = "$team_name <$admin_email>";
- $to = $values_href->{contact_email};
- $subject = $agency_name . " has been added!";
-
- $body = << "BODY";
-Hi $values_href->{contact_first_name}
-
-$values_href->{agency_name} has just been added to our database.
-
-You were listed as our contact for this agency.
-
-If you didn't enter this information and feel that
-you should not be the contact for this agency,
-please contact us. For future reference, your
-agency's password is:
-
- $values_href->{password}
-
-Thank you for registering with the Hub
-$team_name
-
-BODY
-
- my $top = MIME::Entity->build(
- Type => "text/plain",
- From => $from,
- To => $to,
- Subject => $subject,
- Data => $body
- );
- MVHub::Common::sendmail($top);
-}
+# Removed send_program_confirmation_email as its not being used
+
=== modified file 'app-mvhub/conf/sql_select.lib'
--- app-mvhub/conf/sql_select.lib 2010-04-06 15:14:41 +0000
+++ app-mvhub/conf/sql_select.lib 2010-04-09 16:54:16 +0000
@@ -40,6 +40,15 @@
AND
a.agency_id = p.agency_id
+[AGENCY_PROGRAM_X_PROGRAM_ALL]
+SELECT
+ a.agency_name, p.*
+FROM
+ agency a, program p
+WHERE
+ a.agency_id = ?
+ AND p.program_id = ?
+
[AGENCY_X_AGENCY_NAME_PASSWORD]
SELECT agency_name, password
FROM
=== modified file 'app-mvhub/t/html_lint.t'
--- app-mvhub/t/html_lint.t 2010-03-25 15:49:52 +0000
+++ app-mvhub/t/html_lint.t 2010-04-09 16:54:16 +0000
@@ -18,7 +18,6 @@
my @files = get_files(qw/*.inc *.tmpl *.shtml/);
# we use HTML::Template for more than html files
-
@files = grep { !m#conf/templates/text# } @files;
eval ' use Test::HTML::Lint; ';
=== modified file 'app-mvhub/t/sql_lib_sanity.t'
--- app-mvhub/t/sql_lib_sanity.t 2010-04-06 15:14:41 +0000
+++ app-mvhub/t/sql_lib_sanity.t 2010-04-09 16:54:16 +0000
@@ -42,6 +42,7 @@
'AGENCY_X_EXPIRED_RECORDS' => [ '01-01-2008', 0 ],
'AGENCY_X_WEBSITE' => [103553],
'AGENCY_PROGRAM_X_AGENCY_NAME_AGENCY_ALIAS' => [510296],
+ AGENCY_PROGRAM_X_PROGRAM_ALL => [ 103586, 509636 ],
'CATEGORY_PROGRAM_VIEW_HEADING_CATEGORY_X_ID_NAME_COUNT' =>
['Arts/Culture/Entertainment'],
'CATEGORY_X_CATEGORY_NAME' => [800363],
=== modified file 'lib-mvhub/lib/MVHub/Common.pm'
--- lib-mvhub/lib/MVHub/Common.pm 2010-03-31 16:11:24 +0000
+++ lib-mvhub/lib/MVHub/Common.pm 2010-04-09 16:54:16 +0000
@@ -34,6 +34,7 @@
print_page_and_exit
sendmail
undelimit_field
+ notification_email
);
our ($VERSION) = '$Revision: 1729 $' =~ /([.\d]+)/;
@@ -297,7 +298,8 @@
my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
$ENV{MV_CONFIG_FILE} );
- my $notice = $cfg->param('SITE.website_name') . " /($ENV{HTTP_HOST})";
+ my $host = $ENV{HTTP_HOST} || `/bin/hostname`;
+ my $notice = $cfg->param('SITE.website_name') . "/$host";
my $installation = $ENV{SERVER_NAME} || $ENV{USER} . ' site';
=== added directory 'lib-mvhub/lib/MVHub/Utils/Email'
=== added file 'lib-mvhub/lib/MVHub/Utils/Email/Send.pm'
--- lib-mvhub/lib/MVHub/Utils/Email/Send.pm 1970-01-01 00:00:00 +0000
+++ lib-mvhub/lib/MVHub/Utils/Email/Send.pm 2010-04-09 16:54:16 +0000
@@ -0,0 +1,314 @@
+package MVHub::Utils::Email::Send;
+use strict;
+use warnings;
+
+our ($VERSION) = '$Revision: 1740 $' =~ /([.\d]+)/xm;
+
+use Carp;
+use DBI;
+use MIME::Entity;
+use MVHub::Utils qw/assert/;
+use MVHub::Utils::DB qw/get_dbh/;
+use MVHub::Utils::ConfigSimple qw/create_config_from/;
+use MVHub::Common qw/notification_email/;
+use MVHub::ProgramFieldDefs;
+use MVHub::AgencyFieldDefs;
+use base 'Exporter';
+
+our @EXPORT_OK
+ = qw(send_program_admin_notification send_agency_admin_notification send_agency_confirmation_email
+);
+
+# TODO KLUDGE duplicate of the constants program.pl
+my $MODE_REMOVE_PROGRAM = 'remove';
+my $MODE_HIDE_PROGRAM = 'hide';
+my $MODE_UNHIDE_PROGRAM = 'unhide';
+my $MODE_PROGRAM_FORM = 'program_form';
+
+sub send_program_admin_notification {
+ my %args = @_;
+ my $mode = delete $args{'mode'};
+ my $program_id = delete $args{'program_id'};
+ my $agency_id = delete $args{'agency_id'};
+ MVHub::Utils::assert( ( scalar keys %args ) == 0,
+ "Unknown arguments: @{[%args]}" );
+
+ my $dbh = MVHub::Utils::DB::get_dbh( $ENV{MV_CONFIG_FILE} );
+
+ my $sql = MVHub::Utils::DB::get_sql_select_statement(
+ 'AGENCY_PROGRAM_X_PROGRAM_ALL');
+ my @bind_values = ( $agency_id, $program_id );
+
+ # Regardless of mode, get the program info and prepare it for display
+ my $result_aref
+ = $dbh->selectall_arrayref( $sql, { Slice => {} }, @bind_values );
+
+ MVHub::Utils::assert( ( @$result_aref == 1 ),
+ "Expected 1 result, got " . scalar @$result_aref );
+
+ my $values_href = $$result_aref[0];
+
+ my $program_name = $values_href->{program_name};
+ my $agency_name = $values_href->{agency_name};
+
+ my $subject = "Program [ $program_name ]";
+
+ my $body = '';
+
+ # Mode-specific actions
+ if ( $mode eq $MODE_REMOVE_PROGRAM ) {
+ $subject .= " removed";
+ $body = "$subject by the agency\n\n";
+ }
+ elsif ( $mode eq $MODE_HIDE_PROGRAM ) {
+ $subject .= " hidden";
+ $body = "$subject by the agency\n\n";
+ $body
+ .= "Reason for hiding program: $values_href->{hidden_reason}\n\n";
+ }
+ elsif ( $mode eq $MODE_UNHIDE_PROGRAM ) {
+ $subject .= " unhidden";
+ $body = "$subject by the agency\n\n";
+ $body
+ .= "Original reason program was hidden: $values_href->{hidden_reason}\n\n";
+ }
+ elsif ( $mode eq $MODE_PROGRAM_FORM ) {
+ $subject .= " added";
+ $body = "$subject by ";
+ $body .= "the agency \n\n";
+ }
+ else {
+ MVHub::Utils::assert( 0,
+ "Unknown mode ($mode) passed to send_program_admin_notification."
+ );
+ }
+
+ $body .= "\n-------------------------------------\n\n";
+
+ $body .= "Agency Name: $agency_name\n\n";
+
+ my $program_fields_aref = \@MVHub::ProgramFieldDefs::FIELDS;
+
+ $body
+ .= _prepare_notification_fields( $program_fields_aref, $values_href );
+
+ my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
+ $ENV{MV_CONFIG_FILE} );
+ my $to = $cfg->param('NOTIFICATION.admin_email');
+
+ # Send the e-mail
+ MVHub::Common::notification_email(
+ to => $to,
+ subject => $subject,
+ message => $body
+ );
+
+}
+
+sub send_agency_admin_notification {
+ my $values_href = shift;
+ my $body;
+ my $agency_fields_aref = \@MVHub::AgencyFieldDefs::FIELDS;
+
+ $body
+ .= _prepare_notification_fields( $agency_fields_aref, $values_href );
+
+ my $cfg = MVHub::Utils::ConfigSimple::create_config_from(
+ $ENV{MV_CONFIG_FILE} );
+ my $to = $cfg->param('NOTIFICATION.admin_email');
+ my $website = $cfg->param('SITE.website_name');
+ my $subject = "New: $website " . $values_href->{agency_name};
+
+ MVHub::Common::notification_email(
+ to => $to,
+ subject => $subject,
+ message =>
+ "The following agency was added to the Community Services Directory:\n\n$body"
+ );
+}
+
+#Prepare the fields for display for admin notifications
+sub _prepare_notification_fields {
+ my $fields_aref = shift or croak 'missing param: $fields_aref ';
+ my $values_href = shift or croak 'missing param: $values_href ';
+ my $delim = $MVHub::Common::FIELD_DELIMITER;
+ my $body;
+
+ foreach my $field (@$fields_aref) {
+
+ if ( defined $values_href->{$field}
+ && ( $values_href->{$field} =~ $delim ) )
+ {
+ $values_href->{$field} =~ s/$delim/, /g;
+ }
+
+ if ( exists $values_href->{$field} )
+ { # Since we deleted the _verification fields
+ $body
+ .= uc($field) . ": "
+ . (
+ ( defined $values_href->{$field} )
+ ? $values_href->{$field}
+ : ''
+ ) . "\n\n";
+ }
+
+ }
+ return $body;
+}
+
+sub send_agency_confirmation_email {
+ my ( $cfg, $values_href ) = @_;
+
+ my %params = _build_agency_confirmation_email_params( $cfg, $values_href );
+ my $top = MIME::Entity->build(
+ Type => "text/plain",
+ From => $params{from},
+ To => $params{to},
+ Subject => $params{subject},
+ Data => $params{body}
+ );
+
+ MVHub::Common::sendmail($top);
+}
+
+sub _build_agency_confirmation_email_params {
+ my ( $cfg, $values_href ) = @_;
+
+ my $from = $cfg->param('NOTIFICATION.team_name')
+ or die "bad team name";
+ my $admin_email = $cfg->param('NOTIFICATION.admin_email')
+ or die "bad admin_email";
+ $from .= " <$admin_email>";
+
+ my $to = $values_href->{contact_email}
+ or die "bad contact_email";
+
+ my $subject = "$values_href->{agency_name} added to: ";
+ $subject .= $cfg->param('SITE.website_name');
+
+ my $body = _build_agency_confirmation_email_body( $cfg, $values_href );
+ my %params
+ = ( from => $from, to => $to, subject => $subject, body => $body, );
+ return %params;
+
+}
+
+sub _build_agency_confirmation_email_body {
+ my ( $cfg, $values_href ) = @_;
+
+ my $website_name = $cfg->param('SITE.website_name');
+ my $team_name = $cfg->param('NOTIFICATION.team_name');
+
+ my $body = << "BODY";
+Hello $values_href->{contact_first_name}
+
+$values_href->{agency_name} was just added to $website_name
+
+You are now listed as our contact for $values_href->{agency_name}.
+If you didn't enter this information and feel that you should
+not be the contact for this agency, please contact us.
+
+For future reference, your agency's password is:
+
+ $values_href->{password}
+
+Thank you for registering with $website_name.
+
+$team_name;
+BODY
+
+ return $body;
+}
+
+#return true like all good modules should
+1;
+
+__END__
+
+=head1 NAME
+
+MVHub::Utils::Email::Send - Subroutines for sending emails
+
+=head1 VERSION
+
+This documentation refers to MVHub::Utils::Email::Send version $Revision: 1740 $
+
+=head1 SYNOPSIS
+
+ use MVHub::Utils::Email::Send;
+
+=head1 DESCRIPTION
+
+subs that send emails to agencies
+
+=head1 SEE ALSO
+
+ MVHub::Common MVHub::Utils
+
+=head1 BUGS
+
+none known
+
+=head1 LICENSE AND COPYRIGHT
+
+The GNU Affero General Public License, version 3.0 or later
+
+Copyright (c) 2004-2008 Community Software Lab, Inc ( http://thecsl.org )
+
+=cut
+
+=head1 SUBROUTINES/METHODS
+
+=head2
+
+send_program_admin_notification(%input_params)
+
+usage Example:
+ use MVHub::Utils::Email::Send
+ MVHub::Utils::Email::Send::send_program_admin_notification(
+ mode => $MODE_PROGRAM_FORM,
+ program_id => $program_id,
+ agency_id => $values_href->{agency_id},);
+
+sub send_agency_admin_notification($values_href)
+
+usage Example:
+use MVHub::Utils::Email::Send
+MVHub::Utils::Email::Send::send_agency_admin_notification(
+ $values_href);
+
+sub send_agency_confirmation_email($a,$b_href)
+
+Usage Example:
+ use MVHub::Utils::Email::Send
+ MVHub::Utils::Email::Send::send_agency_confirmation_email(
+ $cfg, $values_href );
+
+
+=head1 DIAGNOSTICS
+
+Error messages are listed with documentation for sub routines.
+
+=head1 CONFIGURATION AND ENVIRONMENT
+
+MVHub::Utils does not require configuration beyond that used by MVHub itself
+
+=head1 DEPENDENCIES
+
+Carp, DBI, HTML::Strip
+
+=head1 BUGS AND LIMITATIONS
+
+There are no known bugs in this module.
+Please report problems to help@xxxxxxxxxx
+Patches are welcome.
+
+=head1 AUTHOR
+
+Community Software Lab help@xxxxxxxxxx
+=head1 INCOMPATIBILITIES
+
+No known incompatibilities
+
+
=== modified file 'lib-mvhub/t/01-load.t'
--- lib-mvhub/t/01-load.t 2009-12-17 22:04:09 +0000
+++ lib-mvhub/t/01-load.t 2010-04-09 16:54:16 +0000
@@ -54,6 +54,11 @@
$module = join '::', ( split '/', $file )[ -3 .. -1 ];
$module = ( split '\.', $module )[0];
push @modules, $module;
+ } # lib/Bar/Baz/Boo/Foo.pm ==> Bar::Baz::Boo::Foo
+ elsif ( $file =~ m|lib/\w+/\w+/\w+/\w+\.pm$| ) {
+ $module = join '::', ( split '/', $file )[ -4 .. -1 ];
+ $module = ( split '\.', $module )[0];
+ push @modules, $module;
}
else {
warn "\n'$file'\n not matched \n";
=== added directory 'lib-mvhub/t/Utils/Email'
=== added directory 'lib-mvhub/t/Utils/Email/Send'
=== added file 'lib-mvhub/t/Utils/Email/Send/send_program_admin_notification.t'
--- lib-mvhub/t/Utils/Email/Send/send_program_admin_notification.t 1970-01-01 00:00:00 +0000
+++ lib-mvhub/t/Utils/Email/Send/send_program_admin_notification.t 2010-04-09 16:54:16 +0000
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+# $Source$
+# $Revision: 1209 $
+
+use strict;
+use warnings;
+
+use Test::More tests => 1 + 1; # +1 for NoWarnings
+use Test::NoWarnings;
+use Test::Exception;
+use MVHub::Utils::Email::Send qw/send_program_admin_notification/;
+
+BEGIN {
+ use FindBin qw($Bin);
+ chdir $Bin;
+ use lib qw( ./t/lib ./lib ../lib/ ../../lib/ );
+}
+
+my $test_message;
+my $result = 1;
+
+###
+$test_message = 'Dies on extra parameter.';
+###
+dies_ok { send_program_admin_notification( bad => 'Extra parameter' ) }
+$test_message;
+