From 3951072f0ce856ab48c8fb0200d85c867f214b26 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 18 Nov 2009 09:01:58 -0800 Subject: [PATCH 1/5] Fix an i18n typo. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2cd7625ce..854aea559 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.8.6 + - fixed #11250: i18n Asset_EMSSubmissionForm::delete created items label help 7.8.5 - added the EMS submission subsystem 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' => { From 53f3683c2193c5472c39efe07da4ab6ba5955269 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 18 Nov 2009 10:24:39 -0800 Subject: [PATCH 2/5] Do not include . in @INC. --- docs/changelog/7.x.x.txt | 1 + sbin/preload.perl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 854aea559..a977fb933 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,6 @@ 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 7.8.5 - added the EMS submission subsystem 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 { From 64640003afc16a1cab27dc1b43e519a14282e4c3 Mon Sep 17 00:00:00 2001 From: Luke Robinson Date: Tue, 17 Nov 2009 15:28:52 +0000 Subject: [PATCH 3/5] ConvertUTCToTZ.pm macro and test Conflicts: lib/WebGUI/Macro/ConvertUTCToTZ.pm --- lib/WebGUI/Macro/ConvertUTCToTZ.pm | 24 +++++++------- t/Macro/ConvertUTCToTZ.t | 53 ++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 t/Macro/ConvertUTCToTZ.t 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/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'); +} + From 74a2df9ad6de21bd19375a263261017e390f60c2 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 18 Nov 2009 11:25:33 -0800 Subject: [PATCH 4/5] Adding Luke Robinson to list of contributors. --- docs/credits.txt | 1 + 1 file changed, 1 insertion(+) 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 From 49ec9f65f4f999b03344fcf04096d4e6d48ca8e2 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 18 Nov 2009 14:54:16 -0800 Subject: [PATCH 5/5] Use https method in SSL mode. Fixes bug #11249 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Form/Captcha.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a977fb933..2884baf73 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +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/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 ''