LP1949226 Staff catalog hold recipient more durable
authorBill Erickson <berickxx@gmail.com>
Fri, 29 Oct 2021 18:37:26 +0000 (14:37 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:38 +0000 (20:13 -0400)
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 <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts
Open-ILS/web/js/ui/default/staff/circ/patron/holds.js

index 76b75ca..d181aa3 100644 (file)
@@ -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();
     }
 
index bab8aa0..3173bfd 100644 (file)
@@ -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