diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
index 8e291dde5..3c38f7697 100644
--- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
+++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm
@@ -1991,6 +1991,7 @@ sub www_printRemainingTickets {
EMSTicket.location as ticketLocation,
EMSTicket.relatedBadgeGroups,
EMSTicket.relatedRibbons,
+ EMSTicket.eventMetaData,
(seatsAvailable - (select count(*) from EMSRegistrantTicket where ticketAssetId = asset.assetId)) as seatsRemaining
FROM
asset
@@ -2011,6 +2012,19 @@ sub www_printRemainingTickets {
$var->{'tickets_loop'} = [];
while (my $hash = $sth->hashRef) {
my $seatsRemaining = $hash->{seatsRemaining};
+ #Put start time in the correct timezone
+ my $startTime = WebGUI::DateTime->new($hash->{ticketStart})->set_time_zone($self->get('timezone'));
+ $hash->{ticketStart} = $startTime->strftime('%F %R');
+ $hash->{ticketStart_epoch} = $startTime->epoch;
+ #Add meta data fields
+ my $data = $hash->{eventMetaData} || '{}';
+ my $meta = JSON->new->decode($data);
+ foreach my $key (keys %{$meta}) {
+ my $tmplKey = $key;
+ $tmplKey =~ s/[\s\W]/_/g;
+ $hash->{'ticketMeta_'.$tmplKey} = $meta->{$key};
+ }
+ #Add to the loop
for (my $i = 0; $i < $seatsRemaining; $i++ ) {
push(@{$var->{'tickets_loop'}},$hash);
}
diff --git a/lib/WebGUI/Help/Asset_EventManagementSystem.pm b/lib/WebGUI/Help/Asset_EventManagementSystem.pm
index 9bb4a5115..16c9a3780 100644
--- a/lib/WebGUI/Help/Asset_EventManagementSystem.pm
+++ b/lib/WebGUI/Help/Asset_EventManagementSystem.pm
@@ -239,11 +239,13 @@ our $HELP = {
{ 'name' => 'ticketDuration'},
{ 'name' => 'ticketLocation'},
{ 'name' => 'ticketEventNumber'},
+ { 'name' => 'ticketMeta_[LABEL]'},
{ 'name' => 'seatsRemaining'},
{ 'name' => 'seatsAvailable'},
{ 'name' => 'price'},
{ 'name' => 'relatedRibbons'},
{ 'name' => 'relatedBadgeGroups'},
+ { 'name' => 'eventMetaData'},
{ 'name' => 'title'},
{ 'name' => 'menuTitle'},
{ 'name' => 'url'},
diff --git a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm
index 2327fb730..a81e3e7c7 100644
--- a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm
+++ b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm
@@ -2084,6 +2084,17 @@ normal templates.|,
context => q|Field Label|,
},
+ 'eventMetaData' => {
+ message => q|Meta data for the event returned as a JSON data structure|,
+ lastUpdated => 1147050475,
+ context => q|Field Label|,
+ },
+
+ 'ticketMeta_[LABEL]' => {
+ message => q|Value for the meta data field [LABEL]. Non word and whitespace characters in [LABEL] should be replaced with an underscore.
Ex: Meta Data Label: "First Name" should be referenced: <tmpl_var ticketMeta_First_Name> and so on|,
+ lastUpdated => 1147050475,
+ context => q|Field Label|,
+ },
};
diff --git a/t/Asset/Wobject/EventManagementSystem.t b/t/Asset/Wobject/EventManagementSystem.t
index 8a7c73747..69c6cf202 100644
--- a/t/Asset/Wobject/EventManagementSystem.t
+++ b/t/Asset/Wobject/EventManagementSystem.t
@@ -78,7 +78,7 @@ isa_ok($ems, 'WebGUI::Asset::Wobject::EventManagementSystem');
# Test to see if we can set new values
my $newEMSSettings = {
- timezone => 'America/New York',
+ timezone => 'America/New_York',
};
# update the new values for this instance
@@ -227,7 +227,8 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } );
'revisedBy' => ignore(),
'isExportable' => ignore(),
'creationDate' => ignore(),
- 'ticketStart' => '2009-01-01 14:00:00'
+ 'ticketStart' => '2009-01-01 09:00',
+ 'ticketStart_epoch' => '1230818400',
};
my $ticket2 = {
@@ -266,7 +267,8 @@ $templateMock->mock('process', sub { $templateVars = $_[1]; } );
'revisedBy' => ignore(),
'isExportable' => ignore(),
'creationDate' => ignore(),
- 'ticketStart' => '2009-01-01 14:00:00'
+ 'ticketStart' => '2009-01-01 09:00',
+ 'ticketStart_epoch' => '1230818400',
};
my @ticketArray = ();