$member_types = false;
$contactUpdateError = false;
$billingFieldResults = false;
+ $contactEditOwnRecord = false;
$where = '';
// If this is a logged in member user, then show their contacts only
if (isset($this->config['loggedInUser']['contactUser'])) {
+ // Find out if the user has same contact id as the one being edited.
+ $contactID = $_REQUEST['contact'] - 0;
+ if ( $this->config['loggedInUser']['contactUser']['ID'] == $contactID ) {
+ $contactEditOwnRecord = true;
+ }
+
// if there's logged in contact user
$contactUser = $this->config['loggedInUser']['contactUser'];
if ($contactUser['ref_type'] = $this->config['ref_type_numb']['Member']
'contactsList' => $contactsList['list'],
'numbContacts' => $numbContacts,
'contactID' => $contactID,
+ 'contactEditOwnRecord' => $contactEditOwnRecord,
'contactInfo' => $contactInfo,
'newContactEmailExists' => $newContactEmailExists,
'newContactUsernameExists' => $newContactUsernameExists,
'My Contact Info',
'glm_members_edit_my_contact_info',
'glm-members-admin-menu-profile',
- function() {$this->controller('profile');}
+ function() {
+ define( 'GLM_MEMBERS_CONTACTS_MEMBER_MENU', true );
+ $_REQUEST['member'] = $lockedToMember;
+ $_REQUEST['contact'] = $this->config['loggedInUser']['contactUser']['ID'];
+ $_REQUEST['option'] = 'edit';
+ $this->controller('contacts', 'index');
+ }
);
} else {
{else}
{if $contactUpdated}<h2 class="glm-notice glm-flash-updated">Contact Updated</h2>{/if}
{/if}
+ {if !$contactEditOwnRecord}
<a id="deleteContactButton" class="button button-primary glm-button glm-right">Delete this Contact</a>
+ {/if}
<div id="deleteContactDialog" class="glm-dialog-box" title="Delete Contact">
<center>
<p><a id="deleteContactCancel" class="button button-primary">Cancel</a></p>