Koha/tools
Pedro Amorim cf06f05ec0
Bug 30869: Add the ability to delete stock rotation rotas
'At the moment, it isn't possible to delete any rotas that have 0 items linked to it. The only way to do it is in MySQL - it would be good if this was possible from the staff client.'
This patch implements this, and also implements the possibility of deleting a rota with items linked to it, providing a warning that the item(s) currently in rotation will remain at its/their current stage library.

Test plan:
1) Enable StockRotation system preference
2) Cataloging > Stock rotation > New rota
3) Enter Name, save
4) Verify 'Delete' button shows on the right
5) Click 'Delete' -> Confirm 'Yes'
6) Repeat steps 1-3 and click 'Manage'->'Stages'
7) Add a new stage, enter Library and Duration, click 'Save'
8) Return to rotas, click 'Manage'->'Items'
9) Add item, enter barcode, click 'Save' (optional: add more than 1 item)
10) Optional: Click 'Move to next stage' and verify that item is now in different branch
11) Click 'return to rotas' and press 'Delete'
12) Verify the warning now shows, because items are attached, with the attached items count
13) Click 'Delete' -> Deletion is successful
14) If you did step 10, verify the item is still in the branch that it was at the time the rota was deleted

Sponsored-by: PTFS-Europe

Signed-off-by: David Nind <david@davidnind.com>

JD Amended patch:
* Fix QA failures
   FAIL   forbidden patterns
                forbidden pattern: tab char (line 150)
                forbidden pattern: tab char (line 151)
* Adjust commit message to describe what the patch does
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-24 17:52:23 -03:00
..
csv-profiles
access_files.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
additional-contents.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
ajax-inventory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
automatic_item_modification_by_age.pl Bug 22827: Add age dependency on other fields than dateaccessioned 2022-04-08 15:49:16 +02:00
background-job-progress.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
batch_delete_records.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
batch_extend_due_dates.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
batch_record_modification.pl Bug 29771: Scalar context for split 2022-03-08 23:03:34 -10:00
batch_records_ajax.pl Bug 22785: Allow option to choose which record match is applied during import 2022-05-03 11:19:50 -10:00
batchMod.pl Bug 32019: Add option to mark items returned via batch modification 2023-02-20 09:54:20 -03:00
cleanborrowers.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
copy-holidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
csv-profiles.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
exceptionHolidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
export.pl Bug 6936: Allow multiple itemtypes for bib record export 2022-08-22 13:34:38 -03:00
holidays.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
import_borrowers.pl Bug 27920: (QA follow-up) Change radios to a single select pulldown 2022-11-09 14:37:24 -03:00
inventory.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
letter.pl Bug 32221: Borrowers.password should no longer be an option 2023-01-20 13:55:17 +00:00
manage-marc-import.pl Bug 15869: (QA follow-up) Don't pass placeholder framework '_USE_ORIG' 2023-02-07 10:32:23 -03:00
marc_modification_templates.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
modborrowers.pl Bug 31095: (follow-up) Iterate debarments in batch mod 2023-01-31 10:19:42 -03:00
newHolidays.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
overduerules.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
page.pl Bug 31385: (follow-up) Same change at intranet side 2022-08-19 11:43:56 -03:00
picture-upload.pl Bug 6815: Capture member photo via webcam 2022-03-24 14:22:10 -10:00
problem-reports.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes-upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
scheduler.pl Bug 30718: Fix scheduler 2022-08-19 08:26:38 -03:00
showdiffmarc.pl Bug 31526: Follow-up for bug 29697 2022-09-16 10:25:48 -03:00
stage-marc-import.pl Bug 31711: (bug 27421 follow-up) Fix add to basket from a new file 2022-11-15 18:44:30 -03:00
stockrotation.pl Bug 30869: Add the ability to delete stock rotation rotas 2023-02-24 17:52:23 -03:00
tools-home.pl Bug 26628: Fix access to clubs when user only has clubs permission 2023-01-31 10:50:52 -03:00
upload-cover-image.pl Bug 30972: Don't replace biblio's local cover images when uploading an image's image 2022-06-20 10:39:34 -03:00
upload-file.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
viewlog.pl Bug 32037: Check for existence of object before building link 2022-11-04 19:18:54 -03:00