X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fsco%2Fsco-main.pl;h=f53fcdabf60e08cf87f8202e7bce1f9aa618925e;hb=05c47d5040ef4328581e177003089f645f37eba1;hp=b36ff6434617d69b820ccab49caababa56d3c142;hpb=ef8171ba425f766b67d9e139194b6a8d570e301e;p=koha_fer diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index b36ff64346..f53fcdabf6 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -2,6 +2,23 @@ # # This code has been modified by Trendsetters (originally from opac-user.pl) # This code has been modified by rch +# Parts Copyright 2010-2011, ByWater Solutions (those related to username/password auth) +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + # We're going to authenticate a self-check user. we'll add a flag to borrowers 'selfcheck' # # We're in a controlled environment; we trust the user. @@ -22,12 +39,10 @@ use Digest::MD5 qw(md5_base64); use C4::Auth qw(get_template_and_user checkpw); use C4::Koha; -use C4::Dates qw/format_date/; use C4::Circulation; use C4::Reserves; use C4::Output; use C4::Members; -use C4::Dates; use C4::Biblio; use C4::Items; @@ -92,7 +107,8 @@ my $issuer = GetMemberDetails($issuerid); my $item = GetItem(undef,$barcode); if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { my $dbh = C4::Context->dbh; - my $resval, $patronid = checkpw($dbh, $patronlogin, $patronpw); + my $resval; + ($resval, $patronid) = checkpw($dbh, $patronlogin, $patronpw); } my $borrower = GetMemberDetails(undef,$patronid); @@ -114,7 +130,13 @@ elsif ( $op eq "checkout" ) { my $impossible = {}; my $needconfirm = {}; if ( !$confirmed ) { - ( $impossible, $needconfirm ) = CanBookBeIssued( $borrower, $barcode ); + ( $impossible, $needconfirm ) = CanBookBeIssued( + $borrower, + $barcode, + undef, + 0, + C4::Context->preference("AllowItemsOnHoldCheckout") + ); } $confirm_required = scalar keys %$needconfirm; @@ -133,7 +155,7 @@ elsif ( $op eq "checkout" ) { hide_main => 1, ); if ($issue_error eq 'DEBT') { - $template->param(amount => $impossible->{DEBT}); + $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT}); } #warn "issue_error: " . $issue_error ; if ( $issue_error eq "NO_MORE_RENEWALS" ) { @@ -165,6 +187,9 @@ elsif ( $op eq "checkout" ) { "circ_error_$issue_error" => 1, hide_main => 1, ); + if ($issue_error eq 'DEBT') { + $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$needconfirm->{DEBT}); + } } else { if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. # warn "issuing book?"; @@ -194,8 +219,13 @@ if ($borrower->{cardnumber}) { my @issues; my ($issueslist) = GetPendingIssues( $borrower->{'borrowernumber'} ); foreach my $it (@$issueslist) { - $it->{date_due_display} = format_date($it->{date_due}); - my ($renewokay, $renewerror) = CanBookBeIssued($borrower, $it->{'barcode'},'',''); + my ($renewokay, $renewerror) = CanBookBeIssued( + $borrower, + $it->{'barcode'}, + undef, + 0, + C4::Context->preference("AllowItemsOnHoldCheckout") + ); $it->{'norenew'} = 1 if $renewokay->{'NO_MORE_RENEWALS'}; push @issues, $it; } @@ -209,6 +239,7 @@ if ($borrower->{cardnumber}) { patronlogin => $patronlogin, patronpw => $patronpw, noitemlinks => 1 , + borrowernumber => $borrower->{'borrowernumber'}, ); my $inputfocus = ($return_only == 1) ? 'returnbook' : ($confirm_required == 1) ? 'confirm' : 'barcode' ;