From 2850ba01c4d825108e5a6dce79a9e946e3ff6607 Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Fri, 2 Jun 2017 15:20:14 -0400 Subject: [PATCH] LP#1642035-Small DRY refactor to regctl.js compress_hold_notify() Signed-off by: Cesar Velez --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index cb0b0fa57f..ae4d05ea4a 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -1504,21 +1504,18 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , // Translate hold notify preferences from the form/scope back into a // single user setting value for opac.hold_notify. function compress_hold_notify() { - var hold_notify = ''; - var splitter = ''; + var hold_notify_methods = []; if ($scope.hold_notify_type.phone) { - hold_notify = 'phone'; - splitter = ':'; + hold_notify_methods.push('phone'); } if ($scope.hold_notify_type.email) { - hold_notify = hold_notify + splitter + 'email'; - splitter = ':'; + hold_notify_methods.push('email'); } if ($scope.hold_notify_type.sms) { - hold_notify = hold_notify + splitter + 'sms'; - splitter = ':'; + hold_notify_methods.push('sms'); } - $scope.user_settings['opac.hold_notify'] = hold_notify; + + $scope.user_settings['opac.hold_notify'] = hold_notify_methods.join(':'); } // dialog for selecting additional permission groups -- 2.11.0