Details
-
Type: New Feature
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.5
-
Fix Version/s: 1.6
-
Component/s: Technical infrastructure
-
Labels:None
Description
We needed to add some additional UI to the contact summary page for a customer. Rather than simply hack it into Basic.tpl, I've implemented a simple callback hook that lets any module add links to the line above the activity links that now appear.
Here's the signature of the hook:
/**
- Rob's hook for getting into the basic template
* - @param string $op
- @param int $contact_id
* - @return array
*/
function hook_civicrm_links($op, $contact_id) { $links = array(); $links[] = array('icon' => url('misc/favicon.ico'), 'title' => t('Drupalify Contact'), 'href' => url("civinode/contact/$contact_id") ); return $links; }
This is dead easy to implement for the end users, and makes it possible for us to do things like "Create a Drupal account for this user", or "purchase a gift for this user via the ecommerce module".
I've implemented the hook, modified the Basic view template, and a small Smarty template that draws the icons in the same style as ActivityLinks.tpl. A new CRM_Utils_Hook::links does the work (implemented for Drupal, stubbed for Mambo and SOAP).
// let the user frameworks add some links to the page
$uf_links = CRM_Utils_Hook::links( 'view', $this->_contactId );
if ( $uf_links )
It would make a few of us pretty happy if this or something like it gets into 1.5.
Thanks,
Rob