Bug 9757

Summary: Make staff client list contents view more like search results
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ListsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, jean-manuel.broust, jonathan.druart, katrin.fischer, m.de.rooy, paul.poulain
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 9652    
Attachments: Screenshot of revised interface
Bug 9757 - Make staff client list contents view more like search results
Bug 9757 - Make staff client list contents view more like search results
Bug 9757 [Revised] Make staff client list contents view more like search results
Bug 9728: XISBN use simple search instead of SQL
Bug 9757 [Revised] Make staff client list contents view more like search results
[SIGNED-OFF] Bug 9757 [Revised] Make staff client list contents view more like search results
Bug 9757: Remove duplicated action buttons.
[SIGNED-OFF] Bug 9757: Remove duplicated action buttons
Bug 9757 [Revised] Make staff client list contents view more like search results
Bug 9757: Remove duplicated action buttons.

Description Owen Leonard 2013-03-06 16:47:59 UTC
Created attachment 15912 [details]
Screenshot of revised interface

Just as we made the view of a list's contents in the OPAC look similar to the OPAC search results page, the staff client lists interface should match the staff client's search results page. Proposed changes include:

- XSLT-based display of record information
- Search results-like toolbar with controls for placing hold,
  adding to cart, etc.
- Additional item information (and a fix for Bug 9652)
Comment 1 Owen Leonard 2013-03-06 19:02:27 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2013-03-13 16:58:06 UTC
I need to rebase this now that Bug 9458 has been pushed.
Comment 3 Owen Leonard 2013-03-13 18:08:10 UTC Comment hidden (obsolete)
Comment 4 jmbroust 2013-03-20 11:26:24 UTC
Tested on Biblibre sandbox :
XSLTResultsDisplay on default :
- Columns itemtype and date added are not sortable (was it before ?)
- "Holds" is still shown in the table (even if permission is not given)
- Adding an item to cart removes the item from the list and the item doesn't move to cart
- Adding an item to another list removes the item from list and the item doesn't move to the other list
- Shelving location is not shown in the table

XSLTResultsDisplay turned to empty :
Same problems and : 
- In title column only title is shown (less information than default. Maybe a way exists to show more in koha but I don't know how to do ...)
Comment 5 Owen Leonard 2013-03-20 13:04:10 UTC
(In reply to comment #4)
> Tested on Biblibre sandbox :
> XSLTResultsDisplay on default :
> - Columns itemtype and date added are not sortable (was it before ?)

No, these columns are not sortable. Sorting is not JavaScript-based, but happens server-side. Sorting on these columns has not bee implemented.

> - "Holds" is still shown in the table (even if permission is not given)

Okay, I see that too.

> - Adding an item to cart removes the item from the list and the item doesn't
> move to cart
> - Adding an item to another list removes the item from list and the item
> doesn't move to the other list

I see. I tested adding to the cart by making a selection but I didn't test the action of the "save" button.

> - Shelving location is not shown in the table

Shelving location appears in the call number column along with the other location information (library). At least it does in my test.

> XSLTResultsDisplay turned to empty :
> Same problems and : 
> - In title column only title is shown

Yes, I didn't add anything to the non-XSLT display of the title, so that view is unimproved. I thought it was reasonable to limit this patch to the XSLT improvements. I'm willing to add more to it if others agree that it should be expanded.

Thanks for the careful testing, I'll submit a revised patch.
Comment 6 Owen Leonard 2013-03-20 16:50:24 UTC Comment hidden (obsolete)
Comment 7 jmbroust 2013-03-21 10:15:27 UTC
Tested on sandbox 2 biblibre, UNIMARC
- The shelving location still not appears in table (config : tag 995$e mapped with items.location)
- "Holds" still shown in the table : 
when the user has no permission for holds or circulation
when no holds allowed in circulation rules
when not for loan is not on 0 (zero), when item is lost (could not test on DAMAGED or WITHDRAWN because authorized values, tags, mapping are not available on my sandbox)
(Note that "HOLDS" is often shown for each item in the search results even if there are no holds allowed on items.)
"Holds" disappear from the table when there are no items : OK.
Moving items to cart or other lists works fine
Comment 8 Owen Leonard 2013-03-21 11:11:34 UTC
(In reply to comment #7)
> - "Holds" still shown in the table : 
> when the user has no permission for holds or circulation
> when no holds allowed in circulation rules
> when not for loan is not on 0 (zero), when item is lost (could not test on
> DAMAGED or WITHDRAWN because authorized values, tags, mapping are not
> available on my sandbox)
> (Note that "HOLDS" is often shown for each item in the search results even
> if there are no holds allowed on items.)

Are these all circumstances in master which prevent the holds link from appearing?
Comment 9 Owen Leonard 2013-03-21 12:34:43 UTC
(In reply to comment #7)
> Tested on sandbox 2 biblibre, UNIMARC
> - The shelving location still not appears in table (config : tag 995$e
> mapped with items.location)

I'm not sure about this one. It is obviously a MARC versus UNIMARC issue.

> - "Holds" still shown in the table : 
> when the user has no permission for holds or circulation
> when no holds allowed in circulation rules
> when not for loan is not on 0 (zero), when item is lost (could not test on
> DAMAGED or WITHDRAWN because authorized values, tags, mapping are not
> available on my sandbox)

These issues are in master as well.

> (Note that "HOLDS" is often shown for each item in the search results even
> if there are no holds allowed on items.)

Koha has no centralized mechanism for deciding whether a title or an item can be placed on hold. There are by my count 6 different implementations of this calculation in 6 different scripts. This of course should be centralized somehow. When this is done it will be easy to add a correct check to the lists display. As it is, my patch doesn't cause any regression in this area.
Comment 10 Owen Leonard 2013-03-21 13:09:46 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > Tested on sandbox 2 biblibre, UNIMARC
> > - The shelving location still not appears in table (config : tag 995$e
> > mapped with items.location)

Shelving location on the lists display comes from a sub which is used only by lists, so it's certainly possible it doesn't work correctly. Shelving location has never been displayed here before. The query:

SELECT a.branchname as homebranch, b.branchname as holdingbranch,
location, itemcallnumber, cn_sort
FROM items, branches as a, branches as b
WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode
AND biblionumber = ?
ORDER BY cn_sort ASC

...seems to return results in a UNIMARC system (just tested on a sandbox). A problem with GetKohaAuthorisedValueLib? I don't know.

Either way, this issue isn't a regression so I would like to be able to address it in a follow-up. Please returned to 'Failed' if you disagree.
Comment 11 Paul Poulain 2013-03-21 15:19:30 UTC
Patch tested with a sandbox, by jmbroust <jean-manuel.broust@univ-lyon2.fr>
Comment 12 Paul Poulain 2013-03-21 15:19:55 UTC Comment hidden (obsolete)
Comment 13 Owen Leonard 2013-03-21 17:55:42 UTC
I'm assuming this isn't really signed off since the wrong patch was attached? Or was the signed-off setting correct, but the patch wasn't?
Comment 14 Katrin Fischer 2013-03-21 20:15:06 UTC
Owen - can't say much about the wrong patch, but could you file a bug with your findings about the 'holdability' calculation maybe? This sounds like it's worth fixing sometime not too late in the next release cycle.
Comment 15 Paul Poulain 2013-03-22 08:28:12 UTC
Patch tested with a sandbox, by jmbroust <jean-manuel.broust@univ-lyon2.fr>
Comment 16 Paul Poulain 2013-03-22 08:28:34 UTC Comment hidden (obsolete)
Comment 17 jmbroust 2013-03-22 08:32:49 UTC
In reply to comment 13 : the patch was already signed off but something went wrong with the sign off of another patch (9728) on the same sandbox. So, I sign off 9757 one more time to validate the status.
Comment 18 Owen Leonard 2013-06-13 16:21:04 UTC Comment hidden (obsolete)
Comment 19 Jonathan Druart 2013-06-19 09:45:54 UTC
QA comment:

It's a great patch, I didn't find many points to discuss. All works as expected and I didn't find any regression.
I wonder if the 3 submit buttons "Place hold", "Remove selected records" and "Merge selected records" at the bottom of the table (viewshelf) should not be removed as they already exist at the top.

Marked as Failed QA (I let you switch back to signed Off if you disagree or when it is done).
Comment 20 Jonathan Druart 2013-06-19 09:50:57 UTC Comment hidden (obsolete)
Comment 21 Owen Leonard 2013-06-25 13:23:17 UTC Comment hidden (obsolete)
Comment 22 Jonathan Druart 2013-06-26 07:23:20 UTC
Created attachment 19240 [details] [review]
Bug 9757 [Revised] Make staff client list contents view more like search results

This patch revises the staff client list contents view to better match
staff client search results, showing more information and offering more
ways to interact with the contents than before.

- List contents output has been modified so that the staff client can
  use XSLT-formatted data just as the OPAC can. As in the OPAC it
  depends on XSLTResultsDisplay being enabled.
- A "toolbar" has been added which is similar to that in search results,
  offering the option to add items to a Cart, add them to a different
  list, place multiple holds, remove items from the list, or merge
  records.
- This toolbar has been made to float on scroll like the one on the
  MARC edit page.
- Library and shelving location have been added to the display of call
  numbers. Call numbers are linked to a search as they are in search
  results.
- Edit links are included just as they are in search results.
- Automatic focus on the add by barcode form has been removed so that
  the page doesn't jump to the bottom unnecessarily.
- basket.js's "addMultiple" function has been modified so that it
  receives an array of checkboxes rather than looking for checkboxes in
  a specific form. This helps abstract its functionality for use on both
  search results and lists. results.tt is modified accordingly.
- The page layout has been widened to make room for the increased amount
  of information on the page.
- A new "merge" icon has been added to the default Bootstrap sprite.

To test:

- View both public and private lists in the staff client.
- View lists with and without contents.
- Test the functionality of options in the toolbar: Add to cart, add to
  lists, place multiple holds, remove items, merge items.
- Test with users with and without cataloging privileges to confirm that
  catalog-related controls are correctly shown or hidden.
- Test with XSLTResultsDisplay set both to "default" and empty.
- Since the staff client and OPAC use some of the same code, test that
  lists in the OPAC have not broken.
- Since JavaScript was modified which affects both lists and search
  results, confirm that adding items to the Cart and Lists from search
  results hasn't been broken by this patch.

Revision corrects conditional display of hold link, hiding it in cases
where there are no items or the record's itemtype is not for loan.

Also corrected is the behavior of the Cart/List "save" button in order
to prevent it from submitting the "remove items" action which is the
default for the form.

Signed-off-by: jmbroust <jean-manuel.broust@univ-lyon2.fr>

Edit: Patch rebased against current master and hard-coded paths to
/prog/ corrected.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 23 Jonathan Druart 2013-06-26 07:23:25 UTC
Created attachment 19241 [details] [review]
Bug 9757: Remove duplicated action buttons.

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 24 Jonathan Druart 2013-06-26 07:24:00 UTC
Marked as Passed QA.
Comment 25 Galen Charlton 2013-06-26 16:27:12 UTC
Pushed to master.  Thanks, Owen!

Here's a thought for a possible enhancement (or possibly bugfix, if there's anybody who was relying on the default focus prior to this change): would it make sense to move the add item by barcode form to the floating toolbar?