From: Bill Erickson Date: Thu, 3 Jul 2014 17:33:50 +0000 (-0400) Subject: patron holds : notify settings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d8bc7f719cc19251d04ea4c514d8f158566f2b6c;p=working%2FEvergreen.git patron holds : notify settings Signed-off-by: Bill Erickson --- 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 069af7d294..d1ff57fb91 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_holds.tt2 @@ -23,6 +23,8 @@ label="[% l('Set Desired Copy Quality') %]"> + diff --git a/Open-ILS/src/templates/staff/circ/share/t_hold_notification_prefs.tt2 b/Open-ILS/src/templates/staff/circ/share/t_hold_notification_prefs.tt2 new file mode 100644 index 0000000000..c0f55d2ab3 --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/share/t_hold_notification_prefs.tt2 @@ -0,0 +1,70 @@ + + + diff --git a/Open-ILS/src/templates/staff/css/circ.css.tt2 b/Open-ILS/src/templates/staff/css/circ.css.tt2 index 7bf4080303..f20c3862b7 100644 --- a/Open-ILS/src/templates/staff/css/circ.css.tt2 +++ b/Open-ILS/src/templates/staff/css/circ.css.tt2 @@ -45,6 +45,15 @@ but the ones I'm finding aren't quite cutting it..*/ margin-bottom: 0px; /* bootstrap default is 20px */ } +#hold-notify-settings div.row { margin-top: 12px; } +#hold-notify-settings div.row:not(.header-row):nth-child(odd) { + background-color: rgb(248, 248, 248); +} +#hold-notify-settings div.row:not(.header-row) { + border-bottom: 1px solid #CCC; +} + + [%# vim: ft=css %] 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 11ff507c61..ca54d5646d 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 @@ -123,11 +123,12 @@ function($scope, $q, $routeParams, egCore, egUser, patronSvc, $scope.set_copy_quality = function(items) { generic_update(items, 'set_copy_quality'); } - $scope.edit_pickup_lib = function(items) { generic_update(items, 'edit_pickup_lib'); } - + $scope.edit_notify_prefs = function(items) { + generic_update(items, 'edit_notify_prefs'); + } }]) 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 36896e7500..2d4808ed4d 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 @@ -65,10 +65,7 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { service.get_cancel_reasons = function() { if (egCore.env.ahrcc) return $q.when(egCore.env.ahrcc.list); return egCore.pcrud.retrieveAll('ahrcc', {}, {atomic : true}) - .then(function(list) { - egCore.env.absorbList(list, 'ahrcc') - return list; - }); + .then(function(list) { return egCore.env.absorbList(list, 'ahrcc').list }); } // Updates a batch of holds, notifies on each response. @@ -130,6 +127,51 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) { }).result; } + service.get_sms_carriers = function() { + if (egCore.env.csc) return $q.when(egCore.env.csc.list); + return egCore.pcrud.retrieveAll('csc', {}, {atomic : true}) + .then(function(list) { return egCore.env.absorbList(list, 'csc').list }); + } + + service.edit_notify_prefs = function(hold_ids) { + if (!hold_ids.length) return $q.when(); + return $modal.open({ + templateUrl : './circ/share/t_hold_notification_prefs', + controller : + ['$scope', '$modalInstance', 'sms_carriers', + function($scope, $modalInstance, sms_carriers) { + $scope.args = {} + $scope.sms_carriers = sms_carriers; + $scope.ok = function() { + + var vals = hold_ids.map(function(hold_id) { + var val = {id : hold_id}; + angular.forEach( + ['email', 'phone', 'sms'], + function(type) { + var key = type + '_notify'; + if ($scope.args['update_' + key]) + val[key] = $scope.args[key]; + } + ); + if ($scope.args.update_sms_carrier) + val.sms_carrier = $scope.args.sms_carrier.id(); + return val; + }); + + service.update_holds(vals).finally(function() { + $modalInstance.close(); + }); + } + $scope.cancel = function() { $modalInstance.dismiss() } + } + ], + resolve : { + sms_carriers : service.get_sms_carriers + } + }).result; + } + return service; }])