handler="editPenalty"></eg-grid-action>
<eg-grid-action label="[% l('Archive Note') %]"
handler="archivePenalty"></eg-grid-action>
+ <eg-grid-action label="[% l('Print Note') %]"
+ handler="printNote"></eg-grid-action>
<eg-grid-field path="read_date"></eg-grid-field>
<eg-grid-field path="deleted" required hidden></eg-grid-field>
<eg-grid-action label="[% l('Unarchive Note') %]"
handler="unarchivePenalty"></eg-grid-action>
+ <eg-grid-action label="[% l('Print Note') %]"
+ handler="printNote"></eg-grid-action>
<eg-grid-field path="read_date"></eg-grid-field>
<eg-grid-field path="deleted" required hidden></eg-grid-field>
--- /dev/null
+<!--
+Template for printing a patron note. Fields include:
+
+* note.usr.family_name
+* note.usr.first_name
+* note.usr.second_given_name
+* note.usr.card.barcode
+* note.standing_penalty.name
+* note.staff.usrname
+* note.pub
+* note.title
+* note.message
+* note.read_date
+* note.org_unit.shortname
+* note.create_date
+
+-->
+<h3>[% 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}}') %]</h3>
+
+<p>[% l('Created on [_1]', '{{note.create_date | date:$root.egDateAndTimeFormat}}') %]</p>
+<b>{{note.title}}</b>
+<br/>
+<p>{{note.message}}</p>
});
});
}
+
+ // 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}
+ });
+ }
+
}])