Bugzilla – Attachment 188572 Details for
Bug 40504
ILL requests should have ability to assign staff to manage
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40504: Auto functionality:
Bug-40504-Auto-functionality.patch (text/plain), 2.58 KB, created by
Pedro Amorim
on 2025-10-29 16:22:33 UTC
(
hide
)
Description:
Bug 40504: Auto functionality:
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2025-10-29 16:22:33 UTC
Size:
2.58 KB
patch
obsolete
>From cbc5c8f64697ab5be08be6f534823c3a64c30f8d Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 15 Oct 2025 11:00:30 +0000 >Subject: [PATCH] Bug 40504: Auto functionality: > >- The staff member who creates a new ILL request is automatically assigned as its manager. >- No manager is assigned to ILL requests made by users without 'ill' permission e.g. patrons using the OPAC. >- When an ILL request without a manager has its status changed, the staff member making the change is automatically assigned as its manager e.g. by clicking 'confirm' or 'revert request'. >- It is possible to manually update a request's manager by clicking the 'Edit request' toolbar button when viewing a request. The patron search modal, 'select manager' button and all its functionality is shared with the 'select manager' present in the suggestions module. This means that when editing an ILL request, the 'managedby' defaults to the staff member editing the request, unless 'Keep existing manager' is clicked, like it happens in suggestions. >- This is fully core built, all backends will automatically hook into this functionality, because: >-- Automatic 'managedby' happen on status change, regardless of backend >-- All requests have access to 'edit request' page, regardless of backend >- Only if a logged in staff member exists does the auto set manager. If no staff member is found, nothing happens e.g. an ILL request status >was changed by a CLI command / cronjob > >Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk> >--- > Koha/ILL/Request/Logger.pm | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > >diff --git a/Koha/ILL/Request/Logger.pm b/Koha/ILL/Request/Logger.pm >index 2f0cb7f02e0..cac5e401295 100644 >--- a/Koha/ILL/Request/Logger.pm >+++ b/Koha/ILL/Request/Logger.pm >@@ -163,9 +163,28 @@ sub log_status_change { > ) > } > ); >+ $self->auto_set_manager( $params->{request} ); > } > } > >+=head3 auto_set_manager >+ >+ $self->auto_set_manager($params->{request}) >+ >+Automatically set managedby to the staff member updating this request's status if request does not yet have a manager >+ >+=cut >+ >+sub auto_set_manager { >+ my ( $self, $illrequest ) = @_; >+ >+ my $userenv = C4::Context->userenv(); >+ my $usernumber = ( ref($userenv) eq 'HASH' ) ? $userenv->{'number'} : 0; >+ my $patron = Koha::Patrons->find($usernumber); >+ $illrequest->managedby($usernumber)->store() >+ if $patron && $patron->has_permission('ill') && $illrequest && !$illrequest->managedby; >+} >+ > =head3 log_something > > Koha::ILL::Request::Logger->log_something({ >-- >2.39.5
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 40504
:
187906
|
187907
|
187908
|
187909
|
187910
|
187911
|
187912
|
187913
|
187914
|
187915
|
188365
|
188563
|
188565
|
188566
|
188567
|
188568
|
188569
|
188570
|
188571
| 188572 |
188573
|
188574
|
188624
|
188625
|
188935
|
188936