Bug 8032

Summary: Sort lists by call number
Product: Koha Reporter: Melia Meggs <melia>
Component: ListsAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: jcamins, jonathan.druart, joseanjos, m.de.rooy
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 9167    
Attachments: Patch for sorting lists on callnumber
[Signed off] Bug 8032: Sort lists by call number
squares between some words in OPAC
Bug 9167: Standardize the sort field copyrightdate for lists

Description Melia Meggs 2012-05-01 00:53:01 UTC
Public and private lists can currently be edited to sort by Author, Title or
Year.

Can a fourth option be added? We'd love to be able to sort lists by call
number.
Comment 1 José Anjos 2012-08-06 14:45:00 UTC
Hi.
It would be very helpfull if we could sort by "Date added".
Another great feature it would be the "Export to CSV" option to the Lists.
Thanks
Comment 2 Marcel de Rooy 2012-11-08 09:18:34 UTC
(In reply to comment #1)
> Another great feature it would be the "Export to CSV" option to the Lists.

I will use this report for a patch that sorts lists by call number (as in the title). Could you save your additional request on a new separate report? Thanks.
Comment 3 Marcel de Rooy 2012-11-08 13:41:19 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2012-11-08 13:49:50 UTC
Please include following values of OPACXSLTResultsDisplay ("default" and clearing the field) when testing display of lists in OPAC.
Also check display in staff client.
Comment 5 Melia Meggs 2012-11-08 18:47:47 UTC
Here is what I did to test.

Staff client:
1. I edited an existing public list to sort it by call number.  I can now see a call number column when I look at the list, which appears to be sorted correctly.
2. I created a new public list sorted by call number.  I added 8 items to it from search results, and they appeared on the list correctly sorted by call number.
3. I edited an existing private list to sort it by call number.  I can now see a call number column when I look at the list, which appears to be sorted correctly.
4. I created a new private list sorted by call number.  I added 12 items to it from search results, and they appeared on the list correctly sorted by call number.

OPAC (with OPACXSLTResultsDisplay set to "default"):
1. I viewed a public list that is sorted by call number, and it is correctly sorted.  I am not able to see the call number of one item that is Checked Out, but it is sorted in the correct place on the list, so everything looks ok.  I also viewed a public list that is sorted by title, and it still looks correct.
2. I created a new private list sorted by call number.  I added 4 items to it from search results, and they appeared on the list correctly sorted by call number.  I then resorted by title, and everything looks good.

The only question is that when I go to Lists in the OPAC, I see four columns:  List name, Contents, Type, but the fourth column is empty and has no heading.  Is the fourth column (furthest to the right) supposed to tell me how the list is sorted?  Right now, I have no indication that a particular list is sorted by call number or title unless I try to edit the list.  But this blank fourth column looks like it's that way on master as well, so I don't think this patch made any change to that...


OPAC (with OPACXSLTResultsDisplay left empty):
1. I viewed a public list, and it is sorted correctly by call number.
2. I viewed a private list, and it is sorted correctly by call number.  (Now I can also see the call number of that one item that is Checked Out.)

One thing I noticed here is that there are squares that appear between some words when you go to edit a list.  I have attached a screenshot.  (See Lists -square- Dreams -square- Editing).  Not sure if this might be browser related.  I am using Chrome if that matters.

Overall, I think this patch works beautifully, so I am signing off!
Comment 6 Melia Meggs 2012-11-08 18:49:33 UTC
Created attachment 13317 [details] [review]
[Signed off] Bug 8032: Sort lists by call number

Precaution: Joining the items table makes that the table is sorted on the item call number of the first item (in case there are more items).

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Comment 7 Melia Meggs 2012-11-08 19:06:05 UTC
Created attachment 13318 [details]
squares between some words in OPAC
Comment 8 Marcel de Rooy 2012-11-10 19:04:49 UTC
(In reply to comment #7)
> Created attachment 13318 [details]
> squares between some words in OPAC

You found another problem! The caret.gif seems to be moved in master now. It is found now in ccsr subdir.

Try: http://yourserver/opac-tmpl/ccsr/images/caret.gif

So the template contains a wrong path. The alternative should be: > (&gt;)
Template contains:
<img src="[% themelang %]/../images/caret.gif" width="16" height="16" alt="&gt;" border="0" />

Thx for signoff!
Comment 9 Owen Leonard 2012-11-10 19:27:08 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Created attachment 13318 [details]
> > squares between some words in OPAC
> 
> You found another problem! The caret.gif seems to be moved in master now. It
> is found now in ccsr subdir.

There is a follow up on bug 7500 for this.
Comment 10 Jonathan Druart 2012-11-29 14:40:08 UTC
QA Comment:

This patch adds a new sort for lists.
Add/edit a list and set the sort value to callnumber.
The results (opac and intranet) are sorted by callnumber. The patch works as expected.

The patch uses an existed esoteric way to pass the sort parameter to the templates (sort_$sort => 1 or author_sort => 1 if $sort eq 'author'), it would be great to standardize this stuff. It is not the goal of this patch.

Marked as Passed QA.
Comment 11 Jonathan Druart 2012-11-29 16:06:11 UTC Comment hidden (obsolete)
Comment 12 Marcel de Rooy 2012-11-29 16:07:05 UTC
(In reply to comment #11)
You are in the wrong report?
Comment 13 Jonathan Druart 2012-11-30 08:10:16 UTC
(In reply to comment #12)
> (In reply to comment #11)
> You are in the wrong report?

Oops, yes
Comment 14 Jared Camins-Esakov 2012-11-30 12:29:31 UTC
This patch has been pushed to master.