From: Bill Erickson Date: Fri, 9 Apr 2021 01:45:35 +0000 (-0400) Subject: LP1904036 waivers; more checkin X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f5819a11084ba07b9182f980dc7fad61f8abf40a;p=Evergreen.git LP1904036 waivers; more checkin Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html index ab5b137ab1..6ef7700410 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html @@ -88,6 +88,12 @@ (onClick)="openItemAlerts($event, 'create')"> + + + diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts index 0e262f339c..124ef241ce 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts @@ -287,8 +287,7 @@ export class CheckoutComponent implements OnInit, AfterViewInit { this.copyAlertsDialog.open({size: 'lg'}).subscribe( modified => { if (modified) { - // TODO: verify the modiifed alerts are present - // or go fetch them. + rows.forEach(row => row.copyAlertCount++); this.checkoutsGrid.reload(); } } diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html index 2206f06e39..2dc6907e96 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html @@ -35,7 +35,7 @@
  • - + Non-Cataloged Circulations ({{context.summary.stats.checkouts.noncat}}) diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index b5dbcfd04e..eb9e5ba1af 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -11,6 +11,7 @@ import {BibRecordService, BibRecordSummary} from '@eg/share/catalog/bib-record.s import {AudioService} from '@eg/share/util/audio.service'; import {CircEventsComponent} from './events-dialog.component'; import {CircComponentsComponent} from './components.component'; +import {StringService} from '@eg/share/string/string.service'; export interface CircDisplayInfo { title?: string; @@ -171,6 +172,7 @@ export class CircService { autoOverrideCheckoutEvents: {[textcode: string]: boolean} = {}; suppressCheckinPopups = false; ignoreCheckinPrecats = false; + copyLocationCache: {[id: number]: IdlObject} = {}; constructor( private audio: AudioService, @@ -178,6 +180,7 @@ export class CircService { private org: OrgService, private net: NetService, private pcrud: PcrudService, + private strings: StringService, private auth: AuthService, private bib: BibRecordService, ) {} @@ -451,12 +454,11 @@ export class CircService { return this.net.request( 'open-ils.circ', method, this.auth.token(), this.apiParams(params)).toPromise() - .then(result => this.processCheckinResult(params, result)); + .then(result => this.unpackCheckinData(params, result)) + .then(result => this.processCheckinResult(result)); } - processCheckinResult( - params: CheckinParams, response: any): Promise { - + unpackCheckinData(params: CheckinParams, response: any): Promise { const allEvents = Array.isArray(response) ? response.map(r => this.evt.parse(r)) : [this.evt.parse(response)]; @@ -476,7 +478,7 @@ export class CircService { const result: CheckinResult = { index: CircService.resultIndex++, firstEvent: firstEvent, - allEvents: response, + allEvents: allEvents, params: params, success: success, circ: payload.circ, @@ -484,6 +486,28 @@ export class CircService { record: payload.record }; + let promise = Promise.resolve();; + const copy = result.copy; + + if (copy) { + if (this.copyLocationCache[copy.location()]) { + copy.location(this.copyLocationCache[copy.location()]); + } else { + promise = this.pcrud.retrieve('acpl', copy.location()).toPromise() + .then(loc => { + copy.location(loc); + this.copyLocationCache[loc.id()] = loc; + }); + } + } + + return promise.then(_ => result); + } + + processCheckinResult(result: CheckinResult): Promise { + const params = result.params; + const allEvents = result.allEvents; + // Informational alerts that can be ignored if configured. if (this.suppressCheckinPopups && allEvents.filter(e => @@ -507,10 +531,9 @@ export class CircService { return this.showOverrideDialog(result, allEvents, true); } - switch (firstEvent.textcode) { + switch (result.firstEvent.textcode) { case 'SUCCESS': case 'NO_CHANGE': - this.audio.play('success.checkin'); return this.handleCheckinSuccess(result); case 'ITEM_NOT_CATALOGED': @@ -527,9 +550,37 @@ export class CircService { } handleCheckinSuccess(result: CheckinResult): Promise { + + switch (result.copy.status()) { + + case 0: /* AVAILABLE */ + case 4: /* MISSING */ + case 7: /* RESHELVING */ + this.audio.play('success.checkin'); + return this.handleCheckinLocAlert(result); + } + return Promise.resolve(result); } + handleCheckinLocAlert(result: CheckinResult): Promise { + const copy = result.copy; + + if (this.suppressCheckinPopups + || copy.location().checkin_alert() === 'f') { + return Promise.resolve(result); + } + + return this.strings.interpolate( + 'staff.circ.checkin.location.alert', + {barcode: copy.barcode(), location: copy.location().name()} + ).then(str => { + this.components.locationAlertDialog.dialogBody = str; + return this.components.locationAlertDialog.open().toPromise() + .then(_ => result); + }); + } + handleOverridableCheckinEvents( result: CheckinResult, events: EgEvent[]): Promise { const params = result.params; @@ -539,7 +590,6 @@ export class CircService { // Should never get here. Just being safe. return Promise.reject(null); } - } diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html index 9afc0ef393..c287856ec4 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html @@ -8,6 +8,15 @@ i18n-dialogBody dialogBody="This item needs to be routed to CATALOGING"> + + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts index 3808ca9b76..d1bcadba0e 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts @@ -23,6 +23,7 @@ export class CircComponentsComponent { @ViewChild('circEventsDialog') circEventsDialog: CircEventsComponent; @ViewChild('routeToCatalogingDialog') routeToCatalogingDialog: AlertDialogComponent; @ViewChild('openCircDialog') openCircDialog: OpenCircDialogComponent; + @ViewChild('locationAlertDialog') locationAlertDialog: AlertDialogComponent; constructor(private circ: CircService) { this.circ.components = this; diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html index 931662f744..5f5251ce84 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/summary.component.html @@ -171,10 +171,31 @@
    Email
    - - {{p().email()}} + {{p().email()}}
    +
    +
    Name Keywords
    +
    {{p().name_keywords()}}
    +
    + + +
    +
    +
    Allow others to use my account
    +
    +
    +
    {{waiver.name()}}
    +
    +
      +
    • Place holds
    • +
    • Pick up holds
    • +
    • View borrowing history
    • +
    • Check out items
    • +
    +
    +
    +