Description
Lari Taskula
2020-04-08 21:02:59 UTC
Created attachment 103046 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103047 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103048 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103049 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103050 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103051 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103052 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103053 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103054 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103239 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103240 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103241 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103242 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103243 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103244 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103245 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103246 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103247 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103248 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 103283 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103284 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103285 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103286 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103287 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103288 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103289 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103290 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103291 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103292 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 103339 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103340 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103341 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103342 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103343 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103344 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103345 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103346 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103347 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103348 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 103349 [details] [review] Bug 25089: Change sorting order to branchcode, checkout_type, categorycode, itemtype Otherwise we need to set renewalsallowed=0 for every rule if we don't want on-site checkouts to be renewalable. To test: 1. prove t/db_dependent/Koha/CirculationRules.t Created attachment 103351 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103352 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103353 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103354 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103355 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103356 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103357 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103358 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103359 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103360 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 103361 [details] [review] Bug 25089: Change sorting order to branchcode, checkout_type, categorycode, itemtype Otherwise we need to duplicate a rule with renewalsallowed=0 every rule if we don't want on-site checkouts to be renewalable. To test: 1. prove t/db_dependent/Koha/CirculationRules.t Created attachment 103537 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 103538 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 103539 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 103540 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 103541 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 103542 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103543 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 103544 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 103545 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 103546 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 103547 [details] [review] Bug 25089: Change sorting order to branchcode, checkout_type, categorycode, itemtype Otherwise we need to duplicate a rule with renewalsallowed=0 every rule if we don't want on-site checkouts to be renewalable. To test: 1. prove t/db_dependent/Koha/CirculationRules.t Created attachment 104274 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. Go to Circulation rules page in Koha 2. Observe checkout type column in the rule matrix 3. Test circulation rules matrix by setting, modifying and deleting rules. 4. Test default checkout, hold and return policy settings. 5. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 104275 [details] [review] Bug 25089: Change sorting order to branchcode, checkout_type, categorycode, itemtype Otherwise we need to duplicate a rule with renewalsallowed=0 every rule if we don't want on-site checkouts to be renewalable. To test: 1. prove t/db_dependent/Koha/CirculationRules.t Created attachment 107523 [details] [review] Bug 25089: Add a new checkout_type to circulation_rules table To add: 1. perl installer/data/mysql/updatedatabase.pl Sponsored-by: The National Library of Finland Created attachment 107524 [details] [review] Bug 25089: Schema changes Sponsored-by: The National Library of Finland Created attachment 107525 [details] [review] Bug 25089: Add checkout_type to Koha::CirculationRules To test: 1. prove t/db_dependent/Koha/CirculationRules.t Sponsored-by: The National Library of Finland Created attachment 107526 [details] [review] Bug 25089: Remove on-site specific circulation rules To apply: 1. perl installer/data/mysql/updatedatabase.pl To test: 1. Search for patron_maxonsiteissueqty rule $ grep -rn 'patron_maxonsiteissueqty' 2. Observe no results in Koha source files 3. Search for maxonsiteissueqty rule $ grep -rn 'maxonsiteissueqty' 4. Observe no results (apart from .git) 5. Check modification made to C4::Circulation::GetBranchBorrowerCircRule(). Make sure the new parameter is being used everywhere. You can search the usage of this subroutine with similar grep commands as above. 6. Run the following tests: prove t/db_dependent/Circulation/Branch.t prove t/db_dependent/Circulation/SwitchOnSiteCheckouts.t prove t/db_dependent/Circulation/TooMany.t Sponsored-by: The National Library of Finland Created attachment 107527 [details] [review] Bug 25089: Sort circulation rules Sponsored-by: The National Library of Finland Created attachment 107528 [details] [review] Bug 25089: Add checkout_type to set_rule To test: 1. Find all occurrences of set_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | grep -Pavz 'hold|reserves|article_requests' \ && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to set_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 2. Find all subroutines using set_rule() git grep --no-index -n -p -P 'set_rule\s*\(' | grep -v 'sub {' \ | grep -P 'sub .*' 2.1 The only return should be Koha/CirculationRules.pm=326=sub set_rules { 3. The boring step. Find all occurrences of set_rule() with the following command: grep --exclude-dir='.git' -Prn 'set_rule' | grep -v set_rules Go through this list and make sure all neccessary locations are updated. A change is required when the rule scope includes checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 107529 [details] [review] Bug 25089: Add checkout_type to set_rules To test: 1. Find all occurrences of set_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' -Przo '(?s)(::|->)set_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 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. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (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=293= 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 checkout_type. See Koha/CirculationRules.pm for scopes. Hold/reserve related rules do not require it. Sponsored-by: The National Library of Finland Created attachment 107530 [details] [review] Bug 25089: Add checkout_type to get_effective_rule To test: 1. Find all occurrences of get_effective_rule that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rule(?!s).*?\)' | \ grep -avz 'checkout_type' | \ grep -Pavz 'hold|reserves|article_requests' && echo "" The only occasions this should return anything are cases where a HASH or HASHref is given to get_effective_rule(), or that we are explicitly testing missing parameters in an unit test. 1.2 Verify the HASH/HASHref cases. The hash should contain a checkout_type (unless the rule is related to holds) 1.3 Verify the other cases. If you find another result than what is mentioned above, then this test fails. 2. Find all subroutines using get_effective_rule() git grep --no-index -n -p -P 'get_effective_rule\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: C4/Circulation.pm=376=sub TooMany { C4/Circulation.pm=1300=sub AddIssue { C4/Circulation.pm=1633=sub GetBranchBorrowerCircRule { C4/Circulation.pm=1689=sub GetBranchItemRule { C4/Circulation.pm=3030=sub GetRenewCount { C4/Reserves.pm=348=sub CanItemBeReserved { C4/Reserves.pm=2230=sub GetHoldRule { Koha/Biblio.pm=294=sub article_request_type_for_bib { Koha/Charges/Fees.pm=98=sub accumulate_rentalcharge { Koha/CirculationRules.pm=218=sub get_effective_rules { Koha/CirculationRules.pm=390=sub get_opacitemholds_policy { Koha/CirculationRules.pm=416=sub get_onshelfholds_policy { Koha/Item.pm=571=sub article_request_type { Koha/REST/V1/Checkouts.pm=192=sub allows_renewal { Koha/Template/Plugin/CirculationRules.pm=26=sub Get { Check these subroutines and make sure they are using get_effective_rule() with the new scope, unless not needed. When fetching a hold-related rules, checkout_type is not needed. These subroutines and classes need changes to sub params: 2.1. Check modifications to Koha::Charges::Fees 2.2. Check modification made to C4::Circulation::_debar_user_on_return(). 2.3. Check modification made to C4::Circulation::_calculate_new_debar_dt(). 3. Find all occurrences of get_effective_rule with the following command: grep --exclude-dir='.git' -Prn 'get_effective_rule(?!s)' Make sure all matches (where rule scope allows checkout_type) are updated. Sponsored-by: The National Library of Finland Created attachment 107531 [details] [review] Bug 25089: Add checkout_type to get_effective_rules To test: 1. Find all occurrences of get_effective_rules that are missing checkout_type where required grep --exclude-dir '.git' --exclude-dir 'misc/translator' \ --exclude-dir 'koha-tmpl' \ -Przo '(?s)(::|->)get_effective_rules.*?\)' | \ grep -avz 'checkout_type' && echo "" 1.1. Verify command output. Only reserve related calls to get_effective_rules() should be returned. 2. Find all subroutines using get_effective_rules() git grep --no-index -n -p -P 'get_effective_rules\s*\(' \ | grep -v 'sub {' | grep -P 'sub .*' This list should be returned: git grep --no-index -n -p 'get_effective_rules' | grep -P 'sub .*' 3. Check modification made to C4::Circulation::CalcDateDue() 4. Check modification made to C4::Circulation::CalcFine() 5. Check modification made to C4::Circulation::GetLoanLength() 6. Check modification made to C4::Circulation::GetHardDueDate() Make sure all matches (where rule scope allows checkout_type) are updated. 7. Run these unit tests: grep -Prl --color=never 'get_effective_rule\(|set_rule\(|set_rules\(' \ t/db_dependent/ | grep '^.*\.t$' | xargs prove 8. Test onboarding tool 8.1. Drop&create your database (take backups first if needed) 8.2. Navigate to web installer 8.3. Continue until you reach onboarding tool step where circulation rules are added. 8.4. Observe new drop down selection "Checkout type". 8.5. Select any checkout type and continue the onboarding process. 8.6. Investigate your database table "circulation_rules". You should now have rules with checkout_type of your choice. Sponsored-by: The National Library of Finland Created attachment 107532 [details] [review] Bug 25089: (OLD GUI) Add checkout_type to smart-rules To test: 1. First apply all the patches tagged with (OLD GUI) prefix in commit title 2. Go to Circulation rules page in Koha 3. Observe checkout type column in the rule matrix 4. Test circulation rules matrix by setting, modifying and deleting rules. 5. Test default checkout, hold and return policy settings. 6. Test default checkout, hold policy by patron category settings. Sponsored-by: The National Library of Finland Created attachment 107533 [details] [review] Bug 25089: (OLD GUI) Indent and add checkout type to all_rules hash No other changes in this patch. To test: 1. git diff --word-diff=color --ignore-all-space HEAD~1 -- koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt 2. Observe only $ct has been added Sponsored-by: The National Library of Finland Rebased Marked as blocked since dependent Bug 25037 does not apply. I'm also considering of dropping it from dependencies. Taking a different approach with less code dependencies - moving these patches to Bug 26814. |