ff ui : on-shelf tab; push status tab right
authorBill Erickson <berick@esilibrary.com>
Mon, 28 Oct 2013 21:26:03 +0000 (17:26 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 28 Oct 2013 21:26:03 +0000 (17:26 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/fulfillment/t_ill.tt2
Open-ILS/src/templates/staff/fulfillment/t_item_table.tt2
Open-ILS/src/templates/staff/fulfillment/t_onshelf.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/fulfillment/app.js

index 44bbdcc..266887d 100644 (file)
@@ -6,9 +6,11 @@
   <li ng-class="{active : tab_outbound}">
     <!-- only one where default view is lender - could be confusing? -->
     <a href="./fulfillment/lender/outbound">[% l('Outbound Transits') %]</a></li>
+  <li ng-class="{active : tab_onshelf}">
+    <a href="./fulfillment/borrower/onshelf">[% l('On Shelf') %]</a></li>
   <li ng-class="{active : tab_circulating}">
     <a href="./fulfillment/borrower/circulating">[% l('Currently Circulating') %]</a></li>
-  <li ng-class="{active : tab_status}">
+  <li ng-class="{active : tab_status}" class="pull-right">
     <a href="./fulfillment/status">[% l('Item Status') %]</a></li>
 </ul>
 <div class="tab-content">
       <div ng-include="'./fulfillment/t_outbound'"></div>
     </div>
   </div>
+  <div class="tab-pane" ng-class="{active : tab_onshelf}">
+    <div ng-if="tab_onshelf">
+      <div ng-include="'./fulfillment/t_onshelf'"></div>
+    </div>
+  </div>
   <div class="tab-pane" ng-class="{active : tab_circulating}">
     <div ng-if="tab_circulating">
       <div ng-include="'./fulfillment/t_circulating'"></div>
index db74bf2..c457a59 100644 (file)
@@ -17,6 +17,9 @@
       <th ng-show="tab_inbound || tab_outbound">[% l('Transit Source') %]</th>
       <th ng-show="tab_inbound || tab_outbound">[% l('Transit Destination') %]</th>
 
+      <!-- shelf columns -->
+      <th ng-show="tab_onshelf">[% l('Shelf Date') %]</th>
+
       <!-- circ columns -->
       <th ng-show="tab_circulating">[% l('Checkout Date') %]</th>
       <th ng-show="tab_circulating">[% l('Due Date') %]</th>
@@ -39,6 +42,7 @@
       <td ng-show="tab_inbound || tab_outbound">{{item.transit_time | date}}</td>
       <td ng-show="tab_inbound || tab_outbound">{{item.transit_source}}</td>
       <td ng-show="tab_inbound || tab_outbound">{{item.transit_dest}}</td>
+      <td ng-show="tab_onshelf">{{item.hold_shelf_time | date}}</td>
       <td ng-show="tab_circulating">{{item.circ_xact_start | date}}</td>
       <td ng-show="tab_circulating">{{item.due_date | date}}</td>
       <td ng-show="tab_circulating">{{item.circ_circ_lib}}</td>
diff --git a/Open-ILS/src/templates/staff/fulfillment/t_onshelf.tt2 b/Open-ILS/src/templates/staff/fulfillment/t_onshelf.tt2
new file mode 100644 (file)
index 0000000..63fe41c
--- /dev/null
@@ -0,0 +1,22 @@
+<div ng-controller="OnShelfCtrl">
+  <br/>
+  <div class="row command-bar">
+    <div class="col-lg-6">
+      <ul class="nav nav-pills">
+        <li ng-class="{active : orientation_borrower}">
+          <a href="./fulfillment/borrower/{{tabname}}">For My Patrons</a>
+        </li>
+        <li ng-class="{active : orientation_lender}">
+          <a  href="./fulfillment/lender/{{tabname}}">For Other Libraries</a>
+        </li>
+      </ul>
+    </div>
+    <div class="col-lg-6 text-right">
+      <div ng-include="'./fulfillment/t_actions'"></div>
+    </div>
+  </div>
+
+  <br/>
+
+  <div ng-include="'./fulfillment/t_item_table'"></div>
+</div>
index d770933..57f3d02 100644 (file)
@@ -283,6 +283,7 @@ function ($scope,  $q,  $compile,  $timeout,  $rootScope, $location,
                 item.hold_pickup_lib = egOrg.get(hold.pickup_lib()).shortname();
                 item.hold_request_time = hold.request_time();
                 item.hold_capture_time = hold.capture_time();
+                item.hold_shelf_time = hold.shelf_time();
                 if (hold.cancel_time()) {
                     item.hold_cancel_time = hold.cancel_time();
                     if (hold.cancel_cause()) {
@@ -536,7 +537,6 @@ function ($scope,  $q,  $compile,  $timeout,  $rootScope, $location,
 function ($scope,  $q,  egPCRUD,  orgSelector) {
 
     $scope.setCollector(function() {
-        var deferred = $q.defer();
         $scope.itemList.items = [];
 
         var fullPath = orgSelector.relatedOrgs();
@@ -587,12 +587,69 @@ function ($scope,  $q,  egPCRUD,  orgSelector) {
     return $scope.collector();
 }])
 
+.controller('OnShelfCtrl',
+        ['$scope','$q','egPCRUD','orgSelector',
+function ($scope,  $q,  egPCRUD,  orgSelector) {
+
+    $scope.setCollector(function() {
+        $scope.itemList.items = [];
+
+        var fullPath = orgSelector.relatedOrgs();
+
+        var copy_lib = {'not in' : fullPath}; // not our copy
+        var shelf_lib = fullPath; // on our shelf
+
+        if ($scope.orientation_lender) {
+            shelf_lib = {'not in' : fullPath};
+            copy_lib = fullPath;
+        }
+            
+        var query = {
+            frozen : 'f',
+            cancel_time : null,
+            fulfillment_time : null,
+            shelf_time : {'!=' : null},
+            current_shelf_lib : shelf_lib,
+            current_copy : {
+                'in' : {
+                    select: {acp : ['id']},
+                    from : 'acp',
+                    where : {
+                        deleted : 'f',
+                        id : {'=' : {'+ahr' : 'current_copy'}},
+                        circ_lib : copy_lib,
+                        status : 8 // On Holds Shelf
+                    }
+                }
+            }
+        };
+
+        return egPCRUD.search('ahr', query,
+            {   limit : $scope.itemList.limit,
+                offset : $scope.itemList.offset,
+                flesh : 1, 
+                flesh_fields : {ahr : ['current_copy']},
+                order_by : {ahr : 'request_time, id'}
+            }, {atomic : true}
+        ).then(function(holds) {
+            angular.forEach(holds, function(hold) {
+                $scope.itemList.addItem(
+                  {barcode : hold.current_copy().barcode()});
+            });
+        });
+    });
+    
+    // outbound tab defaults to lender view
+    return $scope.collector();
+}])
+
+
+
 .controller('CircCtrl',
         ['$scope','$q','egPCRUD','orgSelector',
 function ($scope,  $q,  egPCRUD,  orgSelector) {
 
     $scope.setCollector(function() {
-        var deferred = $q.defer();
         $scope.itemList.items = [];
 
         var fullPath = orgSelector.relatedOrgs();