From 64ed7914fd1969d411cc06edf051ae6c8e6a9a4b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 4 Mar 2014 13:54:20 -0500 Subject: [PATCH] web staff: experimenting with websockets; api_level; patron search Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/t_base_js.tt2 | 6 ++++ .../web/js/ui/default/staff/circ/patron/app.js | 39 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/staff/t_base_js.tt2 b/Open-ILS/src/templates/staff/t_base_js.tt2 index e1fd7a8bcc..b9d825d904 100644 --- a/Open-ILS/src/templates/staff/t_base_js.tt2 +++ b/Open-ILS/src/templates/staff/t_base_js.tt2 @@ -16,7 +16,13 @@ + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index edb846a13d..0d8c02bc53 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -301,7 +301,8 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egEnv, } // send compiled search; get user IDs - function sendSearch(args) { + /* + function __sendSearch(args) { search = compileSearch(args); var home_ou = search.home_ou; @@ -313,8 +314,8 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egEnv, egNet.request( 'open-ils.actor', 'open-ils.actor.patron.search.advanced', - egAuth.token(), search, 100 /* limit */, - [ /* sort */ + egAuth.token(), search, 100, + [ // sort "family_name ASC", "first_given_name ASC", "second_given_name ASC", @@ -327,6 +328,38 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egEnv, retrieveUsers(ids); }); }; + */ + + // alt form which receives fleshed user objects + function sendSearch(args) { + search = compileSearch(args); + + var home_ou = search.home_ou; + delete search.home_ou; + var inactive = search.inactive; + delete search.inactive; + + console.debug('patron search ' + js2JSON(search)); + egNet.request( + 'open-ils.actor', + 'open-ils.actor.patron.search.advanced.fleshed', + egAuth.token(), search, 50 /* limit */, + [ /* sort */ + "family_name ASC", + "first_given_name ASC", + "second_given_name ASC", + "dob DESC" + ], + inactive, + home_ou, + egUser.defaultFleshFields + + ).then(null, null, function(user) { + patronSvc.localFlesh(user); + $scope.patrons.items[$scope.patrons.items.length] = user; + }); + }; + // fetch users by id and add them to the patrons list function retrieveUsers(ids) { -- 2.11.0