all loop iterators have to be declared lexical. PBP/108
This commit is contained in:
parent
52132e61f4
commit
08fbd46d28
8 changed files with 31 additions and 34 deletions
|
|
@ -404,7 +404,7 @@ C<viewPurchaseHistory> operation.
|
|||
sub www_checkoutSubmit {
|
||||
my $session = shift;
|
||||
my ($plugin, $shoppingCart, $transaction, $var, $amount, @cartItems, $i18n, @transactions,
|
||||
@normal, $currentPurchase, $checkoutError, @resultLoop, %param, $normal, $recurring,
|
||||
@normal, $checkoutError, @resultLoop, %param, $normal, $recurring,
|
||||
$formError, $shipping, $shippingCost, $shippingDescription);
|
||||
|
||||
$i18n = WebGUI::International->new($session, 'Commerce');
|
||||
|
|
@ -449,7 +449,7 @@ sub www_checkoutSubmit {
|
|||
map {push(@transactions, {recurring => 1, items => [$_]})} @$recurring;
|
||||
push(@transactions, {recurring => 0, items => [@$normal]}) if (@$normal);
|
||||
|
||||
foreach $currentPurchase (@transactions) {
|
||||
foreach my $currentPurchase (@transactions) {
|
||||
$amount = 0;
|
||||
$var = {};
|
||||
|
||||
|
|
@ -634,7 +634,7 @@ Calls C<www_editCommerceSettingsSave> on form submission.
|
|||
|
||||
sub www_editCommerceSettings {
|
||||
my $session = shift;
|
||||
my (%tabs, $tabform, $currentPlugin, $ac, $jscript, $i18n,
|
||||
my (%tabs, $tabform, $ac, $jscript, $i18n,
|
||||
$paymentPlugin, @paymentPlugins, %paymentPlugins, @failedPaymentPlugins, $plugin,
|
||||
$shippingPlugin, @shippingPlugins, %shippingPlugins, @failedShippingPlugins);
|
||||
return $session->privilege->adminOnly unless canView($session);
|
||||
|
|
@ -741,7 +741,7 @@ sub www_editCommerceSettings {
|
|||
-extras => 'onchange="activePayment=operateHidden(this.options[this.selectedIndex].value,activePayment)"'
|
||||
);
|
||||
|
||||
foreach $currentPlugin (@paymentPlugins) {
|
||||
foreach my $currentPlugin (@paymentPlugins) {
|
||||
my $style = '" style="display: none;' unless ($currentPlugin->namespace eq $paymentPlugin);
|
||||
$tabform->getTab('payment')->raw('<tr id="'.$currentPlugin->namespace.$style.'"><td colspan="2" width="100%">'.
|
||||
'<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
|
||||
|
|
@ -780,7 +780,7 @@ sub www_editCommerceSettings {
|
|||
-extras => 'onchange="activeShipping=operateHidden(this.options[this.selectedIndex].value,activeShipping)"'
|
||||
);
|
||||
|
||||
foreach $currentPlugin (@shippingPlugins) {
|
||||
foreach my $currentPlugin (@shippingPlugins) {
|
||||
my $style = '" style="display: none;' unless ($currentPlugin->namespace eq $shippingPlugin);
|
||||
$tabform->getTab('shipping')->raw('<tr id="'.$currentPlugin->namespace.$style.'"><td colspan="2" width="100%">'.
|
||||
'<table border="0" cellspacing="0" cellpadding="0" width="100%">'.
|
||||
|
|
@ -897,7 +897,7 @@ The screen is not templated.
|
|||
|
||||
sub www_listTransactions {
|
||||
my $session = shift;
|
||||
my ($output, %criteria, $transaction, @transactions);
|
||||
my ($output, %criteria, @transactions);
|
||||
|
||||
return $session->privilege->insufficient unless canView($session);
|
||||
|
||||
|
|
@ -968,7 +968,7 @@ sub www_listTransactions {
|
|||
'<th>'. $i18n->get('shipping cost'). '</th>'.
|
||||
'<th>'. $i18n->get('status'). '</th>'.
|
||||
'<th>'. $i18n->get('shipping status'). '</th></tr>';
|
||||
foreach $transaction (@transactions) {
|
||||
foreach my $transaction (@transactions) {
|
||||
$output .= '<tr bgcolor="#ddd">';
|
||||
$output .= '<td>'.$session->icon->delete('op=deleteTransaction;tid='.$transaction->get('transactionId')).'</td>';
|
||||
my $userId = $transaction->get('userId');
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ sub www_editFontSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub www_editPalette {
|
||||
my ($name, $palette, $output, $color);
|
||||
my ($name, $palette, $output);
|
||||
my $session = shift;
|
||||
my $paletteId = shift || $session->form->process('pid');
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ sub www_editPalette {
|
|||
|
||||
$output .= '<table>';
|
||||
$output .= '<tr><th></th><th>'.$i18n->get('fill color').'</th><th>'.$i18n->get('stroke color').'</th></tr>';
|
||||
foreach $color (@{$palette->getColorsInPalette}) {
|
||||
foreach my $color (@{$palette->getColorsInPalette}) {
|
||||
$output .= '<tr>';
|
||||
$output .= '<td>';
|
||||
$output .= $session->icon->delete('op=removeColorFromPalette;pid='.$palette->getId.';index='.$palette->getColorIndex($color));
|
||||
|
|
|
|||
|
|
@ -852,7 +852,7 @@ The current WebGUI session object.
|
|||
|
||||
sub www_manageProduct {
|
||||
my $session = shift;
|
||||
my ($product, $output, $parameter, $option, $optionId, $i18n);
|
||||
my ($product, $output, $option, $i18n);
|
||||
|
||||
return $session->privilege->insufficient unless canView($session);
|
||||
|
||||
|
|
@ -882,14 +882,14 @@ sub www_manageProduct {
|
|||
$output .= "<h2>Parameters</h2>";
|
||||
$output .= '<a href="'.$session->url->page('op=editProductParameter;parameterId=new;productId='.$product->get('productId')).'">'.
|
||||
$i18n->get('add parameter').'</a><br />';
|
||||
foreach $parameter (@{$product->getParameter}) {
|
||||
foreach my $parameter (@{$product->getParameter}) {
|
||||
$output .= $session->icon->delete('op=deleteProductParameter;parameterId='.$parameter->{parameterId}).
|
||||
$session->icon->edit('op=editProductParameter;parameterId='.$parameter->{parameterId});
|
||||
$output .= '<span style="margin-left: 10px"><b>'.$parameter->{name}.'</b></span><br />';
|
||||
$output .= '<a style="margin-left: 20px" href="'.
|
||||
$session->url->page('op=editProductParameterOption;optionId=new;parameterId='.$parameter->{parameterId}).'">'.
|
||||
$i18n->get('add option').'</a><br />';
|
||||
foreach $optionId (@{$parameter->{options}}) {
|
||||
foreach my $optionId (@{$parameter->{options}}) {
|
||||
$option = $product->getOption($optionId);
|
||||
$output .= '<span style="margin-left: 20px">'.
|
||||
$session->icon->delete('op=deleteProductParameterOption;optionId='.$option->{optionId}).
|
||||
|
|
|
|||
|
|
@ -254,12 +254,12 @@ A reference to the current session.
|
|||
|
||||
sub www_editProfileSave {
|
||||
my $session = shift;
|
||||
my ($profile, $fieldName, $error, $u, $warning);
|
||||
my ($profile, $error, $warning);
|
||||
return WebGUI::Operation::Auth::www_auth($session, "init") if ($session->user->userId eq '1');
|
||||
($profile, $error, $warning) = validateProfileData($session);
|
||||
$error .= $warning;
|
||||
return www_editProfile($session, '<ul>'.$error.'</ul>') if($error ne "");
|
||||
foreach $fieldName (keys %{$profile}) {
|
||||
foreach my $fieldName (keys %{$profile}) {
|
||||
$session->user->profileField($fieldName,$profile->{$fieldName});
|
||||
}
|
||||
return WebGUI::Operation::Auth::www_auth($session);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue