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}}') %]";
}]);
</script>
}])
.controller('PatronNotesCtrl',
- ['$scope', '$filter', '$routeParams','$location','egCore','patronSvc','$uibModal',
-function($scope, $filter, $routeParams , $location , egCore , patronSvc , $uibModal) {
+ ['$scope','$filter','$routeParams','$location','egCore','patronSvc','$uibModal',
+ 'egConfirmDialog',
+function($scope, $filter , $routeParams , $location , egCore , patronSvc , $uibModal,
+ egConfirmDialog) {
$scope.initTab('other', $routeParams.id);
var usr_id = $routeParams.id;
// 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