Merge branch 'master' into WebGUI8

This commit is contained in:
Graham Knop 2010-04-13 07:50:02 -05:00
commit 2400f19099
797 changed files with 33894 additions and 27196 deletions

View file

@ -294,49 +294,51 @@ inserts the ad into the adspace...
=cut
sub onCompletePurchase {
my $self = shift;
my $item = shift;
my $self = shift;
my $session = $self->session;
my $item = shift;
my $options = $self->getOptions;
my $ad;
# LATER: if we use Temp Storage for the image we need to move it to perm storage
my $userId = $item->transaction->get('userId');
if( $options->{adId} ne '' ) {
$ad = WebGUI::AdSpace::Ad->new($self->session,$options->{adId});
my $clicks = $options->{clicks} + $ad->get('clicksBought');
$ad = WebGUI::AdSpace::Ad->new($session, $options->{adId});
my $clicks = $options->{clicks} + $ad->get('clicksBought');
my $impressions = $options->{impressions} + $ad->get('impressionsBought');
$ad->set({
title => $options->{'adtitle'},
clicksBought => $clicks,
impressionsBought => $impressions,
url => $options->{'link'},
storageId => $options->{'image'},
title => $options->{'adtitle'},
clicksBought => $clicks,
impressionsBought => $impressions,
url => $options->{'link'},
storageId => $options->{'image'},
});
}
else {
$ad = WebGUI::AdSpace::Ad->create($self->session,$self->adSpace,{
title => $options->{'adtitle'},
clicksBought => $options->{'clicks'},
impressionsBought => $options->{'impressions'},
url => $options->{'link'},
storageId => $options->{'image'},
ownerUserId => $self->session->user->userId,
isActive => 1,
type => 'image',
priority => $self->priority,
adSpace => $self->adSpace,
$ad = WebGUI::AdSpace::Ad->create($session, $self->adSpace, {
title => $options->{'adtitle'},
clicksBought => $options->{'clicks'},
impressionsBought => $options->{'impressions'},
url => $options->{'link'},
storageId => $options->{'image'},
ownerUserId => $userId,
isActive => 1,
type => 'image',
priority => $self->priority,
adSpace => $self->adSpace,
});
}
WebGUI::AssetCollateral::Sku::Ad::Ad->create($self->session,{
userId => $item->transaction->get('userId'),
transactionItemId => $item->getId,
adId => $ad->getId,
clicksPurchased => $options->{'clicks'},
impressionsPurchased => $options->{'impressions'},
dateOfPurchase => $item->transaction->get('dateOfPurchase'),
storedImage => $options->{'image'},
isDeleted => 0,
WebGUI::AssetCollateral::Sku::Ad::Ad->create($session, {
userId => $userId,
transactionItemId => $item->getId,
adId => $ad->getId,
clicksPurchased => $options->{'clicks'},
impressionsPurchased => $options->{'impressions'},
dateOfPurchase => $item->transaction->get('dateOfPurchase'),
storedImage => $options->{'image'},
isDeleted => 0,
});
}

View file

@ -67,7 +67,7 @@ This asset makes donations possible.
=head1 SYNOPSIS
use WebGUI::Asset::Sku::Dnoation;
use WebGUI::Asset::Sku::Donation;
=head1 METHODS

View file

@ -236,7 +236,7 @@ sub onCompletePurchase {
my ($self, $item) = @_;
my $badgeInfo = $self->getOptions;
$badgeInfo->{purchaseComplete} = 1;
$badgeInfo->{userId} = $self->session->user->userId; # they have to be logged in at this point
$badgeInfo->{userId} = $item->transaction->get('userId'); # they have to be logged in at this point
$badgeInfo->{transactionItemId} = $item->getId;
$self->session->db->setRow("EMSRegistrant","badgeId", $badgeInfo);
return undef;

View file

@ -123,37 +123,37 @@ property warranty => (
);
property variantsJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
property accessoryJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
property relatedJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
property specificationJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
property featureJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
property benefitJSON => (
##Collateral data is stored as JSON in here
noFormPost => 0,
noFormPost => 1,
default => '[]',
fieldType => "textarea",
);
@ -1655,8 +1655,9 @@ sub view {
my $error = shift;
my $session = $self->session;
my $cache = $session->cache;
my $cacheKey = $self->getWwwCacheKey( 'view' );
if (!$session->var->isAdminOn && $self->get("cacheTimeout") > 10){
my $out = $cache->get("view_".$self->getId);
my $out = $cache->get( $cacheKey );
return $out if $out;
}
my (%data, $segment, %var, @featureloop, @benefitloop, @specificationloop, @accessoryloop, @relatedloop);
@ -1859,7 +1860,7 @@ sub view {
my $out = $self->processTemplate(\%var,undef,$self->{_viewTemplate});
if (!$self->session->var->isAdminOn && $self->cacheTimeout > 10 && $self->{_hasAddedToCart} != 1){
$cache->set("view_".$self->getId, $out, $self->cacheTimeout);
$cache->set( $cacheKey, $out, $self->cacheTimeout );
}
return $out;
}