new i18n api requiring $session

This commit is contained in:
Colin Kuskie 2006-01-12 17:49:20 +00:00
parent 877bf082a0
commit 01d95a265e
141 changed files with 2266 additions and 1745 deletions

View file

@ -82,10 +82,11 @@ sub configurationForm {
$form = shift;
$f = WebGUI::HTMLForm->new($self->session);
my $i18n = WebGUI::International->new($self->session, 'Commerce');
$f->yesNo(
-name => $self->prepend('enabled'),
-value => $self->enabled,
-label => WebGUI::International::get('enable', 'Commerce'),
-label => $i18n->get('enable'),
);
$f->raw($form);
@ -420,7 +421,7 @@ The period you want the name for.
sub recurringPeriodValues {
my ($i18n, %periods);
$i18n = WebGUI::International->new('Commerce');
$i18n = WebGUI::International->new($self->session, 'Commerce');
tie %periods, "Tie::IxHash";
%periods = (
Weekly => $i18n->get('weekly'),

View file

@ -106,7 +106,7 @@ sub checkoutForm {
my ($self, $u, $f, %months, %years, $i18n);
$self = shift;
$i18n = WebGUI::International->new('CommercePaymentITransact');
$i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$u = WebGUI::User->new($self->session->user->profileField("userId"));
@ -433,7 +433,7 @@ sub checkoutForm {
sub configurationForm {
my ($self, $f, $i18n);
$self = shift;
$i18n = WebGUI::International->new('CommercePaymentITransact');
$i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$f = WebGUI::HTMLForm->new($self->session);
$f->text(
@ -567,7 +567,8 @@ sub errorCode {
#-------------------------------------------------------------------
sub name {
return WebGUI::International::get('module name', "CommercePaymentITransact");
my $i18n = WebGUI::International->new($self->session, "CommercePaymentITransact");
return $i18n->get('module name');
}
#-------------------------------------------------------------------
@ -584,10 +585,11 @@ sub normalTransaction {
$normal = shift;
if ($normal) {
$i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$self->{_recurring} = 0;
$self->{_transactionParams} = {
AMT => sprintf('%.2f', $normal->{amount}),
DESCRIPTION => $normal->{description} || WebGUI::International::get('no description', "CommercePaymentITransact"),
DESCRIPTION => $normal->{description} || $i18n->get('no description'),
INVOICENUMBER => $normal->{invoiceNumber},
ORGID => $normal->{id},
};
@ -608,13 +610,14 @@ sub recurringTransaction {
$initialAmount = ($self->session->datetime->getDaysInMonth(time) - ($self->session->datetime->localtime)[2])*$recurring->{amount}/$self->session->datetime->getDaysInMonth(time);
$initialAmount = $recurring->{amount} if ($initialAmount < 1);
$self->{_recurring} = 1;
$i18n = WebGUI::International->new($self->session, 'CommercePaymentITransact');
$self->{_transactionParams} = {
START => $recurring->{start} || $self->session->datetime->epochToHuman($self->session->datetime->addToDate(time, 0, 0, 1), '%m%d%y'),
AMT => sprintf('%.2f', $recurring->{amount}),
INITIALAMT => sprintf('%.2f', $initialAmount),
TERM => $recurring->{term} || 9999,
RECIPE => _resolveRecipe($recurring->{payPeriod}),
DESCRIPTION => $recurring->{description} || WebGUI::International::get('no description', "CommercePaymentITransact"),
DESCRIPTION => $recurring->{description} || $i18n->get('no description'),
INVOICENUMBER => $recurring->{invoiceNumber},
ORGID => $recurring->{id},
};

View file

@ -48,10 +48,11 @@ sub configurationForm {
$form = shift;
$f = WebGUI::HTMLForm->new($self->session);
my $i18n = WebGUI::International->new($self->session, 'Commerce');
$f->yesNo(
-name => $self->prepend('enabled'),
-value => $self->enabled,
-label => WebGUI::International::get('enable', 'Commerce'),
-label => $i18n->get('enable'),
);
$f->raw($form);

View file

@ -24,9 +24,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByPrice');
$f->float(
-name => $self->prepend('percentageOfPrice'),
-label => WebGUI::International::get('percentage of price', 'CommerceShippingByPrice'),
-label => $i18n->get('percentage of price'),
-value => $self->get('percentageOfPrice')
);
@ -45,7 +46,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
return WebGUI::International::get('title', 'CommerceShippingByPrice');
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByPrice');
return $i18n->get('title');
}
1;

View file

@ -24,9 +24,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByWeight');
$f->float(
-name => $self->prepend('pricePerUnitWeight'),
-label => WebGUI::International::get('price per weight', 'CommerceShippingByWeight'),
-label => $i18n->get('price per weight'),
-value => $self->get('pricePerUnitWeight')
);
@ -45,7 +46,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
return WebGUI::International::get('title', 'CommerceShippingByWeight');
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingByWeight');
return $i18n->get('title');
}
1;

View file

@ -20,9 +20,10 @@ sub configurationForm {
$self = shift;
$f = WebGUI::HTMLForm->new($self->session);
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingPerTransaction');
$f->float(
-name => $self->prepend('pricePerTransaction'),
-label => WebGUI::International::get('price', 'CommerceShippingPerTransaction'),
-label => $i18n->get('price'),
-value => $self->get('pricePerTransaction')
);
@ -41,7 +42,8 @@ sub init {
#-------------------------------------------------------------------
sub name {
return WebGUI::International::get('title', 'CommerceShippingPerTransaction');
my $i18n = WebGUI::International->new($self->session, 'CommerceShippingPerTransaction');
return $i18n->get('title');
}
1;