<img src="/opac/extras/ac/jacket/small/r/{{co.circ.target_copy().call_number().record().id()}}"/>
</ng-container>
</td>
- <td><span *ngIf="co.circ">{{cocirc.target_copy().barcode()}}</span></td>
- <td>{{getTitle(circ)}}</td>
- <td>{{getAuthor(circ)}}</td>
+ <td><span *ngIf="co.circ">{{co.circ.target_copy().barcode()}}</span></td>
+ <td>{{scko.getCircTitle(co.circ)}}</td>
+ <td>{{scko.getCircAuthor(co.circ)}}</td>
<td><span *ngIf="co.circ">{{co.circ | egDueDate}}</span></td>
<td><span *ngIf="co.circ">{{co.circ.renewal_remaining()}}</span></td>
<td>
ngOnInit() {
}
-
- displayValue(circ: IdlObject, field: string): string {
- const entry =
- circ.target_copy().call_number().record().flat_display_entries()
- .filter(e => e.name() === field)[0];
-
- return entry ? entry.value() : '';
- }
-
- getTitle(circ: IdlObject): string {
- if (!circ) { return ''; }
- const copy = circ.target_copy();
- return this.displayValue(circ, 'title');
- }
-
- getAuthor(circ: IdlObject): string {
- if (!circ) { return ''; }
- const copy = circ.target_copy();
- return this.displayValue(circ, 'author');
- }
}
</ng-container>
</td>
<td>{{circ.target_copy().barcode()}}</td>
- <td>{{getTitle(circ)}}</td>
- <td>{{getAuthor(circ)}}</td>
+ <td>{{scko.getCircTitle(circ)}}</td>
+ <td>{{scko.getCircAuthor(circ)}}</td>
<td>{{circ | egDueDate}}</td>
<td>{{circ.renewal_remaining()}}</td>
<td>
});
}
- // TODO use scko versions
- isPrecat(copy: IdlObject): boolean {
- return Number(copy.id()) === -1;
- }
-
- displayValue(circ: IdlObject, field: string): string {
-
- const entry =
- circ.target_copy().call_number().record().flat_display_entries()
- .filter(e => e.name() === field)[0];
-
- return entry ? entry.value() : '';
- }
-
- getTitle(circ: IdlObject): string {
- const copy = circ.target_copy();
- if (this.isPrecat(copy)) { return copy.dummy_title(); }
- return this.displayValue(circ, 'title');
- }
-
- getAuthor(circ: IdlObject): string {
- const copy = circ.target_copy();
- if (this.isPrecat(copy)) { return copy.dummy_author(); }
- return this.displayValue(circ, 'author');
- }
-
printList() {
const data = this.circs.map(c => {
return {
circ: c,
copy: c.target_copy(),
- title: this.getTitle(c),
- author: this.getAuthor(c)
+ title: this.scko.getCircTitle(c),
+ author: this.scko.getCircAuthor(c)
};
});
<eg-context-menu-container></eg-context-menu-container>
<eg-string i18n-text key="scko.unknown" text="Unknown Error Occurred"></eg-string>
+<eg-string i18n-text key="scko.checkout.success" text="Checkout Succeeded"></eg-string>
<eg-string i18n-text key="scko.renew.success" text="Renewal Succeeded"></eg-string>
<eg-string i18n-text key="scko.item.not_found"
text="Item was not found in the system. Try re-scanning the item."></eg-string>
text="The system could not find this patron"></eg-string>
<eg-string i18n-text key="scko.error.transit_range"
text="The item cannot transit this far"></eg-string>
-
+<eg-string i18n-text key="scko.error.patron_exceeds_checkout_count"
+ text="Maximum checkouts reached on this account"></eg-string>
// Currently active patron account object.
patronSummary: PatronSummary;
+ statusDisplayText = '';
+ statusDisplaySuccess: boolean;
+
barcodeRegex: RegExp;
patronPasswordRequired = false;
patronIdleTimeout: number;
patronTimeoutId: number;
logoutWarningTimeout = 20;
logoutWarningTimerId: number;
- statusDisplayText = '';
- statusDisplaySuccess: boolean;
alertAudio = false;
alertPopup = false;
}
resetPatron() {
+ this.statusDisplayText = '';
this.patronSummary = null;
this.sessionCheckouts = [];
}
checkout(barcode: string, override?: boolean): Promise<any> {
this.resetPatronTimeout();
+ barcode = (barcode || '').trim();
+ if (!barcode) { return Promise.resolve(); }
+
let method = 'open-ils.circ.checkout.full';
if (override) { method += '.override'; }
const age = this.orgSettings['circ.checkout_auto_renew_age'];
if (!age || (age && ctx.payload.auto_renew)) {
- ctx.previousCirc = ctx.payload.old_circ;
ctx.renew = true;
- return Promise.resolve(ctx);
+
+ // Flesh the previous circ so we can show the title,
+ // etc. in the receipt.
+ return this.getFleshedCirc(ctx.payload.old_circ.id())
+ .then(oldCirc => {
+ ctx.previousCirc = oldCirc;
+ return ctx;
+ });
}
}
getErrorDisplyText(evt: EgEvent): string {
switch (evt.textcode) {
+ case 'PATRON_EXCEEDS_CHECKOUT_COUNT':
+ return 'scko.error.patron_exceeds_checkout_count';
case 'MAX_RENEWALS_REACHED':
return 'scko.error.max_renewals';
case 'ITEM_NOT_CATALOGED':
sub.unsubscribe();
// Give the print operation just a bit more time after
// the data is passed to the printer just to be safe.
- setTimeout(() => resolve, 1000);
+ setTimeout(() => resolve(null), 1000);
});
const data = this.sessionCheckouts.map(c => {
+ const circ = c.circ || c.ctx.previousCirc;
return {
checkout: c,
barcode: c.ctx.barcode,
- circ: c.circ,
- copy: c.circ ? c.circ.target_copy() : null,
- title: this.getCircTitle(c.circ),
- author: this.getCircAuthor(c.circ)
+ circ: circ,
+ copy: circ ? circ.target_copy() : null,
+ title: this.getCircTitle(circ),
+ author: this.getCircAuthor(circ)
};
});
-
this.printer.print({
templateName: 'scko_checkouts',
contextData: {
my $staff_org = $e->retrieve_actor_org_unit([
$e->requestor->ws_ou, {
flesh => 1,
- flesh_fields => {aou => ['billing_address', 'mailing_address']}
+ flesh_fields => {
+ aou => [
+ 'billing_address',
+ 'mailing_address',
+ 'hours_of_operation'
+ ]
+ }
}
]);
USE date;
SET user = template_data.user;
SET checkouts = template_data.checkouts;
+ SET lib = staff_org;
+ SET hours = lib.hours_of_operation;
+ SET lib_addr = staff_org.billing_address || staff_org.mailing_address;
-%]
<div>
<style> li { padding: 8px; margin 5px; }</style>
<div>[% date.format(date.now, '%x %r') %]</div>
+ <div>[% lib.name %]</div>
+ <div>[% lib_addr.street1 %] [% lib_addr.street2 %]</div>
+ <div>[% lib_addr.city %], [% lib_addr.state %] [% lib_addr.post_code %]</div>
+ <div>[% lib.phone %]</div>
<br/>
[% user.pref_family_name || user.family_name %],
<li>
<div>[% checkout.title %]</div>
<div>Barcode: [% checkout.barcode %]</div>
- <div>Due Date: [%
- IF checkout.circ;
- date.format(helpers.format_date(
- checkout.circ.due_date, staff_org_timezone), '%x %r')
- END;
- %]
- </div>
+
+ [% IF checkout.ctx.renewalFailure %]
+ <div style="color:red;">Renewal Failed</div>
+ [% END %]
+
+ <div>Due Date: [% date.format(helpers.format_date(
+ checkout.circ.due_date, staff_org_timezone), '%x') %]</div>
</li>
[% END %]
</ol>
+
+ <div>
+ Library Hours
+ [%-
+ BLOCK format_time;
+ date.format(time _ ' 1/1/1000', format='%I:%M %p');
+ END
+ -%]
+ <div>
+ Monday
+ [% PROCESS format_time time = hours.dow_0_open %]
+ [% PROCESS format_time time = hours.dow_0_close %]
+ </div>
+ <div>
+ Tuesday
+ [% PROCESS format_time time = hours.dow_1_open %]
+ [% PROCESS format_time time = hours.dow_1_close %]
+ </div>
+ <div>
+ Wednesday
+ [% PROCESS format_time time = hours.dow_2_open %]
+ [% PROCESS format_time time = hours.dow_2_close %]
+ </div>
+ <div>
+ Thursday
+ [% PROCESS format_time time = hours.dow_3_open %]
+ [% PROCESS format_time time = hours.dow_3_close %]
+ </div>
+ <div>
+ Friday
+ [% PROCESS format_time time = hours.dow_4_open %]
+ [% PROCESS format_time time = hours.dow_4_close %]
+ </div>
+ <div>
+ Saturday
+ [% PROCESS format_time time = hours.dow_5_open %]
+ [% PROCESS format_time time = hours.dow_5_close %]
+ </div>
+ <div>
+ Sunday
+ [% PROCESS format_time time = hours.dow_6_open %]
+ [% PROCESS format_time time = hours.dow_6_close %]
+ </div>
+ </div>
+
</div>
$TEMPLATE$ WHERE name = 'scko_checkouts';