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

@ -261,7 +261,7 @@ sub view {
$book->submit(value=>$i18n->get("populate from address book"));
# instanciate address
my $address = WebGUI::Shop::AddressBook->create($self->session)->getAddress($form->get("addressId")) if ($form->get("addressId"));
my $address = WebGUI::Shop::AddressBook->newBySession($self->session)->getAddress($form->get("addressId")) if ($form->get("addressId"));
# build the form that the user needs to fill out with badge holder information
my $info = WebGUI::HTMLForm->new($self->session, action=>$self->getUrl);

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