Merge branch 'master' of git@github.com:plainblack/webgui

This commit is contained in:
Martin Kamerbeek 2009-10-23 15:14:26 +00:00
commit 3ba2ecf307
5 changed files with 38 additions and 6 deletions

View file

@ -32,7 +32,7 @@ my $session = start(); # this line required
# upgrade functions go here # upgrade functions go here
reKeyTemplateAttachments($session); reKeyTemplateAttachments($session);
addSelectPaymentGatewayTemplateToSettings($session);
finish($session); # this line required finish($session); # this line required
@ -55,6 +55,15 @@ sub reKeyTemplateAttachments {
print "DONE!\n" unless $quiet; print "DONE!\n" unless $quiet;
} }
#----------------------------------------------------------------------------
# add default template for selectPaymentGateway
sub addSelectPaymentGatewayTemplateToSettings {
my $session = shift;
print "\tAdding select payment gateway template to settings... " unless $quiet;
$session->db->write("insert into settings values ('selectGatewayTemplateId', '2GxjjkRuRkdUg_PccRPjpA');");
print "Done.\n" unless $quiet;
}
#sub exampleFunction { #sub exampleFunction {
# my $session = shift; # my $session = shift;
# print "\tWe're doing some stuff here that you should know about... " unless $quiet; # print "\tWe're doing some stuff here that you should know about... " unless $quiet;

View file

@ -180,6 +180,13 @@ sub www_editSettings {
label => $i18n->get("edit address template"), label => $i18n->get("edit address template"),
hoverHelp => $i18n->get("edit address template help"), hoverHelp => $i18n->get("edit address template help"),
); );
$form->template(
name => "selectGatewayTemplateId",
value => $setting->get("selectGatewayTemplateId"),
label => $i18n->get("select gateway template"),
namespace => "Shop/selectGateway",
hoverHelp => $i18n->get("select gateway template help"),
);
$form->template( $form->template(
name => "shopMyPurchasesTemplateId", name => "shopMyPurchasesTemplateId",
value => $setting->get("shopMyPurchasesTemplateId"), value => $setting->get("shopMyPurchasesTemplateId"),
@ -226,7 +233,7 @@ sub www_editSettingsSave {
# Save shop templates # Save shop templates
foreach my $template (qw(shopMyPurchasesDetailTemplateId shopMyPurchasesTemplateId foreach my $template (qw(shopMyPurchasesDetailTemplateId shopMyPurchasesTemplateId
shopCartTemplateId shopAddressBookTemplateId shopAddressTemplateId shopReceiptEmailTemplateId)) { shopCartTemplateId shopAddressBookTemplateId shopAddressTemplateId selectGatewayTemplateId shopReceiptEmailTemplateId)) {
$setting->set($template, $form->get($template, "template")); $setting->set($template, $form->get($template, "template"));
} }

View file

@ -423,12 +423,16 @@ sub www_selectPaymentGateway {
# TODO: If only one payOption exists, just send us there # TODO: If only one payOption exists, just send us there
# In order to do this, the PayDriver must give us a direct URL to go to # In order to do this, the PayDriver must give us a direct URL to go to
my $output .= $i18n->get('choose payment gateway message'); my $var;
my @paymentGateways;
foreach my $payOption ( values %{$payOptions} ) { foreach my $payOption ( values %{$payOptions} ) {
$output .= $payOption->{button} . '<br />'; push @paymentGateways, $payOption;
} }
$var->{ paymentGateways } = \@paymentGateways;
return $session->style->userStyle( $output ); $var->{ choose } = $i18n->get('choose payment gateway message');
$session->log->warn('###'.$session->setting->get("selectGatewayTemplateId"));
my $template = WebGUI::Asset::Template->new($session, $session->setting->get("selectGatewayTemplateId"));
return $session->style->userStyle($template->process($var));
} }
1; 1;

View file

@ -669,6 +669,18 @@ our $I18N = {
context => q|commerce setting help| context => q|commerce setting help|
}, },
'select gateway template' => {
message => q|Select Gateway Template|,
lastUpdated => 0,
context => q|commerce setting|
},
'select gateway template help' => {
message => q|This template is the template for the Select Payment Gateway step.|,
lastUpdated => 0,
context => q|commerce setting help|
},
'transactions' => { 'transactions' => {
message => q|Transactions|, message => q|Transactions|,
lastUpdated => 0, lastUpdated => 0,