Bug 15258: Fix Perl scripts declaring unused variables

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

All affected files tested with `perl -c`.
Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
This commit is contained in:
Frédéric Demians 2015-11-26 08:26:34 +01:00 committed by Jesse Weaver
parent c7ec79b839
commit ff1579de6d
29 changed files with 6 additions and 57 deletions

View file

@ -310,7 +310,7 @@ sub new {
sub _initialize {
my ($self, $msg, $control_block) = @_;
my ($fs, $fn, $fe);
my $fn;
my $proto = $control_block->{protocol}->{$protocol_version};
$self->{name} = $control_block->{name};
@ -931,7 +931,7 @@ sub handle_patron_info {
my ($lang, $trans_date, $summary) = @{$self->{fixed_fields}};
my $fields = $self->{fields};
my ($inst_id, $patron_id, $terminal_pwd, $patron_pwd, $start, $end);
my ($resp, $patron, $count);
my ($resp, $patron);
$inst_id = $fields->{(FID_INST_ID)};
$patron_id = $fields->{(FID_PATRON_ID)};

View file

@ -106,7 +106,6 @@ sub search {
};
my $start = clock_gettime( CLOCK_MONOTONIC );
my $select = IO::Select->new;
my @worker_fhs;
my @cached_sets;
my @servers;

View file

@ -41,7 +41,6 @@ Convert a hashref with a Bib-1 mapping into its PQF string representation.
sub attributes_to_attr_string {
my ($attributes) = @_;
my $attr_string = '';
my $value;
foreach my $key ( sort keys %{$attributes} ) {
next unless looks_like_number($key);
$attr_string .= ' @attr ' . $key . '=' . $attributes->{ $key } . ' ';

View file

@ -41,7 +41,6 @@ not have a reference to their parent query_plan.
sub target_syntax {
my ($self, $server, $query_plan) = @_;
my $pqf = '';
my @fields;
my $attributes = $query_plan->QueryParser->bib1_mapping_by_name('modifier', $self->name, $server);
$pqf = ($attributes->{'op'} ? $attributes->{'op'} . ' ' : '') . ($self->negate ? '@not @attr 1=_ALLRECORDS @attr 2=103 "" ' : '') . $attributes->{'attr_string'};

View file

@ -29,7 +29,6 @@ sub filter {
my ( $self, $value, $args, $config ) = @_;
$value ||= 0;
$config->{on_editing} //= 0;
my $formatted_price;
return $config->{on_editing}
? Koha::Number::Price->new( $value )->format_for_editing
: Koha::Number::Price->new( $value )->format;

View file

@ -129,7 +129,6 @@ if ( $op eq 'add_form' ) {
my $deliveryplace = $basket->{'deliveryplace'} || C4::Context->userenv->{"branch"};
# Build the combobox to select the billing place
my @billingplaceloop;
my $branches = C4::Branch::GetBranchesLoop( $billingplace );
$template->param( billingplaceloop => $branches );

View file

@ -112,7 +112,6 @@ my $details = GetInvoiceDetails($invoiceid);
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $details->{booksellerid} });
my @orders_loop = ();
my $orders = $details->{'orders'};
my $qty_total;
my @foot_loop;
my %foot;
my $total_quantity = 0;

View file

@ -89,7 +89,6 @@ if ( $sth->err ) {
die "An error occurred fetching records: " . $sth->errstr;
}
my $subtotal = 0;
my $toggle;
my @spent;
while ( my $data = $sth->fetchrow_hashref ) {
my $recv = $data->{'quantityreceived'};

View file

@ -85,7 +85,6 @@ $template->param(
my $borrower_id = $template->{VARS}->{'USER_INFO'}->{'borrowernumber'};
my $borrower_branchcode = $template->{VARS}->{'USER_INFO'}->{'branchcode'};
my $periods;
my $authcat = $input->param('authcat');
my $show_active = $input->param('show_active');
my $show_actual = $input->param('show_actual');
@ -107,8 +106,6 @@ $authcat = 'Asort1' if not defined $authcat; # defaults to Asort if no authcat
my $budget_id = $input->param('budget_id');
my $op = $input->param("op");
my $budget_branchcode;
my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' );
# build categories list
@ -140,7 +137,6 @@ $template->param( authcat_dropbox => {
});
my @budgets = @$budgets_ref;
my $CGISort;
my @authvals;
my %labels;
@ -160,7 +156,6 @@ if ( $op eq 'save' ) {
my %seen;
@buds = grep { !$seen{$_}++ } @buds;
@auth_values = grep { !$seen{$_}++ } @auth_values;
my @budget_ids;
my @budget_lines;
foreach my $budget (@buds) {

View file

@ -273,7 +273,6 @@ if ($op eq 'add_form') {
my @kohafield = ''.$input->param('kohafield');
my @tab = $input->param('tab');
my @seealso = $input->param('seealso');
my @hidden;
my @ohidden = $input->param('ohidden');
#my @ihidden = $input->param('ihidden');
#my @ehidden = $input->param('ehidden');

View file

@ -64,7 +64,6 @@ my $cache = Koha::Cache->get_instance();
################## ADD_FORM ##################################
# called by default. Used to create form to add or modify a record
if ( $op eq 'add_form' ) {
my $data;
my $sth =
$dbh->prepare(
"select tagfield,tagsubfield,liblibrarian as lib,tab from marc_subfield_structure where kohafield=? AND frameworkcode=''"

View file

@ -55,7 +55,7 @@ my @branchloop = map { code => $_,
name => $branches->{$_}->{'branchname'} },
sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} }
keys %$branches;
my (@branchfromloop, @cost, @errors);
my (@branchfromloop, @errors);
foreach my $branchfrom ( @branchloop ) {
my $fromcode = $branchfrom->{code};

View file

@ -84,7 +84,6 @@ foreach my $biblionumber ( @bibs ) {
}
}
# COinS format FIXME: for books Only
my $coins_format;
my $fmt = substr $record->leader(), 6,2;
my $fmts;
$fmts->{'am'} = 'book';

View file

@ -130,7 +130,6 @@ foreach my $thisframeworkcode ( keys %$frameworks ) {
$template->param( frameworkcodeloop => \@frameworkcodeloop, );
# fill arrays
my @loop_data = ();
my $tag;
# loop through each tab 0 through 9
for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) {

View file

@ -178,7 +178,6 @@ sub build_authorized_values_list {
&& !C4::Context->IsSuperLibrarian()
&& C4::Context->userenv->{branch};
my $branches = GetBranches($onlymine);
my @branchloop;
foreach my $thisbranch ( sort keys %$branches ) {
push @authorised_values, $thisbranch;
$authorised_lib{$thisbranch} = $branches->{$thisbranch}->{'branchname'};
@ -777,7 +776,6 @@ my (
$biblionumbertagsubfield,
$biblioitemnumtagfield,
$biblioitemnumtagsubfield,
$bibitem,
$biblioitemnumber
);
@ -845,7 +843,6 @@ if ( $op eq "addbiblio" ) {
my $confirm_not_duplicate = $input->param('confirm_not_duplicate');
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
my $oldbibnum;
my $oldbibitemnum;
if (C4::Context->preference("BiblioAddsAuthorities")){
BiblioAutoLink( $record, $frameworkcode );

View file

@ -121,7 +121,6 @@ if ($merge) {
my @marcfields = $marcrecord->field($field->{tag});
foreach my $marcfield (@marcfields) {
my $tag = $marcfield->tag();
my %subfields;
if (scalar @{$field->{subfields}}) {
foreach my $subfield (@{$field->{subfields}}) {
my @values = $marcfield->subfield($subfield);

View file

@ -51,7 +51,6 @@ return ($function_name,$res);
sub plugin {
my ($input) = @_;
my %env;
# my $input = new CGI;
my $index= $input->param('index');
@ -62,8 +61,7 @@ my ($input) = @_;
#tabs
$rq->execute;
my @BIGLOOP;
my @innerloop;
my (%numbers,%cells,@colhdr,@rowhdr,@multiplelines,@lists,$table);
my (%numbers,@lists,$table);
while (my $tab = $rq->fetchrow_hashref){
my $number=substr($tab->{authorised_value},0,1);
if ($tab->{authorised_value}=~/[0-9]XX/){

View file

@ -64,7 +64,6 @@ my $launcher = sub {
$startfrom = 0 if ( !defined $startfrom );
my ( $template, $loggedinuser, $cookie );
my $resultsperpage;
my $searchdesc;
if ( $op eq "fillinput" ) {
my $biblionumber = $query->param('biblionumber');

View file

@ -68,7 +68,6 @@ sub plugin {
$startfrom = 0 if ( !defined $startfrom );
my ( $template, $loggedinuser, $cookie );
my $resultsperpage;
my $searchdesc;
if ( $op eq "fillinput" ) {
my $biblionumber = $query->param('biblionumber');

View file

@ -106,7 +106,6 @@ elsif ( $request eq 'KillReserved' ) {
# collect the stack of books already transfered so they can printed...
my @trsfitemloop;
my %transfereditems;
my $transfered;
my $barcode = $query->param('barcode');
# strip whitespace

View file

@ -53,19 +53,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
my $duedate;
my $borrowernumber;
my $itemnum;
my $data1;
my $data2;
my $data3;
my $name;
my $phone;
my $email;
my $biblionumber;
my $title;
my $author;
my $today = dt_from_string;
$startdate =~ s/^\s+//;
$startdate =~ s/\s+$//;

View file

@ -48,8 +48,6 @@ my $all_branches = $input->param('allbranches') || '';
my $cancelall = $input->param('cancelall');
my $tab = $input->param('tab');
my $cancel;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "circ/waitingreserves.tt",

View file

@ -53,7 +53,7 @@ my $ccl_query = $query->param('ccl_query');
my $startfrom = $query->param('startfrom') || 1;
my ($template, $loggedinuser, $cookie) = (undef, undef, undef);
my (
$total_hits, $orderby, $results, $total, $error,
$total_hits, $total, $error,
$marcresults, $idx, $datefrom, $dateto, $ccl_textbox
);
my $resultsperpage = C4::Context->preference('numSearchResults') || '20';
@ -174,7 +174,7 @@ if ($show_results) {
);
# build page nav stuff.
my ( @field_data, @numbers );
my @numbers;
$total = $total_hits;
my ( $from, $to, $startfromnext, $startfromprev, $displaynext,

View file

@ -154,7 +154,6 @@ if ( IsDebarred($borrowernumber) ) {
$data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex};
my $catcode;
if ( $category_type eq 'C') {
my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
my $cnt = scalar(@$catcodes);
@ -252,7 +251,6 @@ my $relatives_issues_count =
my $roadtype = C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
my $today = DateTime->now( time_zone => C4::Context->tz);
$today->truncate(to => 'day');
my @borrowers_with_issues;
my $overdues_exist = 0;
my $totalprice = 0;

View file

@ -92,7 +92,6 @@ if ($type eq 'str8' && $borrower){
$i2++;
}
}
my $const;
if (defined $checkitem && $checkitem ne ''){
my $item = GetItem($checkitem);

View file

@ -48,7 +48,6 @@ use Koha::Borrower::Debarments qw(IsDebarred);
use Koha::Holds;
my $dbh = C4::Context->dbh;
my $sth;
my $input = new CGI;
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
{
@ -141,7 +140,6 @@ if ($multihold) {
if ($borrowernumber_hold && !$action) {
my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
my $diffbranch;
my @getreservloop;
# we check the reserves of the borrower, and if he can reserv a document
# FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ...
@ -284,7 +282,6 @@ foreach my $biblionumber (@biblionumbers) {
# adding a fixed value for priority options
my $fixedRank = $count+1;
my @branchcodes;
my %itemnumbers_of_biblioitem;
my @itemnumbers;

View file

@ -113,7 +113,6 @@ if ($date) {
);
}
my $branchname;
my $branches_loop;
if ( !C4::Context->preference("IndependentBranches")
or C4::Context->IsSuperLibrarian()

View file

@ -42,7 +42,6 @@ my $op = $query->param('op') || '';
my $dbh = C4::Context->dbh;
my $sub_length;
my @budgets;
# Permission needed if it is a modification : edit_subscription
# Permission needed otherwise (nothing or dup) : create_subscription
@ -437,7 +436,6 @@ sub redirect_mod_subscription {
sub insert_additional_fields {
my ( $additional_fields, $biblionumber, $subscriptionid ) = @_;
my @additional_field_values;
my $record = GetMarcBiblio( $biblionumber, 1 );
for my $field ( @$additional_fields ) {
my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch;

View file

@ -10,9 +10,7 @@ use C4::Members;
use C4::Circulation;
my ($res,$ua);
my %commands;
my $message;
my $phone;
my $result;
my $errorcode;
my $smsid;