X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=serials%2Fmember-search.pl;h=f027df573901d8a18f08dd4bd62f4b2c0add1b56;hb=76b80ac33ce5ad2048f4de8a9d132610f89d3fc1;hp=2d9a031f521151be2f1aaa36b05851eb277c7642;hpb=df4b588c6e7166a50ca5724fde16e75c2c84d18c;p=koha.git diff --git a/serials/member-search.pl b/serials/member-search.pl index 2d9a031f52..f027df5739 100755 --- a/serials/member-search.pl +++ b/serials/member-search.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# Parts copyright Catalyst IT 2010 +# # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the @@ -43,6 +45,8 @@ foreach (keys %$patron){ my @categories=C4::Category->all; my $branches=(defined $$patron{branchcode}?GetBranchesLoop($$patron{branchcode}):GetBranchesLoop()); +my $subscriptionid = $cgi->param('subscriptionid'); +my $searchstring = $cgi->param('member'); my %categories_dislay; my ($template, $loggedinuser, $cookie); @@ -51,7 +55,7 @@ my ($template, $loggedinuser, $cookie); query => $cgi, type => "intranet", authnotrequired => 0, - flagsrequired => {borrowers => 1}, + flagsrequired => { serials => 'routing' }, }); foreach my $category (@categories){ @@ -108,18 +112,20 @@ my @resultsdata; $to=($count>$to?$to:$count); my $index=$from; foreach my $borrower(@$results[$from..$to-1]){ - #find out stats - - $$borrower{'dateexpiry'}= C4::Dates->new($$borrower{'dateexpiry'},'iso')->output('syspref'); - - my %row = ( - count => $index++, - %$borrower, - %{$categories_dislay{$$borrower{categorycode}}}, - ); - push(@resultsdata, \%row); + # find out stats + $borrower->{'dateexpiry'}= C4::Dates->new($borrower->{'dateexpiry'},'iso')->output('syspref'); + if ($categories_dislay{$borrower->{'categorycode'}}){ + my %row = ( + count => $index++, + %$borrower, + %{$categories_dislay{$$borrower{categorycode}}}, + ); + push(@resultsdata, \%row); + } + else { + warn $borrower->{'cardnumber'} ." has a bad category code of " . $borrower->{'categorycode'} ."\n"; + } } - if ($$patron{branchcode}){ foreach my $branch (grep{$_->{value} eq $$patron{branchcode}}@$branches){ $$branch{selected}=1;