Bug 39917 - Display a prompt for status alias when completing a request if ILL_STATUS_ALIAS in use
Summary: Display a prompt for status alias when completing a request if ILL_STATUS_ALI...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-16 11:49 UTC by Pedro Amorim
Modified: 2025-06-26 13:32 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement to ILL requests lets you select a 'status alias' when marking requests as complete. This is only shown when values are defined for the ILL_STATUS_ALIAS authorized values category. The alias is then shown in the status field on the request details page, and in the status column for the list of ILL requests. If there are no values defined, then you are not prompted to select a status alias.
Version(s) released in:
Circulation function:


Attachments
Bug 39917: Add tests (2.54 KB, patch)
2025-05-16 11:50 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39917: Add new optional 'mark_completed' ILL screen (6.02 KB, patch)
2025-05-16 11:50 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39917: (QA follow-up): Fix xt/find-missing-filters.t (1.37 KB, patch)
2025-05-16 14:25 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39917: Add tests (2.58 KB, patch)
2025-06-07 06:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 39917: Add new optional 'mark_completed' ILL screen (6.06 KB, patch)
2025-06-07 06:35 UTC, David Nind
Details | Diff | Splinter Review
Bug 39917: (QA follow-up): Fix xt/find-missing-filters.t (1.41 KB, patch)
2025-06-07 06:35 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-05-16 11:49:07 UTC

    
Comment 1 Pedro Amorim 2025-05-16 11:50:16 UTC
Created attachment 182517 [details] [review]
Bug 39917: Add tests

prove t/db_dependent/Koha/ILL/Requests.t
Comment 2 Pedro Amorim 2025-05-16 11:50:19 UTC
Created attachment 182518 [details] [review]
Bug 39917: Add new optional 'mark_completed' ILL screen

This new 'Mark completed' screen only shows when ILL_STATUS_ALIAS is not empty, i.e. Koha installations that are not using ILL_STATUS_ALIAS will not see any change in their workflow.
Backends that don't implement 'mark_completed' are inherently already making use of core 'mark_completed' and will automatically adopt this enhancement.
Backends that do implement their own mark_completed don't automatically adopt this enhancement and will not see any change in their workflow.

Test plan:
1) Enable ILLModule sys pref
2) Create a new ILL request:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add a type, cardnumber and library. Click 'Create'.
4) You should now be on the manage request screen. Click 'Confirm' and 'Confirm request'.
5) You should be on the manage request screen again. Click 'Mark completed'. The request's status became 'Completed'.
6) Add at least one AV entry to ILL_STATUS_ALIAS av category, visit:
   <staff_url>/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=ILL_STATUS_ALIAS
7) Add 'abc_code' to 'Authorized value' and 'abc_description' to 'Description'. Click 'Save'.
8) Repeat steps 2 to 5. Notice that when you 'Mark completed' now, a new screen is shown prompting for a status_alias.
9) Pick a status_alias and save. Notice the 'status' now shows the alias.

Sponsored-by: NHS England
Comment 3 Pedro Amorim 2025-05-16 14:25:41 UTC
Created attachment 182541 [details] [review]
Bug 39917: (QA follow-up): Fix xt/find-missing-filters.t

prove xt/find-missing-filters.t
Comment 4 David Nind 2025-06-07 06:35:35 UTC
Created attachment 183091 [details] [review]
Bug 39917: Add tests

prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2025-06-07 06:35:38 UTC
Created attachment 183092 [details] [review]
Bug 39917: Add new optional 'mark_completed' ILL screen

This new 'Mark completed' screen only shows when ILL_STATUS_ALIAS is not empty, i.e. Koha installations that are not using ILL_STATUS_ALIAS will not see any change in their workflow.
Backends that don't implement 'mark_completed' are inherently already making use of core 'mark_completed' and will automatically adopt this enhancement.
Backends that do implement their own mark_completed don't automatically adopt this enhancement and will not see any change in their workflow.

Test plan:
1) Enable ILLModule sys pref
2) Create a new ILL request:
   <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Add a type, cardnumber and library. Click 'Create'.
4) You should now be on the manage request screen. Click 'Confirm' and 'Confirm request'.
5) You should be on the manage request screen again. Click 'Mark completed'. The request's status became 'Completed'.
6) Add at least one AV entry to ILL_STATUS_ALIAS av category, visit:
   <staff_url>/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=ILL_STATUS_ALIAS
7) Add 'abc_code' to 'Authorized value' and 'abc_description' to 'Description'. Click 'Save'.
8) Repeat steps 2 to 5. Notice that when you 'Mark completed' now, a new screen is shown prompting for a status_alias.
9) Pick a status_alias and save. Notice the 'status' now shows the alias.

Sponsored-by: NHS England
Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2025-06-07 06:35:40 UTC
Created attachment 183093 [details] [review]
Bug 39917: (QA follow-up): Fix xt/find-missing-filters.t

prove xt/find-missing-filters.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Pedro Amorim 2025-06-26 13:32:01 UTC
(In reply to Pedro Amorim from comment #2)
> Backends that do implement their own mark_completed don't automatically
> adopt this enhancement and will not see any change in their workflow.

This is false. 'mark_completed' is always used by core and requests from any backend will adopt this new feature, meaning the screen will show as long as ILL_STATUS_ALIAS is in use. I've updated the bug title to clarify this further. The release notes are accurate as is.

If that were required, a new backend_mark_completed in Koha::ILL::Request would need to be implemented and ill-requests.pl would have to invoke that instead (similar to how it does for backend_cancel or backend_confirm).

Should the above be required it should be a new bug entry as it's a change in behavior. The feature in this patchset works as intended, I just wanted to correct my original comment.