checkin; backdating
authorBill Erickson <berick@esilibrary.com>
Mon, 23 Jun 2014 19:34:21 +0000 (15:34 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 23 Jun 2014 19:34:21 +0000 (15:34 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/checkin/index.tt2
Open-ILS/src/templates/staff/circ/share/circ_strings.tt2
Open-ILS/src/templates/staff/css/style.css.tt2
Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index 6bd7f1c..4eb198b 100644 (file)
         </div>
       </form>
   </div>
+  <div class="col-md-8">
+    <div class="flex-row">
+      <div class="pad-horiz" ng-if="is_backdate()">
+        <div class="alert-danger pad-min">
+          [% l('Backdated Check In [_1]', 
+            '{{checkinArgs.backdate | date:"shortDate"}}') %]
+        </div>
+      </div>
+      <div class="flex-cell"></div>
+      <div class="pad-horiz">[% l('Effective Date') %]</div>
+      <!-- date max= not yet supported -->
+      <div><input eg-date-input
+        class="form-control" ng-model="checkinArgs.backdate"/>
+      </div>
+    </div>
+  </div>
+
 </div>
 
+<hr/>
+
 [% INCLUDE 'staff/circ/checkin/t_checkin_table.tt2' %]
 
 [% END %]
index 0148f50..47d09f8 100644 (file)
@@ -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") %]';
 }]);
 </script>
 
index c30215b..7d0e95d 100644 (file)
@@ -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; }
 
index 4568cf2..04119c6 100644 (file)
@@ -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);
index 5c8ea16..80a6d72 100644 (file)
@@ -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);