Bugzilla – Attachment 4458 Details for
Bug 5453
Variables declaration should not occur in conditionals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5453 Move declarations out of conditionals
Bug-5453-Move-declarations-out-of-conditionals.patch (text/plain), 3.91 KB, created by
Chris Cormack
on 2011-06-14 21:05:41 UTC
(
hide
)
Description:
Bug 5453 Move declarations out of conditionals
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-06-14 21:05:41 UTC
Size:
3.91 KB
patch
obsolete
>From 64970e63bb17b309f76787e78bcc1b129a334402 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 29 Nov 2010 12:28:36 +0000 >Subject: [PATCH] Bug 5453 Move declarations out of conditionals > >Fix im members scripts > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > members/mancredit.pl | 5 ++++- > members/maninvoice.pl | 5 ++++- > members/memberentry.pl | 38 +++++++++++++++++++++----------------- > 3 files changed, 29 insertions(+), 19 deletions(-) > >diff --git a/members/mancredit.pl b/members/mancredit.pl >index 7d57fa5..ae41b57 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -45,7 +45,10 @@ my $add=$input->param('add'); > if ($add){ > if(checkauth($input)) { > my $barcode = $input->param('barcode'); >- my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode; >+ my $itemnum; >+ if ($barcode) { >+ $itemnum = GetItemnumberFromBarcode($barcode); >+ } > my $desc = $input->param('desc'); > my $note = $input->param('note'); > my $amount = $input->param('amount') || 0; >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index f804e52..9e8d429 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -45,7 +45,10 @@ if ($add){ > if(checkauth($input)) { > # print $input->header; > my $barcode=$input->param('barcode'); >- my $itemnum = GetItemnumberFromBarcode($barcode) if $barcode; >+ my $itemnum; >+ if ($barcode) { >+ $itemnum = GetItemnumberFromBarcode($barcode); >+ } > my $desc=$input->param('desc'); > my $amount=$input->param('amount'); > my $type=$input->param('type'); >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 61c3c2c..286eb36 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -183,24 +183,28 @@ if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) > } > > #############test for member being unique ############# >-if (($op eq 'insert') and !$nodouble){ >- my $category_type_send=$category_type if ($category_type eq 'I'); >- my $check_category; # recover the category code of the doublon suspect borrowers >- # ($result,$categorycode) = checkuniquemember($collectivity,$surname,$firstname,$dateofbirth) >- ($check_member,$check_category) = checkuniquemember( >- $category_type_send, >- ($newdata{surname} ? $newdata{surname} : $data{surname} ), >- ($newdata{firstname} ? $newdata{firstname} : $data{firstname} ), >- ($newdata{dateofbirth} ? $newdata{dateofbirth} : $data{dateofbirth}) >- ); >- if(!$check_member){ >- $nodouble = 1; >- } >- # recover the category type if the borrowers is a doublon >+if ( ( $op eq 'insert' ) and !$nodouble ) { >+ my $category_type_send; >+ if ( $category_type eq 'I' ) { >+ $category_type_send = $category_type; >+ } >+ my $check_category; # recover the category code of the doublon suspect borrowers >+ # ($result,$categorycode) = checkuniquemember($collectivity,$surname,$firstname,$dateofbirth) >+ ( $check_member, $check_category ) = checkuniquemember( >+ $category_type_send, >+ ( $newdata{surname} ? $newdata{surname} : $data{surname} ), >+ ( $newdata{firstname} ? $newdata{firstname} : $data{firstname} ), >+ ( $newdata{dateofbirth} ? $newdata{dateofbirth} : $data{dateofbirth} ) >+ ); >+ if ( !$check_member ) { >+ $nodouble = 1; >+ } >+ >+ # recover the category type if the borrowers is a doublon > if ($check_category) { >- my $tmpborrowercategory=GetBorrowercategory($check_category); >- $check_categorytype=$tmpborrowercategory->{'category_type'}; >- } >+ my $tmpborrowercategory = GetBorrowercategory($check_category); >+ $check_categorytype = $tmpborrowercategory->{'category_type'}; >+ } > } > > #recover all data from guarantor address phone ,fax... >-- >1.7.4.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5453
:
4340
|
4341
|
4342
|
4343
|
4344
|
4345
|
4346
|
4455
|
4456
|
4457
| 4458 |
4459
|
4460
|
4461