--- /dev/null
+<div id='oils-selfck-circ-table-div'>
+ <table id='oils-selfck-circ-table' class='oils-selfck-item-table'>
+ <thead>
+ <tr>
+ <td class="rounded-left" id='oils-self-circ-pic-cell'></td>
+ <td i18n>Title</td>
+ <td i18n>Author</td>
+ <td class="rounded-right" i18n>Status</td>
+ </tr>
+ </thead>
+ <tbody class='oils-selfck-item-table'>
+ <tr *ngFor="let hold of holds">
+ <td><img src="/opac/extras/ac/jacket/small/r/{{hold.record_id}}"/></td>
+ <td>{{hold.title}}</td>
+ <td>{{hold.author}}</td>
+ <td>
+ <ng-container *ngIf="hold.hold_status == 4" i18n>
+ Ready for Pickup
+ </ng-container>
+ <ng-container *ngIf="hold.hold_status != 4" i18n>
+ #{{hold.relative_queue_position}} in line with {{hold.potentials}} copie(s)
+ </ng-container>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
--- /dev/null
+import {Component, OnInit, ViewEncapsulation} from '@angular/core';
+import {Router, ActivatedRoute, NavigationEnd} from '@angular/router';
+import {tap} from 'rxjs/operators';
+import {AuthService} from '@eg/core/auth.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {NetService} from '@eg/core/net.service';
+import {IdlObject} from '@eg/core/idl.service';
+import {SckoService} from './scko.service';
+import {ServerStoreService} from '@eg/core/server-store.service';
+
+@Component({
+ templateUrl: 'holds.component.html'
+})
+
+export class SckoHoldsComponent implements OnInit {
+
+ holds: IdlObject[] = [];
+
+ constructor(
+ private router: Router,
+ private route: ActivatedRoute,
+ private net: NetService,
+ private auth: AuthService,
+ private pcrud: PcrudService,
+ public scko: SckoService
+ ) {}
+
+ ngOnInit() {
+
+ if (!this.scko.patronSummary) {
+ this.router.navigate(['/scko']);
+ return;
+ }
+
+ const orderBy = [
+ {shelf_time: {nulls: 'last'}},
+ {capture_time: {nulls: 'last'}},
+ {request_time: {nulls: 'last'}}
+ ];
+
+ const filters = {
+ usr_id: this.scko.patronSummary.id,
+ fulfillment_time: null
+ };
+
+ let first = true;
+ this.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.hold.wide_hash.stream',
+ this.auth.token(), filters, orderBy, 1000, 0, {}
+ ).subscribe(holdData => {
+
+ if (first) { // First response is the hold count.
+ first = false;
+ return;
+ }
+
+ this.holds.push(holdData);
+ });
+ }
+}
+
+
.then(data => {
const ids = data.out.concat(data.overdue).concat(data.long_overdue);
- return this.pcrud.search('circ', {id: ids}, {
- flesh: CIRC_FLESH_DEPTH,
- flesh_fields: CIRC_FLESH_FIELDS,
- order_by : {circ : 'due_date'},
+ return this.pcrud.search('circ', {id: ids}, {
+ flesh: CIRC_FLESH_DEPTH,
+ flesh_fields: CIRC_FLESH_FIELDS,
+ order_by : {circ : 'due_date'},
- select: {bre : ['id']}
+ select: {bre : ['id']}
- }).pipe(tap(circ => {
- this.circs.push(circ);
- })).toPromise();
+ }).pipe(tap(circ => {
+ this.circs.push(circ);
+ })).toPromise();
});
}