Make the Redeem Subscription code template user selectable in the Subscription Asset.

Add Help, i18n for that template.
This commit is contained in:
Colin Kuskie 2008-12-29 17:31:36 +00:00
parent 81c9d117e5
commit 47eb1998dd
5 changed files with 68 additions and 17 deletions

View file

@ -13,6 +13,7 @@
- fixed #9368: Gallery: All children included into navigation
- fixed #9349: CS archival broken after update (Bernd Kalbfuß-Zimmermann)
- fixed Display of Interval form control in Thingy and User profiling did not show units, only seconds.
- fixed #9374: Subscription Asset: Redeem subscription template not documented, or user selectable
7.6.7
- fixed #9263: Thingy possibleValues processing, and List type autodetection.

View file

@ -34,6 +34,7 @@ my $session = start(); # this line required
# upgrade functions go here
setDefaultItransactCredentialTemplate($session);
hideGalleryPhotos($session);
addSubscriptionRedeemTemplateSetting($session);
finish($session); # this line required
@ -58,6 +59,18 @@ sub setDefaultItransactCredentialTemplate {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub addSubscriptionRedeemTemplateSetting {
my $session = shift;
print "\tAdd a field to the Subscription Asset so the user can select which Redeem Subscription code template to use... " unless $quiet;
# and here's our code
$session->db->write(<<EOSQL);
alter table Subscription add column redeemSubscriptionCodeTemplateId char(22) NOT NULL default ''
EOSQL
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Describe what our function does
sub hideGalleryPhotos {

View file

@ -99,6 +99,14 @@ sub definition {
label => $i18n->get("template"),
hoverHelp => $i18n->get("template help"),
},
redeemSubscriptionCodeTemplateId => {
tab => "display",
fieldType => "template",
namespace => "Operation/RedeemSubscription",
defaultValue => 'PBtmpl0000000000000053',
label => $i18n->get("redeem subscription code template"),
hoverHelp => $i18n->get("redeem subscription code template help"),
},
thankYouMessage => {
tab => "properties",
defaultValue => $i18n->get("default thank you message"),
@ -980,7 +988,7 @@ sub www_redeemSubscriptionCode {
$f->submit;
$var->{ codeForm } = $f->print;
return $self->processStyle($self->processTemplate($var, 'PBtmpl0000000000000053'));
return $self->processStyle($self->processTemplate($var, $self->get('redeemSubscriptionCodeTemplateId')));
}
1;

View file

@ -4,8 +4,8 @@ use strict;
our $HELP = {
'template' => {
'template' => {
title => 'subscription template',
body => '',
isa => [
@ -32,6 +32,20 @@ our $HELP = {
],
},
'redeem subscription template' => {
title => 'help redeem code template title',
body => '',
isa => [ ],
fields => [ ],
variables => [
{ name => 'batchDescription' , required=>1},
{ name => 'message' , required=>1 },
{ name => 'codeForm' , required=>1 },
],
related => [
],
},
};
1;

View file

@ -358,20 +358,23 @@ characters long.</p>|,
context => q|Shows up in the selection part of listSubscriptionCodes.|
},
'help redeem code template body' => {
message => q|The following template variables are available through this template:<br />
<br />
<b>batchDescription</b><br />
The description of the batch tied to the subscription code.<br />
<br />
<b>message</b><br />
The message that gives the result of your action. Depending on what you've done it says that you can enter a code, you've entered the wrong code, or you've successfully redeemed your code.<br />
<br />
<b>codeForm</b><br />
The form in which the user can enter his subscription code.<br />|,
lastUpdated => 1215618652,
context => q|The body of the help page of the code redemption template.|
},
'batchDescription' => {
message => q|The description of the batch tied to the subscription code.|,
context => q|Template variable in the redeem subscription code template|,
lastUpdated => 0,
},
'message' => {
message => q|The message that gives the result of your action. Depending on what you've done it says that you can enter a code, you've entered the wrong code, or you've successfully redeemed your code.|,
context => q|Template variable in the redeem subscription code template|,
lastUpdated => 0,
},
'codeForm' => {
message => q|The form in which the user can enter his subscription code.|,
context => q|Template variable in the redeem subscription code template|,
lastUpdated => 0,
},
'help redeem code template title' => {
message => q|Redeem subscription code template|,
@ -431,6 +434,18 @@ The form in which the user can enter his subscription code.<br />|,
context => q|Asset property hover help|,
},
'redeem subscription code template' => {
message => q|Redeem Subscription template|,
lastUpdated => 0,
context => q|Asset property|,
},
'redeem subscription code template help' => {
message => q|Choose the template that is used to display the screen where users redeem subscription codes.|,
lastUpdated => 0,
context => q|Asset property hover help|,
},
'batch name' => {
message => q|Batch Name|,
lastUpdated => 0,
@ -508,7 +523,7 @@ The form in which the user can enter his subscription code.<br />|,
lastUpdated => 0,
context => q|Label for swith to set subscription to be recurring or not.|
},
'recurring subscription description' => {
message => q|If set to yes, the customer will be charged after each term for a new one and the subscription
will be renewed for an extra term. If set to no, the customer will be charged for the first term only, and after one