'integer'
);
--- For backwards compat apply a max count value of 1 globally.
-INSERT INTO actor.org_unit_setting (org_unit, name, value)
- SELECT id, 'ui.staff.max_recent_patrons', '1'
- FROM actor.org_unit WHERE parent_ou IS NULL;
-
'integer'
);
--- For backwards compat apply a max count value of 1 globally.
-INSERT INTO actor.org_unit_setting (org_unit, name, value)
- SELECT id, 'ui.staff.max_recent_patrons', '1'
- FROM actor.org_unit WHERE parent_ou IS NULL;
-
COMMIT;
$scope.aous = egCore.env.aous;
$scope.auth_user_id = egCore.auth.user().id();
- // max recents setting is loaded during startup.
+ // max recents setting is loaded and scrubbed during startup.
// cache it in a local variable for ease of access.
egCore.org.settings('ui.staff.max_recent_patrons').then(function(s) {
- patronSvc.maxRecentPatrons = s['ui.staff.max_recent_patrons'] || 0;
+ patronSvc.maxRecentPatrons = s['ui.staff.max_recent_patrons'];
});
if (patron_id) {
egCore.org.settings('ui.staff.max_recent_patrons')
.then(function(s) {
var val = s['ui.staff.max_recent_patrons'];
- $scope.showRecentPatron = (val && val > 0);
- $scope.showRecentPatrons = (val && val > 1);
+ $scope.showRecentPatron = val > 0;
+ $scope.showRecentPatrons = val > 1;
});
}
}
set['webstaff.format.dates'] || 'shortDate';
$rootScope.egDateAndTimeFormat =
set['webstaff.format.date_and_time'] || 'short';
+
+ // default to 1 for backwards compat.
+ if (set['ui.staff.max_recent_patrons'] === null)
+ set['ui.staff.max_recent_patrons'] = 1
}
);
}