Bug 9259

Summary: Delete marc batches from staged marc management
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: CatalogingAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: aleisha, f.demians, hector.hecaxmmx, jonathan.druart, karamqubsi, katrin.fischer, kyle, m.de.rooy, marjorie.barry-vila, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16862
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Now is possible to delete a staged file once it has been cleaned. If a clean could be 'undo', a delete no. So use delete only when you realy want to erase the file.
Version(s) released in:
Attachments: Bug 9259: Ability to delete a staged file once it has been cleaned
Bug 9259: Ability to delete a staged file once it has been cleaned
Bug 9259: Ability to delete a staged file once it has been cleaned
Bug 9259: Ability to delete a staged file once it has been cleaned
Bug 9259: Ability to delete a staged file once it has been cleaned
Bug 9259: Use is instead of is_deeply

Description Nicole C. Engard 2012-12-10 21:00:49 UTC
We have the ability to 'clean' a staged file but it would be great if there was a way to batch delete (or barring that delete one by one) old batches.  Today I saw a system with over 1700 of these batches and there is really no need to keep that much stuff.  I'm thinking checkboxes next to each batch and then a 'clean' and a 'delete' button at the top of the page and you can choose one or the other. I should make you clean it before you delete it - kind of like deleting all items before deleting the bib record.

Just some ideas I have.

Nicole
Comment 1 Aleisha Amohia 2016-03-29 00:09:33 UTC Comment hidden (obsolete)
Comment 2 Liz Rea 2016-03-31 20:58:33 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2016-04-04 17:57:20 UTC
I wish we had a better icon for the "clean" button. One of the problems with using Font Awesome is that we're kinda stuck if we don't have just the right thing.

I'm not sure what the rules are... Do the changes to C4/ImportBatch.pm require a test?
Comment 4 Katrin Fischer 2016-04-04 21:28:54 UTC
Yes, a new routine should be unit tested. - Aleisha, can you please take a look?
Comment 5 Owen Leonard 2016-06-17 18:49:38 UTC
What about the eraser icon instead?

http://fontawesome.io/icon/eraser/
Comment 6 Katrin Fischer 2016-06-19 09:49:13 UTC
(In reply to Owen Leonard from comment #5)
> What about the eraser icon instead?
> 
> http://fontawesome.io/icon/eraser/

Looks good to me!
Comment 7 Aleisha Amohia 2016-06-20 04:08:38 UTC
(In reply to Katrin Fischer from comment #6)
> (In reply to Owen Leonard from comment #5)
> > What about the eraser icon instead?
> > 
> > http://fontawesome.io/icon/eraser/
> 
> Looks good to me!

Agreed, will continue with this asap!
Comment 8 Aleisha Amohia 2016-07-01 01:45:31 UTC Comment hidden (obsolete)
Comment 9 Nick Clemens 2016-07-05 19:31:35 UTC Comment hidden (obsolete)
Comment 10 Nick Clemens 2016-07-05 19:33:19 UTC
This is great! I think missing form what was requested is the ability to do this to multiple batches at once (batches of import batches)

I can open a new bug and retitle this one if that makes the most sense, unless you want to build that functionality in too?
Comment 11 Aleisha Amohia 2016-07-06 07:40:32 UTC
(In reply to Nick Clemens from comment #10)
> This is great! I think missing form what was requested is the ability to do
> this to multiple batches at once (batches of import batches)
> 
> I can open a new bug and retitle this one if that makes the most sense,
> unless you want to build that functionality in too?

Please file a new bug for that and I'll work on it. Would like to get this one tested and passed since it's been around for a while :)
Comment 12 Jonathan Druart 2016-07-06 15:58:14 UTC
Created attachment 53139 [details] [review]
Bug 9259: Ability to delete a staged file once it has been cleaned

To test:
1) Go to Tools -> Staged MARC Management and clean a file. If you have no files to clean, go to 'Stage MARC for import' and upload one to clean following the necessary steps.
2) Confirm that once the file has been cleaned, the Action column now shows a Delete button. Confirm this button only shows for cleaned files.
3) Click the Delete button.
4) Confirm that clicking Cancel exits the pop-up message and does not delete the file.
5) Confirm that clicking OK refreshes the list of staged records and the one you just deleted is no longer on it (has been deleted). You can confirm this by checking for the file in mysql (SELECT * FROM import_batches WHERE import_batch_id = X;)
6) Run prove -v t/db_dependent/ImportBatch.t (have written unit tests for CleanBatch and DeleteBatch)

Sponsored-by: Catalyst IT
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Catalyst sign off, so needs another one but YAY this is great.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Jonathan Druart 2016-07-06 15:58:18 UTC
Created attachment 53140 [details] [review]
Bug 9259: Use is instead of is_deeply

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Jonathan Druart 2016-07-06 16:00:23 UTC
To enhance:
Maybe DeleteBatch should check if the batch has been cleaned before deleting it.

Note that the patch is not perfect but follow the existing pattern of this module.
Comment 15 Aleisha Amohia 2016-07-06 23:41:41 UTC
(In reply to Jonathan Druart from comment #14)
> To enhance:
> Maybe DeleteBatch should check if the batch has been cleaned before deleting
> it.
> 
I thought about this, but the DeleteBatch function can only be called if the status has been set to cleaned (the user can't see the button), so thought I could get away with skipping that :)
Comment 16 Kyle M Hall 2016-07-08 13:44:50 UTC
Pushed to master for 16.11, thanks Aleisha, Jonathan!
Comment 17 Héctor Eduardo Castro Avalos 2016-07-14 20:59:22 UTC
+1 Aleisha this is very, very great
Comment 18 Frédéric Demians 2016-08-01 13:32:30 UTC
Pushed in 16.05. Will be in 16.05.02.