a number of bug fixes

This commit is contained in:
JT Smith 2008-04-04 22:42:54 +00:00
parent cdc48cf9f6
commit 8dd5a6bd2c
9 changed files with 134 additions and 145 deletions

View file

@ -47,9 +47,13 @@ Does some bookkeeping to keep track of limited quantities of tickets that are av
sub addToCart {
my ($self, $badgeInfo) = @_;
$self->session->db->write("insert into EMSRegistrantTicket (badgeId, ticketAssetId) values (?,?)",
[$badgeInfo->{badgeId},$self->getId]);
$self->SUPER::addToCart($badgeInfo);
my $db = $self->session->db;
my @params = ($badgeInfo->{badgeId},$self->getId);
# don't let them add a ticket they already have
unless ($db->quickScalar("select count(*) from EMSRegistrantTicket where badgeId=? and ticketAssetId=?",\@params)) {
$db->write("insert into EMSRegistrantTicket (badgeId, ticketAssetId) values (?,?)", \@params);
$self->SUPER::addToCart($badgeInfo);
}
}
#-------------------------------------------------------------------