From 52f0deb8f6ed0e259c92c6489ba71f1f33446e94 Mon Sep 17 00:00:00 2001 From: Hayley Mapley Date: Thu, 14 Mar 2019 21:37:36 +0000 Subject: [PATCH] Bug 19630: Added Status column to Patron Holds table 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 --- .../prog/en/modules/circ/circulation.tt | 1 + .../prog/en/modules/members/moremember.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/holds.js | 73 ++++++++++++---------- 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 5490ea64f6..da0712d965 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -895,6 +895,7 @@ No patron matched [% message | html %] Priority Cancel? Suspend? + Status diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 45277f61ed..e3e44a932b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -764,6 +764,7 @@ Priority Delete? Suspend? + Status diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 757eb6da45..13b05349a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -53,37 +53,7 @@ $(document).ready(function() { { "mDataProp": function( oObj ) { var data = ""; - - if ( oObj.suspend == 1 ) { - data += "

" + HOLD_IS_SUSPENDED; - if ( oObj.suspend_until ) { - data += " " + UNTIL.format( oObj.suspend_until_formatted ); - } - data += "

"; - } - - if ( oObj.itemtype_limit ) { - data += NEXT_AVAILABLE_ITYPE.format( oObj.itemtype_limit ); - } - if ( oObj.barcode ) { - data += ""; - 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 += ""; - data += " " + SUSPEND + ""; } } - } + }, + { + "mDataProp": function( oObj ) { + var data = ""; + if ( oObj.suspend != 1 && !oObj.itemtype_limit) { + data = _("Hold has been placed\n"); + } + + if ( oObj.suspend == 1 ) { + data += "

" + HOLD_IS_SUSPENDED; + if ( oObj.suspend_until ) { + data += " " + UNTIL.format( oObj.suspend_until_formatted ); + } + data += "

"; + } + + if ( oObj.itemtype_limit ) { + data += NEXT_AVAILABLE_ITYPE.format( oObj.itemtype_limit ); + } + + if ( oObj.barcode ) { + data += ""; + 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 += ""; + } + return data; + } + } ], "bPaginate": false, "bProcessing": true, -- 2.11.0