+<div class="d-flex">
+ <div class="flex-1"></div>
+ <div>
+ <button class="btn btn-outline-dark" (click)="printList()" i18n>Print List</button>
+ </div>
+</div>
<div id='oils-selfck-circ-table-div'>
<table id='oils-selfck-circ-table' class='oils-selfck-item-table'>
<thead>
import {IdlObject} from '@eg/core/idl.service';
import {SckoService} from './scko.service';
import {ServerStoreService} from '@eg/core/server-store.service';
+import {PrintService} from '@eg/share/print/print.service';
@Component({
templateUrl: 'holds.component.html'
private net: NetService,
private auth: AuthService,
private pcrud: PcrudService,
+ private printer: PrintService,
public scko: SckoService
) {}
this.holds.push(holdData);
});
}
+
+ printList() {
+ this.printer.print({
+ templateName: 'scko_holds',
+ contextData: {
+ holds: this.holds,
+ user: this.scko.patronSummary.patron
+ },
+ printContext: 'default'
+ });
+ }
}
+<div class="d-flex">
+ <div class="flex-1"></div>
+ <div>
+ <button class="btn btn-outline-dark" (click)="printList()" i18n>Print List</button>
+ </div>
+</div>
<div id='oils-selfck-circ-table-div'>
<table id='oils-selfck-circ-table' class='oils-selfck-item-table'>
<thead>
import {IdlObject} from '@eg/core/idl.service';
import {SckoService} from './scko.service';
import {ServerStoreService} from '@eg/core/server-store.service';
+import {PrintService} from '@eg/share/print/print.service';
const CIRC_FLESH_DEPTH = 4;
const CIRC_FLESH_FIELDS = {
private net: NetService,
private auth: AuthService,
private pcrud: PcrudService,
+ private printer: PrintService,
public scko: SckoService
) {}
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)
+ };
+ });
+
+ this.printer.print({
+ templateName: 'scko_items_out',
+ contextData: {checkouts: data},
+ printContext: 'default'
+ });
+ }
}
+
+
import {StoreService} from '@eg/core/store.service';
import {PatronService, PatronSummary, PatronStats} from '@eg/staff/share/patron/patron.service';
import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
+import {PrintService} from '@eg/share/print/print.service';
@Injectable({providedIn: 'root'})
export class SckoService {
private net: NetService,
private evt: EventService,
public auth: AuthService,
+ private printer: PrintService,
private patrons: PatronService,
) {}
this.patronSummary.stats.checkouts.overdue +
this.patronSummary.stats.checkouts.long_overdue;
}
+
+
+ /*
+ logout(receiptType:
+ this.printer.print({
+ templateName: 'bills_current',
+ contextData: {xacts: rows},
+ printContext: 'default'
+ });
+ */
+
}
} else if (this.status === 404) {
console.error('No active template found: ', printReq);
reject({notFound: true});
+ } else {
+ console.error(
+ "Print template generator returned status: " + this.status);
}
reject({});
}
# Instance-specific personality
if ($app) {
+ # Reset everything in case this editor instance was
+ # previously used as a different personality.
+ delete $self->{session};
+ $self->{app} = $app;
$self->{personality} = $app;
init();
}
# Requires staff login
return Apache2::Const::FORBIDDEN
- unless $e->checkauth && $e->requestor->wsid;
+ unless $e->checkauth && $e->allowed('STAFF_LOGIN');
# Let pcrud handle the authz
+ #$e->{app} = 'open-ils.pcrud';
$e->personality('open-ils.pcrud');
my $tmpl_owner = $cgi->param('template_owner') || $e->requestor->ws_ou;
SET udata = user_data.$idx
-%]
<li>
- <div>Title: [% udata.item_title %]</div>
+ <table>
+ <tr>
+ <td>Title:</td>
+ <td>[% hold.title %]</td>
+ </tr>
+ <tr>
+ <td>author:</td>
+ <td>[% hold.author %]</td>
+ </tr>
+
<div>Author: [% udata.item_author %]</div>
<div>Pickup Location: [% udata.pickup_lib %]</b></div>
<div>Status:
--- /dev/null
+
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
+
+INSERT INTO config.print_template
+ (name, label, owner, active, locale, content_type, template)
+VALUES ('scko_items_out', 'Self-Checkout Items Out', 1, TRUE, 'en-US', 'text/html', '');
+
+UPDATE config.print_template SET template = $TEMPLATE$
+[%-
+ USE date;
+ SET user = template_data.user;
+ SET checkouts = template_data.checkouts;
+-%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format(date.now, '%x %r') %]</div>
+ <br/>
+
+ [% user.pref_family_name || user.family_name %],
+ [% user.pref_first_given_name || user.first_given_name %]
+
+ <ol>
+ [% FOR checkout IN checkouts %]
+ <li>
+ <div>[% checkout.title %]</div>
+ <div>Barcode: [% checkout.copy.barcode %]</div>
+ <div>Due Date: [%
+ date.format(helpers.format_date(
+ checkout.circ.due_date, staff_org_timezone), '%x %r')
+ %]
+ </div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$TEMPLATE$ WHERE name = 'scko_items_out';
+
+INSERT INTO config.print_template
+ (name, label, owner, active, locale, content_type, template)
+VALUES ('scko_holds', 'Self-Checkout Holds', 1, TRUE, 'en-US', 'text/html', '');
+
+UPDATE config.print_template SET template = $TEMPLATE$
+[%-
+ USE date;
+ SET user = template_data.user;
+ SET holds = template_data.holds;
+-%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format(date.now, '%x %r') %]</div>
+ <br/>
+
+ [% user.pref_family_name || user.family_name %],
+ [% user.pref_first_given_name || user.first_given_name %]
+
+ <ol>
+ [% FOR hold IN holds %]
+ <li>
+ <table>
+ <tr>
+ <td>Title:</td>
+ <td>[% hold.title %]</td>
+ </tr>
+ <tr>
+ <td>Author:</td>
+ <td>[% hold.author %]</td>
+ </tr>
+ <tr>
+ <td>Pickup Location:</td>
+ <td>[% helpers.get_org_unit(hold.pickup_lib).name %]</td>
+ </tr>
+ <tr>
+ <td>Status:</td>
+ <td>
+ [%- IF hold.ready -%]
+ Ready for pickup
+ [% ELSE %]
+ #[% hold.relative_queue_position %] of [% hold.potentials %] copies.
+ [% END %]
+ </td>
+ </tr>
+ </div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$TEMPLATE$ WHERE name = 'scko_holds';
+
+COMMIT;
+
+