</button>
<ul class="dropdown-menu">
<li><a href="javascript:;" ng-click="checkin()"
- ng-show="tab_pending && itemList.filterLender">Capture Item</a></li>
+ ng-show="tab_pending && orientation_lender">Capture Item</a></li>
<li><a href="javascript:;" ng-click="retarget()"
ng-show="tab_pending">Retarget Request</a></li>
<li><a href="javascript:;" ng-click="cancel()"
- ng-show="(tab_pending || tab_inbound) && itemList.filterBorrower">Cancel Request</a></li>
+ ng-show="(tab_pending || tab_inbound) && orientation_borrower">Cancel Request</a></li>
<li><a href="javascript:;" ng-click="abort_transit()"
ng-show="tab_inbound || tab_outbound">Abort Transit</a></li>
<li><a href="javascript:;" ng-click="checkin()"
ng-show="tab_inbound">Receive Item</a></li>
<li><a href="javascript:;" ng-click="checkin()"
- ng-show="tab_circulating && itemList.filterBorrower">Check In</a></li>
+ ng-show="tab_circulating && orientation_borrower">Check In</a></li>
<!-- We need an on-shelf tab for this action to have a home
<li><a href="javascript:;"
ng-show="">Check Out</a></li>
-->
<li><a href="javascript:;" ng-click="mark_lost()"
- ng-show="tab_circulating && itemList.filterBorrower">Mark Lost</a></li>
+ ng-show="tab_circulating && orientation_borrower">Mark Lost</a></li>
<li><a href="javascript:;" ng-click="print()">Print</a></li>
</ul>
</div>
controller: 'RecordsCtrl',
resolve : resolver
});
-
- // Default to ILL management tabs
+
$routeProvider.when('/fulfillment/status/:barcode', {
templateUrl: './fulfillment/t_ill',
controller: 'ILLCtrl',
resolve : resolver
});
+ $routeProvider.when('/fulfillment/status', {
+ templateUrl: './fulfillment/t_ill',
+ controller: 'ILLCtrl',
+ resolve : resolver
+ });
- // Default to ILL management tabs
- $routeProvider.otherwise({
+ $routeProvider.when('/fulfillment/:orientation/:tab', {
templateUrl: './fulfillment/t_ill',
controller: 'ILLCtrl',
resolve : resolver
});
+ // Default to ILL management tabs
+ $routeProvider.otherwise({
+ redirectTo : '/fulfillment/borrower/pending'
+ });
+
$locationProvider.html5Mode(true);
})
function ($scope, $q, $compile, $timeout, $rootScope, $location,
$route, $routeParams, egNet, egAuth, ffService, egOrg) {
- // tabs
- var mytab = $location.path().match(/\/fulfillment\/([^\/]+)/)[1];
- $scope['tab_' + mytab] = true;
+ $scope.tabname = $routeParams.tab;
+ $scope.orientation = $routeParams.orientation;
+
+ // URL format for /status needs a wee bit of manual handling
+ if (!$scope.tabname) $scope.tabname = 'status';
+
+ // bools useful for templates
+ $scope['tab_' + $scope.tabname] = true;
+ $scope['orientation_' + $scope.orientation] = true;
+
// so our child controllers can access our route info
$scope.illRouteParams = $routeParams;
selected : {},
limit : 10, // TODO UI
offset : 0, // TODO UI
- filter_borrwer : true,
- filterLender : false,
-
- toggleFilters : function(lender) {
- $scope.itemList.filterBorrower = !lender;
- $scope.itemList.filterLender = lender;
- },
// select all rows in the list. if any are
// already selected, de-select all.
['$scope', '$q', 'egPCRUD', 'ffService',
function ($scope, $q, egPCRUD, ffService) {
- $scope.drawTable = function(filterLender) {
+ $scope.drawTable = function() {
var deferred = $q.defer();
$scope.itemList.items = [];
- $scope.itemList.toggleFilters(filterLender);
var fullPath = ffService.relatedOrgs();
var dest = fullPath; // inbound transits
var circ_lib = fullPath; // our copies
- if ($scope.itemList.filterBorrower) {
+ if ($scope.orientation_borrower) {
// borrower always means not-our-copies
circ_lib = {'not in' : fullPath};
}
['$scope', '$q', 'egPCRUD', 'ffService',
function ($scope, $q, egPCRUD, ffService) {
- $scope.drawTable = function(filterLender) {
+ $scope.drawTable = function() {
var deferred = $q.defer();
$scope.itemList.items = [];
- $scope.itemList.toggleFilters(filterLender);
var fullPath = ffService.relatedOrgs();
var copy_lib = fullPath; // our copies
var circ_lib = fullPath; // circulating here
- if ($scope.itemList.filterLender) {
+ if ($scope.orientation_lender) {
// borrower always means not-our-copies
circ_lib = {'not in' : fullPath};
} else {
if (hold_blob.volume) {
display.call_number = hold_blob.volume.label();
}
- if ($scope.itemList.filterLender)
+ if ($scope.orientation_lender)
display.next_action = 'ill-home-capture';
};
);
*/
- $scope.drawTable = function(filterLender) {
+ $scope.drawTable = function() {
$scope.itemList.items = [];
- $scope.itemList.toggleFilters(filterLender);
-
var fullPath = ffService.relatedOrgs();
var query = {
frozen : 'f'
};
- if ($scope.itemList.filterBorrower) {
+ if ($scope.orientation_borrower) {
// holds for my patrons originate "here"
// current_copy is not relevant
query.request_lib = fullPath;
$scope.firstPage = function() {
$scope.itemList.offset = 0;
- $scope.drawTable($scope.itemList.filterLender == true);
+ $scope.drawTable();
};
$scope.nextPage = function() {
$scope.itemList.offset += $scope.itemList.limit;
- $scope.drawTable($scope.itemList.filterLender == true);
+ $scope.drawTable();
};
$scope.prevPage = function() {
$scope.itemList.offset -= $scope.itemList.limit;
- $scope.drawTable($scope.itemList.filterLender == true);
+ $scope.drawTable();
};
$scope.drawTable();