This patch allows the Branch Transfer Limits feature to limit transfers either by...
[koha_fer] / circ / circulation.pl
index 198ab2d..d51f2d3 100755 (executable)
@@ -86,7 +86,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { circulate => 1 },
+        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
     }
 );
 
@@ -196,6 +196,14 @@ if ($findborrower) {
     my ( $count, $borrowers ) =
       SearchMember($findborrower, 'cardnumber', 'web' );
     my @borrowers = @$borrowers;
+        $template->param(
+                "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
+        );
+        if (C4::Context->preference("AddPatronLists")=~/code/){
+                my $categories=GetBorrowercategoryList;
+                $categories->[0]->{'first'}=1;
+                $template->param(categories=>$categories);
+        }
     if ( $#borrowers == -1 ) {
         $query->param( 'findborrower', '' );
         $message = "'$findborrower'";
@@ -422,7 +430,7 @@ my @issued_itemtypes_count_loop;
 
 if ($borrower) {
 # get each issue of the borrower & separate them in todayissues & previous issues
-    my ($countissues,$issueslist) = GetPendingIssues($borrower->{'borrowernumber'});
+    my ($issueslist) = GetPendingIssues($borrower->{'borrowernumber'});
 
     # split in 2 arrays for today & previous
     foreach my $it ( @$issueslist ) {
@@ -482,7 +490,7 @@ FROM issuingrules
   WHERE categorycode=?
 " );
 #my @issued_itemtypes_count;  # huh?
-$issueqty_sth->execute("*");   # FIXME: Why have a WHERE clause at all with a hardcoded "*"?
+$issueqty_sth->execute("*");   # This is a literal asterisk, not a wildcard.
 
 while ( my $data = $issueqty_sth->fetchrow_hashref() ) {
 
@@ -525,6 +533,7 @@ if ($borrowerslist) {
         -id       => 'borrowernumber',
         -values   => \@values,
         -labels   => \%labels,
+       -onclick  => "window.location = '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + this.value;",
         -size     => 7,
         -tabindex => '',
         -multiple => 0