From: Jason Etheridge Date: Fri, 11 Nov 2022 18:14:42 +0000 (-0500) Subject: LP1996423 restore templated patron note printing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcollab%2Fphasefx%2Flp1996423-print-note;p=working%2FEvergreen.git LP1996423 restore templated patron note printing Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/templates/staff/circ/patron/t_messages.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_messages.tt2 index 5bc5246e33..e66e890a81 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_messages.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_messages.tt2 @@ -15,6 +15,8 @@ handler="editPenalty"> + @@ -59,6 +61,8 @@ + diff --git a/Open-ILS/src/templates/staff/share/t_patron_note.tt2 b/Open-ILS/src/templates/staff/share/t_patron_note.tt2 new file mode 100644 index 0000000000..765343d6bc --- /dev/null +++ b/Open-ILS/src/templates/staff/share/t_patron_note.tt2 @@ -0,0 +1,28 @@ + +

[% l( + 'Pertaining to [_1], [_2] [_3] : [_4]', + '{{note.usr.family_name}}', + '{{note.usr.first_given_name}}', + '{{note.usr.second_given_name}}', + '{{note.usr.card.barcode}}') %]

+ +

[% l('Created on [_1]', '{{note.create_date | date:$root.egDateAndTimeFormat}}') %]

+{{note.title}} +
+

{{note.message}}

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 fec6e90aef..e22a744548 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 @@ -1113,6 +1113,24 @@ function($scope , $q , $routeParams, egCore , $uibModal , egConfirmDialog , pat }); }); } + + // print the selected note + $scope.printNote = function(selected) { + if (selected.length !== 1) return; + + var hash = egCore.idl.toHash(selected[0]); + hash.usr = egCore.idl.toHash($scope.patron()); + + // for backwards compatability with original stock template + hash.value = hash.message; + + egCore.print.print({ + context : 'default', + template : 'patron_note', + scope : {note : hash} + }); + } + }])