Bugzilla – Attachment 130416 Details for
Bug 24239
Let the ILL module set ad hoc hard due dates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24239: Let the ILL module set ad hoc hard due dates
Bug-24239-Let-the-ILL-module-set-ad-hoc-hard-due-d.patch (text/plain), 3.21 KB, created by
Lari Taskula
on 2022-02-09 23:12:47 UTC
(
hide
)
Description:
Bug 24239: Let the ILL module set ad hoc hard due dates
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2022-02-09 23:12:47 UTC
Size:
3.21 KB
patch
obsolete
>From c420bcf65bfaf43953ba12775357549fc65fb3ee Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 13 Dec 2019 13:17:55 +0100 >Subject: [PATCH] Bug 24239: Let the ILL module set ad hoc hard due dates > >The Swedish Libris ILL backend lets librarians store a specific due date >when an ILL loan is received. This is stored as a ILL request attribute. > >This patch adds a syspref that can take the name of the >illrequestattribute used to store the specific date. If the syspref is >set, and if an item is connected to an ILL request, the due date will be >taken from the illrequestattribute, instead of being calculated in the >regular way, based on patroncategory and itemtype. > >To test: >- Apply the patch and make sure the atomic database update is run >- Use the FreeForm backend to add one ILL request. Take note of the > illrequest_id of the request you created. We refer to this as > "x" below. >- Connect a biblio (with biblionumber y), that has an item with a > barcode, to the ILL request directly in the database: > UPADTE illrequests SET biblio_id = y WHERE illrequest_id = x; >- Add an attribute to the ILL request directly in the database: > INSERT INTO illrequestattributes SET illrequest_id = x, type = > 'illduedate', value = '2023-01-01'; >- Enter 'illduedate' as a value for the ILLUseExactDueDate syspref. >- Go to circulation and issue the barcode of the item to the > patron associated with the FreeForm ILL request. Verify that the > loan gets a due date of 2023-01-01. >- Ideally: return the item and issue it again through SIP2 and SCO, > and verify that the due date is still 2023-01-01. > (I don't think the REST API supports issuing yet?) >- Verify that there are no regressions, so that regular calculation > of due dates still work, if ILLUseExactDueDate is empty or not. >- prove t/db_dependent/Circulation.t > >(Patch description, test plan and partial code credits to Magnus Enger) >--- > C4/Circulation.pm | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d59fbf6380..076a2f14e3 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1472,6 +1472,25 @@ sub AddIssue { > $datedue = CalcDateDue( $issuedate, $itype, $branchcode, $borrower ); > > } >+ >+ # Check if we need to use an exact due date set by the ILL module >+ if ( C4::Context->preference('ILLModule') ) { >+ # Check if there is an ILL connected with the biblio of the item we are issuing >+ my $ill_request = Koha::Illrequests->search({ >+ biblio_id => $item_object->biblionumber, >+ borrowernumber => $borrower->{'borrowernumber'}, >+ completed => undef, >+ date_due => { '!=', undef }, >+ })->next; >+ >+ if ( $ill_request and length( $ill_request->date_due ) > 0 ) { >+ my $ill_dt = dt_from_string( $ill_request->date_due ); >+ $ill_dt->set_hour(23); >+ $ill_dt->set_minute(59); >+ $datedue = $ill_dt; >+ } >+ } >+ > $datedue->truncate( to => 'minute' ); > > my $patron = Koha::Patrons->find( $borrower ); >-- >2.25.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 24239
:
96246
|
106409
|
130056
|
130057
|
130414
|
130415
|
130416
|
133475
|
133476
|
133477
|
135244
|
135245
|
135246
|
135943
|
135944
|
135945
|
136458
|
136459
|
136460
|
136461
|
136462
|
136463