From: Steve Sutton Date: Wed, 24 Jul 2019 15:15:40 +0000 (-0400) Subject: Setup notification preview X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e39726da33aa173a929ba429af35e215a625ebb7;p=WP-Plugins%2Fglm-member-db-billing.git Setup notification preview test in mobile --- diff --git a/classes/notifications.php b/classes/notifications.php index 6c38217..d64f5f3 100644 --- a/classes/notifications.php +++ b/classes/notifications.php @@ -86,6 +86,8 @@ class GlmNotifications $invTypeData = $BillingSupport->getInvoiceTypeById( $account['invoice_type'] ); $currentAmount = $invTypeData['amount']; } + } else { + $account = $test_data['account']; } // get the Notification type @@ -190,6 +192,11 @@ class GlmNotifications $account_data['account']['first_name'] = $account['billing_fname']; $account_data['account']['last_name'] = $account['billing_lname']; } + } else { + $account_data = array( + 'account' => $test_data['account'], + 'contact' => $test_data['contact'], + ); } // Merge any data passed into this method $account_data['data'] = $data; diff --git a/models/admin/billing/notifications.php b/models/admin/billing/notifications.php index 1467feb..6d8a67a 100644 --- a/models/admin/billing/notifications.php +++ b/models/admin/billing/notifications.php @@ -153,8 +153,39 @@ class GlmMembersAdmin_billing_notifications extends GlmDataNotificationTypes $view = 'preview'; $testData = array( - 'account' => array(), + 'account' => array( + 'first_name' => 'Test', + 'fname' => 'Test', + 'last_name' => 'Person', + 'lname' => 'Person', + 'contact_name' => 'Test Person', + 'name' => 'Test Member', + 'email' => 'test@gaslightmedia.com', + 'addr1' => '120 E Lake St.', + 'addr2' => 'P.O. Box 209', + 'city' => 'Petoskey', + 'state' => 'MI', + 'zip' => '49770', + 'phone' => '(231) 555-1234', + 'company' => 'Gaslight Media', + 'position' => 'Tester', + 'renewal_date' => '01/01/2018', + 'current_due' => '100.00', + ), 'contact' => array( + 'company' => 'Gaslight Media', + 'fname' => 'Test', + 'lname' => 'Person', + 'title' => 'Tester', + 'city' => 'Petoskey', + 'state' => array( + 'value' => 'MI' + ), + 'zip' => '49770', + 'email' => 'test@gaslightmedia.com', + 'office_phone' => '(231) 555-1234', + 'mobile_phone' => '(231) 555-2345', + 'fax' => '(231) 555-3456', ) ); $Notifications = new GlmNotifications( $this->wpdb, $this->config ); diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index ba76e9e..06b76de 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -26,8 +26,7 @@ {/if}
- - +
diff --git a/views/admin/billing/editInvoiceType.html b/views/admin/billing/editInvoiceType.html index b970fc7..fe9a142 100644 --- a/views/admin/billing/editInvoiceType.html +++ b/views/admin/billing/editInvoiceType.html @@ -121,7 +121,7 @@ 'field' => 'amount', 'label' => 'Amount', 'pattern' => 'number', - 'required' => $data.fieldRequired.amount, + 'required' => true, 'errorText' => 'Amount is Required', 'dataError' => $data.fieldFail.amount ]} @@ -226,6 +226,19 @@ } }); + // Either the Dynamic Amount is checked or Amount is required + $('#dynamic_amount').on('change', function(){ + var amount = $('#amount'); + if ( $(this).is(':checked')) { + amount.prop( 'required', false ); + amount.focus().blur(); + } else { + amount.prop( 'required', true ); + amount.focus().blur(); + } + }); + + /* * Check for input changes */ diff --git a/views/admin/billing/editNotificationType.html b/views/admin/billing/editNotificationType.html index 322ff32..5c4d04d 100644 --- a/views/admin/billing/editNotificationType.html +++ b/views/admin/billing/editNotificationType.html @@ -45,9 +45,9 @@ {* Notification Insert Error *} {$ui = [ - 'label' => 'Notification Added', - 'active' => $notificationAdded, - 'type' => 'success' + 'label' => 'Notification Insert Error', + 'active' => $notificationInsertError, + 'type' => 'alert' ]} {include file="ui/f6/callout.html"} @@ -278,9 +278,6 @@
ID