Can no longer buy badges from receipt or direct link page if quantity is empty

This commit is contained in:
Kaleb Murphy 2008-09-12 16:02:09 +00:00
parent 4c85377156
commit c678529589
3 changed files with 13 additions and 1 deletions

View file

@ -36,6 +36,8 @@
- fixed: If a user clicks on an unsubscribe link in an email and they are not logged into WebGUI, they are now prompted to log in so that they can then unsbscribe.
- fixed: Using a password recovery token a second time informs the user of the reuse instead of having a style inside a style with a login form.
- fixed: Thingy Things can now have no fields and still be functional.
- fixed: Can no longer buy badges from receipt or direct link page if quantity is empty
7.5.22
- fixed: Layout template now gets prepared correctly
- fixed: When user does not have permissions to search/edit a thing a proper error is shown.

View file

@ -51,6 +51,9 @@ Adds this badge as configured for an individual to the cart.
sub addToCart {
my ($self, $badgeInfo) = @_;
if($self->getQuantityAvailable() < 1){
return WebGUI::International->new($self->session, "Asset_EventManagementSystem")->get('no more available');
}
$badgeInfo->{badgeId} = "new";
$badgeInfo->{badgeAssetId} = $self->getId;
$badgeInfo->{emsAssetId} = $self->getParent->getId;
@ -397,7 +400,9 @@ sub view {
name => 'email',
defaultValue => $form->get('email','email'),
});
$vars{submitAddress} = WebGUI::Form::submit($session, {value => $i18n->get('add to cart'),});
if($self->getQuantityAvailable() > 0){
$vars{submitAddress} = WebGUI::Form::submit($session, {value => $i18n->get('add to cart'),});
}
$vars{title} = $self->getTitle;
$vars{description} = $self->get('description');

View file

@ -895,6 +895,11 @@ our $I18N = {
context => q|heading on add badge to cart screen|,
},
'no more available' => {
message => q|Error: No more items available for purcahse.|,
lastUpdated => 0,
},
'add to cart' => {
message => q|Add To Cart|,
lastUpdated => 0,