From 5a63ae870611602d240db2ca7933695d55b2ff5d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 30 Jun 2014 17:33:52 -0400 Subject: [PATCH] items out print; initial edit due date Signed-off-by: Bill Erickson --- .../staff/circ/patron/t_edit_due_date_dialog.tt2 | 20 +++++++++ .../templates/staff/circ/patron/t_items_out.tt2 | 10 +++++ .../staff/circ/patron/t_new_message_dialog.tt2 | 1 - .../staff/share/print_templates/t_items_out.tt2 | 17 ++++++++ .../js/ui/default/staff/circ/patron/items_out.js | 49 +++++++++++++++++++++- 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/src/templates/staff/circ/patron/t_edit_due_date_dialog.tt2 create mode 100644 Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit_due_date_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit_due_date_dialog.tt2 new file mode 100644 index 0000000000..338c3e993e --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit_due_date_dialog.tt2 @@ -0,0 +1,20 @@ +
+ + + +
diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 index b8d00e9771..887d433b71 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 @@ -7,6 +7,16 @@ main-label="[% l('Items Checked Out') %]" items-provider="gridDataProvider" persist-key="circ.patron.items_out"> + + + + + + diff --git a/Open-ILS/src/templates/staff/circ/patron/t_new_message_dialog.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_new_message_dialog.tt2 index 5f6ebab059..d3555a0e2d 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_new_message_dialog.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_new_message_dialog.tt2 @@ -42,5 +42,4 @@ - diff --git a/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 new file mode 100644 index 0000000000..fee903b86a --- /dev/null +++ b/Open-ILS/src/templates/staff/share/print_templates/t_items_out.tt2 @@ -0,0 +1,17 @@ +
+
[% l('Welcome to [_1]', '{{current_location.name}}') %]
+
[% l('You have the following items:') %]
+
+
    +
  1. +
    {{checkout.title}}
    +
    [% l('Barcode: [_1] Due: [_2]', + '{{checkout.copy.barcode}}', + '{{checkout.circ.due_date | date:"short"}}') %]
    +
  2. +
+
+
{{current_location.shortname}} {{today | date:'short'}}
+
[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]
+
+ diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index d80e022838..dff599b0bb 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -4,8 +4,8 @@ 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); @@ -108,5 +108,50 @@ function($scope, $q, $routeParams, egCore , egUser, patronSvc , egGridDataPr 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, + }); + } + }]); -- 2.11.0