Bug 19021 - Inventory column sorting
Summary: Inventory column sorting
Status: Pushed to Master
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin SOMERS
QA Contact: Nick Clemens
URL:
Whiteboard:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2017-08-02 08:34 UTC by Fridolin SOMERS
Modified: 2017-10-27 19:11 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19021 - inventory column not sortable (1.59 KB, patch)
2017-08-02 08:38 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 19021 - inventory column sorting (2.30 KB, patch)
2017-08-02 09:45 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 19021 - inventory column sorting (2.36 KB, patch)
2017-08-02 13:34 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19021 - inventory column sorting (2.31 KB, patch)
2017-09-14 14:49 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 19021 - inventory column sorting (2.37 KB, patch)
2017-10-07 14:41 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 19021 - inventory column sorting (2.42 KB, patch)
2017-10-27 14:01 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2017-08-02 08:34:32 UTC
In inventory result page, items are shown in a JS DataTable.
A column is not sortable for no reason.
Comment 1 Fridolin SOMERS 2017-08-02 08:38:40 UTC Comment hidden (obsolete)
Comment 2 Fridolin SOMERS 2017-08-02 09:45:17 UTC
Created attachment 65417 [details] [review]
Bug 19021 - inventory column sorting

In inventory result page, items are shown in a JS DataTable.
For an inventory with barcode file second column is not sortable for no reason.
For an inventory without barcode file first column is not sortable but since it is the default sort order the sorting icon is still displayed.

This patch corrects by setting default sort order on barcode column.

Test plan :
- perform inventory with barcode file
- look at result table
- table is sorted by barcode
=> Without patch second column is not sortable
=> With patch all columns are sortable
- perform inventory without barcode file
- look at result table
=> Without patch first column show sort icon and table is not sorted by barcode
=> With patch first column is not sortable and table is sorted by barcode
Comment 3 Fridolin SOMERS 2017-08-02 09:46:04 UTC
Oh I see, this JS code is usefull for inventory without barcode file.
I have correct patch and renamed bug a little
Comment 4 Owen Leonard 2017-08-02 13:34:52 UTC
Created attachment 65424 [details] [review]
[SIGNED-OFF] Bug 19021 - inventory column sorting

In inventory result page, items are shown in a JS DataTable.
For an inventory with barcode file second column is not sortable for no reason.
For an inventory without barcode file first column is not sortable but since it is the default sort order the sorting icon is still displayed.

This patch corrects by setting default sort order on barcode column.

Test plan :
- perform inventory with barcode file
- look at result table
- table is sorted by barcode
=> Without patch second column is not sortable
=> With patch all columns are sortable
- perform inventory without barcode file
- look at result table
=> Without patch first column show sort icon and table is not sorted by barcode
=> With patch first column is not sortable and table is sorted by barcode

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Nick Clemens 2017-09-01 10:48:02 UTC
> => With patch first column is not sortable and table is sorted by barcode

When performing an inventory without a barcode file we are essentially generating a shelf list, shouldn't callnumber (or cn_sort ideally) be the default sort here?

Even when comparing to a barcode file I think we should probably be sorting by callnumber in our results
Comment 6 Fridolin SOMERS 2017-09-14 14:49:48 UTC
Created attachment 67138 [details] [review]
Bug 19021 - inventory column sorting

In inventory result page, items are shown in a JS DataTable.
For an inventory with barcode file second column is not sortable for no reason.
For an inventory without barcode file first column is not sortable but since it is the default sort order the sorting icon is still displayed.

This patch corrects by setting default sort order on callnumber column.

Test plan :
- perform inventory with barcode file
- look at result table
- table is sorted by callnumber
=> Without patch second column is not sortable
=> With patch all columns are sortable
- perform inventory without barcode file
- look at result table
=> Without patch first column show sort icon and table is not sorted by callnumber
=> With patch first column is not sortable and table is sorted by callnumber
Comment 7 Fridolin SOMERS 2017-09-14 14:51:53 UTC
(In reply to Nick Clemens from comment #5)
> > => With patch first column is not sortable and table is sorted by barcode
> 
> When performing an inventory without a barcode file we are essentially
> generating a shelf list, shouldn't callnumber (or cn_sort ideally) be the
> default sort here?
> 
> Even when comparing to a barcode file I think we should probably be sorting
> by callnumber in our results

Makes sens to me, I have pushed new patch.

Using cn_sort is I think possible but needs some dev so it would be in another bug report.

Regards ;)
Comment 8 Katrin Fischer 2017-10-07 14:41:50 UTC
Created attachment 67804 [details] [review]
Bug 19021 - inventory column sorting

In inventory result page, items are shown in a JS DataTable.
For an inventory with barcode file second column is not sortable for no reason.
For an inventory without barcode file first column is not sortable but since it is the default sort order the sorting icon is still displayed.

This patch corrects by setting default sort order on callnumber column.

Test plan :
- perform inventory with barcode file
- look at result table
- table is sorted by callnumber
=> Without patch second column is not sortable
=> With patch all columns are sortable
- perform inventory without barcode file
- look at result table
=> Without patch first column show sort icon and table is not sorted by callnumber
=> With patch first column is not sortable and table is sorted by callnumber

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Kyle M Hall 2017-10-27 14:01:33 UTC
Created attachment 68715 [details] [review]
Bug 19021 - inventory column sorting

In inventory result page, items are shown in a JS DataTable.
For an inventory with barcode file second column is not sortable for no reason.
For an inventory without barcode file first column is not sortable but since it is the default sort order the sorting icon is still displayed.

This patch corrects by setting default sort order on callnumber column.

Test plan :
- perform inventory with barcode file
- look at result table
- table is sorted by callnumber
=> Without patch second column is not sortable
=> With patch all columns are sortable
- perform inventory without barcode file
- look at result table
=> Without patch first column show sort icon and table is not sorted by callnumber
=> With patch first column is not sortable and table is sorted by callnumber

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Jonathan Druart 2017-10-27 19:11:02 UTC
Pushed to master for 17.11, thanks to everybody involved!