LP1468132 MARC search honors search scope user/berick/lp1468132-marc-search-all-results
authorBill Erickson <berickxx@gmail.com>
Mon, 14 Sep 2020 14:52:05 +0000 (10:52 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 14 Sep 2020 15:51:05 +0000 (11:51 -0400)
Adds a 'Results from All Libraries' checkbox to the MARC search form in
the Angular staff catalog.  When unchecked, the MARC search will limit
to results with holdings in the search scope.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/search-context.ts
Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html

index 57d9db6..73dfbd7 100644 (file)
@@ -490,6 +490,10 @@ export class CatalogSearchContext {
             org_unit: this.searchOrg.id()
         };
 
+        if (this.global) {
+            args.depth = this.org.root().ou_type().depth();
+        }
+
         if (this.sort) {
             const parts = this.sort.split(/\./);
             args.sort = parts[0]; // title, author, etc.
index 4468d38..b14d3c8 100644 (file)
               </div>
             </div>
           </div>
+          <div class="row mt-2">
+            <div class="checkbox pl-3">
+              <label>
+                <input type="checkbox" [(ngModel)]="context.global"/>
+                <span class="pl-1" i18n>Results from All Libraries</span>
+              </label>
+            </div>
+          </div>
         </ng-template>
       </ngb-tab>
       <ngb-tab title="Browse" i18n-title id="browse">