Now contact profile edit has the custom fields.
$contactUpdated = false;
$contactMembers = false;
$membersList = false;
- $newEmail = false;
- $newEmailError = false;
+ $newEmail = false;
+ $newEmailError = false;
$customFieldResults = false;
$view = 'admin/profile/index.html';
// If the submission was a success
if ($this->contactInfo['status']) {
+ $this->contactInfo = $this->editEntry(($_REQUEST['id']-0));
+
+ $customFieldResults = apply_filters( 'glm-member-db-save-custom-fields', $_REQUEST['id']-0 );
$contactUpdated = true;
$this->contactInfo = $this->editEntry($this->contactID);
+ $contactInfoID = $this->contactInfo['fieldData']['id'];
+ $customFieldResults = apply_filters( 'glm-member-db-save-custom-fields', $contactInfoID );
+
// If the contact wasn't found, then set ID to false
if (!$this->contactInfo['status']) {
$this->contactID = false;
// Compile template data
$templateData = array(
- 'option' => $option,
- 'contactID' => $this->contactID,
- 'contactInfo' => $this->contactInfo,
- 'contactUpdated' => $contactUpdated,
- 'contactMembers' => $contactMembers,
- 'membersList' => $membersList,
- 'EntityManagerRole' => $this->config['contact_role_numb']['EntityManager'],
- 'new_email' => $newEmail,
- 'newEmailError' => $newEmailError
+ 'option' => $option,
+ 'contactID' => $this->contactID,
+ 'contactInfo' => $this->contactInfo,
+ 'contactUpdated' => $contactUpdated,
+ 'contactMembers' => $contactMembers,
+ 'membersList' => $membersList,
+ 'EntityManagerRole' => $this->config['contact_role_numb']['EntityManager'],
+ 'new_email' => $newEmail,
+ 'newEmailError' => $newEmailError,
+ 'customFieldResults' => $customFieldResults,
+ 'slug' => GLM_MEMBERS_CONTACTS_PLUGIN_SLUG,
);
// Return status, any suggested view, and any data to controller
<h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
<a id="glm-contact-info-profile" data-show-table="glm-table-profile" class="glm-contact-info-tab nav-tab nav-tab-active">Profile Data</a>
{apply_filters('glm-member-db-custom-fields-nav', '', 'contact-info')}
-
+
<!--{if $contactUpdateError}<span class="glm-error glm-flash-updated glm-right">{$terms.term_contact_cap} Profile Update Error</span>{/if}-->
<!--{if $errorMessage}<span class="glm-error glm-flash-updated glm-right">{$errorMessage}</span>{/if}-->
</h2>
<div id="glm-table-custom-fields" class="glm-hidden glm-admin-table glm-table glm-contact-info-table">
-
-
{if $option == 'create'}
{apply_filters('glm-members-custom-fields-form', '', $slug,'','')}
{else}
<input type="hidden" name="id" value="{$contactInfo.fieldData.id}">
<input type="hidden" name="modify_time" value="now">
- <table class="glm-admin-table glm-shrink">
+ <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+ <a id="glm-contact-info-profile" data-show-table="glm-table-profile" class="glm-contact-info-tab nav-tab nav-tab-active">Profile Data</a>
+ {apply_filters('glm-member-db-custom-fields-nav', '', 'contact-info')}
+ </h2>
+
+ <div id="glm-table-custom-fields" class="glm-hidden glm-admin-table glm-table glm-contact-info-table">
+ {$prefix = $slug|cat:'_'}
+ {$uid = $prefix|cat:$contactInfo.fieldData.id}
+ {apply_filters('glm-members-custom-fields-form', '', $slug,$contactInfo.fieldData.id,'')}
+ {apply_filters('glm-members-custom-fields-form', '', $uid,$contactInfo.fieldData.id,'')}
+ </div>
+ <table id="glm-table-profile" class="glm-admin-table glm-shrink glm-hidden glm-contact-info-table">
<tr>
<th>Contact For:</th>
<td>{$contactInfo.fieldData.ref_type.name} - {$contactInfo.fieldData.ref_dest_name}</td>
jQuery(document).ready(function($) {
+ /*
+ * Edit area tabs
+ */
+ $('.glm-contact-info-tab').click( function() {
+ glmSetupAreaTab($(this));
+ });
+
+ // Do inital setup on load for first tab
+ glmSetupAreaTab($('#glm-contact-info-profile'));
+
+ // Setup edit area selected
+ function glmSetupAreaTab(t) {
+
+ // Clear table highlights and hide all tables
+ $('.glm-contact-info-tab').removeClass('nav-tab-active');
+ $('.glm-contact-info-table').addClass('glm-hidden');
+
+ // Highlight selected tab
+ t.addClass('nav-tab-active');
+
+ // Show selected table
+ var table = t.attr('data-show-table');
+ $('#' + table).removeClass('glm-hidden');
+
+ // Count remaining characters in field
+ $('.glm-char-count').keyup( function() {
+ glmCharsRemaining($(this));
+ });
+
+ $('.glm-char-count').each( function() {
+ glmCharsRemaining($(this));
+ });
+
+ }
+
/*
* New City Dialog
*/