rfe: Town Hall: EMS badge early bird field/discount

This commit is contained in:
JT Smith 2008-09-16 21:00:47 +00:00
parent 2afadf1cf7
commit 7b21d656ef
4 changed files with 101 additions and 10 deletions

View file

@ -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

View file

@ -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;
}
#----------------------------------------------------------------------------

View file

@ -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');
}
#-------------------------------------------------------------------

View file

@ -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,