diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2cd7625ce..2884baf73 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,7 @@ 7.8.6 + - fixed #11250: i18n Asset_EMSSubmissionForm::delete created items label help + - fixed #11251: perload.perl tries to load t/lib/WebGUI/Test.pm + - fixed #11249: Recaptcha https bug 7.8.5 - added the EMS submission subsystem diff --git a/docs/credits.txt b/docs/credits.txt index 6565e28a0..3fdafc6be 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -58,6 +58,7 @@ Contributing Developers..............Meg O'Keefe Andrea / Plain Black Jukka Raimovaara / Axxion Oy Alan Ritari / DonorWare Hal Roberts / Harvard + Luke Robinson / Orchard Solutions Laura Rummage / Plain Black Tera Runde / Plain Black Steve Simms diff --git a/lib/WebGUI/Form/Captcha.pm b/lib/WebGUI/Form/Captcha.pm index defd3ec50..21fab775a 100644 --- a/lib/WebGUI/Form/Captcha.pm +++ b/lib/WebGUI/Form/Captcha.pm @@ -162,7 +162,7 @@ sub toHtml { my $pubKey = $self->session->setting->get('recaptchaPublicKey'); my $server = "http://api.recaptcha.net"; if ($env->sslRequest) { - $server = "http://api-secure.recaptcha.net"; + $server = "https://api-secure.recaptcha.net"; } return '' diff --git a/lib/WebGUI/Macro/ConvertUTCToTZ.pm b/lib/WebGUI/Macro/ConvertUTCToTZ.pm index add651399..4098980c4 100644 --- a/lib/WebGUI/Macro/ConvertUTCToTZ.pm +++ b/lib/WebGUI/Macro/ConvertUTCToTZ.pm @@ -73,33 +73,31 @@ sub process { $toTZ ||= $uTZ; $format ||= $uFormat; - # remove all whitespace including newlines - $date =~ s/\s//msg; - - # Additional date delimiters accepted for edge cases - my ( $year, $month, $day ) = split /[\/\-\.]/, $date; + my ( $year, $month, $day ); + if ($date) { + ( $year, $month, $day ) = split /[\/\-\.]/, $date; + $date =~ s/\s//msg; # remove all whitespace including newlines + } my $dt = WebGUI::DateTime->now; - unless ( length($year) ) { + unless ( $year ) { $year = $dt->year; } - unless ( length($month) ) { + unless ( $month ) { $month = $dt->month; } - unless ( length($day) ) { + unless ( $day ) { $day = $dt->day; } my $formatter = DateTime::Format::Strptime->new( pattern => $format ); - # Macro calls also seem to include any spaces between commas - $time =~ s/^\s+//msg; - my ( $hour, $minute, $second ); - if ( length($time) ) { + if ( $time ) { + $time =~ s/^\s+//msg; # remove all whitespace including newlines ( $hour, $minute, $second ) = split /\:/, $time; } my $dtOut = DateTime->new( @@ -114,7 +112,7 @@ sub process { # If no time component, we use the date as provided with no conversion # Without a time to convert between, there is no point to altering the date - if ( length($time) ) { + if ( $time ) { $dtOut->set_time_zone($toTZ); } $dtOut->set_formatter($formatter); diff --git a/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm b/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm index 3c8c140b5..3b0bd989a 100644 --- a/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm +++ b/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm @@ -35,8 +35,8 @@ our $I18N = { ##hashref of hashes context => q|This is the label for the 'delete created items' field. The value will indicate if the EMSCleanup will delete items that have been converted to EMSTicket assets.| }, 'delete created items label help' => { - message => q|Set this to 'Yes' if you want submissions to be deleted after they have been converted into EMSTisket assets.|, - lastUpdated => 1131394072, + message => q|Set this to 'Yes' if you want submissions to be deleted after they have been converted into EMSTicket assets.|, + lastUpdated => 1258563620, context => q|This is the help text for the delete created items field, if it is set to yes the EMSCleanup activity will delete approved items after EMSTickets have been created from them. This field depends on the 'days before cleanup' field and the EMSCleanup activity also.| }, 'form dscription label' => { diff --git a/sbin/preload.perl b/sbin/preload.perl index 103016bec..1d2cf228b 100644 --- a/sbin/preload.perl +++ b/sbin/preload.perl @@ -2,7 +2,7 @@ use strict; my $webguiRoot = '/data/WebGUI'; -unshift @INC, $webguiRoot . "/lib"; +@INC = "$webguiRoot/lib", grep { $_ ne q{.} } @INC; # add custom lib directories to library search path unshift @INC, grep { diff --git a/t/Macro/ConvertUTCToTZ.t b/t/Macro/ConvertUTCToTZ.t new file mode 100644 index 000000000..e126885a0 --- /dev/null +++ b/t/Macro/ConvertUTCToTZ.t @@ -0,0 +1,53 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2008 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Session; +use Test::More; +use DateTime; + +my $session = WebGUI::Test->session; + +my $numTests = 5+1; +plan tests => $numTests; + +my $macro = 'WebGUI::Macro::ConvertUTCToTZ'; +my $loaded = use_ok($macro); +my $formatter = '%Y-%m-%d'; + +SKIP: { + skip "Unable to load $macro", $numTests-1 unless $loaded; + + my $today = DateTime->now(); + $today->set_time_zone('UTC'); + my $yesterday = $today->clone; + $yesterday->subtract( days => 1 ); + $yesterday->set_formatter($formatter); + + my $out1 = WebGUI::Macro::ConvertUTCToTZ::process($session); + like( $out1, qr/\d{2}\/\d{2}\/\d{2}\/\d{2}\/\d{2}/, 'No parameters passed, check pattern'); + + my $out2 = WebGUI::Macro::ConvertUTCToTZ::process($session, 'UTC', $formatter, $today->ymd); + is( $out2, $today->ymd, 'UTC, date only'); + + my $out3 = WebGUI::Macro::ConvertUTCToTZ::process($session, 'UTC', $formatter, $today->ymd, '02:30:00'); + is( $out3, $today->ymd, 'UTC, date and time'); + + my $out4 = WebGUI::Macro::ConvertUTCToTZ::process($session, 'America/Chicago', $formatter, $today->ymd, '02:30:00'); + is( $out4, $yesterday->ymd, 'Chicago, date and a.m. time'); + + my $out5 = WebGUI::Macro::ConvertUTCToTZ::process($session, 'America/Chicago', $formatter, $today->ymd, '14:30:00'); + is( $out5, $today->ymd, 'Chicago, date and p.m. time'); +} +