Bugzilla – Attachment 7177 Details for
Bug 7090
Add "AllowItemsOnHoldCheckout" syspref to allow issue to the patron regardless of hold status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rebased Patch (2012-01-16)
0001-bug_7090-AllowItemsOnHoldCheckout-syspref.patch (text/plain), 10.89 KB, created by
Ian Walls
on 2012-01-16 20:10:26 UTC
(
hide
)
Description:
Rebased Patch (2012-01-16)
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2012-01-16 20:10:26 UTC
Size:
10.89 KB
patch
obsolete
>From 3413808efa8dd32781c1ab550a3b4dbfb3efc042 Mon Sep 17 00:00:00 2001 >From: Srdjan Jankovic <srdjan@catalyst.net.nz> >Date: Wed, 21 Dec 2011 21:26:30 +1300 >Subject: [PATCH] bug_7090: AllowItemsOnHoldCheckout syspref > >Observe AllowItemsOnHandCheckout syspref when using self checkout >--- > C4/Circulation.pm | 68 ++++++++++--------- > C4/SIP/ILS/Transaction/Checkout.pm | 8 ++- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 ++ > .../en/modules/admin/preferences/circulation.pref | 6 ++ > opac/sco/sco-main.pl | 16 ++++- > 6 files changed, 71 insertions(+), 35 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9a6f4f2..5b03b37 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -570,7 +570,7 @@ sub itemissues { > =head2 CanBookBeIssued > > ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, >- $barcode, $duedatespec, $inprocess ); >+ $barcode, $duedatespec, $inprocess, $ignore_reserves ); > > Check if a book can be issued. > >@@ -584,7 +584,8 @@ C<$issuingimpossible> and C<$needsconfirmation> are some hashref. > > =item C<$duedatespec> is a C4::Dates object. > >-=item C<$inprocess> >+=item C<$inprocess> boolean switch >+=item C<$ignore_reserves> boolean switch > > =back > >@@ -661,7 +662,7 @@ if the borrower borrows to much things > =cut > > sub CanBookBeIssued { >- my ( $borrower, $barcode, $duedate, $inprocess ) = @_; >+ my ( $borrower, $barcode, $duedate, $inprocess, $ignore_reserves ) = @_; > my %needsconfirmation; # filled with problems that needs confirmations > my %issuingimpossible; # filled with problems that causes the issue to be IMPOSSIBLE > my $item = GetItem(GetItemnumberFromBarcode( $barcode )); >@@ -868,37 +869,40 @@ sub CanBookBeIssued { > $needsconfirmation{issued_borrowernumber} = $currborinfo->{'borrowernumber'}; > } > >- # See if the item is on reserve. >- my ( $restype, $res, undef ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); >- if ($restype) { >- my $resbor = $res->{'borrowernumber'}; >- my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor ); >- my $branches = GetBranches(); >- my $branchname = $branches->{ $res->{'branchcode'} }->{'branchname'}; >- if ( $resbor ne $borrower->{'borrowernumber'} && $restype eq "Waiting" ) >- { >- # The item is on reserve and waiting, but has been >- # reserved by some other patron. >- $needsconfirmation{RESERVE_WAITING} = 1; >- $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'}; >- $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; >- $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; >- $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >- $needsconfirmation{'resbranchname'} = $branchname; >- $needsconfirmation{'reswaitingdate'} = format_date($res->{'waitingdate'}); >- } >- elsif ( $restype eq "Reserved" ) { >- # The item is on reserve for someone else. >- $needsconfirmation{RESERVED} = 1; >- $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'}; >- $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; >- $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; >- $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >- $needsconfirmation{'resbranchname'} = $branchname; >- $needsconfirmation{'resreservedate'} = format_date($res->{'reservedate'}); >+ unless ( $ignore_reserves ) { >+ # See if the item is on reserve. >+ my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); >+ if ($restype) { >+ my $resbor = $res->{'borrowernumber'}; >+ if ( $resbor ne $borrower->{'borrowernumber'} ) { >+ my ( $resborrower ) = C4::Members::GetMember( borrowernumber => $resbor ); >+ my $branchname = GetBranchName( $res->{'branchcode'} ); >+ if ( $restype eq "Waiting" ) >+ { >+ # The item is on reserve and waiting, but has been >+ # reserved by some other patron. >+ $needsconfirmation{RESERVE_WAITING} = 1; >+ $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'}; >+ $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; >+ $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; >+ $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >+ $needsconfirmation{'resbranchname'} = $branchname; >+ $needsconfirmation{'reswaitingdate'} = format_date($res->{'waitingdate'}); >+ } >+ elsif ( $restype eq "Reserved" ) { >+ # The item is on reserve for someone else. >+ $needsconfirmation{RESERVED} = 1; >+ $needsconfirmation{'resfirstname'} = $resborrower->{'firstname'}; >+ $needsconfirmation{'ressurname'} = $resborrower->{'surname'}; >+ $needsconfirmation{'rescardnumber'} = $resborrower->{'cardnumber'}; >+ $needsconfirmation{'resborrowernumber'} = $resborrower->{'borrowernumber'}; >+ $needsconfirmation{'resbranchname'} = $branchname; >+ $needsconfirmation{'resreservedate'} = format_date($res->{'reservedate'}); >+ } >+ } > } > } >- return ( \%issuingimpossible, \%needsconfirmation ); >+ return ( \%issuingimpossible, \%needsconfirmation ); > } > > =head2 AddIssue >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index 8a14877..617a4eb 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -58,7 +58,13 @@ sub do_checkout { > $debug and warn "do_checkout: patron (" . $patron_barcode . ")"; > my $borrower = $self->{patron}->getmemberdetails_object(); > $debug and warn "do_checkout borrower: . " . Dumper $borrower; >- my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $barcode ); >+ my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( >+ $borrower, >+ $barcode, >+ undef, >+ 0, >+ C4::Context->preference("AllowItemsOnHoldCheckout") >+ ); > my $noerror=1; > if (scalar keys %$issuingimpossible) { > foreach (keys %$issuingimpossible) { >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 918df5c..3ee40ea 100755 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -330,3 +330,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CircAutoPrintQuickSlip', '1', 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.',NULL,'YesNo'); >+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0a3603d..24a5a56 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4620,6 +4620,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > } > > >+$DBversion = "3.07.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AllowItemsOnHoldCheckout',0,'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','','YesNo')"); >+ print "Upgrade to $DBversion add 'AllowItemsOnHoldCheckout' syspref \n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 817ce57..d58b7e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -112,6 +112,12 @@ Circulation: > no: "Don't allow" > - staff to manually override the renewal limit and renew a checkout when it would go over the renewal limit. > - >+ - pref: AllowItemsOnHoldCheckout >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - checkouts of items items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items. >+ - > - pref: AllFinesNeedOverride > choices: > yes: Require >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index a1a3ce6..7e4f810 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -132,7 +132,13 @@ elsif ( $op eq "checkout" ) { > my $impossible = {}; > my $needconfirm = {}; > if ( !$confirmed ) { >- ( $impossible, $needconfirm ) = CanBookBeIssued( $borrower, $barcode ); >+ ( $impossible, $needconfirm ) = CanBookBeIssuedCheckout( >+ $borrower, >+ $barcode, >+ undef, >+ 0, >+ C4::Context->preference("AllowItemsOnHoldCheckout") >+ ); > } > $confirm_required = scalar keys %$needconfirm; > >@@ -213,7 +219,13 @@ if ($borrower->{cardnumber}) { > 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; > } >-- >1.7.4.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 7090
:
6069
|
6900
|
7177
|
7413