From: Kyle Huckins Date: Tue, 4 Oct 2016 17:26:30 +0000 (-0700) Subject: LP#1537215 Delete Note Warning X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=725e5d7563d7c7b2a08e18041fee01cae0220af3;p=working%2FEvergreen.git LP#1537215 Delete Note Warning Call egConfirmDialog to confirm deletion of patron note. Create strings for Note Deletion. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/web/js/ui/default/staff/circ/patron/app.js modified: Open-ILS/src/templates/staff/circ/patron/index.tt2 --- diff --git a/Open-ILS/src/templates/staff/circ/patron/index.tt2 b/Open-ILS/src/templates/staff/circ/patron/index.tt2 index cc3ee09827..63e1f2ac79 100644 --- a/Open-ILS/src/templates/staff/circ/patron/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/index.tt2 @@ -49,6 +49,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) { s.PAYMENT_WARN_AMOUNT = "[% l('Are you sure you want to apply a payment of $[_1]?', '{{payment_amount}}') %]"; s.PAYMENT_WARN_AMOUNT_TITLE = "[% l('Verify Payment Amount') %]"; s.PAYMENT_OVER_MAX = "[% l('Payments over $[_1] are denied by policy.', '{{max_amount}}') %]"; + s.PATRON_NOTE_DELETE_CONFIRM_TITLE = "[% l('Delete Note?') %]"; + s.PATRON_NOTE_DELETE_CONFIRM = "[% l('Delete the note titled \"[_1]\" created on [_2]?', '{{note_title}}', '{{create_date | date}}') %]"; }]); 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 350a48af9b..3ec8c04bcc 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 @@ -1310,7 +1310,9 @@ function($scope, $routeParams , $location , egCore , patronSvc) { .controller('PatronNotesCtrl', ['$scope','$routeParams','$location','egCore','patronSvc','$uibModal', -function($scope, $routeParams , $location , egCore , patronSvc , $uibModal) { + 'egConfirmDialog', +function($scope, $routeParams , $location , egCore , patronSvc , $uibModal, + egConfirmDialog) { $scope.initTab('other', $routeParams.id); var usr_id = $routeParams.id; @@ -1354,7 +1356,14 @@ function($scope, $routeParams , $location , egCore , patronSvc , $uibModal) { // delete the selected note $scope.deleteNote = function(note) { - egCore.pcrud.remove(note).then(function() {refreshPage()}); + egConfirmDialog.open( + egCore.strings.PATRON_NOTE_DELETE_CONFIRM_TITLE, egCore.strings.PATRON_NOTE_DELETE_CONFIRM, + {ok : function() { + egCore.pcrud.remove(note).then(function() {refreshPage()}); + }, + note_title : note.title(), + create_date : note.create_date() + }); } // print the selected note