Bugzilla – Attachment 138496 Details for
Bug 25560
Define itemtype specific rules in the UpdateNotForLoanStatusOnCheckin system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25560: Define item-type specific rules in UpdateNotForLoanStatusOnCheckin
Bug-25560-Define-item-type-specific-rules-in-Updat.patch (text/plain), 3.25 KB, created by
Alex Buckley
on 2022-08-02 06:27:29 UTC
(
hide
)
Description:
Bug 25560: Define item-type specific rules in UpdateNotForLoanStatusOnCheckin
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2022-08-02 06:27:29 UTC
Size:
3.25 KB
patch
obsolete
>From 8a020b799e80988b88c3ad6be844f81ab1130ebd Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 2 Aug 2022 17:05:39 +1200 >Subject: [PATCH] Bug 25560: Define item-type specific rules in > UpdateNotForLoanStatusOnCheckin > >This enhancement respects the 'item-level_itypes' syspref, so will look >at the authoritative item type when determining to update the notforloan >status. > >Test plan: >1. Set -1 to 'Ordered', and 1 to 'Not for Loan' in Administration > Authorised values > NOT_LOAN > >2. Make sure the 'item-level_itypes' syspref is set to 'specific item' > >3. Add the following rules in UpdateNotForLoanStatusOnCheckin system >preference: >-1: 0 > >4. Apply patch & update database >cd installer/data/mysql >sudo koha-shell <instancename> >./updatedatabase.pl > >5. Restart plack > >6. Observe the UpdateNotForLoanStatusOnCheckin syspref values have >updated to the following format: ><itemtype_1>: > -1: 0 > ><itemtype_2>: > -1: 0 > >etc. > >Each item type setup in Koha has the existing rule(s) listed under it > >7. Check in an 'Ordered' item of any item type and confirm it is changed >to 'Available for loan' > >8. Reset the UpdateNotForLoanStatusOnCheckin syspref to: >BK: > -1: 0 > >CD: > 1: 0 > >9. Check-in an 'ordered' BK item (item level itype='BK') and observe the item's >notforloan status updates > >10. Check-in a 'Not for Loan' CD item (item level itype='CD') and >observe the item's notforloan status updates > >11. Check-in an 'ordered' DVD item (item level itype='DVD') and observe >the items notforloan status does not change > >12. Change 'item-level_itypes' syspref to 'bibliographic record' > >13. Check-in an 'ordered' item (with biblio-level itemtype='BK' & >item-level itype='DVD') and observe the item's notforloan status updates > >14. Check-in an 'ordered' item (with biblio-level itemtype='DVD' & >item-level itype='BK') and observe the item's notforloan status does not change > >Sponsored-By: Waikato Institute of Technology, NZ >--- > C4/Circulation.pm | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5b57575f3b5..99b7dd7ed02 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2141,10 +2141,16 @@ sub AddReturn { > } > else { > foreach my $key ( keys %$rules ) { >- if ( $item->notforloan eq $key ) { >- $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} }; >- $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }); >- last; >+ >+ # Check and apply rules for the item type being returned >+ if ( $item->itype eq $key ) { >+ foreach my $itype_rule_key ( keys %{ $rules->{$key}} ) { >+ if ( $item->notforloan eq $itype_rule_key ) { >+ $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key}->{$itype_rule_key} }; >+ $item->notforloan($rules->{$key}->{$itype_rule_key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }); >+ last; >+ } >+ } > } > } > } >-- >2.20.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 25560
:
105236
|
105237
|
105238
|
105239
|
105240
|
105241
|
105242
|
105243
|
105244
|
105245
|
109562
|
109563
|
109564
|
109565
|
109566
|
109567
|
112492
|
112887
|
113161
|
113212
|
113213
|
113214
|
113215
|
113216
|
113217
|
131816
|
131817
|
131818
|
131819
|
131820
|
135742
|
135743
|
136079
|
136080
|
136081
|
136082
|
136083
|
136084
|
138494
|
138495
|
138496
|
138497
|
138498
|
138499
|
146556
|
146557
|
146558
|
146559
|
146993
|
148679
|
148680
|
148681
|
148682
|
148683