From fb5610d63579606cbb17a6dd50d5be207d47da14 Mon Sep 17 00:00:00 2001 From: Mason James Date: Fri, 23 Jan 2009 11:04:50 +1300 Subject: [PATCH] fix for bug-2923, corrects renew status in SCO - removes unneeded HTML::Template::Pro - some indent/newline tidies Signed-off-by: Galen Charlton --- C4/Circulation.pm | 2 +- .../prog/en/modules/sco/sco-main.tmpl | 11 ++++-- opac/sco/sco-main.pl | 36 +++++++++++-------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0694c40b38..fb4e4a1dcf 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -809,7 +809,7 @@ sub CanBookBeIssued { elsif ($issue->{borrowernumber}) { # issued to someone else - my $currborinfo = GetMemberDetails( $issue->{borrowernumber} ); + my $currborinfo = C4::Members::GetMemberDetails( $issue->{borrowernumber} ); # warn "=>.$currborinfo->{'firstname'} $currborinfo->{'surname'} ($currborinfo->{'cardnumber'})"; $needsconfirmation{ISSUED_TO_ANOTHER} = diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl index 4df77754e0..b46601bde3 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tmpl @@ -92,6 +92,7 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a
+ " value="">
@@ -116,6 +117,7 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a + diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index e7ff367560..62d8760aa6 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -2,7 +2,7 @@ # This code has been modified by Trendsetters (originally from opac-user.pl) # This code has been modified by rch # 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. so the selfcheck station will accept a patronid and +# We're in a controlled environment; we trust the user. so the selfcheck station will accept a patronid and # issue items to that borrower. # use strict; @@ -18,7 +18,7 @@ use C4::Reserves; use C4::Search; use C4::Output; use C4::Members; -use HTML::Template::Pro; +#use HTML::Template::Pro; use C4::Dates; use C4::Biblio; use C4::Items; @@ -30,7 +30,7 @@ my ($template, $loggedinuser, $cookie) type => "opac", authnotrequired => 0, flagsrequired => { circulate => "circulate_remaining_permissions" }, - debug => 1, + debug => 0, }); my $dbh = C4::Context->dbh; @@ -39,8 +39,8 @@ my ($op, $patronid, $barcode, $confirmed, $timedout) = ( $query->param("op") || '', $query->param("patronid") || '', $query->param("barcode") || '', - $query->param( "confirmed") || '', - $query->param( "timedout") || '', #not actually using this... + $query->param("confirmed") || '', + $query->param("timedout") || '', #not actually using this... ); my %confirmation_strings = ( RENEW_ISSUE => "This item is already checked out to you. Return it?", ); @@ -65,7 +65,7 @@ if ($op eq "logout") { #warn "returnbook: " . $doreturn; ($borrower) = GetMemberDetails(undef, $patronid); } - + if ($op eq "checkout" ) { my $impossible = {}; my $needconfirm = {}; @@ -113,7 +113,7 @@ if ($op eq "logout") { #warn "issuing book?"; AddIssue($borrower,$barcode); # ($borrower, $flags) = getpatroninformation(undef,undef, $patronid); - + # $template->param( patronid => $patronid, # validuser => 1, # ); @@ -136,14 +136,20 @@ if ($borrower->{cardnumber}) { my $bornum = $borrower->{borrowernumber}; my $borrowername = $borrower->{firstname} . " " . $borrower->{surname}; my @issues; - my ($issueslist) = GetPendingIssues($borrower->{'borrowernumber'}); - foreach my $it ( @$issueslist ) { - push @issues, $it; - $cnt++; - } - $template->param( validuser => 1, + + my ($issueslist) = GetPendingIssues( $borrower->{'borrowernumber'} ); + foreach my $it (@$issueslist) { + + my ( $renewokay, $renewerror ) = + CanBookBeIssued( $borrower, $it->{'barcode'}, '', '' ); + $it->{'norenew'} = 1 if $renewokay->{'NO_MORE_RENEWALS'} == 1; + push @issues, $it; + $cnt++; + } + + $template->param( validuser => 1, borrowername => $borrowername, - issues_count => $cnt, + issues_count => $cnt, ISSUES => \@issues,, patronid => $patronid , noitemlinks => 1 , @@ -156,7 +162,7 @@ if ($borrower->{cardnumber}) { $inputfocus = 'confirm' ; } else { $inputfocus = 'barcode' ; - } + } $template->param( inputfocus => $inputfocus, nofines => 1, -- 2.20.1
Issues for ( total)
TitleCall No.DueRenewFines
">.01.THUMBZZZ.jpg" alt="Book Cover Image" class="thumbnail" /> "> @@ -123,10 +125,13 @@ Sorry, This Self-Checkout Station has lost authentication. Please contact the a   - + &bornum=">Renew - - Not renewable + + Not renewable + + Renewable + YesNo