From 404ff5d570cd8e30107117e2097e0ec569bf9d48 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 09:04:31 -0700 Subject: [PATCH 1/8] i18n the ableToBeFrield user profile field label. --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.8.2-7.8.3.pl | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e0cd1dc74..f276b66a1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -22,6 +22,7 @@ - fixed #11069: "More" options menu in asset manager - rfe #10755: Adding SetLanguage bazaar item - fixed #11176: New upgrade error in 7.6.35 to 7.7.17 + - fixed #11181: ableToBeFriend label not i18n 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/docs/upgrades/upgrade_7.8.2-7.8.3.pl b/docs/upgrades/upgrade_7.8.2-7.8.3.pl index ab4476476..b0d402b9b 100644 --- a/docs/upgrades/upgrade_7.8.2-7.8.3.pl +++ b/docs/upgrades/upgrade_7.8.2-7.8.3.pl @@ -23,6 +23,7 @@ use WebGUI::Session; use WebGUI::Storage; use WebGUI::Asset; use WebGUI::Utility; +use WebGUI::ProfileField; my $toVersion = '7.8.3'; @@ -38,9 +39,23 @@ addClipboardAdminSetting($session); addTrashAdminSetting($session); addPickLanguageMacro($session); installSetLanguage($session); +i18nAbleToBeFriend($session); finish($session); # this line required +#---------------------------------------------------------------------------- +sub i18nAbleToBeFriend { + my $session = shift; + print "\tInternationalize the Able To Be Friend profile field... " unless $quiet; + my $field = WebGUI::ProfileField->new($session, 'ableToBeFriend'); + if ($field) { + my $props = $field->get(); + $props->{label} = q{WebGUI::International::get('user profile field friend availability','WebGUI')}; + $field->set($props); + } + print "Done.\n" unless $quiet; +} + #---------------------------------------------------------------------------- sub addClipboardAdminSetting { my $session = shift; From 305860073730fb6bd1974732714a78f8d5bb3f67 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 10:51:12 -0700 Subject: [PATCH 2/8] Test maintenance in t/Macro --- t/Macro/CanEditText.t | 12 ++---------- t/Macro/D_date.t | 14 +++----------- t/Macro/EditableToggle.t | 21 +++------------------ t/Macro/Extras.t | 10 +--------- t/Macro/c_companyName.t | 19 ++----------------- t/Macro/e_companyEmail.t | 14 ++------------ 6 files changed, 13 insertions(+), 77 deletions(-) diff --git a/t/Macro/CanEditText.t b/t/Macro/CanEditText.t index a0af7a479..e1807e8da 100644 --- a/t/Macro/CanEditText.t +++ b/t/Macro/CanEditText.t @@ -14,6 +14,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; +use WebGUI::Macro::CanEditText; use Data::Dumper; my $session = WebGUI::Test->session; @@ -61,17 +62,10 @@ my @testSets = ( }, ); -my $numTests = scalar @testSets + 2; +my $numTests = scalar @testSets + 1; plan tests => $numTests; -my $macro = 'WebGUI::Macro::CanEditText'; -my $loaded = use_ok($macro); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; - is( WebGUI::Macro::CanEditText::process($session,''), '', @@ -85,8 +79,6 @@ foreach my $testSet (@testSets) { is($output, $testSet->{output}, $testSet->{comment}); } -} - sub setupTest { my ($session, $defaultNode) = @_; $session->user({userId=>3}); diff --git a/t/Macro/D_date.t b/t/Macro/D_date.t index 55221fd93..05f6afad8 100644 --- a/t/Macro/D_date.t +++ b/t/Macro/D_date.t @@ -15,12 +15,13 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; +use WebGUI::Macro::D_date; use Data::Dumper; # ---- END DO NOT EDIT ---- use Test::More; # increment this value for each test you create -my $wgbday = 997966800; +my $wgbday = WebGUI::Test->webguiBirthday; my @testSets = ( { @@ -33,17 +34,10 @@ my @testSets = ( }, ); -my $numTests = scalar @testSets + 1 + 1; +my $numTests = scalar @testSets + 1; plan tests => $numTests; -my $macro = 'WebGUI::Macro::D_date'; -my $loaded = use_ok($macro); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; - my $session = WebGUI::Test->session; foreach my $testSet (@testSets) { @@ -65,5 +59,3 @@ while ($time1 != $time2) { } is($output, $session->datetime->epochToHuman($time1), 'checking default time and format'); - -} diff --git a/t/Macro/EditableToggle.t b/t/Macro/EditableToggle.t index bf26cb1a6..29fb31462 100644 --- a/t/Macro/EditableToggle.t +++ b/t/Macro/EditableToggle.t @@ -15,6 +15,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; use HTML::TokeParser; +use WebGUI::Macro::EditableToggle; use Data::Dumper; use Test::More; # increment this value for each test you create @@ -184,17 +185,10 @@ foreach my $testSet (@testSets) { $numTests += 1 + (ref $testSet->{output} eq 'CODE'); } -$numTests += 1 + 1; ##Empty session Asset plus use_ok +$numTests += 1; ##Empty session Asset plus use_ok plan tests => $numTests; -my $macro = 'WebGUI::Macro::EditableToggle'; -my $loaded = use_ok($macro); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; - is( WebGUI::Macro::EditableToggle::process($session,'on','off',''), '', @@ -229,8 +223,6 @@ foreach my $testSet (@testSets) { } } -} - sub simpleHTMLParser { my ($text) = @_; my $p = HTML::TokeParser->new(\$text); @@ -255,7 +247,6 @@ sub setupTest { my ($session, $defaultNode) = @_; $session->user({userId=>3}); my $editGroup = WebGUI::Group->new($session, "new"); - WebGUI::Test->groupsToDelete($editGroup); my $tao = WebGUI::Group->find($session, "Turn Admin On"); ##Create an asset with specific editing privileges my $versionTag = WebGUI::VersionTag->getWorking($session); @@ -278,12 +269,6 @@ sub setupTest { $users[1]->addToGroups([$editGroup->getId]); ##User 2 is an editor AND can turn on Admin $users[2]->addToGroups([$editGroup->getId, $tao->getId]); - WebGUI::Test->usersToDelete(@users); + addToCleanup($versionTag, $editGroup, @users); return ($versionTag, $asset, @users); } - -END { ##Clean-up after yourself, always - if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') { - $versionTag->rollback; - } -} diff --git a/t/Macro/Extras.t b/t/Macro/Extras.t index ba5cf3d85..7bfeccfcd 100644 --- a/t/Macro/Extras.t +++ b/t/Macro/Extras.t @@ -14,6 +14,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; +use WebGUI::Macro::Extras; use Test::More; # increment this value for each test you create @@ -49,20 +50,11 @@ my @testSets = ( my $numTests = scalar @testSets; -$numTests += 1; - plan tests => $numTests; my $macro = 'WebGUI::Macro::Extras'; -my $loaded = use_ok($macro); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; foreach my $testSet (@testSets) { my $output = WebGUI::Macro::Extras::process($session, $testSet->{path}); is($output, $testSet->{output}, $testSet->{comment}); } - -} diff --git a/t/Macro/c_companyName.t b/t/Macro/c_companyName.t index b50a883f0..24d51d7ff 100644 --- a/t/Macro/c_companyName.t +++ b/t/Macro/c_companyName.t @@ -14,24 +14,14 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; +use WebGUI::Macro::c_companyName; use Data::Dumper; use Test::More; # increment this value for each test you create my $session = WebGUI::Test->session; -my $numTests = 2+1; - -plan tests => $numTests; - -my $macro = 'WebGUI::Macro::c_companyName'; -my $loaded = use_ok($macro); - -my $originalCompanyName = $session->setting->get('companyName'); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; +plan tests => 2; my $output = WebGUI::Macro::c_companyName::process($session); is($output, $originalCompanyName, "Testing companyName"); @@ -39,8 +29,3 @@ is($output, $originalCompanyName, "Testing companyName"); $session->setting->set('companyName', q|Gooey's Consulting, LLC|); $output = WebGUI::Macro::c_companyName::process($session); is($output, q|Gooey's Consulting, LLC|, "Testing companyName with embedded quote and comma"); - -} - -END { -} diff --git a/t/Macro/e_companyEmail.t b/t/Macro/e_companyEmail.t index aa1205cc7..d54c6f0fa 100644 --- a/t/Macro/e_companyEmail.t +++ b/t/Macro/e_companyEmail.t @@ -14,26 +14,16 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; +use WebGUI::Macro::e_companyEmail; use Data::Dumper; use Test::More; # increment this value for each test you create my $session = WebGUI::Test->session; -my $numTests = 1 + 1; - -plan tests => $numTests; - -my $macro = 'WebGUI::Macro::e_companyEmail'; -my $loaded = use_ok($macro); - -SKIP: { - -skip "Unable to load $macro", $numTests-1 unless $loaded; +plan tests => 1; my ($value) = $session->dbSlave->quickArray( "select value from settings where name='companyEmail'"); my $output = WebGUI::Macro::e_companyEmail::process($session); is($output, $value, sprintf "Testing companyEmail"); - -} From 9c21429b398d7fdb2f3cf0674b931bcfd9af4ac1 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 29 Oct 2009 13:17:16 -0500 Subject: [PATCH 3/8] Fixed an error being thrown by the CalendarUpdateFeeds workflow activity. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Workflow/Activity/CalendarUpdateFeeds.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0c3aa2e82..b97aa7221 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.8.3 + - Fixed an error being thrown by the CalendarUpdateFeeds workflow activity. - fixed #11074: Links to CS posts not working - fixed #11152: Image edits do not autocommit version tags - fixed template attachments are not cleaned up during purge diff --git a/lib/WebGUI/Workflow/Activity/CalendarUpdateFeeds.pm b/lib/WebGUI/Workflow/Activity/CalendarUpdateFeeds.pm index b9cef3ed4..795192bc6 100644 --- a/lib/WebGUI/Workflow/Activity/CalendarUpdateFeeds.pm +++ b/lib/WebGUI/Workflow/Activity/CalendarUpdateFeeds.pm @@ -100,6 +100,7 @@ sub execute { my $getCalendar = WebGUI::Asset::Wobject::Calendar->getIsa($session); CALENDAR: while (my $calendar = $getCalendar->()) { + next unless defined $calendar; my $calendarTitle = $calendar->getTitle; my $calendarId = $calendar->getId; if ( $calendar->get( "state" ) ne "published" ) { From f1bc38de6cc4906a058d4fe0c5af283bcca88d98 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 29 Oct 2009 14:01:53 -0500 Subject: [PATCH 4/8] The auto add to group and auto delete from group operations that are used with the GroupAdd and GroupDelete macros were fixed to make the user log in if they aren't already. Conflicts: docs/changelog/7.x.x.txt --- docs/changelog/7.x.x.txt | 22 ++++++++++++++++++++++ lib/WebGUI/Operation/Group.pm | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 22871f4e7..83543b139 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,5 +1,27 @@ 7.8.3 - Fixed an error being thrown by the CalendarUpdateFeeds workflow activity. + - The auto add to group and auto delete from group operations that are used with the GroupAdd and GroupDelete macros were fixed to make the user log in if they aren't already. + +7.7.24 + - fixed #11176: New upgrade error in 7.6.35 to 7.7.17 + - fixed #11181: ableToBeFriend label not i18n + +7.7.23 + - fixed #11126: WebGUI database has varchar fields + - fixed #10989: DataForm List: No pagination + - fixed #11128: Thing breaks w/ default value for date field + - fixed #10888: Issues with adding points to Maps + - fixed #11139: referencing an item in the clipboard + - fixed #11146: Upgrade Error 7.7.21 to 7.7.22 + - fixed #11147: fail safe template is missing embedded style + - fixed #11137: Customers see failed orders + - fixed #11156: Syndicated Content doesn't show all headlines in feed + - fixed #11138: RichEdit, upload image does not commit a version tag + - refixed #2569: robots.txt issues + - fixed #11157: calendar tool for entering add event date + - fixed #11158: Calendar iCal feed doesn't show today's all-day events + - fixed #11131: https / http URLs still caching across secure/insecure boundary + - fixed #11093: Spectre cron can DoS server with many sites - fixed #11074: Links to CS posts not working - fixed #11152: Image edits do not autocommit version tags - fixed template attachments are not cleaned up during purge diff --git a/lib/WebGUI/Operation/Group.pm b/lib/WebGUI/Operation/Group.pm index 753ea5d9f..2ebf7d6b7 100644 --- a/lib/WebGUI/Operation/Group.pm +++ b/lib/WebGUI/Operation/Group.pm @@ -337,7 +337,7 @@ A WebGUI::Session object sub www_autoAddToGroup { my $session = shift; - return WebGUI::AdminConsole->new($session,"groups")->render($session->privilege->insufficient()) unless ($session->user->userId ne 1); + return $self->session->privilege->noAccess() if ($session->user->isVisitor); my $group = WebGUI::Group->new($session,$session->form->process("groupId")); if ($group && $group->autoAdd) { $group->addUsers([$session->user->userId],[$session->form->process("groupId")]); @@ -361,7 +361,7 @@ A WebGUI::Session object sub www_autoDeleteFromGroup { my $session = shift; - return WebGUI::AdminConsole->new($session,"groups")->render($session->privilege->insufficient()) unless ($session->user->userId ne 1); + return $self->session->privilege->noAccess() if ($session->user->isVisitor); my $group = WebGUI::Group->new($session,$session->form->process("groupId")); if ($group && $group->autoDelete) { $group->deleteUsers([$session->user->userId],[$session->form->process("groupId")]); From a1c1cd47d85e38cfebce993a14cb5165c94cc0c2 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 12:38:59 -0700 Subject: [PATCH 5/8] Fix broken i18n in the PayoutVendors workflow. --- lib/WebGUI/Workflow/Activity/PayoutVendors.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebGUI/Workflow/Activity/PayoutVendors.pm b/lib/WebGUI/Workflow/Activity/PayoutVendors.pm index 386abf873..01b214620 100644 --- a/lib/WebGUI/Workflow/Activity/PayoutVendors.pm +++ b/lib/WebGUI/Workflow/Activity/PayoutVendors.pm @@ -81,7 +81,7 @@ sub definition { }, paypalSubject => { fieldType => 'text', - label => $i18n->get('Subject for vendor notication email'), + label => $i18n->get('Subject for vendor notification email'), defaultValue => $i18n->get('Vendor payout from').' ' . $session->setting->get('companyUrl'), }, notificationGroupId => { From 97a340a45cbcbffe6f442bb12f8f8b3d17f2b5a1 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 12:39:18 -0700 Subject: [PATCH 6/8] CS template variable help review. Fixes bug #11179. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Help/Asset_Collaboration.pm | 84 +++------- .../i18n/English/Asset_Collaboration.pm | 147 +++++------------- 3 files changed, 61 insertions(+), 171 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 83543b139..cac9ab249 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -46,6 +46,7 @@ - rfe #10755: Adding SetLanguage bazaar item - fixed #11176: New upgrade error in 7.6.35 to 7.7.17 - fixed #11181: ableToBeFriend label not i18n + - fixed #11179: user.CanStartThread missing from help 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/lib/WebGUI/Help/Asset_Collaboration.pm b/lib/WebGUI/Help/Asset_Collaboration.pm index 4605ec3d4..ef134eb75 100644 --- a/lib/WebGUI/Help/Asset_Collaboration.pm +++ b/lib/WebGUI/Help/Asset_Collaboration.pm @@ -18,6 +18,7 @@ our $HELP = { { 'name' => 'back.label' }, { 'name' => 'compensation.label' }, { 'name' => 'open.label' }, + { 'name' => 'captcha_label' }, { 'name' => 'close.label' }, { 'name' => 'closed.label' }, { 'name' => 'critical.label' }, @@ -34,6 +35,9 @@ our $HELP = { { 'name' => 'job.title.label' }, { 'name' => 'job.description.label' }, { 'name' => 'job.requirements.label' }, + { 'name' => 'karmascale.label' }, + { 'name' => 'karmaRank.label' }, + { 'name' => 'keywords.label' }, { 'name' => 'location.label' }, { 'name' => 'layout.flat.label' }, { 'name' => 'link.header.label' }, @@ -64,6 +68,7 @@ our $HELP = { { 'name' => 'synopsis.label' }, { 'name' => 'thumbnail.label' }, { 'name' => 'title.label' }, + { 'name' => 'transferkarma.label' }, { 'name' => 'unlock.label' }, { 'name' => 'unstick.label' }, { 'name' => 'unsubscribe.label' }, @@ -80,6 +85,11 @@ our $HELP = { title => 'collaboration post list template variables title', body => '', fields => [], + isa => [ + { tag => 'pagination template variables', + namespace => 'WebGUI' + }, + ], variables => [ { 'name' => 'post_loop', 'variables' => [ @@ -139,6 +149,7 @@ our $HELP = { fields => [], variables => [ { 'name' => 'displayLastReply' }, + { 'name' => 'user.canStartThread' }, { 'name' => 'user.canPost' }, { 'name' => 'user.isModerator' }, { 'name' => 'user.isVisitor', }, @@ -159,7 +170,7 @@ our $HELP = { { 'name' => 'sortby.rating.url' }, { 'name' => 'collaborationAssetId' }, ], - related => [ + isa => [ { tag => 'collaboration template labels', namespace => 'Asset_Collaboration', }, @@ -173,76 +184,19 @@ our $HELP = { title => 'collaboration search template title', body => '', fields => [], + isa => [ + { namespace => "Asset_Collaboration", + tag => "collaboration post list template variables" + }, + ], variables => [ { 'name' => 'form.header' }, { 'name' => 'query.form' }, { 'name' => 'form.search' }, + { 'name' => 'form.footer' }, { 'name' => 'back.url' }, - { 'name' => 'unsubscribe.url', }, - { 'name' => 'sortby.title.url', }, - { 'name' => 'sortby.username.url', }, - { 'name' => 'sortby.date.url', }, - { 'name' => 'sortby.lastreply.url', }, - { 'name' => 'sortby.views.url', }, - { 'name' => 'sortby.replies.url', }, - { 'name' => 'sortby.rating.url', } ], - related => [ - { tag => 'collaboration post list template variables', - namespace => 'Asset_Collaboration', - }, - ] - }, - - 'collaboration rss template' => { - title => 'collaboration rss template title', - body => '', - fields => [], - variables => [ - { 'name' => 'title', - 'description' => 'feed title' - }, - { 'name' => 'link', - 'description' => 'collab link' - }, - { 'name' => 'description', - 'description' => 'feed description' - }, - { 'name' => 'generator' }, - { 'name' => 'webMaster' }, - { 'name' => 'docs' }, - { 'name' => 'lastBuildDate' }, - { 'name' => 'item_loop', - 'variables' => [ - { 'name' => 'author' }, - { 'name' => 'title', - 'description' => 'post title' - }, - { 'name' => 'link', - 'description' => 'full text link' - }, - { 'name' => 'description', - 'description' => 'item description' - }, - { 'name' => 'guid' }, - { 'name' => 'pubDate' }, - { 'name' => 'epochDate' }, - { 'name' => 'attachmentLoop', - 'variables' => [ - { 'name' => 'attachment_thumbnail' }, - { 'name' => 'attachment.url' }, - { 'name' => 'attachment.path' }, - { 'name' => 'attachment.length' } - ] - } - ] - } - ], - related => [ - { tag => 'collaboration post list template variables', - namespace => 'Asset_Collaboration', - }, - ] + related => [ ], }, }; diff --git a/lib/WebGUI/i18n/English/Asset_Collaboration.pm b/lib/WebGUI/i18n/English/Asset_Collaboration.pm index ed6b1559a..237b2c0f8 100644 --- a/lib/WebGUI/i18n/English/Asset_Collaboration.pm +++ b/lib/WebGUI/i18n/English/Asset_Collaboration.pm @@ -1057,6 +1057,31 @@ our $I18N = { lastUpdated => 1150169038, }, + 'transferkarma.label' => { + message => q|The phrase "Transfer Karma".|, + lastUpdated => 1150169038, + }, + + 'karmascale.label' => { + message => q|The phrase "Karma Scale".|, + lastUpdated => 1150169038, + }, + + 'karmaRank.label' => { + message => q|The phrase "Karma Rank".|, + lastUpdated => 1150169038, + }, + + 'captcha_label' => { + message => q|The word "Captcha".|, + lastUpdated => 1150169038, + }, + + 'keywords.label' => { + message => q|The word "Keywords".|, + lastUpdated => 1150169038, + }, + 'display last reply description' => { message => q|If set to Yes, template variables will be added to allow the display of the last reply in this Thread.|, lastUpdated => 1165449294, @@ -1404,6 +1429,12 @@ user has an avatar.|, lastUpdated => 1149655833, }, + 'user.canStartThread' => { + message => q|A conditional that is true if the current user can add Threads to this Collaboration Asset.|, + lastUpdated => 1149655833, + context => q|Template variable help|, + }, + 'displayLastReply' => { message => q|A conditional that is true if the Collaboration System was configured to display the last reply. If this variable is true, then in the Collaboration Template, the lastReply.* variables will be enabled.|, lastUpdated => 1149655833, @@ -1510,11 +1541,21 @@ the Collaboration Asset, the user will be notified.|, lastUpdated => 1149655909, }, + 'form.footer' => { + message => q|HTML required to end the search form.|, + lastUpdated => 1149655909, + }, + 'back.url' => { message => q|A URL for returning to the main view for this Collaboration Asset.|, lastUpdated => 1149655909, }, + 'doit' => { + message => q|A boolean that is true if a search has just been submitted|, + lastUpdated => 1149655909, + }, + 'enable avatars' => { message => q|Enable Avatars?|, lastUpdated => 1131432414, @@ -1535,112 +1576,6 @@ the Collaboration Asset, the user will be notified.|, lastUpdated => 1180759724, }, - 'collaboration rss template title' => { - message => q|Collaboration RSS Template Variables|, - lastUpdated => 1184905545, - }, - - 'feed title' => { - message => q|The title of the rss feed (comes from the collaboration title).|, - lastUpdated => 1149656056, - }, - - 'collab link' => { - message => q|The url to the collaboration.|, - lastUpdated => 1149656056, - }, - - 'feed description' => { - message => q|The description of the rss feed (comes from the collaboration synopsis).|, - lastUpdated => 1216913516, - }, - - 'generator' => { - message => q|The program used to generate the rss feed, i.e. WebGUI plus version information. (optional field)|, - lastUpdated => 1149656056, - }, - - 'webMaster' => { - message => q|The email address of the person responsible for the technical issues relating to this rss feed. (optional field)|, - lastUpdated => 1149656056, - }, - - 'docs' => { - message => q|The url of documentation about the format of this file, RSS 2.0 (optional field)|, - lastUpdated => 1149656056, - }, - - 'lastBuildDate' => { - message => q|The date that this feed was last updated. (optional field)|, - lastUpdated => 1149656056, - }, - - 'item_loop' => { - message => q|Loops over the posts to be transmitted in this RSS feed.|, - lastUpdated => 1149656056, - }, - - 'author' => { - message => q|The username of the person who submitted the post.|, - lastUpdated => 1149656056, - }, - - 'post title' => { - message => q|The title of the item (post).|, - lastUpdated => 1149656056, - }, - - 'full text link' => { - message => q|The url to the full text of the item.|, - lastUpdated => 1149656056, - }, - - 'item description' => { - message => q|A synopsis of the item.|, - lastUpdated => 1149656056, - }, - - 'guid' => { - message => q|A unique identifier for this item.|, - lastUpdated => 1149656056, - }, - - 'pubDate' => { - message => q|The date the item was published.|, - lastUpdated => 1149656056, - }, - - 'epochDate' => { - message => q|The date the item was published as an epoch date so that the Date macro can be used for custom date formatting.|, - lastUpdated => 1222106027, - }, - - 'attachmentLoop' => { - message => q|A loop containg all attachements to this item (post).|, - lastUpdated => 1149656056, - }, - - 'attachment_thumbnail' => { - message => q|The URL to the thumbnail for this attachment. Files will be represented by an - icon depending on their type. Images will have a true thumbnail.|, - lastUpdated => 1169747804, - }, - - 'attachment.url' => { - message => q|The URL to this attachment.|, - lastUpdated => 1149656056, - }, - - 'attachment.path' => { - message => q|The path in the filesystem to this attachment.|, - lastUpdated => 1149656056, - }, - - 'attachment.length' => { - message => q|The length in this attachment, in bytes.|, - lastUpdated => 1149656056, - }, - 'collaborationAssetId' => { message => q|The assetId of this Collaboration System. Unlike the variable assetId, this one will not be overridden by the assetIds inside of Threads or Posts.|, lastUpdated => 1170543345, From a4a5403e8caf9f16dbc3edcea5d653c4bb75727f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 12:46:45 -0700 Subject: [PATCH 7/8] Fix bad merge. --- docs/changelog/7.x.x.txt | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index cac9ab249..76abe88ea 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,27 +1,6 @@ 7.8.3 - Fixed an error being thrown by the CalendarUpdateFeeds workflow activity. - The auto add to group and auto delete from group operations that are used with the GroupAdd and GroupDelete macros were fixed to make the user log in if they aren't already. - -7.7.24 - - fixed #11176: New upgrade error in 7.6.35 to 7.7.17 - - fixed #11181: ableToBeFriend label not i18n - -7.7.23 - - fixed #11126: WebGUI database has varchar fields - - fixed #10989: DataForm List: No pagination - - fixed #11128: Thing breaks w/ default value for date field - - fixed #10888: Issues with adding points to Maps - - fixed #11139: referencing an item in the clipboard - - fixed #11146: Upgrade Error 7.7.21 to 7.7.22 - - fixed #11147: fail safe template is missing embedded style - - fixed #11137: Customers see failed orders - - fixed #11156: Syndicated Content doesn't show all headlines in feed - - fixed #11138: RichEdit, upload image does not commit a version tag - - refixed #2569: robots.txt issues - - fixed #11157: calendar tool for entering add event date - - fixed #11158: Calendar iCal feed doesn't show today's all-day events - - fixed #11131: https / http URLs still caching across secure/insecure boundary - - fixed #11093: Spectre cron can DoS server with many sites - fixed #11074: Links to CS posts not working - fixed #11152: Image edits do not autocommit version tags - fixed template attachments are not cleaned up during purge From 5510710b53a4d6fe8f7a0a76139123d6f474be34 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Oct 2009 18:14:21 -0700 Subject: [PATCH 8/8] Adjust window in listView for Calendar. Fixes ug #11183 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Calendar.pm | 7 ++- t/Asset/Wobject/Calendar.t | 75 +++++++++++++++++++++++----- 3 files changed, 70 insertions(+), 13 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 76abe88ea..402145569 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -26,6 +26,7 @@ - fixed #11176: New upgrade error in 7.6.35 to 7.7.17 - fixed #11181: ableToBeFriend label not i18n - fixed #11179: user.CanStartThread missing from help + - fixed #11183: Calendar List View 7.8.2 - Added scheduled vendor payout workflow activity. (Special thanks to Martin @ Oqapi) diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index fdbb397a6..e288cfa8d 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -1291,11 +1291,16 @@ sub viewList { my $session = $self->session; my $i18n = WebGUI::International->new($session,"Asset_Calendar"); my $var = $self->getTemplateVars; + my $tz = $session->datetime->getTimeZone(); ### Get the events - my $dtStart = WebGUI::DateTime->new( $session, $params->{start} )->truncate( to => "day" ); + my $dtStart = WebGUI::DateTime->new( $session, $params->{start} ); + $dtStart->set_time_zone($tz); + $dtStart->truncate( to => 'day' ); my $dtEnd = $dtStart->clone->add( seconds => $self->get('listViewPageInterval') ); + warn 'truncated: '.$dtStart->toDatabase; + warn 'end date: '.$dtEnd->toDatabase; my @events = $self->getEventsIn( $dtStart->toDatabase, diff --git a/t/Asset/Wobject/Calendar.t b/t/Asset/Wobject/Calendar.t index 994bff95d..a9dc27bc2 100644 --- a/t/Asset/Wobject/Calendar.t +++ b/t/Asset/Wobject/Calendar.t @@ -66,7 +66,7 @@ my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Calendar Test"}); -WebGUI::Test->tagsToRollback($versionTag); +addToCleanup($versionTag); my $cal = $node->addChild({className=>'WebGUI::Asset::Wobject::Calendar'}); my $windowCal = $node->addChild({ @@ -264,7 +264,7 @@ my $coincidentHigh = $windowCal->addChild({ my $tag2 = WebGUI::VersionTag->getWorking($session); $tag2->commit; -WebGUI::Test->tagsToRollback($tag2); +addToCleanup($tag2); is(scalar @{ $windowCal->getLineage(['children'])}, 13, 'added events to the window calendar'); @@ -321,7 +321,7 @@ my $endOfWeek = $weekCal->addChild({ my $tag3 = WebGUI::VersionTag->getWorking($session); $tag3->commit; -WebGUI::Test->tagsToRollback($tag3); +addToCleanup($tag3); my $weekVars = $weekCal->viewWeek({ start => $bday }); my @eventBins = (); @@ -401,7 +401,7 @@ my $endOfMonth = $monthCal->addChild({ my $tag4 = WebGUI::VersionTag->getWorking($session); $tag4->commit; -WebGUI::Test->tagsToRollback($tag4); +addToCleanup($tag4); my $monthVars = $monthCal->viewMonth({ start => $bday }); @eventBins = (); @@ -447,7 +447,7 @@ my $dayCal = $node->addChild({ title => 'Calendar for doing event span testing, day', }); -$allDayDt = $bday->cloneToUserTimeZone; +$allDayDt = $bday->cloneToUserTimeZone; my $nextDayDt = $bday->cloneToUserTimeZone->add(days => 1)->truncate( to => 'day')->add(hours => 19); $allDay = $dayCal->addChild({ @@ -472,7 +472,7 @@ my $nextDay = $dayCal->addChild({ my $tag5 = WebGUI::VersionTag->getWorking($session); $tag5->commit; -WebGUI::Test->tagsToRollback($tag5); +addToCleanup($tag5); my $hourVars = $dayCal->viewDay({ start => $nextDayDt }); @eventBins = (); @@ -488,6 +488,62 @@ cmp_deeply( '... end of day event in proper bin' ); +###################################################################### +# +# viewList +# +###################################################################### + +my $listCal = $node->addChild({ + className => 'WebGUI::Asset::Wobject::Calendar', + title => 'Calendar for doing event span testing, list', + listViewPageInterval => 3600*24*3, +}); + +$allDayDt = $bday->cloneToUserTimeZone->truncate( to => 'day' ); +my $prevDayDt = $bday->cloneToUserTimeZone->truncate( to => 'day' )->subtract(days => 1)->add(hours => 19); + +diag $allDayDt->toDatabase; +diag $prevDayDt->toDatabase; + +$allDay = $listCal->addChild({ + className => 'WebGUI::Asset::Event', + title => 'An event with explicit times that lasts all day', + startDate => $allDayDt->toDatabaseDate, + endDate => $allDayDt->clone->add(days => 1)->toDatabaseDate, + startTime => $allDayDt->toDatabaseTime, + endTime => $allDayDt->clone->add(days => 1)->toDatabaseTime, + timeZone => $tz, +}, undef, undef, {skipAutoCommitWorkflows => 1}); + +my $prevDay = $listCal->addChild({ + className => 'WebGUI::Asset::Event', + title => 'Event at the end of the previous day', + startDate => $prevDayDt->toDatabaseDate, + endDate => $prevDayDt->toDatabaseDate, + startTime => $prevDayDt->toDatabaseTime, + endTime => $prevDayDt->clone->add(hours => 1)->toDatabaseTime, + timeZone => $tz, +}, undef, undef, {skipAutoCommitWorkflows => 1}); + +my $tag6 = WebGUI::VersionTag->getWorking($session); +$tag6->commit; +addToCleanup($tag6); + +my $listVars = $listCal->viewList({ start => $bday }); + +@eventBins = (); +foreach my $event (@{ $listVars->{events} }) { + push @eventBins, $event->{eventAssetId}; +} + +cmp_deeply( + \@eventBins, + [ $allDay->getId ], + '... correct set of events in list view' +); + + ###################################################################### # # getFeeds @@ -501,7 +557,7 @@ my $feedCal = $node->addChild({ my $feedTag = WebGUI::VersionTag->getWorking($session); $feedTag->set({name=>"Calendar Feed Test"}); -WebGUI::Test->tagsToRollback($feedTag); +addToCleanup($feedTag); $feedTag->commit; cmp_deeply( @@ -509,8 +565,3 @@ cmp_deeply( [], 'getFeeds: returns an empty array ref with no feeds' ); - -TODO: { - local $TODO = "Tests to make later"; - ok(0, 'Lots more to test'); -}