Bug 14222: Sort holds in OPAC by priority
authorOwen Leonard <oleonard@myacpl.org>
Thu, 21 Jun 2018 14:32:52 +0000 (14:32 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 29 Jun 2018 20:21:52 +0000 (20:21 +0000)
This patch modifies the markup of the users's holds table in the OPAC so
that if hold priority is displayed, the table will be sorted by that
number.

To test, apply the patch and set the OPACShowHoldQueueDetails system
preference to "Show priority level" or "Show holds and their priority
level."

 - Log in to the OPAC as a user who has multiple holds with various
   priorities. Include priorities which could be sorted incorrectly
   using a text sort, e.g. 1, 10.
 - View the holds tab on the "your summary" page. Confirm that the
   priority column is sorted by default with the lowest priority holds
   first.
 - Set the  OPACShowHoldQueueDetails preference to "Show holds" and
   confirm that the holds table still displays correctly, sorted by
   "Placed on" ascending.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

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

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt

index 134ea41..cbe4106 100644 (file)
                                     <thead>
                                         <tr>
                                             <th class="anti-the">Title</th>
-                                            <th class="psort title-string">Placed on</th>
+                                            [% IF ( showpriority ) %]
+                                                <th class="title-string">Placed on</th>
+                                            [% ELSE %]
+                                                <th class="psort title-string">Placed on</th>
+                                            [% END %]
                                             <th class="title-string">Expires on</th>
                                             [% UNLESS( singleBranchMode) %]
                                                 <th>Pick up location</th>
                                             [% END %]
                                             [% IF ( showpriority ) %]
-                                                <th>Priority</th>
+                                                <th class="psort">Priority</th>
                                             [% END %]
                                             <th>Status</th>
                                             [% IF SuspendHoldsOpac %]
                                                 </td>
                                             [% END %]
                                             [% IF ( showpriority ) %]
-                                                 <td class="priority">
+                                                 <td data-order="[% RESERVE.priority %]" class="priority">
                                                     <span class="tdlabel">Priority:</span>
                                                     [% RESERVE.priority %]
                                                 </td>