From e7ce9a90b7e42e2c20973a2caae94b69c88ff8bb Mon Sep 17 00:00:00 2001 From: daviddelikat Date: Fri, 6 Nov 2009 18:50:09 -0600 Subject: [PATCH] bit --- .../Asset/Wobject/EventManagementSystem.pm | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index ce80a694e..41e29f6e0 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -375,7 +375,7 @@ may be SQL optimized for quick access sub getLocations { my $self = shift; - my $dateRef = shift || [ ]; + my $dateRef = shift ; my %hash; my %hashDate; @@ -384,13 +384,30 @@ sub getLocations { # this is a really compact 'uniq' operation my @locations = map { $h{$_}++ == 0 ? $_ : () } ( map { $_->get('location') } ( @$tickets ) ); # the dates have the time data removed with a pattern substitution - push @$dateRef, map { s/\s*\d+:\d+(:\d+)?//; $h{$_}++ == 0 ? $_ : () } ( map { $_->get('startDate') } ( @$tickets ) ); + if( $dateRef ) { + push @$dateRef, map { s/\s*\d+:\d+(:\d+)?//; $h{$_}++ == 0 ? $_ : () } ( map { $_->get('startDate') } ( @$tickets ) ); + } return @locations; } #------------------------------------------------------------------- +=head2 getNextSubmissionId + +get a sequence number for the submission id + +=cut + +sub getNextSubmissionId { + my $self = shift; + my ($submissionId) = $self->session->db->read('select nextSubmissionId from EventManagementSystem where assetId = ?', [ $self->getId ] )->array; + $self->update( { nextSubmissionId => ($submissionId + 1) } ); + return $submissionId; +} + +#------------------------------------------------------------------- + =head2 getRegistrant ( badgeId ) Returns a hash reference containing the properties of a registrant.