From 8e5ae09bfbaf1195cbb17c78b7b9a95d99e2ebb7 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 9 Jul 2019 10:20:09 -0400 Subject: [PATCH] Create new view file for account Reveals Setup account reveal into it's own view file so code is not duplicated for dashboard and account pages. --- models/admin/billing/index.php | 1 + views/admin/billing/accountReveals.html | 126 ++++++++++++++++++++++++ views/admin/billing/accounts.html | 124 +---------------------- views/admin/billing/index.html | 3 +- views/admin/billing/payments.html | 4 +- 5 files changed, 134 insertions(+), 124 deletions(-) create mode 100644 views/admin/billing/accountReveals.html diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 87ae51e..f5eef1a 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -304,6 +304,7 @@ class GlmMembersAdmin_billing_index extends GlmDataAccounts 'filterActive' => $filterActive, 'filterArchived' => $filterArchived, 'searchName' => $searchName, + 'pluginAssetsUrl' => GLM_MEMBERS_BILLING_PLUGIN_BASE_URL . '/assets/' ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/billing/accountReveals.html b/views/admin/billing/accountReveals.html new file mode 100644 index 0000000..201531b --- /dev/null +++ b/views/admin/billing/accountReveals.html @@ -0,0 +1,126 @@ +{* Foundation 6 Reveal modals for Billing Account Tables *} + +{* Reveal for Billing Info *} +
+
+{* Reveal for Billing Info Success *} +
+

Billing Info Updated!

+ +
+{* Reveal for Billing Statements *} +
+ +
+{* Reveal for Billing Payments *} +
+
+{* Reveal for Billing View Invoice *} +
+
+{* Ajax Loading Graphic *} + + + diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index bb14509..327d4a4 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -2,10 +2,10 @@
-
Accounts Export
-

Accounts

+
Accounts Export
+ {include file='admin/billing/accountSearchForm.html'}
@@ -143,129 +143,11 @@ accountEmployee = false; } - $('.account-billing').on('click', function(e){ - e.preventDefault(); - var member = $(this).data('member'); - var $modal = $('#glmBillingInfo'); - - $.ajax({ - url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=ajaxBillingInfo&option=account&member=' + member, - cache: false, - beforeSend: startAjax, - complete: completeAjax, - }) - .done(function(resp){ - $modal.html(resp).foundation('open').trigger('resizeme.zp.reveal'); - }); - return false; - }); - - $('.account-member-statements').on('click', function(e){ - e.preventDefault(); - var member = $(this).data('member'); - var $modalStm = $('#glmBillingStatements'); - - $.ajax({ - url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=ajaxBillingInfo&option=list&member=' + member, - cache: false, - beforeSend: startAjax, - complete: completeAjax, - }) - .done(function(resp){ - $modalStm.html(resp).foundation('open').trigger('resizeme.zp.reveal'); - - // Pay Invoice link - $('.payInvoice').on('click', function(e){ - e.preventDefault(); - var member = $(this).data('member'); - var $modalPayment = $('#glmBillingPayment'); - $.ajax({ - url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=ajaxBillingInfo&option=makepayment&member=' + member, - cache: false, - beforeSend: startAjax, - complete: completeAjax, - }).done(function(resp){ - $modalPayment.html(resp).foundation('open').trigger('resizeme.zp.reveal'); - }); - return false; - }); - - // Make A Payment link - $('.makeAPayment').on('click', function(e){ - e.preventDefault(); - var member = $(this).data('member'); - var $modalPayment = $('#glmBillingPayment'); - $.ajax({ - url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=ajaxBillingInfo&option=makepaymentadjustment&member=' + member, - cache: false, - beforeSend: startAjax, - complete: completeAjax, - }).done(function(resp){ - $modalPayment.html(resp).foundation('open').trigger('resizeme.zp.reveal'); - }); - - return false; - }); - - // View Link - $('.view').on('click', function(e){ - e.preventDefault(); - var member = $(this).data('member'); - var id = $(this).data('id'); - var $modalVidew = $('#glmBillingView'); - $.ajax({ - url: '{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=ajaxBillingInfo&option=view&member=' + member + '&id=' + id, - cache: false, - beforeSend: startAjax, - complete: completeAjax, - }).done(function(resp){ - $modalVidew.html(resp).foundation('open').trigger('resizeme.zp.reveal'); - - }); - - return false; - }); - - }); - return false; - }); - - function startAjax(){ - $('#glmLoading').show(); - } - function completeAjax(){ - $('#glmLoading').hide(); - }; }); - {* Reveal for Billing Info *} -
-
- {* Reveal for Billing Info Success *} -
-

Billing Info Updated!

- -
- {* Reveal for Billing Statements *} -
- -
- {* Reveal for Billing Payments *} -
-
- {* Reveal for Billing View Invoice *} -
-
- {* Ajax Loading Graphic *} - + {include file='admin/billing/accountReveals.html'}
{include file='admin/footer.html'} diff --git a/views/admin/billing/index.html b/views/admin/billing/index.html index ddd843d..b9609a8 100644 --- a/views/admin/billing/index.html +++ b/views/admin/billing/index.html @@ -47,7 +47,7 @@ View Statements | - + {if $t.boss.value} @@ -132,6 +132,7 @@ }); + {include file='admin/billing/accountReveals.html'} {include file='admin/footer.html'} diff --git a/views/admin/billing/payments.html b/views/admin/billing/payments.html index 78c976b..c7a8ee4 100644 --- a/views/admin/billing/payments.html +++ b/views/admin/billing/payments.html @@ -2,13 +2,13 @@
+

Payments

+
Payments Export
Make Payment
-

Payments

-
-- 2.17.1