Bugzilla – Attachment 114422 Details for
Bug 26814
Add onsite_checkout to circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26814: Add onsite_checkout to set_rules
Bug-26814-Add-onsitecheckout-to-setrules.patch (text/plain), 36.20 KB, created by
Lari Taskula
on 2020-12-15 23:31:45 UTC
(
hide
)
Description:
Bug 26814: Add onsite_checkout to set_rules
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2020-12-15 23:31:45 UTC
Size:
36.20 KB
patch
obsolete
>From 7c1f7efa7e3e2b1e64fa255ff4202ea379746a7a Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Sat, 11 Apr 2020 17:25:57 +0000 >Subject: [PATCH] Bug 26814: Add onsite_checkout to set_rules > >To test: >1. Find all occurrences of set_rules that are missing onsite_checkout > where required > >grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ >--exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' \ >--exclude="smart-rules.pl" --exclude="smart-rules.tt" | \ >grep -avz 'onsite_checkout' | less > > The only occasions this should return anything are cases where > a HASH or HASHref is given to set_rules(), or that we are > explicitly testing missing parameters in an unit test, or that > rules are only related to holds > > 1.2 Verify the HASH/HASHref cases. The hash should contain > a onsite_checkout (unless the rule is related to holds) > >2. Find all subroutines using set_rules() > >git grep --no-index -n -p -P 'set_rules\s*\(' | grep -v 'sub {' \ >| grep -P 'sub .*' > > 2.1 The only return should be > t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t=401= > sub set_holdallowed_rule { > >3. The boring step. Find all occurrences of set_rules() with > the following command: > >grep --exclude-dir='.git' -Prn 'set_rules' > > Go through this list and make sure all neccessary locations are > updated. A change is required when the rule scope includes > onsite_checkout. See Koha/CirculationRules.pm for scopes. > Hold/reserve related rules do not require it. > >Sponsored-by: The National Library of Finland >--- > installer/onboarding.pl | 2 + > .../en/modules/onboarding/onboardingstep5.tt | 10 +++ > t/db_dependent/Circulation.t | 69 ++++++++++++++++++- > t/db_dependent/Circulation/CalcDateDue.t | 4 ++ > t/db_dependent/Circulation/GetHardDueDate.t | 43 +++++++++--- > .../IssuingRules/maxsuspensiondays.t | 4 ++ > t/db_dependent/Circulation/Returns.t | 1 + > t/db_dependent/Circulation/issue.t | 3 + > t/db_dependent/DecreaseLoanHighHolds.t | 22 ++++++ > t/db_dependent/Fines.t | 2 + > t/db_dependent/Holds.t | 11 +++ > .../Holds/DisallowHoldIfItemsAvailable.t | 48 +++++++++++-- > t/db_dependent/Koha/Charges/Fees.t | 2 + > t/db_dependent/SIP/ILS.t | 11 +++ > t/db_dependent/SIP/Transaction.t | 23 +++++++ > t/db_dependent/api/v1/checkouts.t | 1 + > t/db_dependent/selenium/basic_workflow.t | 6 ++ > 17 files changed, 246 insertions(+), 16 deletions(-) > >diff --git a/installer/onboarding.pl b/installer/onboarding.pl >index d8626671eb..7acd42a1af 100755 >--- a/installer/onboarding.pl >+++ b/installer/onboarding.pl >@@ -241,6 +241,7 @@ if ( $step == 5 ) { > my $branchcode = $input->param('branch'); > my $categorycode = $input->param('categorycode'); > my $itemtype = $input->param('itemtype'); >+ my $onsite_checkout = $input->param('onsite_checkout'); > my $maxissueqty = $input->param('maxissueqty'); > my $issuelength = $input->param('issuelength'); > my $lengthunit = $input->param('lengthunit'); >@@ -258,6 +259,7 @@ if ( $step == 5 ) { > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, >+ onsite_checkout => $onsite_checkout, > rules => { > renewalsallowed => $renewalsallowed, > renewalperiod => $renewalperiod, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >index e70870f500..8cd4fe27c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt >@@ -67,6 +67,16 @@ > </select> > <span class="required"> Required</span> > </li> >+ <li> >+ <label for="itemtype"> Checkout type: </label> >+ <select id="onsite_checkout" name="onsite_checkout" required="required"> >+ <option value=""> Choose </option> >+ <option value="*" selected="selected">All</option> >+ <option value="CHECKOUT">Normal checkout</option> >+ <option value="ONSITE">On-site checkout</option> >+ </select> >+ <span class="required"> Required</span> >+ </li> > <li> > <label for="maxissueqty" class="required">Current checkouts allowed: </label> > <input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" value="50" class="required" required="required" /> >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index be320000af..d6e441d808 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -270,6 +270,17 @@ Koha::CirculationRules->set_rules( > itemtype => undef, > rules => { > reservesallowed => 25, >+ } >+ } >+); >+ >+Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ onsite_checkout => undef, >+ rules => { > issuelength => 14, > lengthunit => 'days', > renewalsallowed => 1, >@@ -778,6 +789,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '7', > no_auto_renewal_after => '9', >@@ -794,6 +806,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '7', > no_auto_renewal_after => '10', >@@ -810,6 +823,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '7', > no_auto_renewal_after => '11', >@@ -826,6 +840,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '11', >@@ -842,6 +857,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => undef, >@@ -859,6 +875,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '7', > no_auto_renewal_after => '15', >@@ -876,6 +893,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => undef, >@@ -907,6 +925,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '11', >@@ -997,6 +1016,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => 10, > no_auto_renewal_after => 11, >@@ -1060,6 +1080,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '7', > no_auto_renewal_after => '', >@@ -1075,6 +1096,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '5', >@@ -1096,6 +1118,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '15', >@@ -1114,6 +1137,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '', >@@ -1131,6 +1155,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => '10', > no_auto_renewal_after => '15', >@@ -1153,6 +1178,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => undef, > renewalsallowed => 0, >@@ -1170,6 +1196,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > unseen_renewals_allowed => 2, > renewalsallowed => 10, >@@ -1186,6 +1213,7 @@ subtest "CanBookBeRenewed tests" => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > norenewalbefore => undef, > renewalsallowed => 0, >@@ -1431,6 +1459,16 @@ subtest "AllowRenewalIfOtherItemsAvailable tests" => sub { > branchcode => undef, > rules => { > reservesallowed => 25, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef, >+ onsite_checkout => undef, >+ rules => { > issuelength => 14, > lengthunit => 'days', > renewalsallowed => 1, >@@ -2058,6 +2096,7 @@ subtest 'AddReturn + CumulativeRestrictionPeriods' => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > issuelength => 1, > firstremind => 1, # 1 day of grace >@@ -2164,6 +2203,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > categorycode => '*', > itemtype => '*', > branchcode => '*', >+ onsite_checkout => '*', > rules => { > issuelength => 1, > firstremind => 0, # 0 day of grace >@@ -2196,6 +2236,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > categorycode => '*', > itemtype => '*', > branchcode => '*', >+ onsite_checkout => '*', > rules => { > issuelength => 1, > firstremind => undef, # 0 day of grace >@@ -2252,6 +2293,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > suspension_chargeperiod => 3, > firstremind => 1, >@@ -2276,6 +2318,7 @@ subtest 'AddReturn + suspension_chargeperiod' => sub { > categorycode => undef, > branchcode => undef, > itemtype => undef, >+ onsite_checkout => undef, > rules => { > finedays => 2, > suspension_chargeperiod => 1, >@@ -2445,6 +2488,7 @@ subtest 'AddReturn | is_overdue' => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > issuelength => 6, > lengthunit => 'days', >@@ -3395,8 +3439,19 @@ subtest 'CanBookBeIssued | is_overdue' => sub { > branchcode => undef, > itemtype => undef, > rules => { >- maxissueqty => 1, > reservesallowed => 25, >+ } >+ } >+ ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => undef, >+ branchcode => undef, >+ itemtype => undef, >+ onsite_checkout => undef, >+ rules => { >+ maxissueqty => 1, > issuelength => 14, > lengthunit => 'days', > renewalsallowed => 1, >@@ -3442,6 +3497,16 @@ subtest 'ItemsDeniedRenewal preference' => sub { > branchcode => $idr_lib->branchcode, > rules => { > reservesallowed => 25, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => '*', >+ itemtype => '*', >+ branchcode => $idr_lib->branchcode, >+ onsite_checkout => '*', >+ rules => { > issuelength => 14, > lengthunit => 'days', > renewalsallowed => 10, >@@ -4200,6 +4265,7 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge with AddReturn' => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > issuelength => 14, > lengthunit => 'days', >@@ -4394,6 +4460,7 @@ subtest 'Tests for NoRefundOnLostReturnedItemsAge with AddIssue' => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > issuelength => 14, > lengthunit => 'days', >diff --git a/t/db_dependent/Circulation/CalcDateDue.t b/t/db_dependent/Circulation/CalcDateDue.t >index 8085dbd486..0c235d0bee 100755 >--- a/t/db_dependent/Circulation/CalcDateDue.t >+++ b/t/db_dependent/Circulation/CalcDateDue.t >@@ -10,6 +10,7 @@ use t::lib::Mocks; > use t::lib::TestBuilder; > use C4::Calendar; > >+use Koha::Checkouts; > use Koha::CirculationRules; > > use_ok('C4::Circulation'); >@@ -21,6 +22,7 @@ my $builder = t::lib::TestBuilder->new; > my $categorycode = 'B'; > my $itemtype = 'MX'; > my $branchcode = 'FPL'; >+my $onsite_checkout = 0; > my $issuelength = 10; > my $renewalperiod = 5; > my $lengthunit = 'days'; >@@ -31,6 +33,7 @@ Koha::CirculationRules->set_rules( > categorycode => $categorycode, > itemtype => $itemtype, > branchcode => $branchcode, >+ onsite_checkout => $onsite_checkout, > rules => { > issuelength => $issuelength, > renewalperiod => $renewalperiod, >@@ -170,6 +173,7 @@ Koha::CirculationRules->set_rules( > categorycode => $dayweek_categorycode, > itemtype => $dayweek_itemtype, > branchcode => $dayweek_branchcode, >+ onsite_checkout => $onsite_checkout, > rules => { > issuelength => $dayweek_issuelength, > renewalperiod => $dayweek_renewalperiod, >diff --git a/t/db_dependent/Circulation/GetHardDueDate.t b/t/db_dependent/Circulation/GetHardDueDate.t >index 275ecc426e..70cab35f5e 100755 >--- a/t/db_dependent/Circulation/GetHardDueDate.t >+++ b/t/db_dependent/Circulation/GetHardDueDate.t >@@ -5,6 +5,7 @@ use C4::Context; > use DateTime; > use Koha::Database; > use Koha::DateUtils; >+use Koha::Checkouts; > use Koha::CirculationRules; > use Koha::Library; > >@@ -120,6 +121,7 @@ my $sampleissuingrule1 = { > branchcode => $samplebranch1->{branchcode}, > categorycode => $samplecat->{categorycode}, > itemtype => $sampleitemtype1, >+ onsite_checkout => 0, > rules => { > finedays => 0, > lengthunit => 'days', >@@ -130,7 +132,6 @@ my $sampleissuingrule1 = { > chargeperiod => 0, > chargeperiod_charge_at => 0, > rentaldiscount => 2, >- reservesallowed => 0, > hardduedate => '2013-01-01', > fine => 0, > hardduedatecompare => 5, >@@ -138,14 +139,21 @@ my $sampleissuingrule1 = { > renewalsallowed => 0, > firstremind => 0, > maxsuspensiondays => 0, >- onshelfholds => 0, >- opacitemholds => 'N', > cap_fine_to_replacement_price => 0, >- holds_per_record => 1, >- article_requests => 'yes', > no_auto_renewal_after => undef, > no_auto_renewal_after_hard_limit => undef, > suspension_chargeperiod => 1, >+ } >+}; >+my $sampleissuingrule1_holds = { >+ branchcode => $samplebranch1->{branchcode}, >+ categorycode => $samplecat->{categorycode}, >+ itemtype => $sampleitemtype1, >+ rules => { >+ onshelfholds => 0, >+ opacitemholds => 'N', >+ holds_per_record => 1, >+ article_requests => 'yes', > holds_per_day => undef, > } > }; >@@ -153,12 +161,12 @@ my $sampleissuingrule2 = { > branchcode => $samplebranch2->{branchcode}, > categorycode => $samplecat->{categorycode}, > itemtype => $sampleitemtype1, >+ onsite_checkout => 0, > rules => { > renewalsallowed => 0, > renewalperiod => 2, > norenewalbefore => 7, > auto_renew => 0, >- reservesallowed => 0, > issuelength => 2, > lengthunit => 'days', > hardduedate => 2, >@@ -171,9 +179,16 @@ my $sampleissuingrule2 = { > rentaldiscount => 2.00, > overduefinescap => undef, > maxsuspensiondays => 0, >+ cap_fine_to_replacement_price => 0, >+ } >+}; >+my $sampleissuingrule2_holds = { >+ branchcode => $samplebranch2->{branchcode}, >+ categorycode => $samplecat->{categorycode}, >+ itemtype => $sampleitemtype1, >+ rules => { > onshelfholds => 1, > opacitemholds => 'Y', >- cap_fine_to_replacement_price => 0, > holds_per_record => 1, > article_requests => 'yes', > } >@@ -182,12 +197,12 @@ my $sampleissuingrule3 = { > branchcode => $samplebranch1->{branchcode}, > categorycode => $samplecat->{categorycode}, > itemtype => $sampleitemtype2, >+ onsite_checkout => 0, > rules => { > renewalsallowed => 0, > renewalperiod => 3, > norenewalbefore => 8, > auto_renew => 0, >- reservesallowed => 0, > issuelength => 3, > lengthunit => 'days', > hardduedate => 3, >@@ -200,9 +215,16 @@ my $sampleissuingrule3 = { > rentaldiscount => 3.00, > overduefinescap => undef, > maxsuspensiondays => 0, >+ cap_fine_to_replacement_price => 0, >+ } >+}; >+my $sampleissuingrule3_holds = { >+ branchcode => $samplebranch1->{branchcode}, >+ categorycode => $samplecat->{categorycode}, >+ itemtype => $sampleitemtype2, >+ rules => { > onshelfholds => 1, > opacitemholds => 'F', >- cap_fine_to_replacement_price => 0, > holds_per_record => 1, > article_requests => 'yes', > } >@@ -211,6 +233,9 @@ my $sampleissuingrule3 = { > Koha::CirculationRules->set_rules( $sampleissuingrule1 ); > Koha::CirculationRules->set_rules( $sampleissuingrule2 ); > Koha::CirculationRules->set_rules( $sampleissuingrule3 ); >+Koha::CirculationRules->set_rules( $sampleissuingrule1_holds ); >+Koha::CirculationRules->set_rules( $sampleissuingrule2_holds ); >+Koha::CirculationRules->set_rules( $sampleissuingrule3_holds ); > > #Test GetLoanLength > is_deeply( >diff --git a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t >index bdb9d5aee6..0198c3f219 100755 >--- a/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t >+++ b/t/db_dependent/Circulation/IssuingRules/maxsuspensiondays.t >@@ -33,6 +33,7 @@ Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > firstremind => 0, > finedays => 2, >@@ -90,6 +91,7 @@ Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > maxsuspensiondays => 10, > } >@@ -113,6 +115,7 @@ subtest "suspension_chargeperiod" => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > firstremind => 0, > finedays => 7, >@@ -139,6 +142,7 @@ subtest "maxsuspensiondays" => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > firstremind => 0, > finedays => 15, >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index 5a2c4ded1b..4c614842aa 100755 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -237,6 +237,7 @@ subtest 'Handle ids duplication' => sub { > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > chargeperiod => 1, > fine => 1, >diff --git a/t/db_dependent/Circulation/issue.t b/t/db_dependent/Circulation/issue.t >index 3fbf46c590..4a5e0265d0 100755 >--- a/t/db_dependent/Circulation/issue.t >+++ b/t/db_dependent/Circulation/issue.t >@@ -93,6 +93,7 @@ Koha::CirculationRules->set_rules( > itemtype => '*', > categorycode => '*', > branchcode => '*', >+ onsite_checkout => '*', > rules => { > lengthunit => 'days', > issuelength => 0, >@@ -355,6 +356,7 @@ Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > renewalsallowed => 3, > } >@@ -498,6 +500,7 @@ Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > renewalsallowed => 10, > unseen_renewals_allowed => 3 >diff --git a/t/db_dependent/DecreaseLoanHighHolds.t b/t/db_dependent/DecreaseLoanHighHolds.t >index 9e25fafba9..cd85f78a1e 100755 >--- a/t/db_dependent/DecreaseLoanHighHolds.t >+++ b/t/db_dependent/DecreaseLoanHighHolds.t >@@ -104,9 +104,20 @@ Koha::CirculationRules->set_rules( > branchcode => undef, > categorycode => undef, > itemtype => $item->itype, >+ onsite_checkout => undef, > rules => { > issuelength => '14', > lengthunit => 'days', >+ } >+ } >+); >+ >+Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => $item->itype, >+ rules => { > reservesallowed => '99', > holds_per_record => '99', > decreaseloanholds => 0, >@@ -141,9 +152,20 @@ Koha::CirculationRules->set_rules( > branchcode => undef, > categorycode => undef, > itemtype => $item->itype, >+ onsite_checkout => undef, > rules => { > issuelength => '14', > lengthunit => 'days', >+ } >+ } >+); >+ >+Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => $item->itype, >+ rules => { > reservesallowed => '99', > holds_per_record => '99', > decreaseloanholds => undef, >diff --git a/t/db_dependent/Fines.t b/t/db_dependent/Fines.t >index 76cc0638a9..f132f1e78b 100755 >--- a/t/db_dependent/Fines.t >+++ b/t/db_dependent/Fines.t >@@ -20,6 +20,7 @@ my $issuingrule = Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > fine => 1, > finedays => 0, >@@ -49,6 +50,7 @@ $issuingrule = Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > chargeperiod_charge_at => 1, > } >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 7ad86b9783..d0a97403a1 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -1244,10 +1244,21 @@ subtest 'non priority holds' => sub { > Koha::CirculationRules->set_rules( > { > branchcode => undef, >+ onsite_checkout => undef, > categorycode => undef, > itemtype => undef, > rules => { > renewalsallowed => 5, >+ } >+ } >+ ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { > reservesallowed => 5, > } > } >diff --git a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >index a815713d43..f224784ff5 100755 >--- a/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >+++ b/t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t >@@ -88,13 +88,22 @@ Koha::CirculationRules->set_rules( > itemtype => $itemtype, > branchcode => undef, > rules => { >- issuelength => 7, >- lengthunit => 8, > reservesallowed => 99, > onshelfholds => 2, > } > } > ); >+Koha::CirculationRules->set_rules( >+ { categorycode => undef, >+ itemtype => $itemtype, >+ branchcode => undef, >+ onsite_checkout => undef, >+ rules => { >+ issuelength => 7, >+ lengthunit => 8, >+ } >+ } >+); > > my $is; > >@@ -303,11 +312,20 @@ Koha::CirculationRules->set_rules( > itemtype => $itemtype2, > branchcode => undef, > rules => { >- maxissueqty => 99, > onshelfholds => 0, > } > } > ); >+Koha::CirculationRules->set_rules( >+ { categorycode => undef, >+ itemtype => $itemtype2, >+ branchcode => undef, >+ onsite_checkout => undef, >+ rules => { >+ maxissueqty => 99, >+ } >+ } >+); > > $is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber, patron => $patron1 } ); # patron1 in library A, library A 1 item > is( $is, 1, "Items availability: 1 item is available, 1 item held in T" ); >@@ -349,8 +367,6 @@ subtest 'Check holds availability with different item types' => sub { > itemtype => $itemtype, > branchcode => undef, > rules => { >- issuelength => 7, >- lengthunit => 8, > reservesallowed => 99, > holds_per_record => 99, > onshelfholds => 2, >@@ -359,17 +375,37 @@ subtest 'Check holds availability with different item types' => sub { > ); > Koha::CirculationRules->set_rules( > { categorycode => undef, >- itemtype => $itemtype2, >+ itemtype => $itemtype, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > issuelength => 7, > lengthunit => 8, >+ } >+ } >+ ); >+ Koha::CirculationRules->set_rules( >+ { categorycode => undef, >+ itemtype => $itemtype2, >+ branchcode => undef, >+ rules => { > reservesallowed => 0, > holds_per_record => 0, > onshelfholds => 2, > } > } > ); >+ Koha::CirculationRules->set_rules( >+ { categorycode => undef, >+ itemtype => $itemtype2, >+ branchcode => undef, >+ onsite_checkout => undef, >+ rules => { >+ issuelength => 7, >+ lengthunit => 8, >+ } >+ } >+ ); > > $is = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblionumber1, patron => $patron1 } ); > is( $is, 1, "Items availability: 2 items, one allowed by smart rule but not checked out, another one not allowed to be held by smart rule" ); >diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t >index 637aaa278f..0cc067a15c 100755 >--- a/t/db_dependent/Koha/Charges/Fees.t >+++ b/t/db_dependent/Koha/Charges/Fees.t >@@ -327,6 +327,7 @@ subtest 'accumulate_rentalcharge tests' => sub { > categorycode => $patron->categorycode, > itemtype => $itemtype->id, > branchcode => $library->id, >+ onsite_checkout => undef, > rules => { > lengthunit => 'days', > } >@@ -388,6 +389,7 @@ subtest 'accumulate_rentalcharge tests' => sub { > categorycode => $patron->categorycode, > itemtype => $itemtype->id, > branchcode => $library->id, >+ onsite_checkout => undef, > rules => { > lengthunit => 'hours', > } >diff --git a/t/db_dependent/SIP/ILS.t b/t/db_dependent/SIP/ILS.t >index f08a259621..0e21a4a0c9 100755 >--- a/t/db_dependent/SIP/ILS.t >+++ b/t/db_dependent/SIP/ILS.t >@@ -96,6 +96,17 @@ subtest cancel_hold => sub { > onshelfholds => 1, > reservesallowed => 3, > holds_per_record => 3, >+ } >+ } >+ ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $patron->categorycode, >+ branchcode => $library->branchcode, >+ itemtype => $item->effective_itemtype, >+ onsite_checkout => undef, >+ rules => { > issuelength => 5, > lengthunit => 'days', > } >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index d9cbf35490..854fc684b9 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -75,12 +75,24 @@ subtest fill_holds_at_checkout => sub { > onshelfholds => 1, > reservesallowed => 3, > holds_per_record => 3, >+ } >+ } >+ ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $borrower->{categorycode}, >+ branchcode => $branch->{branchcode}, >+ itemtype => $itype->{itemtype}, >+ onsite_checkout => undef, >+ rules => { > issuelength => 5, > lengthunit => 'days', > } > } > ); > >+ > my $reserve1 = AddReserve( > { > branchcode => $branch->{branchcode}, >@@ -181,6 +193,17 @@ subtest cancel_hold => sub { > onshelfholds => 1, > reservesallowed => 3, > holds_per_record => 3, >+ } >+ } >+ ); >+ >+ Koha::CirculationRules->set_rules( >+ { >+ categorycode => $patron->categorycode, >+ branchcode => $library->branchcode, >+ itemtype => $item->effective_itemtype, >+ onsite_checkout => undef, >+ rules => { > issuelength => 5, > lengthunit => 'days', > } >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index b3868a340f..bab9afdc8b 100755 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -76,6 +76,7 @@ Koha::CirculationRules->set_rules( > categorycode => undef, > itemtype => undef, > branchcode => undef, >+ onsite_checkout => undef, > rules => { > renewalperiod => 7, > renewalsallowed => 1, >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index c4bb0310c5..f8fc8fac2d 100755 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -70,6 +70,11 @@ our $sample_data = { > rentalcharge => 0, > notforloan => 0, > }, >+ onsite_checkout => { >+ itemtype => 'CHECKOUT', >+ description => 'Just a onsite_checkout for tests', >+ maxissueqty => 80100, >+ }, > issuingrule => { > categorycode => 'test_cat', > itemtype => 'IT4test', >@@ -159,6 +164,7 @@ SKIP: { > categorycode => $issuing_rules->{categorycode}, > itemtype => $issuing_rules->{itemtype}, > branchcode => $issuing_rules->{branchcode}, >+ onsite_checkout => $issuing_rules->{onsite_checkout}, > rules => { > maxissueqty => $issuing_rules->{maxissueqty}, > issuelength => $issuing_rules->{issuelength}, >-- >2.17.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 26814
:
112376
|
112377
|
112378
|
112379
|
112380
|
112381
|
112382
|
112383
|
112384
|
112385
|
112608
|
112609
|
112610
|
112611
|
112623
|
112624
|
112625
|
112626
|
112627
|
112628
|
112630
|
112631
|
112632
|
112651
|
112652
|
112653
|
114417
|
114418
|
114419
|
114420
|
114421
| 114422 |
114423
|
114424
|
114425
|
114426
|
114427