Bugzilla – Attachment 28147 Details for
Bug 11629
Add ability to update not for loan status on checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11629 - Add ability to update not for loan status on checkin
Bug-11629---Add-ability-to-update-not-for-loan-sta.patch (text/plain), 6.22 KB, created by
Kyle M Hall (khall)
on 2014-05-09 16:57:25 UTC
(
hide
)
Description:
Bug 11629 - Add ability to update not for loan status on checkin
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-05-09 16:57:25 UTC
Size:
6.22 KB
patch
obsolete
>From 6cb9e8e327a6186d7f9b996161139ce8ab66875e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 28 Jan 2014 11:43:50 -0500 >Subject: [PATCH] Bug 11629 - Add ability to update not for loan status on checkin > >Some libraries would like to streamline the cataloging process my >automatically updating notforloan values on checkin. For example, an >item is set to notforloan of -1 ( ordered ). The item, is received, >processed, and checked in for the first time before being shelved. >The checkin automatically changes the nfl value from -1 to 0. The >same workflow could be used for damaged items as well. > >Test Plan: >1) Apply this patch >2) Run updatedatabase.pl >3) Set the new system preference UpdateNotForLoanStatusOnCheckin > to the following: >-1: 0 >0: 1 >4) Create an item, set it's notforloan value to -1 >5) Check in the item, note its not for loan value is now 0 >6) Check in the item again, note its not for loan value is now 1 >7) Check in the item again, note its not for loan value reamins 1 > >Signed-off-by: Havilah Lyon <havilah@aflibrary.org> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Testing notes on last patch. >--- > C4/Circulation.pm | 19 +++++++++++++++++++ > installer/data/mysql/sysprefs.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 7 +++++++ > 4 files changed, 35 insertions(+), 0 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 639956b..e15db1c 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1756,6 +1756,25 @@ sub AddReturn { > > my $borrowernumber = $borrower->{'borrowernumber'} || undef; # we don't know if we had a borrower or not > >+ my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin'); >+ if ($yaml) { >+ $yaml = "$yaml\n\n"; # YAML is anal on ending \n. Surplus does not hurt >+ my $rules; >+ eval { $rules = YAML::Load($yaml); }; >+ if ($@) { >+ warn "Unable to parse UpdateNotForLoanStatusOnCheckin syspref : $@"; >+ } >+ else { >+ foreach my $key ( keys %$rules ) { >+ if ( $item->{notforloan} eq $key ) { >+ ModItem( { notforloan => $rules->{$key} }, undef, $itemnumber ); >+ last; >+ } >+ } >+ } >+ } >+ >+ > # check if the book is in a permanent collection.... > # FIXME -- This 'PE' attribute is largely undocumented. afaict, there's no user interface that reflects this functionality. > if ( $hbr ) { >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index be2f63f..27eee15 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -408,7 +408,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('TrackClicks','0',NULL,'Track links clicked','Integer'), > ('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'), > ('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'), >+('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'), > ('UNIMARCAuthorityField100','afrey50 ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'), >+('UNIMARCAuthorityField100','afrey50 ba0',NULL,NULL,'Textarea'), > ('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'), > ('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'), > ('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3b1718c..fb8994e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8465,6 +8465,13 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if (CheckVersion($DBversion)) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free');"); >+ print "Upgrade to $DBversion done (Bug 11629 - Add ability to update not for loan status on checkin)\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 ad0d78b..81065f9 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 >@@ -363,6 +363,13 @@ Circulation: > no: "Don't" > - calculate and update overdue charges when an item is returned. > - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b> >+ - >+ - pref: UpdateNotForLoanStatusOnCheckin >+ type: textarea >+ class: code >+ - This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value >+ - "it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan." >+ - Each pair of values should be on a separate line. > Holds Policy: > - > - pref: AllowHoldPolicyOverride >-- >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 11629
:
24848
|
24849
|
24962
|
24963
|
24964
|
25229
|
25580
|
25581
|
25582
|
25583
|
27233
|
27244
|
27245
|
27246
|
27247
|
27248
|
27249
|
27250
|
27251
|
27252
| 28147 |
28148
|
28149
|
28150
|
28151
|
28152