From: Bill Erickson Date: Fri, 8 Dec 2017 23:13:58 +0000 (-0500) Subject: LP#626157 Ang2 experiments X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=75c955bbf3523f3f87c72c148bbe6a6145ac2da7;p=working%2FEvergreen.git LP#626157 Ang2 experiments Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html new file mode 100644 index 0000000000..ea269a8654 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.html @@ -0,0 +1,50 @@ + +
+
+
Location
+
Call Number / Copy Notes
+
Barcode
+
Shelving Location
+
Circulation Modifier
+
Age Hold Protection
+
Active/Create Date
+
Holdable?
+
Status
+
Due Date
+
+
+
    +
  • +
    +
    {{orgName(copy.circ_lib)}}
    +
    + {{copy.call_number_prefix_label}} + {{copy.call_number_label}} + {{copy.call_number_suffix_label}} +
    +
    {{copy.barcode}}
    +
    {{copy.location}}
    +
    {{copy.circ_modifier || ''}}
    +
    {{copy.age_protect}}
    +
    + {{copy.active_date || copy.create_date | date:'shortDate'}} +
    +
    + Yes + No +
    +
    {{copy.copy_status}}
    +
    {{copy.due_date | date:'shortDate'}}
    +
    +
  • +
+
+
diff --git a/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts new file mode 100644 index 0000000000..3e80783d72 --- /dev/null +++ b/Open-ILS/webby-src/src/app/staff/catalog/record/copies.component.ts @@ -0,0 +1,61 @@ +import {Component, OnInit, Input} from '@angular/core'; +import {EgNetService} from '@eg/core/net'; +import {StaffCatalogService} from '../staff-catalog.service'; +import {StaffRecordService} from './record.service'; +import {Pager} from '@eg/share/util/pager'; +import {EgOrgService} from '@eg/core/org'; + +@Component({ + selector: 'eg-catalog-copies', + styleUrls: ['copies.component.css'], + templateUrl: 'copies.component.html' +}) +export class CopiesComponent implements OnInit { + + @Input() recordId: number; + pager: Pager; + copies: any[]; + + constructor( + private net: EgNetService, + private org: EgOrgService, + private staffCat: StaffCatalogService, + private staffRecord: StaffRecordService + ) {} + + ngOnInit() { + if (!this.recordId) return; + this.pager = new Pager(); + this.pager.limit = 50; // TODO + this.fetchCopies(); + } + + orgName(orgId: number): string { + return this.org.get(orgId).shortname(); + } + + fetchCopies(): void { + this.copies = []; + this.net.request( + 'open-ils.search', + 'open-ils.search.bib.copies.staff', + this.recordId, + this.staffCat.searchContext.searchOrg.id(), + this.staffCat.searchContext.searchOrg.ou_type().depth(), // TODO + this.pager.limit, + this.pager.offset, + this.staffCat.searchContext.searchOrg.id() // TODO pref_ou + ).subscribe(copy => { + this.copies.push(copy); + }); + } + + holdable(copy: any): boolean { + return copy.holdable == 't' + && copy.location_holdable == 't' + && copy.status_holdable == 't'; + } + +} + +