From 6bfc5915c4dc350f00a40111d59938b1d8739d5a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 20 Aug 2014 16:45:47 -0400 Subject: [PATCH] browser client experiment w/ idl/pcrud-based pull list; in progress Signed-off-by: Bill Erickson --- Open-ILS/examples/fm_IDL.xml | 10 ++-- .../src/templates/staff/circ/holds/t_pull_list.tt2 | 54 ++++++++++++++++++++-- Open-ILS/web/js/ui/default/staff/circ/holds/app.js | 48 +++++-------------- Open-ILS/web/js/ui/default/staff/services/grid.js | 15 +++--- 4 files changed, 75 insertions(+), 52 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index c418c58a7d..1dc2084ed7 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -5355,7 +5355,7 @@ SELECT usr, - + @@ -5502,7 +5502,7 @@ SELECT usr, - + @@ -5587,7 +5587,7 @@ SELECT usr, - + @@ -5669,7 +5669,7 @@ SELECT usr, - + @@ -5728,7 +5728,7 @@ SELECT usr, - + diff --git a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 index 8cea1d1e72..6f3fac6dbf 100644 --- a/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 +++ b/Open-ILS/src/templates/staff/circ/holds/t_pull_list.tt2 @@ -4,8 +4,8 @@ - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js index 21e9ffc400..1b5bf5cd14 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/holds/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/holds/app.js @@ -35,11 +35,6 @@ angular.module('egHoldsApp', $routeProvider.otherwise({redirectTo : '/circ/holds/shelf'}); }) -.factory('holdUiSvc', function() { - return { - holds : [] // cache - } -}) .controller('HoldsShelfCtrl', ['$scope','$q','$routeParams','$window','$location','egCore','egHolds','egHoldGridActions','egCirc','egGridDataProvider', @@ -206,44 +201,25 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e }]) .controller('HoldsPullListCtrl', - ['$scope','$q','$routeParams','$window','$location','egCore','egHolds','egCirc','egGridDataProvider','egHoldGridActions','holdUiSvc', -function($scope , $q , $routeParams , $window , $location , egCore , egHolds , egCirc , egGridDataProvider , egHoldGridActions , holdUiSvc) { + ['$scope','$q','$routeParams','$window','$location','egCore','egHolds','egCirc','egHoldGridActions', +function($scope , $q , $routeParams , $window , $location , egCore , egHolds , egCirc , egHoldGridActions) { $scope.detail_hold_id = $routeParams.hold_id; - var provider = egGridDataProvider.instance({}); - $scope.gridDataProvider = provider; + $scope.gridControls = { + setQuery : function() { + return {pickup_lib : egCore.auth.user().ws_ou()} + }, + setSort : function() { + return ['copy_location_order_position','call_number_sort_key'] + } + } $scope.grid_actions = egHoldGridActions; $scope.grid_actions.refresh = function() { - holdUiSvc.holds = []; - provider.refresh(); + $scope.gridControls.refresh(); } - provider.get = function(offset, count) { - - if (holdUiSvc.holds[offset]) { - return provider.arrayNotifier(holdUiSvc.holds, offset, count); - } - - var deferred = $q.defer(); - var recv_index = 0; - - // fetch the IDs - egCore.net.request( - 'open-ils.circ', - 'open-ils.circ.hold_pull_list.fleshed.stream', - egCore.auth.token(), count, offset - ).then( - deferred.resolve, null, - function(hold_data) { - egHolds.local_flesh(hold_data); - holdUiSvc.holds[offset + recv_index++] = hold_data; - deferred.notify(hold_data); - } - ); - - return deferred.promise; - } + // TODO: update the rest of the func for ahopl $scope.detail_view = function(action, user_data, items) { if (h = items[0]) { diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index a554e93643..ee38e1a7df 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -1150,16 +1150,17 @@ angular.module('egGridMod', var part = path_parts[path_idx]; idl_field = class_obj.field_map[part]; - if (idl_field && idl_field['class'] && ( - idl_field.datatype == 'link' || - idl_field.datatype == 'org_unit')) { - class_obj = egCore.idl.classes[idl_field['class']]; + if (idl_field) { + if (idl_field['class'] && ( + idl_field.datatype == 'link' || + idl_field.datatype == 'org_unit')) { + class_obj = egCore.idl.classes[idl_field['class']]; + } + } else { + return null; } - // else, path is not in the IDL, which is fine } - if (!idl_field) return null; - return { idl_field :idl_field, idl_class : class_obj -- 2.11.0