--- /dev/null
+<form ng-submit="ok(args)" role="form">
+ <div class="modal-header">
+ <button type="button" class="close" ng-click="cancel()"
+ aria-hidden="true">×</button>
+ <h4 class="modal-title">
+ [% l('Edit Due Date For [_1] Items', '{{args.num_circs}}') %]
+ </h4>
+ </div>
+ <div class="modal-body">
+ <div class="form-group row pad-vert">
+ <div class="col-md-6">
+ <input eg-date-input class="form-control" ng-model="args.due_date"/>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <input type="submit" class="btn btn-primary" value="[% l('OK') %]"/>
+ <button class="btn btn-warning" ng-click="cancel($event)">[% l('Cancel') %]</button>
+ </div>
+</form>
main-label="[% l('Items Checked Out') %]"
items-provider="gridDataProvider"
persist-key="circ.patron.items_out">
+
+ <eg-grid-action
+ handler="print_receipt"
+ label="[% l('Print Item Receipt') %]">
+ </eg-grid-action>
+ <eg-grid-action
+ handler="edit_due_date"
+ label="[% l('Edit Due Date') %]">
+ </eg-grid-action>
+
<eg-grid-field label="[% l('Circ ID') %]" path='id'></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path='target_copy.barcode'>
<a href="./cat/item/{{item.target_copy().id()}}" target="_self">
--- /dev/null
+<div>
+ <div>[% l('Welcome to [_1]', '{{current_location.name}}') %]</div>
+ <div>[% l('You have the following items:') %]</div>
+ <hr/>
+ <ol>
+ <li ng-repeat="checkout in circulations">
+ <div>{{checkout.title}}</div>
+ <div>[% l('Barcode: [_1] Due: [_2]',
+ '{{checkout.copy.barcode}}',
+ '{{checkout.circ.due_date | date:"short"}}') %]</div>
+ </li>
+ </ol>
+ <hr/>
+ <div>{{current_location.shortname}} {{today | date:'short'}}</div>
+ <div>[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]</div>
+<br/>
+
angular.module('egPatronApp').controller('PatronItemsOutCtrl',
- ['$scope','$q','$routeParams','egCore','egUser','patronSvc','egGridDataProvider',
-function($scope, $q, $routeParams, egCore , egUser, patronSvc , egGridDataProvider) {
+ ['$scope','$q','$routeParams','egCore','egUser','patronSvc','egGridDataProvider','$modal',
+function($scope, $q, $routeParams, egCore , egUser, patronSvc , egGridDataProvider , $modal) {
$scope.initTab('items_out', $routeParams.id);
date.setTime(Date.parse(circ.due_date()));
return date < new Date();
}
+
+ $scope.edit_due_date = function(items) {
+ $modal.open({
+ templateUrl : './circ/patron/t_edit_due_date_dialog',
+ controller : [
+ '$scope','$modalInstance',
+ function($scope , $modalInstance) {
+ $scope.args = {
+ num_circs : items.length,
+ due_date : new Date()
+ }
+ $scope.ok = function(args) {
+ // TODO open-ils.circ.circulation.due_date.update (circ_id, date)
+ $modalInstance.close();
+ }
+ $scope.cancel = function($event) {
+ $modalInstance.dismiss();
+ $event.preventDefault();
+ }
+ }
+ ]
+ });
+ }
+
+ $scope.print_receipt = function(items) {
+ if (items.length == 0) return $q.when();
+ var print_data = {circulations : []}
+
+ angular.forEach(patronSvc.items_out, function(circ) {
+ print_data.circulations.push({
+ circ : egCore.idl.toHash(circ),
+ copy : egCore.idl.toHash(circ.target_copy()),
+ call_number : egCore.idl.toHash(circ.target_copy().call_number()),
+ title : circ.target_copy().call_number().record().simple_record().title(),
+ author : circ.target_copy().call_number().record().simple_record().author(),
+ })
+ });
+
+ return egCore.print.print({
+ context : 'default',
+ template : 'items_out',
+ scope : print_data,
+ });
+ }
+
}]);