Bugzilla – Attachment 3554 Details for
Bug 5632
SIP improvements = Date formatting & debarrement management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Another patch
0001-Bug-5632-SIP-ILS-and-Debarment-fixes.patch (text/plain), 4.93 KB, created by
Chris Cormack
on 2011-03-30 21:43:11 UTC
(
hide
)
Description:
Another patch
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-03-30 21:43:11 UTC
Size:
4.93 KB
patch
obsolete
>From 9a8c0cc56c5f773c98e68c784434dce120928183 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Thu, 31 Mar 2011 10:40:52 +1300 >Subject: [PATCH] Bug 5632 SIP/ILS and Debarment fixes > >Squashed commit of the following: > >commit 7f6ff7d28b148d4eb054f0c67427dd2bd461fdc2 >Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Wed Jan 19 21:38:59 2011 +0100 > > SIP Fixing debarment management > > debarred is now a date. > We have to use the calculated flag DEBARRED rather than simply looking at the debarred field > >commit 773426c83b6c7cbeff12fcc096eb8fdb25322749 >Author: Henri-Damien LAURENT <henridamien.laurent@biblibre.com> >Date: Wed Jan 19 21:38:58 2011 +0100 > > ILS/Transaction Conforming to APIs > > Checkout And Renew were not really using the full correct interface of AddIssue > Renew is using AddIssue where it could/should use AddRenewal >--- > C4/SIP/ILS/Patron.pm | 31 ++++++++++++++++--------------- > C4/SIP/ILS/Transaction/Checkout.pm | 3 ++- > C4/SIP/ILS/Transaction/Renew.pm | 3 +++ > 3 files changed, 21 insertions(+), 16 deletions(-) > >diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm >index 3f4e136..e8f9c63 100644 >--- a/C4/SIP/ILS/Patron.pm >+++ b/C4/SIP/ILS/Patron.pm >@@ -38,21 +38,22 @@ sub new { > my ($class, $patron_id) = @_; > my $type = ref($class) || $class; > my $self; >- $kp = GetMember(cardnumber=>$patron_id); >- $debug and warn "new Patron (GetMember): " . Dumper($kp); >- unless (defined $kp) { >- syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id); >- return undef; >- } >- $kp = GetMemberDetails(undef,$patron_id); >- $debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); >- my $pw = $kp->{password}; ### FIXME - md5hash -- deal with . >- my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; >- my $debarred = $kp->{debarred}; # 1 if ($kp->{flags}->{DBARRED}->{noissues}); >- $debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}}); >- my ($day, $month, $year) = (localtime)[3,4,5]; >- my $today = sprintf '%04d-%02d-%02d', $year+1900, $month+1, $day; >- my $expired = ($today gt $kp->{dateexpiry}) ? 1 : 0; >+ $kp = GetMember( cardnumber => $patron_id ); >+ $debug and warn "new Patron (GetMember): " . Dumper($kp); >+ unless ( defined $kp ) { >+ syslog( "LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id ); >+ return undef; >+ } >+ $kp = GetMemberDetails( undef, $patron_id ); >+ $debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); >+ my $pw = $kp->{password}; ### FIXME - md5hash -- deal with . >+ my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; >+ my $debarred = defined($kp->{flags}->{DEBARRED}); # 1 if ($kp->{flags}->{DBARRED}->{noissues}); >+ $debug and warn sprintf( "Debarred = %s : ", ( $debarred || 'undef' ) ) . Dumper( %{ $kp->{flags} } ); >+ my ( $day, $month, $year ) = (localtime)[ 3, 4, 5 ]; >+ my $today = sprintf '%04d-%02d-%02d', $year + 1900, $month + 1, $day; >+ my $expired = ( $today gt $kp->{dateexpiry} ) ? 1 : 0; >+ > if ($expired) { > if ($kp->{opacnote} ) { > $kp->{opacnote} .= q{ }; >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index 8a14877..7cd4ca9 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -60,6 +60,7 @@ sub do_checkout { > $debug and warn "do_checkout borrower: . " . Dumper $borrower; > my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $barcode ); > my $noerror=1; >+ $debug and warn "do_checkout IssuingImpossible: . " , Dumper($issuingimpossible),"\n",Dumper($needsconfirmation); > if (scalar keys %$issuingimpossible) { > foreach (keys %$issuingimpossible) { > # do something here so we pass these errors >@@ -116,7 +117,7 @@ sub do_checkout { > $debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n" > # . "w/ \$borrower: " . Dumper($borrower) > . "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv); >- my $c4due = AddIssue($borrower, $barcode, undef, 0); >+ my $c4due = AddIssue($borrower, $barcode, undef, 0,undef,1); > my $due = $c4due->output('iso') || undef; > $debug and warn "Item due: $due"; > $self->{'due'} = $due; >diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm >index 73acaa3..57d6c9d 100644 >--- a/C4/SIP/ILS/Transaction/Renew.pm >+++ b/C4/SIP/ILS/Transaction/Renew.pm >@@ -37,6 +37,9 @@ sub do_renew_for ($$) { > my $borrower = shift; > my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber}); > if ($renewokay){ >+ #Why not AddRenewal ???? >+ #my $datedue = AddRenewal( $borrower, $self->{item}->id, undef, 0 ); >+ > my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 ); > $self->{due} = $datedue; > $self->renewal_ok(1); >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5632
:
3464
| 3554