From 391c5cfde44d89261978e2a835c6dac593aae7c3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 29 Oct 2021 14:37:26 -0400 Subject: [PATCH] LP1949226 Staff catalog hold recipient more durable When placing holds for a specific patron from the patron's holds list, the hold recipient barcode will now persist across multiple browser tabs. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts | 5 ++++- Open-ILS/web/js/ui/default/staff/circ/patron/holds.js | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts index 76b75ca830..d181aa3649 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts @@ -7,6 +7,7 @@ import {CatalogUrlService} from '@eg/share/catalog/catalog-url.service'; import {CatalogSearchContext} from '@eg/share/catalog/search-context'; import {BibRecordSummary} from '@eg/share/catalog/bib-record.service'; import {PatronService} from '@eg/staff/share/patron/patron.service'; +import {StoreService} from '@eg/core/store.service'; /** * Shared bits needed by the staff version of the catalog. @@ -63,6 +64,7 @@ export class StaffCatalogService { constructor( private router: Router, private route: ActivatedRoute, + private store: StoreService, private org: OrgService, private cat: CatalogService, private patron: PatronService, @@ -77,7 +79,7 @@ export class StaffCatalogService { this.searchContext = this.catUrl.fromUrlParams(this.route.snapshot.queryParamMap); - this.holdForBarcode = this.route.snapshot.queryParams['holdForBarcode']; + this.holdForBarcode = this.store.getLocalItem('eg.circ.patron_hold_target'); if (this.holdForBarcode) { this.patron.getByBarcode(this.holdForBarcode) @@ -95,6 +97,7 @@ export class StaffCatalogService { clearHoldPatron() { this.holdForUser = null; this.holdForBarcode = null; + this.store.removeLocalItem('eg.circ.patron_hold_target'); this.holdForChange.emit(); } diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js index bab8aa0848..3173bfdb70 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js @@ -145,10 +145,11 @@ function($scope, $q, $routeParams, egCore, egUser, patronSvc, } $scope.place_hold = function() { - $window.location.href = '/eg2/staff/catalog?holdForBarcode=' + - encodeURIComponent(patronSvc.current.card().barcode()); - //$location.path($location.path() + '/create'); + egCore.hatch.setLocalItem( + 'eg.circ.patron_hold_target', patronSvc.current.card().barcode()); + + $window.location.href = '/eg2/staff/catalog'; } // when the detail hold is fetched (and updated), update the bib -- 2.43.2