Bug 18394

Summary: Add an option to item search to export a barcodes file
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: SearchingAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, kyle, stephane.delaye
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 18433    
Attachments: Bug 18394: Remove useless code from item search
Bug 18394: Add an option to item search to export a barcodes file
[SIGNED-OFF] Bug 18394: Remove useless code from item search
[SIGNED-OFF] Bug 18394: Add an option to item search to export a barcodes file
Bug 18394: Remove useless code from item search
Bug 18394: Add an option to item search to export a barcodes file

Description Julian Maurice 2017-04-06 15:25:32 UTC

    
Comment 1 Julian Maurice 2017-04-06 15:26:51 UTC
Created attachment 61937 [details] [review]
Bug 18394: Remove useless code from item search

The item search was originally designed to work even with JS disabled.
Since bug 15111, the staff interface does not work at all without JS, so some
parts of this code are useless and should be removed
Comment 2 Julian Maurice 2017-04-06 15:26:55 UTC
Created attachment 61938 [details] [review]
Bug 18394: Add an option to item search to export a barcodes file

Test plan:
1. Go to item search (/cgi-bin/koha/catalogue/itemsearch.pl)
2. Fill the form with whatever you want
3. Leave the 'Output' option to 'Screen' and click 'Search'
4. Verify that the search still works
5. Click on 'Edit search' and set 'Output' to 'Barcodes file', click 'Search'
6. You should be able to download a 'barcodes.txt' file, open it and compare it
   to the previous search results
7. Now click on the 'Export results to barcodes file' button above the results,
   you should have the same result as in step 5
8. Verify that the CSV export still works
Comment 3 Owen Leonard 2017-04-07 18:32:50 UTC
Step 5 and Step 7 don't work for me. I expect the browser to start the download of a text file, but the page reloads without any prompt.
Comment 4 Julian Maurice 2017-04-10 06:51:51 UTC
Hi Owen,

do you have any JS errors in the console ?
Comment 5 Owen Leonard 2017-04-10 15:33:14 UTC
Sorry, it must have been a problem with my setup. It looks like it's working now. I'll continue testing.
Comment 6 Owen Leonard 2017-04-10 15:52:51 UTC
Created attachment 62006 [details] [review]
[SIGNED-OFF] Bug 18394: Remove useless code from item search

The item search was originally designed to work even with JS disabled.
Since bug 15111, the staff interface does not work at all without JS, so some
parts of this code are useless and should be removed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Owen Leonard 2017-04-10 15:52:54 UTC
Created attachment 62007 [details] [review]
[SIGNED-OFF] Bug 18394: Add an option to item search to export a barcodes file

Test plan:
1. Go to item search (/cgi-bin/koha/catalogue/itemsearch.pl)
2. Fill the form with whatever you want
3. Leave the 'Output' option to 'Screen' and click 'Search'
4. Verify that the search still works
5. Click on 'Edit search' and set 'Output' to 'Barcodes file', click 'Search'
6. You should be able to download a 'barcodes.txt' file, open it and compare it
   to the previous search results
7. Now click on the 'Export results to barcodes file' button above the results,
   you should have the same result as in step 5
8. Verify that the CSV export still works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 8 delaye 2017-04-11 09:58:31 UTC
The number of exported barcodes remains unchanged despite the use of filters in the result table
Comment 9 Jonathan Druart 2017-04-11 22:12:31 UTC
(In reply to delaye from comment #8)
> The number of exported barcodes remains unchanged despite the use of filters
> in the result table

Yes right, but this behavior already existed when exporting as CSV.

Julian, any chances to see you fix that on another bug report? :)

Passing QA this one.
Comment 10 Jonathan Druart 2017-04-11 22:14:23 UTC
Created attachment 62068 [details] [review]
Bug 18394: Remove useless code from item search

The item search was originally designed to work even with JS disabled.
Since bug 15111, the staff interface does not work at all without JS, so some
parts of this code are useless and should be removed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2017-04-11 22:14:28 UTC
Created attachment 62069 [details] [review]
Bug 18394: Add an option to item search to export a barcodes file

Test plan:
1. Go to item search (/cgi-bin/koha/catalogue/itemsearch.pl)
2. Fill the form with whatever you want
3. Leave the 'Output' option to 'Screen' and click 'Search'
4. Verify that the search still works
5. Click on 'Edit search' and set 'Output' to 'Barcodes file', click 'Search'
6. You should be able to download a 'barcodes.txt' file, open it and compare it
   to the previous search results
7. Now click on the 'Export results to barcodes file' button above the results,
   you should have the same result as in step 5
8. Verify that the CSV export still works

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Julian Maurice 2017-04-12 07:37:02 UTC
(In reply to Jonathan Druart from comment #9)
> (In reply to delaye from comment #8)
> > The number of exported barcodes remains unchanged despite the use of filters
> > in the result table
> 
> Yes right, but this behavior already existed when exporting as CSV.
> 
> Julian, any chances to see you fix that on another bug report? :)
> 
> Passing QA this one.

Thanks. That's probably what I'll do
Comment 13 Kyle M Hall (khall) 2017-04-13 12:52:59 UTC
Pushed to master for 17.05, thanks Julian!
Comment 14 Katrin Fischer 2017-04-16 12:26:18 UTC
This won't get ported back to 16.11.x as it is an enhancement.