From 46163cec0639e740c8b82dfb213bbd4bd8a0d031 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 3 Jul 2014 16:38:46 -0400 Subject: [PATCH] patron holds / transfer to marked title, second half Signed-off-by: Bill Erickson --- .../src/templates/staff/circ/patron/t_holds.tt2 | 2 ++ .../templates/staff/circ/share/hold_strings.tt2 | 4 +++ .../web/js/ui/default/staff/circ/patron/holds.js | 4 +++ .../web/js/ui/default/staff/circ/services/holds.js | 29 ++++++++++++++++++++-- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 index 9c06d4460a..f720a4f0db 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 @@ -35,6 +35,8 @@ label="[% l('Set Top of Queue') %]"> + diff --git a/Open-ILS/src/templates/staff/circ/share/hold_strings.tt2 b/Open-ILS/src/templates/staff/circ/share/hold_strings.tt2 index 8496380753..1cf5111920 100644 --- a/Open-ILS/src/templates/staff/circ/share/hold_strings.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/hold_strings.tt2 @@ -17,6 +17,10 @@ s.SET_TOP_OF_QUEUE = '{{num_holds}}') %]"; s.CLEAR_TOP_OF_QUEUE = "[% l('Unset the Top of Queue flag for [_1] Hold(s)?', '{{num_holds}}') %]"; +s.TRANSFER_HOLD_TO_TITLE = + "[% l('Tranfer [_1] Hold(s) to bib record ID [_2]?', '{{num_holds}}', '{{bib_id}}') %]"; +s.NO_HOLD_TRANSFER_TITLE_MARKED = + "[% l('No record is marked as a hold transfer target!') %]"; }]); diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js index 0f310e1967..9c47198886 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js @@ -145,6 +145,10 @@ function($scope, $q, $routeParams, egCore, egUser, patronSvc, generic_update(items, 'clear_top_of_queue'); } + $scope.transfer_to_marked_title = function(items) { + generic_update(items, 'transfer_to_marked_title'); + } + }]) diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index 62946607f0..94ef30b3ab 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -6,8 +6,8 @@ angular.module('egCoreMod') .factory('egHolds', - ['$modal','$q','egCore','egAlertDialog','egConfirmDialog', -function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { + ['$modal','$q','egCore','egAlertDialog','egConfirmDialog','egAlertDialog', +function($modal , $q , egCore , egAlertDialog , egConfirmDialog , egAlertDialog) { var service = {}; @@ -253,6 +253,31 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { hold_ids, 'CLEAR_TOP_OF_QUEUE', 'cut_in_line', null); } + service.transfer_to_marked_title = function(hold_ids) { + if (!hold_ids.length) return $q.when(); + + var bib_id = egCore.hatch.getLocalItem( + 'eg.circ.hold.title_transfer_target'); + + if (!bib_id) { + // no target marked + return egAlertDialog.open( + egCore.strings.NO_HOLD_TRANSFER_TITLE_MARKED).result; + } + + return egConfirmDialog.open( + egCore.strings.TRANSFER_HOLD_TO_TITLE, '', { + num_holds : hold_ids.length, + bib_id : bib_id + } + ).result.then(function() { + return egCore.net.request( + 'open-ils.circ', + 'open-ils.circ.hold.change_title.specific_holds', + egCore.auth.token(), bib_id, hold_ids); + }); + } + return service; }]) -- 2.11.0