From: Bill Erickson Date: Mon, 21 Jun 2021 15:14:08 +0000 (-0400) Subject: LPXXX Item Status Angular WIP X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4dae825011dc023d1e0ab0ef1f99b0edf6ad5706;p=working%2FEvergreen.git LPXXX Item Status Angular WIP Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html index ba0a811079..9c91bd7b43 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/status.component.html @@ -23,7 +23,7 @@
-
+
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html index 47c18a4e3e..8be3f98517 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.html @@ -2,7 +2,7 @@ This item has been marked as Deleted.
-
+
Precat Title
@@ -43,7 +43,11 @@
{{item.call_number().label()}}
Due Date
-
{{circ.due_date() | date:'shortDate'}}
+
+ + {{circ.due_date() | date:'shortDate'}} + +
@@ -63,7 +67,11 @@
Checkout Date
-
{{circSummary.start_time() | date:'shortDate'}}
+
+ + {{circSummary.start_time() | date:'shortDate'}} + +
@@ -81,14 +89,20 @@
Renewal Type
-
OPAC
-
Desk
-
Phone
-
Automatic
+ +
OPAC
+
Desk
+
Phone
+
Automatic
+
Checkout Workstation
-
{{circSummary.checkout_workstation()}}
+
+ + {{circSummary.checkout_workstation()}} + +
@@ -105,7 +119,11 @@
{{total_circs}}
Duration Rule
-
{{circ.duration_rule().name()}}
+
+ + {{circ.duration_rule().name()}} + +
@@ -113,13 +131,17 @@
{{item.active_date() | date:'shortDate'}}
Reference
-
{{item.ref()}}
+
Total Circs - Current Year
{{total_circs_this_year}}
Recurring Fine Rule
-
{{circ.recurring_fine_rule().name()}}
+
+ + {{circ.recurring_fine_rule().name()}} + +
@@ -127,13 +149,17 @@
{{item.status_changed_time() | date:'shortDate'}}
OPAC Visible
-
{{item.opac_visible()}}
+
Total Circs - Prev Year
{{total_circs_prev_year}}
Max Fine Rule
-
{{circ.max_fine_rule().name()}}
+
+ + {{circ.max_fine_rule().name()}} + +
@@ -141,32 +167,44 @@
{{item.id()}}
Holdable
-
{{item.holdable()}}
+
In-House Uses
{{item._inHouseUseCount}}
Checkin Time
- {{circ.checkin_time() || - circSummary.last_checkin_time() | date:'shortDate'}} + + {{circ.checkin_time() || + circSummary.last_checkin_time() | date:'shortDate'}} +
Circulate
-
{{item.circulate()}}
+
Renewal Workstation
-
{{circSummary.last_renewal_workstation()}}
+
+ + {{circSummary.last_renewal_workstation()}} + +
Remaining Renewals
-
{{circ.renewal_remaining()}}
+
+ + {{circ.renewal_remaining()}} + +
Checkin Scan Time
- {{circ.checkin_scan_time() || - circSummary.last_checkin_scan_time() | date:'shortDate'}} + + {{circ.checkin_scan_time() || + circSummary.last_checkin_scan_time() | date:'shortDate'}} +
@@ -194,17 +232,32 @@
Checkin Workstation
- {{circ.checkin_workstation().name() || - circSummary.last_checkin_workstation().name()}} + + + {{circ.checkin_workstation().name()}} + + + {{circSummary.last_checkin_workstation().name()}} + +
Inventory Date
-
{{item.latest_inventory().inventory_date() | date:'shortDate'}}
+
+ + {{item.latest_inventory().inventory_date() | date:'shortDate'}} + +
Inventory Workstation
-
{{item.latest_inventory().inventory_workstation().name()}}
+
+ + {{item.latest_inventory().inventory_workstation().name()}} + +
@@ -215,10 +268,12 @@
Item Alerts
- - + +
- + +
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts index ea9e6db15f..8f6379e2f8 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/item/summary.component.ts @@ -4,9 +4,11 @@ import {IdlService, IdlObject} from '@eg/core/idl.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {AuthService} from '@eg/core/auth.service'; import {NetService} from '@eg/core/net.service'; +import {OrgService} from '@eg/core/org.service'; import {PrintService} from '@eg/share/print/print.service'; import {HoldingsService} from '@eg/staff/share/holdings/holdings.service'; import {EventService} from '@eg/core/event.service'; +import {PermService} from '@eg/core/perm.service'; import {PatronPenaltyDialogComponent} from '@eg/staff/share/patron/penalty-dialog.component'; import {BarcodeSelectComponent} from '@eg/staff/share/barcodes/barcode-select.component'; import {CatalogService} from '@eg/share/catalog/catalog.service'; @@ -22,31 +24,116 @@ export class ItemSummaryComponent implements OnInit { circ: IdlObject; circSummary: IdlObject; + prevCircSummary: IdlObject; + prevCircUser: IdlObject; + maxHistoryCount: number; + loading = false; constructor( private router: Router, private route: ActivatedRoute, private net: NetService, + private org: OrgService, private printer: PrintService, private pcrud: PcrudService, private auth: AuthService, + private perms: PermService, private idl: IdlService, private evt: EventService, private cat: CatalogService, private holdings: HoldingsService ) { - // Create dummy objects so we can avoid a lot of *ngIf's in the template - this.circ = this.idl.create('circ'); - this.circSummary = this.idl.create('accs'); - this.circ.duration_rule(this.idl.create('crcd')); - this.circ.recurring_fine_rule(this.idl.create('crrf')); - this.circ.max_fine_rule(this.idl.create('crmf')); } ngOnInit() { + this.loading = true; + this.loadCircInfo() + .then(_ => this.loading = false); + } + + loadCircInfo(): Promise { + + const copyOrg = + this.item.call_number().id() == -1 ? + this.item.circ_lib().id() : + this.item.call_number().owning_lib().id(); + + return this.perms.hasWorkPermAt(['VIEW_COPY_CHECKOUT_HISTORY'], copyOrg) + .then(hasPerm => { + if (hasPerm) { + return this.org.settings('circ.item_checkout_history.max') + .then(sets => { + this.maxHistoryCount = sets['circ.item_checkout_history.max'] || 4; + }) + } + }) + .then(_ => { + + return this.pcrud.search('aacs', + {target_copy : this.item.id()}, + { flesh: 2, + flesh_fields: { + aacs: [ + 'usr', + 'workstation', + 'checkin_workstation', + 'duration_rule', + 'max_fine_rule', + 'recurring_fine_rule' + ], + au: ['card'] + }, + order_by: {aacs: 'xact_start desc'}, + limit: 1 + } + + ).toPromise(); + }) + + .then(circ => { + this.circ = circ; + + if (!circ) return Promise.resolve(); + + // load the chain for this circ + return this.net.request( + 'open-ils.circ', + 'open-ils.circ.renewal_chain.retrieve_by_circ.summary', + this.auth.token(), this.circ.id() + ).toPromise().then(summary => { + this.circSummary = summary + + if (this.maxHistoryCount <= 1) { return; } + // load the chain for the previous circ, plus the user + + return this.net.request( + 'open-ils.circ', + 'open-ils.circ.prev_renewal_chain.retrieve_by_circ.summary', + this.auth.token(), this.circ.id() + + ).toPromise().then(summary => { + if (!summary) { return; } + + this.prevCircSummary = summary.summary; + + if (summary.usr) { // aged circs have no 'usr'. + + return this.pcrud.retrieve('au', summary.usr, + {flesh : 1, flesh_fields : {au : ['card']}}) + .toPromise().then(user => this.prevCircUser = user); + } + }); + }); + }); } + addItemAlerts() { + } + + manageItemAlerts() { + } + }