From 3513cb170d100c11c9199fbb47c31aefc182b173 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 27 Jul 2018 15:10:23 -0400 Subject: [PATCH] Adding Billing tab and setup name for custom fields from option. Name of custom fields is from wp option. Setting up the billing section. --- models/admin/contacts/index.php | 8 ++++++++ views/admin/contacts/edit.html | 23 ++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/models/admin/contacts/index.php b/models/admin/contacts/index.php index 0b15688..fa127b7 100644 --- a/models/admin/contacts/index.php +++ b/models/admin/contacts/index.php @@ -140,6 +140,7 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts $customFieldResults = false; $member_types = false; $contactUpdateError = false; + $billingFieldResults = false; $where = ''; @@ -453,7 +454,9 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts if ($contactInfo['status']) { $contactInfo = $this->editEntry(($_REQUEST['id']-0)); + // Apply Filter to save the custom field data $customFieldResults = apply_filters( 'glm-member-db-save-custom-fields', $_REQUEST['id']-0 ); + // Deal with Custom field errors if(is_array($customFieldResults)){ $contactUpdated = false; $contactUpdateError = true; @@ -461,6 +464,10 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts $contactUpdated = true; $contactUpdateError = false; } + // Apply Filter to save billing data + if ( $this->memberID ) { + $billingFieldResults = apply_filters( 'glm-members-billing-contact-save-data', $this->memberID ); + } // Get the wordpress user ID $wpUser = get_user_by('email', $contactInfo['fieldData']['email']); @@ -786,6 +793,7 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts 'member_types' => $member_types, 'contactUpdateError' => $contactUpdateError, 'errorMessage' => false, + 'billingFieldResults' => $billingFieldResults, ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/contacts/edit.html b/views/admin/contacts/edit.html index 5d9fae1..f97a4df 100644 --- a/views/admin/contacts/edit.html +++ b/views/admin/contacts/edit.html @@ -143,7 +143,7 @@
Account Profile
- + @@ -151,7 +151,7 @@ - + - +
Contact For {$memberData.name} {else} @@ -364,7 +364,7 @@ {if $contactInfo.fieldFail.image}

{$contactInfo.fieldFail.image}

{/if}
Management/Access to @@ -558,7 +558,7 @@
-

Organization/Company Information

+

Organization/Company Information

@@ -738,8 +738,17 @@
+ {if apply_filters( 'glm-members-billing-enabled', false )} +
+

Billing Info

+
+
+ {apply_filters( 'glm-members-billing-contact-form', '', $contactInfo.fieldData.ref_dest )} +
+ {/if} +
-

Custom Fields

+

{apply_filters( 'glm-members-billing-contact-tab-name', '' )}

@@ -754,14 +763,14 @@
-

Notes

+

Notes

- -- 2.17.1
+ {if $contactInfo.fieldFail.notes}

{$contactInfo.fieldFail.notes}

{/if}