lp1777677 Show test notification buttons by retrieved data
authorKyle Huckins <khuckins@catalyte.io>
Wed, 28 Nov 2018 22:10:24 +0000 (22:10 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 11 Sep 2020 19:51:31 +0000 (15:51 -0400)
- Prevents test notification buttons from displaying when email or sms
data is input but no data exists on server.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index d147b45..966f9bb 100644 (file)
@@ -461,7 +461,7 @@ within the "form" by name for validation.
 <div class="row reg-field-row" ng-show="show_field('au.email')">
   [% draw_field_label('au', 'email') %]
   [% draw_form_input('au', 'email', '', 'email') %]
-  <div class="col-md-3" ng-if="patron.email && !patron.isnew">
+  <div class="col-md-3" ng-if="base_email && !patron.isnew">
     <button class="btn btn-default" ng-click="send_test_message({test_type:'email'})">[% l('Send Test Email') %]</button>
   </div>
   <div class="col-md-3 patron-reg-example">
@@ -786,7 +786,7 @@ within the "form" by name for validation.
       ng-blur="handle_field_changed(user_settings, 'opac.default_sms_notify')"
       type='text'/>
   </div>
-  <div class="col-md-3" ng-if="user_settings['opac.default_sms_notify'] && !patron.isnew">
+  <div class="col-md-3" ng-if="base_default_sms && !patron.isnew">
     <button class="btn btn-default" ng-click="send_test_message({test_type:'sms_text'})">[% l('Send Test Text') %]</button>
   </div>
 </div>
index 0d7269b..e78cda9 100644 (file)
@@ -1370,6 +1370,8 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
         // in standalone mode, we have no patronSvc
         var prs = patronRegSvc;
         $scope.patron = patron;
+        $scope.base_email = patron.email;
+        $scope.base_default_sms = prs.user_settings['opac.default_sms_notify']
         $scope.field_doc = prs.field_doc;
         $scope.edit_profiles = prs.edit_profiles;
         $scope.edit_profile_entries = prs.edit_profile_entries;