<div class="modal-footer">
<div class="row">
<div class="col-md-2">
- <input type="text" class="form-control"
- ng-model="args.initials" placeholder="[% l('Initials') %]" required/>
+ <input type="text" class="form-control" ng-hide="!require_initials"
+ ng-model="args.initials" placeholder="[% l('Initials') %]" ng-required="require_initials"/>
</div>
<div class="col-md-10 pull-right">
<input type="submit" class="btn btn-primary" value="[% l('OK') %]"/>
var service = {
// auto-override these events after the first override
auto_override_checkout_events : {},
+ require_initials : false
};
+ egCore.startup.go().finally(function() {
+ egCore.org.settings([
+ 'ui.staff.require_initials.patron_standing_penalty'
+ ]).then(function(set) {
+ service.require_initials = Boolean(set['ui.staff.require_initials.patron_standing_penalty']);
+ });
+ });
+
service.reset = function() {
service.auto_override_checkout_events = {};
}
function($scope , $modalInstance , staffPenalties) {
$scope.focusNote = true;
$scope.penalties = staffPenalties;
+ $scope.require_initials = service.require_initials;
$scope.args = {penalty : 21}; // default to Note
$scope.setPenalty = function(id) {
args.penalty = id;
var pen = new egCore.idl.ausp();
pen.usr(user_id);
pen.org_unit(egCore.auth.user().ws_ou());
- pen.note(args.note + ' [' + args.initials + ']');
+ pen.note(args.note);
+ if (args.initials) pen.note(args.note + ' [' + args.initials + ']');
if (args.custom_penalty) {
pen.standing_penalty(args.custom_penalty);
} else {
function($scope , $modalInstance , staffPenalties) {
$scope.focusNote = true;
$scope.penalties = staffPenalties;
+ $scope.require_initials = service.require_initials;
$scope.args = {
penalty : usr_penalty.standing_penalty().id(),
note : usr_penalty.note()
}).result.then(
function(args) {
usr_penalty.note(args.note);
+ if (args.initials) usr_penalty.note(args.note + ' [' + args.initials + ']');
usr_penalty.standing_penalty(args.penalty);
return egCore.pcrud.update(usr_penalty);
}