From 26a73eaa513b559850d08abd29d921b27a6b2520 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 Signed-off-by: Kathy Lussier --- .../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 9d02459ba6..4e53fde217 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 @@ -1500,21 +1500,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.43.2