From 4dfac86f2f6943a728c67771ce7c60034c837bde Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 17 Jun 2008 21:12:00 +0000 Subject: [PATCH] Add hoverHelp for the Tax screen. Change tax rate to be an integer. --- lib/WebGUI/Shop/Tax.pm | 37 +++++++++++++++++++--------------- lib/WebGUI/i18n/English/Tax.pm | 29 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 16 deletions(-) diff --git a/lib/WebGUI/Shop/Tax.pm b/lib/WebGUI/Shop/Tax.pm index ba4430699..b0e35e08a 100644 --- a/lib/WebGUI/Shop/Tax.pm +++ b/lib/WebGUI/Shop/Tax.pm @@ -406,11 +406,11 @@ sub www_addTax { unless $admin->canManage; my $params; my ($form) = $session->quick('form'); - $params->{country} = $form->get('country'); - $params->{state} = $form->get('state'); - $params->{city} = $form->get('city'); - $params->{code} = $form->get('code'); - $params->{taxRate} = $form->get('taxRate'); + $params->{country} = $form->get('country', 'text'); + $params->{state} = $form->get('state', 'text'); + $params->{city} = $form->get('city', 'text'); + $params->{code} = $form->get('code', 'text'); + $params->{taxRate} = $form->get('taxRate', 'integer'); $self->add($params); return $self->www_manage; } @@ -538,24 +538,29 @@ sub www_manage { my $addForm = WebGUI::HTMLForm->new($session,action=>$url->page('shop=tax;method=addTax')); $addForm->text( - label => $i18n->get('country'), - name => 'country', + label => $i18n->get('country'), + hoverHelp => $i18n->get('country help'), + name => 'country', ); $addForm->text( - label => $i18n->get('state'), - name => 'state', + label => $i18n->get('state'), + hoverHelp => $i18n->get('state help'), + name => 'state', ); $addForm->text( - label => $i18n->get('city'), - name => 'city', + label => $i18n->get('city'), + hoverHelp => $i18n->get('city help'), + name => 'city', ); $addForm->text( - label => $i18n->get('code'), - name => 'code', + label => $i18n->get('code'), + hoverHelp => $i18n->get('code help'), + name => 'code', ); - $addForm->text( - label => $i18n->get('tax rate'), - name => 'taxRate', + $addForm->integer( + label => $i18n->get('tax rate'), + hoverHelp => $i18n->get('tax rate help'), + name => 'taxRate', ); $addForm->submit( value => $i18n->get('add a tax'), diff --git a/lib/WebGUI/i18n/English/Tax.pm b/lib/WebGUI/i18n/English/Tax.pm index 97af278d4..7add09e43 100644 --- a/lib/WebGUI/i18n/English/Tax.pm +++ b/lib/WebGUI/i18n/English/Tax.pm @@ -10,29 +10,58 @@ our $I18N = { context => q|The name of a country, such as Portugal or Canada.|, }, + 'country help' => { + message => q|The name of the country that the tax applies to.|, + lastUpdated => 1205120607, + context => q|The name of a country, such as Portugal or Canada.|, + }, + 'state' => { message => q|State|, lastUpdated => 1205120615, context => q|A political subdivision of a country, such as California.|, }, + 'state help' => { + message => q|The name of the state or province that the tax applies to.|, + lastUpdated => 1205120615, + context => q|A political subdivision of a country, such as California.|, + }, + 'city' => { message => q|City|, lastUpdated => 1205120661, }, + 'city help' => { + message => q|The name of the city that the tax applies to.|, + lastUpdated => 1205120661, + }, + 'code' => { message => q|Code|, lastUpdated => 1205120660, context => q|A postal code, or zip code.|, }, + 'code help' => { + message => q|The postal or zip code that the tax applies to.|, + lastUpdated => 1205120660, + context => q|A postal code, or zip code.|, + }, + 'tax rate' => { message => q|Tax Rate|, lastUpdated => 1206302052, context => q|The amount that a person is charged to buy something, a percentage of the price.|, }, + 'tax rate help' => { + message => q|Enter the tax as a percentage. For 5%, enter 5|, + lastUpdated => 1206302052, + context => q|The amount that a person is charged to buy something, a percentage of the price.|, + }, + 'delete' => { message => q|delete|, lastUpdated => 1206385749,