+<div ng-if="print_list_progress !== null" class="strong-text-2">
+ [% l('Loading... [_1]', '{{print_list_progress}}') %]
+</div>
+
<eg-grid
id-field="id"
features="-sort,-multisort"
<eg-grid-menu-item handler="detail_view"
label="[% l('Detail View') %]"></eg-grid-menu-item>
+ <eg-grid-menu-item handler="print_full_list"
+ label="[% l('Print Full List') %]"></eg-grid-menu-item>
+
+ <!--
+ The Alternate print UI appears to be generated in a very similar
+ fashion to our native full list printer. Also, since it's
+ generated from a separate standalone HTML page, the print
+ action bypasses Hatch and goes straight to the browser printer.
+ <eg-grid-menu-item handler="print_list_alt"
+ label="[% l('Print Full List (Alt)') %]"></eg-grid-menu-item>
+ -->
+
<eg-grid-action handler="grid_actions.show_recent_circs"
label="[% l('Show Last Few Circulations') %]"></eg-grid-action>
<eg-grid-action divider="true"></eg-grid-action>
</a>
</eg-grid-field>
+ <eg-grid-field label="[% l('Part') %]" path='part.label'></eg-grid-field>
<eg-grid-field label="[% l('Request Date') %]" path='hold.request_time'></eg-grid-field>
<eg-grid-field label="[% l('Hold Type') %]" path='hold.hold_type'></eg-grid-field>
<eg-grid-field label="[% l('Pickup Library') %]" path='hold.pickup_lib.shortname'></eg-grid-field>
--- /dev/null
+<table id='pull-list-template-table'>
+ <style>
+ #pull-list-template-table td,
+ #pull-list-template-table th {
+ padding: 5px;
+ border: 1px solid #000;
+ }
+ </style>
+ <thead>
+ <tr>
+ <th>[% l('Type') %]</th>
+ <th>[% l('Title') %]</th>
+ <th>[% l('Author') %]</th>
+ <th>[% l('Shelf Location') %]</th>
+ <th>[% l('Call Number') %]</th>
+ <th>[% l('Barcode/Part') %]</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="hold_data in holds">
+ <td>{{hold_data.hold.hold_type}}</td>
+ <td>{{hold_data.title}}</td>
+ <td>{{hold_data.author}}</td>
+ <td>{{hold_data.copy.location.name}}</td>
+ <td>{{hold_data.volume.label}}</td>
+ <td>{{hold_data.copy.barcode}} {{hold_data.part.label}}</td>
+ </tr>
+ </tbody>
+</table>
// clear shelf done; fetch the cached results.
function(resp) {
clearing = false;
- console.debug('clear holds cache key is ' + resp.cache_key);
egCore.net.request(
'open-ils.circ',
'open-ils.circ.hold.clear_shelf.get_cache',
$scope.detail_hold_record_id = hold_data.mvr.doc_id();
}
+ // By default, this action is hidded from the UI, but leaving it
+ // here in case it's needed in the future
+ $scope.print_list_alt = function() {
+ var url = '/opac/extras/circ/alt_holds_print.html';
+ var win = $window.open(url, '_blank');
+ win.ses = function() {return egCore.auth.token()};
+ win.open();
+ win.focus();
+ }
+
+ $scope.print_list_progress = null;
+ $scope.print_full_list = function() {
+ var print_holds = [];
+ $scope.print_list_loading = true;
+ $scope.print_list_progress = 0;
+
+ // collect the full list of holds
+ egCore.net.request(
+ 'open-ils.circ',
+ 'open-ils.circ.hold_pull_list.fleshed.stream',
+ egCore.auth.token(), 10000, 0
+ ).then(
+ function() {
+ console.debug('printing ' + print_holds.length + ' holds');
+
+ // holds fetched, send to print
+ egCore.print.print({
+ context : 'default',
+ template : 'hold_pull_list',
+ scope : {holds : print_holds}
+ });
+ },
+ null,
+ function(hold_data) {
+ $scope.print_list_progress++;
+ egHolds.local_flesh(hold_data);
+ print_holds.push(hold_data);
+ hold_data.title = hold_data.mvr.title();
+ hold_data.author = hold_data.mvr.author();
+ hold_data.hold = egCore.idl.toHash(hold_data.hold);
+ hold_data.copy = egCore.idl.toHash(hold_data.copy);
+ hold_data.volume = egCore.idl.toHash(hold_data.volume);
+ hold_data.part = egCore.idl.toHash(hold_data.part);
+ }
+ ).finally(function() {
+ $scope.print_list_loading = false;
+ $scope.print_list_progress = null;
+ });
+ }
+
}])