Bug 17674 - Allow UI to delete serials issues in batch
Summary: Allow UI to delete serials issues in batch
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Charles Farmer
QA Contact: Josef Moravec
URL:
Keywords:
: 12157 12575 27611 (view as bug list)
Depends on:
Blocks: 26846 26992
  Show dependency treegraph
 
Reported: 2016-11-23 17:16 UTC by Blou
Modified: 2021-12-13 21:08 UTC (History)
25 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This allows to select multiple issues to be deleted from the 'serial collection' page in the serials module. A checkbox allows to optionally delete linked items as well.
Version(s) released in:
20.05.00


Attachments
Bug 17674 - Allow UI to delete serials in batch (9.17 KB, patch)
2016-11-23 17:23 UTC, Blou
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.45 KB, patch)
2016-12-16 15:56 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug - Add unit tests (4.08 KB, patch)
2016-12-16 15:58 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.08 KB, patch)
2016-12-16 16:03 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.10 KB, patch)
2017-03-08 17:09 UTC, Bouzid Fergani
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (9.23 KB, patch)
2017-03-20 14:40 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.50 KB, patch)
2017-03-20 14:40 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.16 KB, patch)
2017-03-20 14:41 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (3.62 KB, patch)
2017-08-28 19:42 UTC, Philippe Audet-Fortin
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (9.23 KB, patch)
2017-11-07 20:00 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.50 KB, patch)
2017-11-07 20:00 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.16 KB, patch)
2017-11-07 20:01 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.44 KB, patch)
2017-11-07 20:01 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (11.46 KB, patch)
2017-12-20 21:34 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.50 KB, patch)
2017-12-20 21:34 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.16 KB, patch)
2017-12-20 21:34 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.44 KB, patch)
2017-12-20 21:34 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (10.13 KB, patch)
2018-02-16 21:54 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.50 KB, patch)
2018-02-16 21:54 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.16 KB, patch)
2018-02-16 21:54 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.37 KB, patch)
2018-02-16 21:54 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Adapting Serials.t to the namespace change (4.53 KB, patch)
2018-02-16 21:54 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17674 - Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.68 KB, patch)
2018-03-15 21:24 UTC, Roch D'Amour
Details | Diff | Splinter Review
remove selected issues (126.32 KB, image/png)
2018-03-16 12:35 UTC, Marjorie Barry-Vila
Details
Bug 17674 - Allow UI to delete serials in batch (10.28 KB, patch)
2018-03-16 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.65 KB, patch)
2018-03-16 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.30 KB, patch)
2018-03-16 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.52 KB, patch)
2018-03-16 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 - Adapting Serials.t to the namespace change (4.67 KB, patch)
2018-03-16 13:02 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 - Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.82 KB, patch)
2018-03-16 13:03 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 17674 (follow-up) Fix some HTML and JS inconsistencies (4.93 KB, patch)
2018-04-17 13:07 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674: Remove delete related item checkbox when no items is available (2.00 KB, patch)
2018-04-17 15:14 UTC, Roch D'Amour
Details | Diff | Splinter Review
Bug 17674 (follow-up) Fix some HTML and JS inconsistencies (4.98 KB, patch)
2018-04-18 16:38 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (10.29 KB, patch)
2018-05-29 19:19 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: Fix problem tabs (1.65 KB, patch)
2018-05-29 19:20 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: Add unit tests (4.30 KB, patch)
2018-05-29 19:20 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.53 KB, patch)
2018-05-29 19:20 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: Adapting Serials.t to the namespace change (4.67 KB, patch)
2018-05-29 19:20 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.82 KB, patch)
2018-05-29 19:20 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies (5.06 KB, patch)
2018-05-29 19:21 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (10.28 KB, patch)
2018-08-13 14:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 - Fix problem tabs (1.65 KB, patch)
2018-08-13 14:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 - Add unit tests (4.30 KB, patch)
2018-08-13 14:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.51 KB, patch)
2018-08-13 14:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 - Adapting Serials.t to the namespace change (4.67 KB, patch)
2018-08-13 14:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 - Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.82 KB, patch)
2018-08-13 14:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674 (follow-up) Fix some HTML and JS inconsistencies (4.84 KB, patch)
2018-08-13 14:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (10.28 KB, patch)
2018-08-15 21:45 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: Fix problem tabs (1.65 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: Add unit tests (4.30 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.51 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: Adapting Serials.t to the namespace change (4.67 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.82 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies (4.84 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually (1.74 KB, patch)
2018-08-15 21:46 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually (1.74 KB, patch)
2018-09-26 13:53 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (10.35 KB, patch)
2018-09-26 14:31 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (10.35 KB, patch)
2018-09-26 14:34 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Fix problem tabs (1.65 KB, patch)
2018-09-26 14:34 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Add unit tests (4.30 KB, patch)
2018-09-26 14:34 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.57 KB, patch)
2018-09-26 14:34 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Adapting Serials.t to the namespace change (4.67 KB, patch)
2018-09-26 14:35 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.82 KB, patch)
2018-09-26 14:35 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies (4.85 KB, patch)
2018-09-26 14:35 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually (1.74 KB, patch)
2018-09-26 14:35 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (10.44 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Fix problem tabs (1.74 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Add unit tests (4.40 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm (9.66 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Adapting Serials.t to the namespace change (4.77 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic (7.92 KB, patch)
2018-09-26 19:41 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies (4.95 KB, patch)
2018-09-26 19:42 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually (1.83 KB, patch)
2018-09-26 19:42 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (7.12 KB, patch)
2018-10-18 14:44 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (7.20 KB, patch)
2018-10-19 15:45 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674 - Allow UI to delete serials in batch (7.15 KB, patch)
2018-10-19 19:25 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (7.14 KB, patch)
2018-11-12 18:09 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (7.46 KB, patch)
2019-03-15 19:21 UTC, Pierre-Marc Thibault
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (7.52 KB, patch)
2019-11-17 14:26 UTC, Michal Denar
Details | Diff | Splinter Review
Bug 17674: Handling of special cases (3.12 KB, patch)
2020-02-21 20:13 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (7.56 KB, patch)
2020-03-02 16:17 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17674: Handling of special cases (3.19 KB, patch)
2020-03-02 16:17 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17674: Allow UI to delete serials in batch (7.62 KB, patch)
2020-03-17 15:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17674: Handling of special cases (3.24 KB, patch)
2020-03-17 15:17 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Blou 2016-11-23 17:16:07 UTC
This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.
Comment 1 Blou 2016-11-23 17:19:17 UTC
Sponsored by : CCSR
Comment 2 Blou 2016-11-23 17:23:37 UTC Comment hidden (obsolete)
Comment 3 Blou 2016-11-23 17:26:59 UTC
A test file for the changes in C4/Serials.pm will follow.

This enhancement was clamored for on the Koha (French) list.
Comment 4 Bouzid Fergani 2016-12-16 15:56:13 UTC Comment hidden (obsolete)
Comment 5 Bouzid Fergani 2016-12-16 15:58:58 UTC Comment hidden (obsolete)
Comment 6 Bouzid Fergani 2016-12-16 16:03:14 UTC Comment hidden (obsolete)
Comment 7 Bouzid Fergani 2017-03-08 17:09:35 UTC Comment hidden (obsolete)
Comment 8 Biblibre Sandboxes 2017-03-20 14:40:12 UTC
Patch tested with a sandbox, by Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Comment 9 Biblibre Sandboxes 2017-03-20 14:40:54 UTC Comment hidden (obsolete)
Comment 10 Biblibre Sandboxes 2017-03-20 14:40:58 UTC Comment hidden (obsolete)
Comment 11 Biblibre Sandboxes 2017-03-20 14:41:02 UTC Comment hidden (obsolete)
Comment 12 Koha Team University Lyon 3 2017-03-20 14:43:58 UTC
It works as described. I test with 1, 2, 3 issues deletion at one time asking for items to be deleting or not and the result is consistent :)
Comment 13 Jonathan Druart 2017-03-21 11:54:32 UTC
New subroutines should be covered by tests.
It would be preferable not to add new subroutines to C4 whereas I am trying to move everything to Koha.
Please consider adding a new method to Koha.
Comment 14 Philippe Audet-Fortin 2017-08-28 19:42:01 UTC Comment hidden (obsolete)
Comment 15 Alex Buckley 2017-10-04 21:22:29 UTC Comment hidden (obsolete)
Comment 16 David Bourgault 2017-11-07 20:00:49 UTC Comment hidden (obsolete)
Comment 17 David Bourgault 2017-11-07 20:00:59 UTC Comment hidden (obsolete)
Comment 18 David Bourgault 2017-11-07 20:01:04 UTC Comment hidden (obsolete)
Comment 19 David Bourgault 2017-11-07 20:01:09 UTC Comment hidden (obsolete)
Comment 20 Marjorie Barry-Vila 2017-11-13 15:05:53 UTC Comment hidden (obsolete)
Comment 21 Charles Farmer 2017-12-20 21:34:35 UTC Comment hidden (obsolete)
Comment 22 Charles Farmer 2017-12-20 21:34:43 UTC Comment hidden (obsolete)
Comment 23 Charles Farmer 2017-12-20 21:34:49 UTC Comment hidden (obsolete)
Comment 24 Charles Farmer 2017-12-20 21:34:55 UTC Comment hidden (obsolete)
Comment 25 Charles Farmer 2017-12-20 21:37:51 UTC Comment hidden (obsolete)
Comment 26 Charles Farmer 2018-02-16 21:54:07 UTC Comment hidden (obsolete)
Comment 27 Charles Farmer 2018-02-16 21:54:12 UTC Comment hidden (obsolete)
Comment 28 Charles Farmer 2018-02-16 21:54:17 UTC Comment hidden (obsolete)
Comment 29 Charles Farmer 2018-02-16 21:54:21 UTC Comment hidden (obsolete)
Comment 30 Charles Farmer 2018-02-16 21:54:29 UTC Comment hidden (obsolete)
Comment 31 Charles Farmer 2018-02-16 21:58:49 UTC
Rebased once again on the current master.

This time, though, a new patch was submitted to make sure our subtests respected the new namespace, and that no items were created without a biblioitemnumber.

Just one more signoff to go.
Comment 32 Jonathan Druart 2018-02-16 22:17:51 UTC
1. You are not supposed to write SQL queries
2. You should read how Koha::Object-based objects work
3. method's names must be snake_case

In short: forget the former C4 logic and rethink your new method. I can help you if you are stuck.
Comment 33 Roch D'Amour 2018-03-15 21:24:17 UTC Comment hidden (obsolete)
Comment 34 Séverine Queune 2018-03-16 11:04:03 UTC
No conflict when applying the patch but I couldn't find where to find the new feature.
Is it supposed to be on the /cgi-bin/koha/serials/serials-search.pl ?
Or a new menu is created on Tools ?
Comment 35 Marjorie Barry-Vila 2018-03-16 12:34:34 UTC
(In reply to Séverine Queune from comment #34)
> No conflict when applying the patch but I couldn't find where to find the
> new feature.
> Is it supposed to be on the /cgi-bin/koha/serials/serials-search.pl ?
> Or a new menu is created on Tools ?

Hi Severine,
You have to go on serials-collection.pl?subscriptionid=?, you will see a button "Remove selected issue".
See attached image.

Regards,
Marjorie
Comment 36 Marjorie Barry-Vila 2018-03-16 12:35:24 UTC
Created attachment 73032 [details]
remove selected issues
Comment 37 Séverine Queune 2018-03-16 12:50:32 UTC
My bad, I confused myself between "serial" and "subscription" so I expected a different feature and was looking at the wrong place ! (It's been a hard hackfest week in Marseille ^^).
Thanks a lot Marjorie ! I 'm going to test it.
Comment 38 Séverine Queune 2018-03-16 13:02:34 UTC Comment hidden (obsolete)
Comment 39 Séverine Queune 2018-03-16 13:02:39 UTC Comment hidden (obsolete)
Comment 40 Séverine Queune 2018-03-16 13:02:45 UTC Comment hidden (obsolete)
Comment 41 Séverine Queune 2018-03-16 13:02:50 UTC Comment hidden (obsolete)
Comment 42 Séverine Queune 2018-03-16 13:02:55 UTC Comment hidden (obsolete)
Comment 43 Séverine Queune 2018-03-16 13:03:00 UTC Comment hidden (obsolete)
Comment 44 Marjorie Barry-Vila 2018-03-16 13:04:15 UTC
(In reply to Séverine Queune from comment #37)
> My bad, I confused myself between "serial" and "subscription" so I expected
> a different feature and was looking at the wrong place ! (It's been a hard
> hackfest week in Marseille ^^).
> Thanks a lot Marjorie ! I 'm going to test it.

Great! Thanks for testing!

Marjorie
Comment 45 Séverine Queune 2018-03-16 13:04:55 UTC
Works as described.
Thanks to all of you for this new feature !
Comment 46 Katrin Fischer 2018-04-16 22:40:55 UTC
Starting with a code review, patches apply, QA script passes:

1) Translatability issue
+   <h3>Are you sure delete <b> [% serialnumber %] </b> selected serials</h3>
Please rethink this sentence. The <b> should not be used within a sentence as it will break this into several strings. I think it's not necessary here. Also sentence reads a bit strangely? :)

Similar here:
<h5>Number of items available <b>: [% countitems %] </b> </h5>

That went well! Now testing:

2) I think if the serial is not set up to create items, we should not ask. Or if the number of items is 0.

3) A checkbox for deleting items would be a little nicer than the radio button. Could be fixed later, not blocker.

4) Number of items available : 0 
No space there in English: available:

5) The appearing yellow dialogue pushes down the navigation bar on the right. Please check.

Mostly tiny stuff, this looks quite good. Can you provide a quick follow-up and switch back to signed-off please?
Comment 47 Owen Leonard 2018-04-17 13:07:52 UTC Comment hidden (obsolete)
Comment 48 Roch D'Amour 2018-04-17 14:34:21 UTC
Hi Owen, did you forget to switch this back to "Need signoff"? 
It seems like your patch cover everything said Kat, yet the bug's status is still failed QA.
Comment 49 Owen Leonard 2018-04-17 14:43:15 UTC
(In reply to Roch D'Amour from comment #48)
> Hi Owen, did you forget to switch this back to "Need signoff"? 

I think this issue is still unresolved:

> 2) I think if the serial is not set up to create items, we should not ask.
> Or if the number of items is 0.
Comment 50 Roch D'Amour 2018-04-17 15:14:27 UTC Comment hidden (obsolete)
Comment 51 Séverine Queune 2018-04-17 20:38:00 UTC
(In reply to Owen Leonard from comment #47)
>  - Confirm that the "Delete selected" button works correctly.
When serials of several years exist, only the button of the first tab works, not the buttons "Delete selected issues" displayed on the tabs of previous years.
The other buttons work as expected on all tabs.
Except that point, the rest of the patch works correctly, but I prefer not sign it.
Comment 52 Jonathan Druart 2018-04-17 21:21:07 UTC
For information: I have added a "modify selected serials" link on bug 18426, but on the other screen (subscription search result)
Comment 53 Katrin Fischer 2018-04-17 21:35:03 UTC
This if for serials issues, not subscriptons. I think it will be useful if libraries bind issues or regularly throw out older ones.
Comment 54 Owen Leonard 2018-04-18 16:38:11 UTC Comment hidden (obsolete)
Comment 55 Owen Leonard 2018-04-18 16:39:28 UTC
(In reply to Roch D'Amour from comment #50)
> - Try to delete some serials that has items available, the confirmation
> dialog does not ask

There is a typo which is preventing this from working correctly:

[% IF $countitems > 0 %]

should be 

[% IF countitems > 0 %]
Comment 56 Katrin Fischer 2018-04-18 22:54:07 UTC
The patch no longer applies, can you please check? Maybe you did the last change without Owen's follow-up? Please also take a comment at c#55!
Comment 57 Katrin Fischer 2018-04-18 22:55:05 UTC
Oh, and please also fix git commit messages! https://wiki.koha-community.org/wiki/Commit_messages
Comment 58 Owen Leonard 2018-04-19 14:11:57 UTC
(In reply to Katrin Fischer from comment #56)
> The patch no longer applies, can you please check?

The patches are out of order after my last update. "Remove delete related item checkbox when no items is available" should be applied after mine.
Comment 59 Katrin Fischer 2018-04-23 09:50:27 UTC
Roch, can you please provide a follow-up fixing the last issues? I'd like to retest before Friday deadline.
Comment 60 David Bourgault 2018-05-29 19:19:57 UTC Comment hidden (obsolete)
Comment 61 David Bourgault 2018-05-29 19:20:17 UTC Comment hidden (obsolete)
Comment 62 David Bourgault 2018-05-29 19:20:25 UTC Comment hidden (obsolete)
Comment 63 David Bourgault 2018-05-29 19:20:34 UTC Comment hidden (obsolete)
Comment 64 David Bourgault 2018-05-29 19:20:42 UTC Comment hidden (obsolete)
Comment 65 David Bourgault 2018-05-29 19:20:51 UTC Comment hidden (obsolete)
Comment 66 David Bourgault 2018-05-29 19:21:01 UTC Comment hidden (obsolete)
Comment 67 David Bourgault 2018-05-29 19:22:59 UTC
Rebased patches. I had to manually redo Owen's patch for some reason so I combined it with Roch's last patch
Comment 68 Owen Leonard 2018-08-13 14:29:20 UTC
Created attachment 77745 [details] [review]
Bug 17674 - Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 69 Owen Leonard 2018-08-13 14:29:31 UTC
Created attachment 77746 [details] [review]
Bug 17674 - Fix problem tabs

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 70 Owen Leonard 2018-08-13 14:29:42 UTC
Created attachment 77747 [details] [review]
Bug 17674 - Add unit tests

https://bugs.koha-community.org/show_bug.cgi?id=17674

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 71 Owen Leonard 2018-08-13 14:30:00 UTC
Created attachment 77748 [details] [review]
Bug 17674 - Move subroutine GetSerialItemsInformations to Koha/Serials.pm

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 72 Owen Leonard 2018-08-13 14:30:14 UTC
Created attachment 77749 [details] [review]
Bug 17674 - Adapting Serials.t to the namespace change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 73 Owen Leonard 2018-08-13 14:30:27 UTC
Created attachment 77750 [details] [review]
Bug 17674 - Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 74 Owen Leonard 2018-08-13 14:30:38 UTC
Created attachment 77751 [details] [review]
Bug 17674 (follow-up) Fix some HTML and JS inconsistencies

This patch makes some HTML and JS changes to make the template more
consistent with coding guidelines and other similar interfaces.

- The confirmation dialog is now below the heading. Buttons are styled
  to match others like them. The layout of messages hopefully makes it a
  little more clear.
- The "delete selected" event handler has been moved from an "onclick"
  attribute into the <script> tags.

To test, apply the patch and follow the original test plan.

 - Confirm that the "Delete selected" button works correctly.
 - Confirm that the confirmation dialog looks good and that its form
   elements work correctly.

Edit: Make sure delete button works from any tab.
Comment 75 Katrin Fischer 2018-08-15 21:45:59 UTC
Created attachment 77861 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 76 Katrin Fischer 2018-08-15 21:46:07 UTC
Created attachment 77862 [details] [review]
Bug 17674: Fix problem tabs

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 77 Katrin Fischer 2018-08-15 21:46:14 UTC
Created attachment 77863 [details] [review]
Bug 17674: Add unit tests

https://bugs.koha-community.org/show_bug.cgi?id=17674

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 78 Katrin Fischer 2018-08-15 21:46:20 UTC
Created attachment 77864 [details] [review]
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 79 Katrin Fischer 2018-08-15 21:46:27 UTC
Created attachment 77865 [details] [review]
Bug 17674: Adapting Serials.t to the namespace change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 80 Katrin Fischer 2018-08-15 21:46:33 UTC
Created attachment 77866 [details] [review]
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 81 Katrin Fischer 2018-08-15 21:46:39 UTC
Created attachment 77867 [details] [review]
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies

This patch makes some HTML and JS changes to make the template more
consistent with coding guidelines and other similar interfaces.

- The confirmation dialog is now below the heading. Buttons are styled
  to match others like them. The layout of messages hopefully makes it a
  little more clear.
- The "delete selected" event handler has been moved from an "onclick"
  attribute into the <script> tags.

To test, apply the patch and follow the original test plan.

 - Confirm that the "Delete selected" button works correctly.
 - Confirm that the confirmation dialog looks good and that its form
   elements work correctly.

Edit: Make sure delete button works from any tab.
Comment 82 Katrin Fischer 2018-08-15 21:46:45 UTC
Created attachment 77868 [details] [review]
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually
Comment 83 Katrin Fischer 2018-08-15 21:49:22 UTC
I've fixed the commit messages Bug XXXX: instead of Bug XXXX -. I've also added a tiny follow-up to fix the styling of the button and the wrong number of tests.

Generally this works well, so I am signing off.

Things to improve:
- When deleting multiple issues and one is expected, the expected one is not deleted, which is, I think, the correct behaviour. Without the expected issue the subscription would no longer work correctly. But we could improve the visual by warning the user maybe.
- When deleting issues that have no items yet, you are still offered the option to delete items with them (Status late for example). Nothing bad happens, so not blocker for me.
Comment 84 Pierre-Marc Thibault 2018-09-26 13:53:20 UTC Comment hidden (obsolete)
Comment 85 Pierre-Marc Thibault 2018-09-26 14:31:14 UTC Comment hidden (obsolete)
Comment 86 Pierre-Marc Thibault 2018-09-26 14:34:37 UTC
Created attachment 79421 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 87 Pierre-Marc Thibault 2018-09-26 14:34:42 UTC
Created attachment 79422 [details] [review]
Bug 17674: Fix problem tabs

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 88 Pierre-Marc Thibault 2018-09-26 14:34:48 UTC
Created attachment 79423 [details] [review]
Bug 17674: Add unit tests

https://bugs.koha-community.org/show_bug.cgi?id=17674

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 89 Pierre-Marc Thibault 2018-09-26 14:34:54 UTC
Created attachment 79424 [details] [review]
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 90 Pierre-Marc Thibault 2018-09-26 14:35:00 UTC
Created attachment 79425 [details] [review]
Bug 17674: Adapting Serials.t to the namespace change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 91 Pierre-Marc Thibault 2018-09-26 14:35:06 UTC
Created attachment 79426 [details] [review]
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 92 Pierre-Marc Thibault 2018-09-26 14:35:11 UTC
Created attachment 79427 [details] [review]
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies

This patch makes some HTML and JS changes to make the template more
consistent with coding guidelines and other similar interfaces.

- The confirmation dialog is now below the heading. Buttons are styled
  to match others like them. The layout of messages hopefully makes it a
  little more clear.
- The "delete selected" event handler has been moved from an "onclick"
  attribute into the <script> tags.

To test, apply the patch and follow the original test plan.

 - Confirm that the "Delete selected" button works correctly.
 - Confirm that the confirmation dialog looks good and that its form
   elements work correctly.

Edit: Make sure delete button works from any tab.
Comment 93 Pierre-Marc Thibault 2018-09-26 14:35:17 UTC
Created attachment 79428 [details] [review]
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually
Comment 94 Pierre-Marc Thibault 2018-09-26 14:47:48 UTC
A rebase has been made.
Comment 95 Michal Denar 2018-09-26 19:41:22 UTC
Created attachment 79453 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 96 Michal Denar 2018-09-26 19:41:29 UTC
Created attachment 79454 [details] [review]
Bug 17674: Fix problem tabs

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 97 Michal Denar 2018-09-26 19:41:36 UTC
Created attachment 79455 [details] [review]
Bug 17674: Add unit tests

https://bugs.koha-community.org/show_bug.cgi?id=17674

Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 98 Michal Denar 2018-09-26 19:41:43 UTC
Created attachment 79456 [details] [review]
Bug 17674: Move subroutine GetSerialItemsInformations to Koha/Serials.pm

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 99 Michal Denar 2018-09-26 19:41:50 UTC
Created attachment 79457 [details] [review]
Bug 17674: Adapting Serials.t to the namespace change

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 100 Michal Denar 2018-09-26 19:41:57 UTC
Created attachment 79458 [details] [review]
Bug 17674: Renamed GetSerialItemsInformations to get_serial_items_count and use new OOP logic

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 101 Michal Denar 2018-09-26 19:42:03 UTC
Created attachment 79459 [details] [review]
Bug 17674: (follow-up) Fix some HTML and JS inconsistencies

This patch makes some HTML and JS changes to make the template more
consistent with coding guidelines and other similar interfaces.

- The confirmation dialog is now below the heading. Buttons are styled
  to match others like them. The layout of messages hopefully makes it a
  little more clear.
- The "delete selected" event handler has been moved from an "onclick"
  attribute into the <script> tags.

To test, apply the patch and follow the original test plan.

 - Confirm that the "Delete selected" button works correctly.
 - Confirm that the confirmation dialog looks good and that its form
   elements work correctly.

Edit: Make sure delete button works from any tab.

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 102 Michal Denar 2018-09-26 19:42:10 UTC
Created attachment 79460 [details] [review]
Bug 17674: (follow-up) Fix wrong number of tests, make button match visually

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 103 Jonathan Druart 2018-10-01 00:01:13 UTC
QA comments (reading the code):

1. I do not understand Koha::Serials::get_serial_items_count, several things are wrong:
 * you should not export, it must be a method and called like others: Koha::Module->method
 * my ( @self ) = @_;
No, $self must be the object, then you pass the parameters.
 * 
+        while ( my $s = $serialitems->next() ) {
+            $countitem++;
+        }

=> You actually want ->count

 * And finally, what is it supposed to do? and why?
`git grep get_serial_items_count` returns only one occurrence:
serials/serials-collection.pl:my @serialitemsinformation=get_serial_items_count(@ids);

It returns an array of hashes (2 keys: countitems and serialid), countitems is used later, and serialid is not.
Moreover I have no idea what the following is supposed to do
130         foreach my $line (@serialitemsinformation){                                                  
131             DelItem($line);                                                                          
132         }
It certainly does not work.

I would suggest you to rethink this as a method, for instance I am pretty sure you are looking for something like that: Koha::Serial->items which would return the items (Koha::Items!) for a given Koha::Serial object (already said, less explicitly, on comment 32)

2. You do not need to concat with '!' then split, you can pass several times a parameters (and retrieve them pl side with CGI->multi_param). It will simplify a lot the javascript code (function deleteIssues).

3. $delete and $confdelete should not be variables, but values of $op (usually "delete_confirm" and "delete_confirmed", see admin/cities.pl)

4. function generateReceive (serials-collection.tt) re-added, has been deleted previously by bug 18327.

5. Same for addsubscriptionid, delete by bug 19777.

IMO it would be easier to redo these patches from scratch and abandon the too long patches history.
Comment 104 Katrin Fischer 2018-10-01 08:47:15 UTC
I really want the feature, but I see that Jonathan has made some very good points. This has been sitting too long and the code has evolved since :(
Comment 105 Pierre-Marc Thibault 2018-10-18 14:42:11 UTC
All patches have been removed and will be replaced by a new one as suggested. It will take in account the last suggestions.
Comment 106 Pierre-Marc Thibault 2018-10-18 14:44:57 UTC
Created attachment 80859 [details] [review]
Bug 17674 - Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR
Comment 107 Séverine Queune 2018-10-18 15:40:33 UTC
Items are not suppressed when I check the box.
Comment 108 Pierre-Marc Thibault 2018-10-19 15:45:22 UTC
Created attachment 80944 [details] [review]
Bug 17674 - Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR
Comment 109 Michal Denar 2018-10-19 19:25:56 UTC
Created attachment 80955 [details] [review]
Bug 17674 - Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 110 Katrin Fischer 2018-10-26 16:16:17 UTC
Hi Pierre-Marc,

some things here:

1) Please make sure all your patches pass the QA script before submitting them: https://gitlab.com/koha-community/qa-test-tools
Currently, it fails:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
   FAIL	  filters
		missing_filter at line 380 (                deleteIssues("[% subscriptionidlist %]");)
		missing_filter at line 39 (                <h5>Number of items available: [% countitems %]</h5>)
		missing_filter at line 46 (            <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />)
		missing_filter at line 48 (                <input type="hidden" name="serialid" value="[% serialid %]" />)
		missing_filter at line 148 (            <input type="button" value="Delete selected issues" class="delete-issues btn btn-default btn-sm" data-subscriptionids="[% subscriptionidlist %]" />)
		missing_filter at line 36 (        <h3>You are about to delete [% serialnumber %] serial(s). Do you want to continue?</h3>)
		missing_filter at line 45 (            <input type="hidden" name="biblionumber" value="[% biblionumber %]" />)
		missing_filter at line 53 (            <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />)

2) Please make sure that the subject lines of your commits are formatted correctly. The QA script will also help with that:

	* Commit title does not start with 'Bug XXXXX: ' - 12463c45e7

3) Please make sure all text is translatable:
https://wiki.koha-community.org/wiki/Coding_Guidelines#JS2:_Enabling_translation_of_language_strings_in_embedded_JavaScript

+                alert("No serials selected");
Comment 111 Pierre-Marc Thibault 2018-11-12 18:09:31 UTC
Created attachment 82237 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Testing
- Have at least three serials, with items
- check the box to select two of them
- Press the Remove selected issues button
- Decide to delete their items as well or not
- Validate.

Sponsored by : CCSR
Comment 112 Pierre-Marc Thibault 2018-11-12 18:14:45 UTC
I made sure that the QA tests passed and that the alert is translatable. These kinds of fixes should be gone now :)
Comment 113 Séverine Queune 2019-02-27 13:50:46 UTC
Everything is correct when I deleted both serials and items, but I have a doubt about the behaviour when I keep the items : is it normal the 'Enumchron' field is emptied after deleting the linked serial ?
I can't remember if it happened when I've previously tested it.
Comment 114 Katrin Fischer 2019-02-27 17:27:10 UTC
(In reply to Séverine Queune from comment #113)
> Everything is correct when I deleted both serials and items, but I have a
> doubt about the behaviour when I keep the items : is it normal the
> 'Enumchron' field is emptied after deleting the linked serial ?
> I can't remember if it happened when I've previously tested it.

This doesn't sound good - I think enumchron is the only way to tell the items apart so needs to be kept.
Comment 115 Pierre-Marc Thibault 2019-03-15 18:37:36 UTC
I am not able to reproduce the problem. I will reupload the patch with a better test plan that will make sure there is no problem with the enumchron.
Comment 116 Pierre-Marc Thibault 2019-03-15 19:06:15 UTC
So... I find out when a serial is deleted with and without the patch, the enumchron lost only the date part. Maybe that was the observed problem, because otherwise the enumcron is not emptied. I will therefore proceed with the clearer test plan.
Comment 117 Pierre-Marc Thibault 2019-03-15 19:21:46 UTC
Created attachment 86689 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Test plan :
- Apply patch.
- Create at least four serials with items.
- Notice that new items have a numbering pattern and a date in the enumchron field.
- Use the button Delete selected issues for the following steps.
- Delete a serial and its associated item.
- Confirm the serial and item are gone.
- Delete a serial and not its item.
- Confirm the serial is gone.
- Confirm the item is still there and the date part in the enumchron field is gone.
- Delete the two lasts serials.
- Confirm they are gone.

Sponsored by : CCSR
Comment 118 Pierre-Marc Thibault 2019-03-15 19:22:44 UTC
So... I find out when a serial is deleted with and without the patch, the enumchron lost only the date part. Maybe that was the observed problem, because otherwise the enumcron is not emptied. I will therefore proceed with the clearer test plan.
Comment 119 Séverine Queune 2019-04-17 13:42:39 UTC
Sorry Pierre-mars, I still have the enumvhron th
Comment 120 Séverine Queune 2019-04-17 13:43:47 UTC
Oups...
Sorry, I still have the enumchron of the item emptied when I delete the serial.
Comment 121 Katrin Fischer 2019-04-17 13:46:00 UTC
Could this be an UNIMARC vs. MARC21 issue? Which format did you use for testing Severine?
Comment 122 Séverine Queune 2019-04-17 13:52:40 UTC
(In reply to Katrin Fischer from comment #121)
> Could this be an UNIMARC vs. MARC21 issue? Which format did you use for
> testing Severine?

Unimarc. I tested with Biblibre's sandbox#1, patch is still applied if you want to take a look : I used the subscription "Psychologies" (Call number: SER4)
Comment 123 Maryse Simard 2019-11-15 22:29:19 UTC
I tried testing myself and could not reproduce the situation when the enumchron is emptied. I also tried testing with Biblibre's sandbox using Unimarc database and "Psychologies" subscription, but did not observe the problem.

I wonder if I could trouble you for the exact steps you used to produce this error while testing?
Comment 124 Michal Denar 2019-11-17 14:26:11 UTC
Created attachment 95474 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Test plan :
- Apply patch.
- Create at least four serials with items.
- Notice that new items have a numbering pattern and a date in the enumchron field.
- Use the button Delete selected issues for the following steps.
- Delete a serial and its associated item.
- Confirm the serial and item are gone.
- Delete a serial and not its item.
- Confirm the serial is gone.
- Confirm the item is still there and the date part in the enumchron field is gone.
- Delete the two lasts serials.
- Confirm they are gone.

Sponsored by : CCSR

Signed-off-by: Michal Denar <black23@gmail.com>
Comment 125 Nick Clemens 2020-02-18 18:23:11 UTC
If I receive a few serials and then delete the expected issue from the serials collection screen I can only see an expected issue until I receive the expected issue, then all previously received undeleted issues show again.

To recreate:
1 - Create a subscription that creates items
2 - Receive two issues
3 - From serial collection select the 'Expected' issue and delete
4 - You only see the new expected issue

If I try to delete a serial with an item that cannot be deleted the serial deletion completes but the item remains with no feedback

To recreate
1 - Follow 1 and 2 above
2 - Check out one of the items
3 - Select the serial for this issue and delete
4 - Check the box to confirm deleting items
5 - The serial is deleted, the item remains, no error shown to user
Comment 126 Maryse Simard 2020-02-21 20:13:50 UTC
Created attachment 99434 [details] [review]
Bug 17674: Handling of special cases

This patch adds handling for those 2 particular cases:
1. Deleting the expected issue
2. Deleting a serial and it's item, but one item cannot be deleted

To test:

1.1 Create a subscription that creates items
1.2 Receive two issues
1.3 Use the new button to delete the 'Expected' issue
1.4 The issue is correctly deleted, but the new expected issue created
to replace the one which has been deleted don't have a published or
received date and is show in it's own tab.
1.5 Apply patch
1.6 Repeat steps 1.1 through 1.4
    => The new expected issue is created correctly

2.1 Use the same serial as in 1 or repeat step 1.1 and 1.2
2.2 Check out one of the items
2.3 Delete the corresponding serial and check box to delete items
2.4 The serial is deleted, but not the item.
    => No feedback is show to the user
2.5 Apply patch
2.6 Repeat step 2.1 through 2.4
    => As before, the serial is deleted, but not the item
    => This time, an error is shown to inform the user
Comment 127 ByWater Sandboxes 2020-03-02 16:17:49 UTC
Created attachment 99944 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Test plan :
- Apply patch.
- Create at least four serials with items.
- Notice that new items have a numbering pattern and a date in the enumchron field.
- Use the button Delete selected issues for the following steps.
- Delete a serial and its associated item.
- Confirm the serial and item are gone.
- Delete a serial and not its item.
- Confirm the serial is gone.
- Confirm the item is still there and the date part in the enumchron field is gone.
- Delete the two lasts serials.
- Confirm they are gone.

Sponsored by : CCSR

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>
Comment 128 ByWater Sandboxes 2020-03-02 16:17:53 UTC
Created attachment 99945 [details] [review]
Bug 17674: Handling of special cases

This patch adds handling for those 2 particular cases:
1. Deleting the expected issue
2. Deleting a serial and it's item, but one item cannot be deleted

To test:

1.1 Create a subscription that creates items
1.2 Receive two issues
1.3 Use the new button to delete the 'Expected' issue
1.4 The issue is correctly deleted, but the new expected issue created
to replace the one which has been deleted don't have a published or
received date and is show in it's own tab.
1.5 Apply patch
1.6 Repeat steps 1.1 through 1.4
    => The new expected issue is created correctly

2.1 Use the same serial as in 1 or repeat step 1.1 and 1.2
2.2 Check out one of the items
2.3 Delete the corresponding serial and check box to delete items
2.4 The serial is deleted, but not the item.
    => No feedback is show to the user
2.5 Apply patch
2.6 Repeat step 2.1 through 2.4
    => As before, the serial is deleted, but not the item
    => This time, an error is shown to inform the user

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>
Comment 129 Koha Team University Lyon 3 2020-03-02 16:22:51 UTC
I've followed the test plan and everything looks Ok for me.
1. The next expected issue is correctly created when we delete the current expected issue.
2. If an item is checked out, you can't delete this item when you delete the serial issue. There's an alert to tell you that you can't delete the item.
Comment 130 Jonathan Druart 2020-03-17 14:36:30 UTC
I'd say you should not call DelItem directly, but DelItemCheck instead.
Comment 131 Maryse Simard 2020-03-17 14:45:43 UTC
(In reply to Jonathan Druart from comment #130)
> I'd say you should not call DelItem directly, but DelItemCheck instead.

This is what has been done in the follow up patch.
Comment 132 Jonathan Druart 2020-03-17 15:16:58 UTC
Created attachment 100906 [details] [review]
Bug 17674: Allow UI to delete serials in batch

This new feature allows for batch deletion of serials through the UI.  The current usage is a one-by-one long game.

Test plan :
- Apply patch.
- Create at least four serials with items.
- Notice that new items have a numbering pattern and a date in the enumchron field.
- Use the button Delete selected issues for the following steps.
- Delete a serial and its associated item.
- Confirm the serial and item are gone.
- Delete a serial and not its item.
- Confirm the serial is gone.
- Confirm the item is still there and the date part in the enumchron field is gone.
- Delete the two lasts serials.
- Confirm they are gone.

Sponsored by : CCSR

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 133 Jonathan Druart 2020-03-17 15:17:05 UTC
Created attachment 100907 [details] [review]
Bug 17674: Handling of special cases

This patch adds handling for those 2 particular cases:
1. Deleting the expected issue
2. Deleting a serial and it's item, but one item cannot be deleted

To test:

1.1 Create a subscription that creates items
1.2 Receive two issues
1.3 Use the new button to delete the 'Expected' issue
1.4 The issue is correctly deleted, but the new expected issue created
to replace the one which has been deleted don't have a published or
received date and is show in it's own tab.
1.5 Apply patch
1.6 Repeat steps 1.1 through 1.4
    => The new expected issue is created correctly

2.1 Use the same serial as in 1 or repeat step 1.1 and 1.2
2.2 Check out one of the items
2.3 Delete the corresponding serial and check box to delete items
2.4 The serial is deleted, but not the item.
    => No feedback is show to the user
2.5 Apply patch
2.6 Repeat step 2.1 through 2.4
    => As before, the serial is deleted, but not the item
    => This time, an error is shown to inform the user

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 134 Jonathan Druart 2020-03-17 15:17:35 UTC
(In reply to Maryse Simard from comment #131)
> (In reply to Jonathan Druart from comment #130)
> > I'd say you should not call DelItem directly, but DelItemCheck instead.
> 
> This is what has been done in the follow up patch.

Indeed! I forgot to squash before reviewing them.
Comment 135 Martin Renvoize 2020-03-19 09:39:30 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 136 Joy Nelson 2020-04-03 20:33:43 UTC
enhancement not backported to 19.11.x
Comment 137 Katrin Fischer 2021-02-06 19:59:29 UTC
*** Bug 12157 has been marked as a duplicate of this bug. ***
Comment 138 Katrin Fischer 2021-02-06 19:59:40 UTC
*** Bug 27611 has been marked as a duplicate of this bug. ***