Bug 19630: Added Status column to Patron Holds table
authorHayley Mapley <hayleymapley@catalyst.net.nz>
Thu, 14 Mar 2019 21:37:36 +0000 (21:37 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 11 Apr 2019 13:52:08 +0000 (13:52 +0000)
When a hold has been suspended or is waiting, the status
message appears in the Barcode column of the Holds table. This patch
fixes this by adding a separate Status column which details the status
of the Hold, whether it has been suspended, or is in transit, etc.

Test plan:
1) Place an item level hold and a 'Next Available' record level hold for
a patron.
2) View the holds in Patrons->Patron details for that Patron in the Check out and Details tabs
3) Suspend one of the holds, and note that the status appears in the
barcode column
4) Set a hold to be waiting for pickup, and note the status appears in
the barcode column
5) Apply the patch
6) Check the same holds and note that the statuses now appear in the new
column called Status, and note that if a hold has status effect that the
row reads "Hold has been placed"
7) Verify that this is the case in both the Holds tables (in Check out
    tab and Details tab)

Sponsored-by: Catalyst IT
Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

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

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

koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/js/holds.js

index 5490ea6..da0712d 100644 (file)
@@ -895,6 +895,7 @@ No patron matched <span class="ex">[% message | html %]</span>
                     <th>Priority</th>
                     <th>Cancel?</th>
                     <th>Suspend?</th>
+                    <th>Status</th>
                 </tr>
             </thead>
         </table>
index 91c3750..d64be13 100644 (file)
                                                     <th>Priority</th>
                                                     <th>Delete?</th>
                                                     <th>Suspend?</th>
+                                                    <th>Status</th>
                                                 </tr>
                                             </thead>
                                         </table>
index 0ca8fb8..48d13fb 100644 (file)
@@ -53,37 +53,7 @@ $(document).ready(function() {
                     {
                         "mDataProp": function( oObj ) {
                             var data = "";
-
-                            if ( oObj.suspend == 1 ) {
-                                data += "<p>" + HOLD_IS_SUSPENDED;
-                                if ( oObj.suspend_until ) {
-                                    data += " " + UNTIL.format( oObj.suspend_until_formatted );
-                                }
-                                data += "</p>";
-                            }
-
-                            if ( oObj.itemtype_limit ) {
-                                data += NEXT_AVAILABLE_ITYPE.format( oObj.itemtype_limit );
-                            }
-
                             if ( oObj.barcode ) {
-                                data += "<em>";
-                                if ( oObj.found == "W" ) {
-
-                                    if ( oObj.waiting_here ) {
-                                        data += ITEM_IS_WAITING_HERE;
-                                    } else {
-                                        data += ITEM_IS_WAITING;
-                                        data += " " + AT.format( oObj.waiting_at );
-                                    }
-
-                                } else if ( oObj.transferred ) {
-                                    data += ITEM_IS_IN_TRANSIT.format( oObj.from_branch, oObj.date_sent );
-                                } else if ( oObj.not_transferred ) {
-                                    data += NOT_TRANSFERRED_YET.format( oObj.not_transferred_by );
-                                }
-                                data += "</em>";
-
                                 data += " <a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber="
                                   + oObj.biblionumber
                                   + "&itemnumber="
@@ -94,7 +64,6 @@ $(document).ready(function() {
                                   + oObj.barcode.escapeHtml()
                                   + "</a>";
                             }
-
                             return data;
                         }
                     },
@@ -159,7 +128,47 @@ $(document).ready(function() {
                                      + "<i class='fa fa-pause'></i> " + SUSPEND + "</a>";
                             }
                         }
-                    }
+                    },
+                    {
+                        "mDataProp": function( oObj ) {
+                            var data = "";
+                            if ( oObj.suspend != 1 && !oObj.itemtype_limit) {
+                                data = _("Hold has been placed\n");
+                            }
+
+                            if ( oObj.suspend == 1 ) {
+                                data += "<p>" + HOLD_IS_SUSPENDED;
+                                if ( oObj.suspend_until ) {
+                                    data += " " + UNTIL.format( oObj.suspend_until_formatted );
+                                }
+                                data += "</p>";
+                            }
+
+                            if ( oObj.itemtype_limit ) {
+                                data += NEXT_AVAILABLE_ITYPE.format( oObj.itemtype_limit );
+                            }
+
+                            if ( oObj.barcode ) {
+                                data += "<em>";
+                                if ( oObj.found == "W" ) {
+
+                                    if ( oObj.waiting_here ) {
+                                        data += ITEM_IS_WAITING_HERE;
+                                    } else {
+                                        data += ITEM_IS_WAITING;
+                                        data += " " + AT.format( oObj.waiting_at );
+                                    }
+
+                                } else if ( oObj.transferred ) {
+                                    data += ITEM_IS_IN_TRANSIT.format( oObj.from_branch, oObj.date_sent );
+                                } else if ( oObj.not_transferred ) {
+                                    data += NOT_TRANSFERRED_YET.format( oObj.not_transferred_by );
+                                }
+                                data += "</em>";
+                            }
+                            return data;
+                        }
+                   }
                 ],
                 "bPaginate": false,
                 "bProcessing": true,