patronSvc , patronRegSvc , egUnloadPrompt, egAlertDialog ,
egWorkLog) {
+ var default_hold_notify = ':phone:email';
+
$scope.page_data_loaded = false;
$scope.hold_notify_type = { phone : null, email : null, sms : null };
$scope.clone_id = patronRegSvc.clone_id = $routeParams.clone_id;
hold_notify_methods.push('sms');
}
- $scope.user_settings['opac.hold_notify'] = hold_notify_methods.join(':');
+ // always include a leading ':' to prevent saving an empty string
+ // this allows a user to specify that they do not want any notifications
+ // (otherwise the falsey empty string will fallback to default)
+ var notify_string = ':'+hold_notify_methods.join(':');
+ // save only if there already was a value or the new value is non-default
+ if($scope.user_settings['opac.hold_notify'] || notify_string !== default_hold_notify){
+ $scope.user_settings['opac.hold_notify'] = notify_string;
+ }
}
// dialog for selecting additional permission groups
}
function extract_hold_notify() {
- var notify = $scope.user_settings['opac.hold_notify'];
- if (!notify) return;
+ var notify = $scope.user_settings['opac.hold_notify'] || default_hold_notify;
$scope.hold_notify_type.phone = Boolean(notify.match(/phone/));
$scope.hold_notify_type.email = Boolean(notify.match(/email/));
$scope.hold_notify_type.sms = Boolean(notify.match(/sms/));