From 9c2980404f15131a62a2a5c92f69b8cd45758515 Mon Sep 17 00:00:00 2001 From: daviddelikat Date: Fri, 6 Nov 2009 09:22:03 -0600 Subject: [PATCH] making tests work --- docs/upgrades/upgrade_7.7.20-7.8.0.pl | 54 ------------------- lib/WebGUI/Asset/EMSSubmission.pm | 1 + lib/WebGUI/Asset/EMSSubmissionForm.pm | 2 + .../Asset/Wobject/EventManagementSystem.pm | 8 ++- .../Activity/CleanupEMSSubmissions.pm | 5 -- .../i18n/English/Asset_EMSSubmission.pm | 6 +++ .../i18n/English/Asset_EMSSubmissionForm.pm | 6 +++ .../English/Asset_EventManagementSystem.pm | 6 +++ t/Asset/Wobject/EventManagementSystem.t | 6 +++ t/lib/WebGUI/Test/Activity.pm | 3 +- 10 files changed, 35 insertions(+), 62 deletions(-) diff --git a/docs/upgrades/upgrade_7.7.20-7.8.0.pl b/docs/upgrades/upgrade_7.7.20-7.8.0.pl index 08ffebafe..680235d48 100644 --- a/docs/upgrades/upgrade_7.7.20-7.8.0.pl +++ b/docs/upgrades/upgrade_7.7.20-7.8.0.pl @@ -35,7 +35,6 @@ reorganizeAdSpaceProperties($session); addSubscribableAspect( $session ); addFeaturedPageWiki( $session ); fixEmptyCalendarIcalFeeds( $session ); -addEMSSubmission( $session ); finish($session); # this line required @@ -119,60 +118,7 @@ sub fixEmptyCalendarIcalFeeds { print "DONE!\n" unless $quiet; } -[ -#---------------------------------------------------------------------------- -# Add tables for the EMS Submission feature -sub addEMSSubmission { - my $session = shift; - print "\tAdding EMS Submission feature..." unless $quiet; - $session->db->write( <<'ESQL' ); -CREATE TABLE EMSSubmissionForm ( - assetId CHAR(22) BINARY NOT NULL, - revisionDate BIGINT NOT NULL, - nextSubmissionId INT, - canSubmitGroupId CHAR(22) BINARY, - daysBeforeCleanup INT, - deleteCreatedItems INT(1), - formDescription TEXT, - PRIMARY KEY ( assetId, revisionDate ) -) -ESQL - - $session->db->write( <<'ESQL' ); -CREATE TABLE EMSSubmission ( - assetId CHAR(22) BINARY NOT NULL, - revisionDate BIGINT NOT NULL, - submissionId INT NOT NULL, - price FLOAT, - seatsAvailable INT, - startDate DATETIME, - duration FLOAT, - eventNumber INT, - location CHAR(100), - relatedBadgeGroups MEDIUMTEXT, - relatedRibbons MEDIUMTEXT, - eventMetaData MEDIUMTEXT, - sendEmailOnChange INT(1), - PRIMARY KEY ( assetId, revisionDate ) -) -ESQL - - $session->db->write( q{ ALTER TABLE EventManagementSystem - ADD COLUMN eventSubmissionTemplateId CHAR(22) BINARY; }); - - $session->db->write( q{ ALTER TABLE EventManagementSystem - ADD COLUMN viewEventSubmissionQueueTemplateId CHAR(22) BINARY; }); - - $session->db->write( q{ ALTER TABLE EventManagementSystem - ADD COLUMN editEventSubmissionTemplateId CHAR(22) BINARY; }); - - $session->db->write( q{ ALTER TABLE EventManagementSystem - ADD COLUMN eventSubmissionGroups MEDIUMTEXT; }); - - print "DONE!\n" unless $quiet; -} -] #---------------------------------------------------------------------------- # Add the column for featured wiki pages sub addFeaturedPageWiki { diff --git a/lib/WebGUI/Asset/EMSSubmission.pm b/lib/WebGUI/Asset/EMSSubmission.pm index 14ac4d85a..8cc5a462e 100644 --- a/lib/WebGUI/Asset/EMSSubmission.pm +++ b/lib/WebGUI/Asset/EMSSubmission.pm @@ -545,6 +545,7 @@ sub getEditTabs { } #------------------------------------------------------------------- + =head2 getQueueUrl returns the URL for the submission queue page with the submisison id in the hash part diff --git a/lib/WebGUI/Asset/EMSSubmissionForm.pm b/lib/WebGUI/Asset/EMSSubmissionForm.pm index 752730e20..e48a5fa3d 100644 --- a/lib/WebGUI/Asset/EMSSubmissionForm.pm +++ b/lib/WebGUI/Asset/EMSSubmissionForm.pm @@ -385,6 +385,7 @@ sub getFormDescription { } #------------------------------------------------------------------- + =head2 getQueueUrl returns the URL for the submission queue page with the submisison id in the hash part @@ -465,6 +466,7 @@ asset instances, you will need to purge them here. =head2 purgeRevision ( ) This method is called when data is purged by the system. + =cut #sub purgeRevision { # my $self = shift; diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 9759575e8..f3e62db5a 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -37,6 +37,7 @@ use Tie::IxHash; use Data::Dumper; #------------------------------------------------------------------- + =head2 addGroupToSubmitList ( groupId ) adds the parameter to eventSubmissionGroups @@ -54,6 +55,7 @@ sub addGroupToSubmitList { } #------------------------------------------------------------------- + =head2 addSubmissionForm creates a child of class WG::Asset::EMSSubmissionForm @@ -101,6 +103,7 @@ sub addSubmissionForm { } #------------------------------------------------------------------- + =head2 canSubmit returns true is the current user can submit to any form attached to this EMS @@ -494,6 +497,7 @@ sub getRibbons { } #------------------------------------------------------------------- + =head2 getSubmissionLocations retuns an arrayref of the locations found in the submission location list @@ -571,6 +575,7 @@ sub getTokens { } #------------------------------------------------------------------- + =head2 hasSubmissionForms returns true if the EMS has subission forms attached @@ -587,6 +592,7 @@ sub hasSubmissionForms { } #------------------------------------------------------------------- + =head2 hasSubmissions returns true if the current user has submission forms in this EMS @@ -793,7 +799,6 @@ sub www_addSubmission { $session->http->setMimeType( 'text/html' ); } my $content = '

' . $title . '

' ; -use lib '/root/pb/lib'; use dav; dav::log $content; if( $asJson ) { return JSON->new->encode( { text => $content, title => $title, id => 'list' . rand } ); } else { @@ -2656,6 +2661,7 @@ sub www_viewSchedule { } #--------------------------------------------- + =head2 www_viewSubmissionQueue =cut diff --git a/lib/WebGUI/Workflow/Activity/CleanupEMSSubmissions.pm b/lib/WebGUI/Workflow/Activity/CleanupEMSSubmissions.pm index 69eadb33e..3cd147211 100644 --- a/lib/WebGUI/Workflow/Activity/CleanupEMSSubmissions.pm +++ b/lib/WebGUI/Workflow/Activity/CleanupEMSSubmissions.pm @@ -68,13 +68,10 @@ See WebGUI::Workflow::Activity::execute() for details. =cut -use lib '/root/pb/lib'; use dav; - sub execute { my $self = shift; my $session = $self->session; my $root = WebGUI::Asset->getRoot($session); -dav::log __PACKAGE__ . " executing\n"; # keep track of how much time it's taking my $start = time; @@ -86,7 +83,6 @@ dav::log __PACKAGE__ . " executing\n"; } ); for my $emsForm ( @$list ) { -dav::log __PACKAGE__ . "::executing::emsForm loop\n"; my $daysBeforeCleanup = $emsForm->get('daysBeforeCleanup') ; next if ! $daysBeforeCleanup; my $whereClause = q{ submissionStatus='denied' }; @@ -101,7 +97,6 @@ dav::log __PACKAGE__ . "::executing::emsForm loop\n"; whereClause => $whereClause, } ); for my $submission ( @$res ) { -dav::log __PACKAGE__ . "::executing::submission loop\n"; $submission->purge; $limit--; return $self->WAITING(1) if ! $limit or time > $start + $timeLimit; diff --git a/lib/WebGUI/i18n/English/Asset_EMSSubmission.pm b/lib/WebGUI/i18n/English/Asset_EMSSubmission.pm index 13c6262ec..1472d9ee3 100644 --- a/lib/WebGUI/i18n/English/Asset_EMSSubmission.pm +++ b/lib/WebGUI/i18n/English/Asset_EMSSubmission.pm @@ -44,6 +44,12 @@ our $I18N = { ##hashref of hashes context => q|Message used to notify user when someone else changes their event submission.| }, + 'edit asset' => { + message => q|Edit Asset|, + lastUpdated => 1131394072, + context => q|The label for the default edit page.| + }, + # 'TODO' => { # message => q|TODO|, # lastUpdated => 1131394072, diff --git a/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm b/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm index 80bbbd3b5..3c8c140b5 100644 --- a/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm +++ b/lib/WebGUI/i18n/English/Asset_EMSSubmissionForm.pm @@ -99,6 +99,12 @@ our $I18N = { ##hashref of hashes context => q|Remind the registrar to allow at least one field to be editted by the event submitter.| }, + 'edit form' => { + message => q|Edit Form|, + lastUpdated => 1131394072, + context => q|The label for the default edit form.| + }, + # 'TODO' => { # message => q|TODO|, # lastUpdated => 1131394072, diff --git a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm index 487547102..c7f0070a4 100644 --- a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm +++ b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm @@ -2267,6 +2267,12 @@ normal templates.|, context => q|Field Label|, }, + 'new form' => { + message => q|New Form|, + lastUpdated => 1147050475, + context => q|The label for the link to create a new submission form.|, + }, + # 'TODO' => { # message => q|TODO|, # lastUpdated => 1147050475, diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t index 1bc2393db..30c0af1d5 100644 --- a/t/Asset/Wobject/EventManagementSystem.t +++ b/t/Asset/Wobject/EventManagementSystem.t @@ -340,6 +340,12 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } ); 'tokenInstructions' => ignore(), 'printableStyleTemplateId' => ignore(), 'ticketInstructions' => ignore(), + 'eventSubmissionGroups' => ignore(), + 'eventSubmissionMainTemplateId' => ignore(), + 'eventSubmissionQueueTemplateId' => ignore(), + 'eventSubmissionTemplateId' => ignore(), + 'nextSubmissionId' => ignore(), + 'submittedLocationsList' => ignore(), 'tickets_loop' => \@ticketArray, }, "www_printRemainingTickets: template variables valid" diff --git a/t/lib/WebGUI/Test/Activity.pm b/t/lib/WebGUI/Test/Activity.pm index 615055a3e..0dc1323e4 100644 --- a/t/lib/WebGUI/Test/Activity.pm +++ b/t/lib/WebGUI/Test/Activity.pm @@ -72,8 +72,7 @@ sub create { my $tag = WebGUI::VersionTag->getWorking($session); $tag->commit; WebGUI::Test->tagsToRollback($tag); - # WebGUI::Test->assetsToPurge($instance,$workflow); -- does not work... - push @cleanup, $instance, $workflow, + WebGUI::Test->workflowsToDelete($instance,$workflow); return bless { instance => $instance, session => $session,