From 0c459071db59205d29b48b86726b829e7db355bb Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 23 Jun 2014 15:34:21 -0400 Subject: [PATCH] checkin; backdating Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/checkin/index.tt2 | 19 +++++++++++++++++ .../templates/staff/circ/share/circ_strings.tt2 | 8 +++++--- Open-ILS/src/templates/staff/css/style.css.tt2 | 1 + .../web/js/ui/default/staff/circ/checkin/app.js | 24 +++++++++++++++++++++- .../web/js/ui/default/staff/circ/services/circ.js | 6 ++++++ 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 index 6bd7f1cd64..4eb198bf57 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/index.tt2 @@ -35,8 +35,27 @@ +
+
+
+
+ [% l('Backdated Check In [_1]', + '{{checkinArgs.backdate | date:"shortDate"}}') %] +
+
+
+
[% l('Effective Date') %]
+ +
+
+
+
+ +
+ [% INCLUDE 'staff/circ/checkin/t_checkin_table.tt2' %] [% END %] diff --git a/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 b/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 index 0148f50685..47d09f8a99 100644 --- a/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 @@ -13,11 +13,13 @@ s.CIRC_CLAIMS_RETURNED = s.CHECKOUT_FAILED_GENERIC = '[% l('Unable to checkout copy "[_1]" : [_2]', '{{barcode}}', '{{textcode}}') %]'; s.COPY_ALERT_MSG_DIALOG_TITLE = - '[% l('Copy Alert Message for "[_1]"', '{{copy_barcode}}') %]'; + '[% l('Copy Alert Message for "[_1]"', '{{copy_barcode}}') %]'; s.UNCAT_ALERT_DIALOG = - '[% l('Copy "[_1]" was mis-scanned or is not cataloged', '{{copy_barcode}}') %]'; + '[% l('Copy "[_1]" was mis-scanned or is not cataloged', '{{copy_barcode}}') %]'; s.PERMISSION_DENIED = - '[% l('Permission Denied : [_1]', '{{permission}}') %]'; + '[% l('Permission Denied : [_1]', '{{permission}}') %]'; +s.PRECAT_CHECKIN_MSG = + '[% l("This item needs to be routed to CATALOGING") %]'; }]); diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index c30215b1f8..7d0e95d3d4 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -112,6 +112,7 @@ table.list tr.selected td { .pad-horiz {padding : 0px 10px 0px 10px; } .pad-vert {padding : 20px 0px 10px 0px;} +.pad-min {padding : 5px; } #print-div { display: none; } diff --git a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js index 4568cf2583..04119c6eb2 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/checkin/app.js @@ -29,6 +29,18 @@ function($scope , $q , egCore , checkinSvc , egGridDataProvider , egCirc) { $scope.focusMe = true; $scope.checkins = checkinSvc.checkins; + $scope.checkinArgs = {backdate : new Date()} + var today = new Date(); + + $scope.$watch('checkinArgs.backdate', function(newval) { + if (newval && newval > today) + $scope.checkinArgs.backdate = today; + }); + + $scope.is_backdate = function() { + return $scope.checkinArgs.backdate < today; + } + var checkinGrid = $scope.gridControls = {}; $scope.gridDataProvider = egGridDataProvider.instance({ @@ -40,8 +52,18 @@ function($scope , $q , egCore , checkinSvc , egGridDataProvider , egCirc) { $scope.checkin = function(args) { if (args && args.copy_barcode) { + var params = angular.copy(args); + + if (params.backdate) { + params.backdate = + params.backdate.toISOString().replace(/T.*/,''); + + // a backdate of 'today' is not really a backdate + if (params.backdate == $scope.max_backdate) + delete params.backdate; + } - egCirc.checkin(angular.copy(args)) + egCirc.checkin(angular.copy(params)) .then(function(final_resp) { final_resp.evt.index = checkinSvc.checkins.length; checkinSvc.checkins.unshift(final_resp.evt); diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index 5c8ea16a21..80a6d72f20 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -538,9 +538,15 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { egCore.strings.UNCAT_ALERT_DIALOG, params) .result.then(function() {return final_resp}); + case 'ITEM_NOT_CATALOGED': + return egAlertDialog.open( + egCore.strings.PRECAT_CHECKIN_MSG, params) + .result.then(function() {return final_resp}); + case 'COPY_ALERT_MESSAGE': return service.copy_alert_dialog(evt, params, options, 'checkin'); + default: console.warn('unhandled checkin response : ' + evt.textcode); return $q.when(final_resp); -- 2.11.0