<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>
<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>
<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>
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()) {
function ($scope, $q, egPCRUD, orgSelector) {
$scope.setCollector(function() {
- var deferred = $q.defer();
$scope.itemList.items = [];
var fullPath = orgSelector.relatedOrgs();
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();