Some interlibrary loan providers, for example Reprints Desk, allow for ILL requests to be submitted in batches. In the Reprints Desk case, a batch is created with the supplier, then requests are then submitted including the batch ID. Obviously, this workflow may differ according to supplier and these differences should be abstracted away into the supplier backend. For core Koha, we should provide the ability for it to recognise if a given backend can process batch requests. If so, we should provide an interface for creating and manipulating batches within Koha, then submitting a batch to the supplier. It should also be possible to view all batches and the contents of a given batch. The funding institution has defined the following workflow for creating and populating batches: - A encapsulating "batch" is created with a name and a requesting borrower - Requests are added to a batch via two methods: - In bulk: - A form which allows the user to paste in a collection of identifiers, such as DOI / PMID etc. - For each of these identifiers: - The request metadata should be populated via API queries to metadata suppliers, for example, PubMed API or LibKey/Browzine. This behaviour is governed by the presence of appropriate plugins. - (Optional) Once the metadata is populated for an item, we check for item availability via any installed ILL availability plugins - Individually: - A regular ILL request form, requests are added to the batch
Created attachment 144281 [details] [review] Bug 30719: Batch requests minor misc improvements - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list
Created attachment 144285 [details] [review] Bug 30719: DB, API & tests This commit adds the following: - A database update that adds an "illbatches" table, a "illrequest.batch_id" foreign key and an "illbatches.borrowernumber" foreign key - Illbatch and Illbatches Koha objects - Adds 'batch' accessor to Illrequest object - CRUD API endpoints for working with ILL batches - Unit tests of the Koha objects and API endpoints - Adds 'batch_id' filter to /illrequests endpoint
Created attachment 144286 [details] [review] Bug 30719: Batch ILL requests - Add API endpoint for ILL request creation - UI for creation of ILL batches, including: - Ability to paste in list of identifier - Auto metadata enrichment for each identifier, using installed third party service API plugins - Auto retrieval of identifier availability, using installed third party service API plugins - Auto creation of local requests within batch - UI for management of existing ILL batches, including adding requests to, and removing requests from, batches - Additional UI to allow users to navigate from requests to their enclosing batches and vice-versa
Created attachment 144287 [details] [review] Bug 30719: Logging of batch operations This commit adds logging of the following batch operations: - Batch creation - Batch update (Updating of the batch itself, not its contents) - Batch delete
Created attachment 144288 [details] [review] Bug 30719: Batch statuses This commits adds the following provision for batch statuses: - Database updates - Object definitions - CRUD REST API - Unit tests - UI adding support for batch statuses in batch UI - Admin UI for managing batch statuses
Created attachment 144289 [details] [review] Bug 30719: DB, API & tests This commit adds the following: - A database update that adds an "illbatches" table, a "illrequest.batch_id" foreign key and an "illbatches.borrowernumber" foreign key - Illbatch and Illbatches Koha objects - Adds 'batch' accessor to Illrequest object - CRUD API endpoints for working with ILL batches - Unit tests of the Koha objects and API endpoints - Adds 'batch_id' filter to /illrequests endpoint
Apply all current 5 patches, on ktd, preparation: - Run DBIC - Run reset_all - Enable ILLModule sys pref - Default ILLLIBS patron category needs to exist, create that - At least one ILL batch status needs to exist, admin -> ILL batch statuses, create for example name:NEW status:NEW - At least one ILL Backend with "provide_batch_requests" capability needs to exist, create ReprintsDesk backend from https://github.com/PTFS-Europe/koha-ill-reprintsdesk - Install ReprintsDesk backend dependencies: cpan XML::Compile XML::Smart XML::Compile:WSDL11 XML::Compile::SOAP12 - Need to restart plack here - Update backend_directory in koha-conf.xml to <backend_directory>/kohadevbox/koha/Koha/Illbackends</backend_directory> - Need to restart plack here - Install metadata enrichment plugin pubmedid from https://github.com/PTFS-Europe/koha-plugin-api-pubmed/releases/tag/1.1.0 through "Manage plugins" in admin - Need to restart plack here - Go to ILL Requests admin area, click "New ILL batch request" and select ReprintsDesk - Create new batch (insert name, cardnumber and library) and press "continue" - Add PubMed ID, one per line (example: 23668524\n29710265) and press "Process identifiers" - After processing is complete, click "add items to batch" and then "finish and view batch" Verify that: - The items requested in the batch are now illrequests in Koha, and are part of the batch that was just created - Clicking on "Batch requests" lists all batch requests created - Clicking on a batch name lists only the requests from that batch - If a batch is deleted, whatever requests previously on that batch are not deleted (they have been detached, their batch_id is now NULL) - When editing a request that is part of a batch, it's possible to change which batch the request is part of, or none. Test logs: - Before doing the above, enable illlog sys pref - Do some CRUD actions on batch requests - Check log viewer -> module "Interlibrary loans" - Verify that the actions performed have been logged Run tests: perl t/db_dependent/Illbatches.t perl t/db_dependent/Illbatchstatuses.t #currently failing, will check why soon
Created attachment 144290 [details] [review] Bug 30719: Batch requests minor misc improvements - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list
Created attachment 144291 [details] [review] Bug 30719: DB, API & tests This commit adds the following: - A database update that adds an "illbatches" table, a "illrequest.batch_id" foreign key and an "illbatches.borrowernumber" foreign key - Illbatch and Illbatches Koha objects - Adds 'batch' accessor to Illrequest object - CRUD API endpoints for working with ILL batches - Unit tests of the Koha objects and API endpoints - Adds 'batch_id' filter to /illrequests endpoint
Created attachment 144292 [details] [review] Bug 30719: Batch ILL requests - Add API endpoint for ILL request creation - UI for creation of ILL batches, including: - Ability to paste in list of identifier - Auto metadata enrichment for each identifier, using installed third party service API plugins - Auto retrieval of identifier availability, using installed third party service API plugins - Auto creation of local requests within batch - UI for management of existing ILL batches, including adding requests to, and removing requests from, batches - Additional UI to allow users to navigate from requests to their enclosing batches and vice-versa
Created attachment 144293 [details] [review] Bug 30719: Logging of batch operations This commit adds logging of the following batch operations: - Batch creation - Batch update (Updating of the batch itself, not its contents) - Batch delete
Created attachment 144294 [details] [review] Bug 30719: Batch statuses This commits adds the following provision for batch statuses: - Database updates - Object definitions - CRUD REST API - Unit tests - UI adding support for batch statuses in batch UI - Admin UI for managing batch statuses
Created attachment 144295 [details] [review] Bug 30719: Batch requests minor misc improvements - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list
Created attachment 144296 [details] [review] Koha 22.11.00 Rosalie is here! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 144297 [details] [review] Koha 22.11.00 Rosalie is here! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 144298 [details] [review] Bug 30719: DB, API & tests This commit adds the following: - A database update that adds an "illbatches" table, a "illrequest.batch_id" foreign key and an "illbatches.borrowernumber" foreign key - Illbatch and Illbatches Koha objects - Adds 'batch' accessor to Illrequest object - CRUD API endpoints for working with ILL batches - Unit tests of the Koha objects and API endpoints - Adds 'batch_id' filter to /illrequests endpoint Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 144299 [details] [review] Bug 30719: Batch ILL requests - Add API endpoint for ILL request creation - UI for creation of ILL batches, including: - Ability to paste in list of identifier - Auto metadata enrichment for each identifier, using installed third party service API plugins - Auto retrieval of identifier availability, using installed third party service API plugins - Auto creation of local requests within batch - UI for management of existing ILL batches, including adding requests to, and removing requests from, batches - Additional UI to allow users to navigate from requests to their enclosing batches and vice-versa Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 144300 [details] [review] Bug 30719: Logging of batch operations This commit adds logging of the following batch operations: - Batch creation - Batch update (Updating of the batch itself, not its contents) - Batch delete Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 144301 [details] [review] Bug 30719: Batch statuses This commits adds the following provision for batch statuses: - Database updates - Object definitions - CRUD REST API - Unit tests - UI adding support for batch statuses in batch UI - Admin UI for managing batch statuses Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Created attachment 144302 [details] [review] Bug 30719: Batch requests minor misc improvements - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Looking at bug history, I am asking for another signoff please.
I'm asking the customer whose sponsored this work to SO. We got a bit ahead of ourselves here.
Created attachment 145760 [details] [review] Bug 30719: (QA Follow-up): - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if if any had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a request in a backend that has JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete and use new standard one. FIXME: The dialog modal .modal has a z-index of 1050 but the autocomplete patron suggestions .ui-front has a z-index of 100, it's working but shows behind the modal and is unclickable.
Created attachment 145869 [details] [review] Bug 30719: (QA Follow-up): - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if if any had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a request in a backend that has JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete and use new standard one and input cardnumber instead of patronid.
Created attachment 145870 [details] [review] Bug 30719: (QA Follow-up): - Fix wrong link in message in case there are no requests batch - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if if any had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a request in a backend that has JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete and use new standard one and input cardnumber instead of patronid. Sponsored-by: UKHSA
Created attachment 145876 [details] [review] Bug 30719: (QA Follow-up): - Fix wrong link 'Create a new batch status message' in case there are no existing batch statuses - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list page - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if any request had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a single request in a backend that is using JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete in batch creation and use patron_autocomplete instead - 'New batch' and 'list batches' buttons no longer show if no metadata plugin is installed Sponsored-by: UKHSA
Created attachment 145934 [details] [review] Bug 30719: (QA Follow-up): - Fix wrong link 'Create a new batch status message' in case there are no existing batch statuses - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list page - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if any request had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a single request in a backend that is using JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete in batch creation and use patron_autocomplete instead - 'New batch' and 'list batches' buttons no longer show if no metadata plugin is installed - Fixed tests, all passing now - Improved error messaging for non-existent cardnumber input in patron in ill batch creation - Improved error messaging for duplicate batch name creation error Sponsored-by: UKHSA
Apply patches, on ktd, preparation: - Run dbic - Run reset_all - Enable ILLModule sys pref - At least one ILL batch status needs to exist, admin -> (bottom right) Interlibrary Loan batch statuses, add that (name:NEW status:NEW) - At least one ILL Backend with "provide_batch_requests" capability needs to exist, add ReprintsDesk backend from https://github.com/PTFS-Europe/koha-ill-reprintsdesk to kohadevbox/koha/Koha/Illbackends with name 'ReprintsDesk' - Update backend_directory in koha-conf.xml to <backend_directory>/kohadevbox/koha/Koha/Illbackends</backend_directory> - At least one metadata enrichment plugin needs to exist, admin -> Manage plugins add that (https://github.com/PTFS-Europe/koha-plugin-api-pubmed/releases/tag/1.1.0) - restart_all - Run yarn build to update CSS Test plan: - Go to ILL Requests admin area, click "New ILL batch request" and select ReprintsDesk - Create new batch (insert name, cardnumber and library) and press "continue" - Add PubMed ID, one per line (example: 23668524\n29710265) and press "Process identifiers" - After processing is complete, click "add items to batch" and then "finish and view batch" Verify that: - The items requested in the batch are now illrequests in Koha, and are part of the batch that was just created - Clicking on "Batch requests" lists all existing batches - From the previous step, clicking on a batch name lists only the requests from that batch - If a batch is deleted, whatever requests that were previously on that batch are not deleted (their batch_id is now NULL) - When editing a request that is part of a batch, it's possible to change which batch the request is part of, or none. (Optional) Test logging: - Before doing the above, enable illlog sys pref - Do some CRUD actions on batch requests - Check log viewer -> module "Interlibrary loans" - Verify that the actions performed have been logged (Optional) Test error messaging: - Try creating a batch with an already existing batch name, verify it doesn't create and error message shows appropriately - Try creating a batch with a non-existent borrower cardnumber, verifiy it doesn't create the batch and error message shows appropriately Run tests and ensure all are passing: prove -v t/db_dependent/Illbatches.t prove -v t/db_dependent/api/v1/illbatches.t prove -v t/db_dependent/IllbatchStatuses.t prove -v t/db_dependent/api/v1/illbatchstatuses.t
Created attachment 146152 [details] [review] Bug 30719: (QA Follow-up): - Fix wrong link 'Create a new batch status message' in case there are no existing batch statuses - Detail of batch update - View status of any request within a batch - Fix typo to correctly display status code on batch statuses list page - Fixed an issue with illrequest api definition that prevented the listing of any ILL requests if any request had a status_alias - Updated "Add items to batch" css class to match new 22.11 style - Fixed conflict issue where it prevented the creation of a single request in a backend that is using JS field validation utilizing the #cardnumber selector - Added a check for metadata enrichment plugins and bail batches JS code if none are found, this prevents a console error - Remove ysearch from patron auto complete in batch creation and use patron_autocomplete instead - 'New batch' and 'list batches' buttons no longer show if no metadata plugin is installed - Fixed tests, all passing now - Improved error messaging for non-existent cardnumber input in patron in ill batch creation - Improved error messaging for duplicate batch name creation error - Fix sidemenu filters and search not working after new batch_id column Sponsored-by: UKHSA