Bugzilla – Attachment 9625 Details for
Bug 7758
Koha allowing LOST items to check out without alert
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7758 - Followup - Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items.
Bug-7758---Followup---Add-syspref-allow-a-choice-o.patch (text/plain), 6.41 KB, created by
Liz Rea
on 2012-05-16 20:34:43 UTC
(
hide
)
Description:
Bug 7758 - Followup - Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items.
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2012-05-16 20:34:43 UTC
Size:
6.41 KB
patch
obsolete
>From bf379a6557df984860c5a22ddadb3e5d75e8188a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 11 Apr 2012 09:55:55 -0400 >Subject: [PATCH] Bug 7758 - Followup - Add syspref allow a choice of blocking, non-blocking, or do nothing when issuing lost items. >Content-Type: text/plain; charset="utf-8" > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Works as advertised. >--- > C4/Circulation.pm | 10 +++++++--- > circ/circulation.pl | 4 +++- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 8 ++++++++ > .../prog/en/modules/circ/circulation.tt | 4 ++++ > 6 files changed, 30 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 4902c13..37b7e0e 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -668,6 +668,8 @@ sub CanBookBeIssued { > 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 %alerts; # filled with messages that shouldn't stop issuing, but the librarian should be aware of. >+ > my $item = GetItem(GetItemnumberFromBarcode( $barcode )); > my $issue = GetItemIssue($item->{itemnumber}); > my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); >@@ -849,8 +851,10 @@ sub CanBookBeIssued { > { > $issuingimpossible{RESTRICTED} = 1; > } >- if ( $item->{'itemlost'} ) { >- $needsconfirmation{ITEM_LOST} = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} ); >+ if ( $item->{'itemlost'} && C4::Context->preference("IssueLostItem") ne 'nothing' ) { >+ my $code = GetAuthorisedValueByCode( 'LOST', $item->{'itemlost'} ); >+ $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' ); >+ $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' ); > } > if ( C4::Context->preference("IndependantBranches") ) { > my $userenv = C4::Context->userenv; >@@ -927,7 +931,7 @@ sub CanBookBeIssued { > } > } > } >- return ( \%issuingimpossible, \%needsconfirmation ); >+ return ( \%issuingimpossible, \%needsconfirmation, \%alerts ); > } > > =head2 AddIssue >diff --git a/circ/circulation.pl b/circ/circulation.pl >index bcbcb6f..dd79777 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -275,10 +275,12 @@ if ($borrowernumber) { > # > if ($barcode) { > # always check for blockers on issuing >- my ( $error, $question ) = >+ my ( $error, $question, $alerts ) = > CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess ); > my $blocker = $invalidduedate ? 1 : 0; > >+ $template->param( alert => $alerts ); >+ > delete $question->{'DEBT'} if ($debt_confirmed); > foreach my $impossible ( keys %$error ) { > $template->param( >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 1edf08e..e84a94e 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -363,3 +363,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 38aa70c..1ed1dec 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5246,6 +5246,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.07.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice')"); >+ print "Upgrade to $DBversion done (Add system preference issuelostitem ))\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 471aa0e..2705d2e 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 >@@ -240,6 +240,14 @@ Circulation: > choices: > homebranch: the library the item is from. > holdingbranch: the library the item was checked out from. >+ - >+ - "When issuing an item that has been marked as lost, " >+ - pref: IssueLostItem >+ choices: >+ confirm: "require confirmation" >+ alert: "display a message" >+ nothing : "do nothing" >+ - . > Holds Policy: > - > - pref: AllowHoldPolicyOverride >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 1bceb0c..aaa0464 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -234,6 +234,10 @@ function refocus(calendar) { > </div> > [% END %] > >+[% IF ( alert.ITEM_LOST ) %] >+ <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST %]".</div> >+[% END %] >+ > [% IF ( NEEDSCONFIRMATION ) %] > <div class="yui-g"> > >-- >1.7.2.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 7758
:
8927
|
8931
|
9082
|
9087
|
9116
| 9625