Reorganize AdSpace properties for prices and permissions.

Remove click and impression prices.  Remove groupToPurchase.
Expose minimum clicks and impressions to the UI.
This commit is contained in:
Colin Kuskie 2009-09-02 10:42:29 -07:00
parent 7b15f13ffb
commit fe253042ea
4 changed files with 62 additions and 23 deletions

View file

@ -302,18 +302,10 @@ A human readable title for this ad space.
A human readable description for this ad space.
=head4 costPerImpression
A float that represents how much it will cost an advertiser every time an ad is viewed in this ad space.
=head4 minimumImpressions
An integer indicating the minimum number of impressions an advertiser is allowed to purchase.
=head4 costPerClick
A float that represents how much it will cost an advertiser everytime someone clicks on an ad in this ad space.
=head4 minimumClicks
An integer indicating the minimum number of clicks an advertiser is allowed to purchase.
@ -344,8 +336,6 @@ sub set {
$self->{_properties}{title} = exists $properties->{title} ? $properties->{title}
: $self->{_properties}{title} || "Untitled";
$self->{_properties}{description} = exists $properties->{description} ? $properties->{description} : $self->{_properties}{description};
$self->{_properties}{costPerImpression} = exists $properties->{costPerImpression} ? $properties->{costPerImpression} : $self->{_properties}{costPerImpression};
$self->{_properties}{costPerClick} = exists $properties->{costPerClick} ? $properties->{costPerClick} : $self->{_properties}{costPerClick};
$self->{_properties}{minimumImpressions} = $properties->{minimumImpressions} || $self->{_properties}{minimumImpressions};
$self->{_properties}{minimumClicks} = $properties->{minimumClicks} || $self->{_properties}{minimumClicks};
$self->{_properties}{groupToPurchase} = $properties->{groupToPurchase} || $self->{_properties}{groupToPurchase} || "3";

View file

@ -345,6 +345,20 @@ sub www_editAdSpace {
hoverHelp => $i18n->get("description help"),
label => $i18n->get("description"),
);
$f->integer(
name => "minimumClicks",
value => $session->form->get('minimumClicks') || ($adSpace && $adSpace->get('minimumClicks')),
defaultValue => 1000,
hoverHelp => $i18n->get("minimum clicks help"),
label => $i18n->get("minimum clicks"),
);
$f->integer(
name => "minimumImpressions",
value => $session->form->get('minimumImpressions') || ($adSpace && $adSpace->get('minimumImpressions')),
defaultValue => 1000,
hoverHelp => $i18n->get("minimum impressions help"),
label => $i18n->get("minimum impressions"),
);
$f->integer(
name => "width",
value => $session->form->get('width') || ($adSpace && $adSpace->get('width')),
@ -396,11 +410,13 @@ sub www_editAdSpaceSave {
my $i18n = WebGUI::International->new( $session, "AdSpace" );
my %properties = (
name => $session->form->process("name", "text"),
title => $session->form->process("title", "text"),
description => $session->form->process("description", "textarea"),
width => $session->form->process("width", "integer"),
height => $session->form->process("height", "integer"),
name => $session->form->process("name", "text"),
title => $session->form->process("title", "text"),
description => $session->form->process("description", "textarea"),
width => $session->form->process("width", "integer"),
height => $session->form->process("height", "integer"),
minimumClicks => $session->form->process("minimumClicks", "integer"),
minimumImpressions => $session->form->process("minimumImpressions", "integer"),
);
### Validate form entry

View file

@ -294,15 +294,35 @@ our $I18N = {
lastUpdated => 0,
},
'error heading' => {
message => q{There was an error with your Ad Space:},
lastUpdated => 0,
},
'error heading' => {
message => q{There was an error with your Ad Space:},
lastUpdated => 0,
},
'error invalid characters' => {
message => q{There are invalid characters in the title field. Please use only letters, numbers, and spaces.},
lastUpdated => 0,
},
'error invalid characters' => {
message => q{There are invalid characters in the title field. Please use only letters, numbers, and spaces.},
lastUpdated => 0,
},
'minimum clicks' => {
message => q{Minimum Clicks To Buy.},
lastUpdated => 0,
},
'minimum clicks help' => {
message => q{This sets a minimum number of clicks that a user would buy when purchasing an Ad for this AdSpace.},
lastUpdated => 0,
},
'minimum impressions' => {
message => q{Minimum Impressions To Buy.},
lastUpdated => 0,
},
'minimum impressions help' => {
message => q{This sets a minimum number of impressions that a user would buy when purchasing an Ad for this AdSpace.},
lastUpdated => 0,
},
};