From b61a05845955b25cb7fc0c457886ff33ea9c7916 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 25 Jun 2014 07:51:53 -0400 Subject: [PATCH] Bug 9805 [QA Followup] - Add system preference --- C4/Circulation.pm | 13 +++++++------ installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 10 ++++++++++ .../en/modules/admin/preferences/circulation.pref | 7 +++++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 68e52f8..a565908 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -2725,17 +2725,18 @@ sub AddRenewal { $renews = $biblio->{'renewals'} + 1; # If item was lost, it has now been found, reverse any list item charges if neccessary. - if ( $item->{'itemlost'} ) { - if ( C4::Context->preference('RefundLostItemFeeOnReturn') ) { - _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); - } + if ( $item->{'itemlost'} && C4::Context->preference('RemoveLostStatusOnRenewal') ) { + + _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ) + if C4::Context->preference('RefundLostItemFeeOnReturn'); + + ModItem( { itemlost => 0, }, $biblio->{'biblionumber'}, $itemnumber ); } ModItem( { renewals => $renews, - onloan => $datedue->strftime('%Y-%m-%d %H:%M'), - itemlost => 0, + onloan => $datedue->strftime('%Y-%m-%d %H:%M'), }, $biblio->{'biblionumber'}, $itemnumber diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 5e4ce7c..72614d2 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -329,6 +329,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), ('RefundLostItemFeeOnReturn','1',NULL,'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.','YesNo'), +('RemoveLostStatusOnRenewal','0', NULL,'If enabled, renewals mark lost items as found in the same manner as returns','YesNo'), ('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'), ('RenewalSendNotice','0','',NULL,'YesNo'), ('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c68ba51..924ad4a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8560,6 +8560,16 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + VALUES ('RemoveLostStatusOnRenewal','0', NULL,'If enabled, renewals mark lost items as found in the same manner as returns','YesNo') + }); + print "Upgrade to $DBversion done (Bug 11169 - Add OPACAcquisitionDetails syspref)\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 5a768a6..bd558e6 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 @@ -344,6 +344,13 @@ Circulation: nothing : "do nothing" - . - + - "When renewing an item that has been marked as lost, " + - pref: RemoveLostStatusOnRenewal + choices: + yes: "do" + no: "do not" + - mark the as found in the same manner as a return would. + - - pref: AllowMultipleIssuesOnABiblio choices: yes: Allow -- 1.7.2.5