Skip to content

Commit ccee815

Browse files
Joe AtzbergerGalen Charlton
Joe Atzberger
authored and
Galen Charlton
committed
Bug 2617: Add strict (and warnings), partial fix.
These are some of the simpler scripts to add strict to. Corrected perldoc for Bookfund. Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
1 parent 1b12339 commit ccee815

File tree

6 files changed

+32
-20
lines changed

6 files changed

+32
-20
lines changed

C4/Bookfund.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,13 @@ sub NewBookFund{
315315

316316
=head3 ModBookFund
317317
318-
&ModBookFund($bookfundname,$bookfundid,$current_branch, $branchcode) =
319-
this function update the bookfundname and the branchcode on aqbookfund table on database.
318+
&ModBookFund($bookfundname,$bookfundid,$current_branch, $branchcode)
319+
320+
This function updates the bookfundname and the branchcode in the aqbookfund table.
320321
321322
=cut
322323

324+
# FIXME: use placeholders, ->prepare(), ->execute()
323325

324326
sub ModBookFund {
325327
my ($bookfundname,$bookfundid,$current_branch, $branchcode) = @_;
@@ -349,8 +351,6 @@ sub ModBookFund {
349351
}
350352
}
351353

352-
353-
354354
#-------------------------------------------------------------#
355355

356356
=head3 SearchBookFund

acqui/currency.pl

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/perl
22

3-
43
#written by chris@katipo.co.nz
54
#9/10/2000
65
#script to display and update currency rates
76

8-
97
# Copyright 2000-2002 Katipo Communications
108
#
119
# This file is part of Koha.
@@ -23,18 +21,21 @@
2321
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
2422
# Suite 330, Boston, MA 02111-1307 USA
2523

24+
use strict;
25+
use warnings;
2626
use CGI;
27-
use C4::Acquisition;
28-
use C4::Biblio;
29-
use C4::Bookfund;
27+
use C4::Bookfund qw(ModCurrencies);
3028

31-
my $input=new CGI;
29+
# FIXME: CHECK AUTH
30+
# FIXME: This should be part of another script, not a throwaway standalone.
31+
# FIXME: params should have better checks before passed to ModCurrencies
32+
# FIXME: need error handling if ModCurrencies FAILS.
3233

33-
my @params=$input->param;
34-
foreach my $param (@params){
35-
if ($param ne 'type' && $param !~ /submit/){
36-
my $data=$input->param($param);
37-
ModCurrencies($param,$data);
38-
}
34+
my $input = new CGI;
35+
36+
foreach my $param ($input->param) {
37+
if ($param ne 'type' && $param !~ /submit/) {
38+
ModCurrencies($param, $input->param($param));
39+
}
3940
}
4041
print $input->redirect('/cgi-bin/koha/acqui/acqui-home.pl');

admin/env_tz_test.pl

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/perl
22

3+
use strict;
4+
use warnings;
35
use CGI;
46
# use Data::Dumper;
57

changelanguage.pl

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
1616
# Suite 330, Boston, MA 02111-1307 USA
1717

18-
use C4::Output;
18+
use strict;
19+
use warnings;
20+
21+
use C4::Output qw(setlanguagecookie);
1922
use CGI;
2023

2124
my $query = new CGI;

misc/sax_parser_print.pl

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/perl
22
# check the current SAX Parser
3+
4+
use strict;
5+
use warnings;
36
use XML::SAX::ParserFactory;
4-
$parser = XML::SAX::ParserFactory->parser();
7+
8+
my $parser = XML::SAX::ParserFactory->parser();
59
print "Koha wants something like:
610
XML::LibXML::SAX::Parser=HASH(0x81fe220)
711
You have:

opac/opac-changelanguage.pl

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
1616
# Suite 330, Boston, MA 02111-1307 USA
1717

18-
use C4::Output;
18+
use strict;
19+
use warnings;
20+
use C4::Output qw(setlanguagecookie);
1921
use CGI;
2022

2123
my $query = new CGI;
2224
my $language = $query->param('language');
2325
my $url = $query->referer();
2426

25-
warn "Language : $query // $language // $url";
27+
# warn "Language : $query // $language // $url";
2628
setlanguagecookie( $query, $language, $url );

0 commit comments

Comments
 (0)