diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 758aca738..ba1c8cc9f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,7 @@ - rfe: Process Macros in HTTP Proxy's URL - rfe: TimeZone for the User Profiles displays incorrectly after installation - rfe: choice of type of redirect on redirect assets + - rfe: Town Hall: EMS badge early bird field/discount - rewrite macro parser, improving speed and making parameter parsing more sane - Made the charset metatag the highest thing in the head block. - fixed: AssetProxy allows proxying content in the trash or clipboard diff --git a/docs/upgrades/upgrade_7.5.21-7.6.0.pl b/docs/upgrades/upgrade_7.5.21-7.6.0.pl index b121480e0..423106df9 100644 --- a/docs/upgrades/upgrade_7.5.21-7.6.0.pl +++ b/docs/upgrades/upgrade_7.5.21-7.6.0.pl @@ -35,14 +35,28 @@ addSortOrderToFolder( $session ); addLoginTimeStats( $session ); addEMSBadgeTemplate ( $session ); redirectChoice ($session); +badgePriceDates ($session); finish($session); # this line required +#---------------------------------------------------------------------------- +sub badgePriceDates { + my $session = shift; + print "\tAllowing badges to have multiple prices set by date." unless $quiet; + my $db = $session->db; + $db->write("alter table EMSBadge add column earlyBirdPrice float not null default 0.0"); + $db->write("alter table EMSBadge add column earlyBirdPriceEndDate bigint"); + $db->write("alter table EMSBadge add column preRegistrationPrice float not null default 0.0"); + $db->write("alter table EMSBadge add column preRegistrationPriceEndDate bigint"); + print "Done.\n" unless $quiet; +} #---------------------------------------------------------------------------- sub fixIsPublicOnTemplates { my $session = shift; + print "\tFixing 'is public' on templates" unless $quiet; $session->db->write('UPDATE `assetIndex` SET `isPublic` = 0 WHERE assetId IN (SELECT assetId FROM asset WHERE className IN ("WebGUI::Asset::RichEdit", "WebGUI::Asset::Snippet", "WebGUI::Asset::Template") )'); + print "Done.\n" unless $quiet; } #---------------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Sku/EMSBadge.pm b/lib/WebGUI/Asset/Sku/EMSBadge.pm index 48ca37c9b..cc5321114 100644 --- a/lib/WebGUI/Asset/Sku/EMSBadge.pm +++ b/lib/WebGUI/Asset/Sku/EMSBadge.pm @@ -84,6 +84,34 @@ sub definition { label => $i18n->get("price"), hoverHelp => $i18n->get("price help"), }, + earlyBirdPrice => { + tab => "shop", + fieldType => "float", + defaultValue => 0.00, + label => $i18n->get("early bird price"), + hoverHelp => $i18n->get("early bird price help"), + }, + earlyBirdPriceEndDate => { + tab => "shop", + fieldType => "date", + defaultValue => undef, + label => $i18n->get("early bird price end date"), + hoverHelp => $i18n->get("early bird price end date help"), + }, + preRegistrationPrice => { + tab => "shop", + fieldType => "float", + defaultValue => 0.00, + label => $i18n->get("pre registration price"), + hoverHelp => $i18n->get("pre registration price help"), + }, + preRegistrationPriceEndDate => { + tab => "shop", + fieldType => "date", + defaultValue => undef, + label => $i18n->get("pre registration price end date"), + hoverHelp => $i18n->get("pre registration price end date help"), + }, seatsAvailable => { tab => "shop", fieldType => "integer", @@ -174,7 +202,13 @@ Returns the price field value. sub getPrice { my $self = shift; - return $self->get("price"); + if ($self->get('earlyBirdPriceEndDate') < time) { + return $self->get('price'); + } + elsif ($self->get('preRegistrationPriceEndDate') < time) { + return $self->get('earlyBirdPrice'); + } + return $self->get('preRegistrationPrice'); } #------------------------------------------------------------------- diff --git a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm index 5fa0834eb..c22ec163f 100644 --- a/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm +++ b/lib/WebGUI/i18n/English/Asset_EventManagementSystem.pm @@ -1037,14 +1037,62 @@ our $I18N = { lastUpdated => 1138312761, }, + 'pre registration price' => { + message => q|Pre-Registration Price|, + lastUpdated => 0, + context => q|field label|, + }, + + 'pre registration price help' => { + message => q|The special price of this badge if the user orders insanely early.|, + lastUpdated => 0, + context => q|field label help|, + }, + + 'pre registration price end date' => { + message => q|Pre-Registration Price End Date|, + lastUpdated => 0, + context => q|field label|, + }, + + 'pre registration price end date help' => { + message => q|The date that the pre-registration price is replaced by the early bird price.|, + lastUpdated => 0, + context => q|field label help|, + }, + 'price' => { - message => q|Price|, - lastUpdated => 1138312761, + message => q|Full Price|, + lastUpdated => 1221590520, context => q|field label|, }, 'price help' => { - message => q|How much do you want to charge for this item?|, + message => q|The regular price of this badge.|, + lastUpdated => 1221590773, + context => q|field label help|, + }, + + 'early bird price' => { + message => q|Early Bird Price|, + lastUpdated => 1221590520, + context => q|field label|, + }, + + 'early bird price help' => { + message => q|The special price of this badge if the user orders early.|, + lastUpdated => 0, + context => q|field label help|, + }, + + 'early bird price end date' => { + message => q|Early Bird Price End Date|, + lastUpdated => 0, + context => q|field label|, + }, + + 'early bird price end date help' => { + message => q|The date that the early bird price is replaced by the full price.|, lastUpdated => 0, context => q|field label help|, }, @@ -1060,12 +1108,6 @@ our $I18N = { context => q|field label|, }, - 'price help' => { - message => q|How much do you want to charge for this item?|, - lastUpdated => 0, - context => q|field label help|, - }, - 'add/edit useSalesTax' => { message => q|Use Sales Tax?|, lastUpdated => 1160109884,