Bugzilla – Attachment 11725 Details for
Bug 3387
WITHDRAWN items shouldn't check in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 3387 - WITHDRAWN items shouldn't check in
SIGNED-OFF-Bug-3387---WITHDRAWN-items-shouldnt-che.patch (text/plain), 7.75 KB, created by
Owen Leonard
on 2012-08-21 18:42:18 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 3387 - WITHDRAWN items shouldn't check in
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2012-08-21 18:42:18 UTC
Size:
7.75 KB
patch
obsolete
>From 6ef5dd637b33c618f9c324385869d5eed5905750 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 17 Jul 2012 09:42:59 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 3387 - WITHDRAWN items shouldn't check in >Content-Type: text/plain; charset="utf-8" > >Adds a system preference BlockReturnOfWithdrawnItems to control >whether or not Koha should allow a withdrawn item to be returned >or not. > >Also fixes the behavior where Koha will attempt to use a withdrawn >item to fill a hold. > >Test Plan: >1) Set BlockReturnOfWithdrawnItems to "Block" ( this is the default ) >2) Check an item out to a patron >3) Mark item as withdrawn >4) Attempt to return the item, you should still see the item on the > borrower's record >5) Set BlockReturnOfWithdrawnItems to "Don't Block" >6) Attempt to return the item, you should see the item is no longer > on the borrower's record. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Circulation.pm | 4 ++-- > circ/returns.pl | 12 ++---------- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 7 +++++++ > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 7 ++++++- > 6 files changed, 25 insertions(+), 13 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 78915ed..5b497c7 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1612,7 +1612,7 @@ sub AddReturn { > > if ( $item->{'wthdrawn'} ) { # book has been cancelled > $messages->{'wthdrawn'} = 1; >- $doreturn = 0; >+ $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); > } > > # case of a return of document (deal with issues and holdingbranch) >@@ -1698,7 +1698,7 @@ sub AddReturn { > > # find reserves..... > # if we don't have a reserve with the status W, we launch the Checkreserves routine >- my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); >+ my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} ); > if ($resfound) { > $resrec->{'ResFound'} = $resfound; > $messages->{'ResFound'} = $resrec; >diff --git a/circ/returns.pl b/circ/returns.pl >index 743bf18..d93b7cd 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -285,15 +285,6 @@ if ($barcode) { > $input{duedate} = 0; > $returneditems{0} = $barcode; > $riduedate{0} = 0; >- if ( $messages->{'wthdrawn'} ) { >- $input{withdrawn} = 1; >- $input{borrowernumber} = 'Item Cancelled'; # FIXME: should be in display layer ? >- $riborrowernumber{0} = 'Item Cancelled'; >- } >- else { >- $input{borrowernumber} = ' '; # This seems clearly bogus. >- $riborrowernumber{0} = ' '; >- } > push( @inputloop, \%input ); > } > } >@@ -438,7 +429,7 @@ foreach my $code ( keys %$messages ) { > } > elsif ( $code eq 'wthdrawn' ) { > $err{withdrawn} = 1; >- $exit_required_p = 1; >+ $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems"); > } > elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) { > if ( $messages->{'IsPermanent'} ne $userenv_branch ) { >@@ -610,6 +601,7 @@ $template->param( > dropboxdate => output_pref($dropboxdate), > overduecharges => $overduecharges, > soundon => C4::Context->preference("SoundOn"), >+ BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"), > ); > > ### Comment out rotating collections for now to allow it a little more time to bake >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f5a18b2..5893c5e 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -374,3 +374,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); >+INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); >\ No newline at end of file >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index ed0c674..c394008 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5635,6 +5635,13 @@ if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion ="3.09.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');"); >+ print "Upgrade to $DBversion done (Add system preference BlockReturnOfWithdrawnItems)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($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 a758b19..5af4e18 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 >@@ -255,6 +255,13 @@ Circulation: > alert: "display a message" > nothing : "do nothing" > - . >+ Checkin Policy: >+ - >+ - pref: BlockReturnOfWithdrawnItems >+ choices: >+ yes: Block >+ no: "Don't block" >+ - returning of items that have been withdrawn. > Holds Policy: > - > - pref: AllowHoldPolicyOverride >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 1ffa114..1758f2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -335,7 +335,12 @@ $(document).ready(function () { > <p class="problem">Item was lost, now found.</p> > [% END %] > [% IF ( errmsgloo.withdrawn ) %] >- <p class="problem">Item is withdrawn.</p> >+ [% IF BlockReturnOfWithdrawnItems %] >+ <h3>Cannot Check In</h3> >+ <p class="problem">Item is withdrawn. <strong>NOT CHECKED IN</strong></p> >+ [% ELSE %] >+ <p class="problem">Item is withdrawn.</p> >+ [% END %] > [% END %] > [% IF ( errmsgloo.debarred ) %] > <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p> >-- >1.7.9.5
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 3387
:
10891
|
10907
|
10911
|
10941
| 11725 |
12524