$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('contactId', $cid);
$smarty->assign('external_identifier', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'external_identifier'));
+ $smarty->assign('created_date', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $cid, 'created_date'));
$smarty->assign('lastModified', CRM_Core_BAO_Log::lastModified($cid, 'civicrm_contact'));
$viewOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'contact_view_options', TRUE
public static $_membershipTypesLinks = NULL;
public $_permission = NULL;
- public $_contactId = NULL;
+
+ /**
+ * Contact ID.
+ *
+ * @var int
+ *
+ * @deprecated
+ */
+ public $_contactId;
/**
* @var bool
$this->_action = CRM_Core_Action::ADD;
}
else {
- $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
- $this->assign('contactId', $this->_contactId);
+ $contactID = $this->getContactID();
+ $this->assign('contactId', $contactID);
+ CRM_Contact_Form_Inline::renderFooter($contactID, FALSE);
// check logged in url permission
CRM_Contact_Page_View::checkUserPermission($this);
}
}
+ /**
+ * Get the contact ID.
+ *
+ * @api Supported for external use.
+ *
+ * @return int|null
+ * @throws \CRM_Core_Exception
+ */
+ public function getContactID(): ?int {
+ $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
+ return $this->_contactId;
+ }
+
}
</div>
<div class="action-link">
- {include file="CRM/common/formButtons.tpl" location="top"}
+ {include file="CRM/common/formButtons.tpl" location="top" form=false}
</div>
{/if}
{if NOT ($activeMembers or $inActiveMembers) and $action ne 2 and $action ne 1 and $action ne 8 and $action ne 4 and $action ne 32768}
<a class="button{if array_key_exists('class', $linkButton)} {$linkButton.class}{/if}" {$linkname} href="{crmURL p=$linkButton.url q=$linkButton.qs}" {$accessKey} {if array_key_exists('extra', $linkButton)}{$linkButton.extra}>{/if}<span>{$icon|smarty:nodefaults}{$linkButton.title}</span></a>
{/foreach}
{/if}
-
-{foreach from=$form.buttons item=button key=key name=btns}
+{if $form}
+ {* This could be called from Membership View - which is a page not a form but uses it for the links above *}
+ {foreach from=$form.buttons item=button key=key name=btns}
{if $key|substring:0:4 EQ '_qf_'}
{if $location}
{$form.buttons.$key.html|crmReplace:id:"$key-$location"}
{/if}
{/if}
{/foreach}
+{/if}
{/crmRegion}