<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Contact_Form_Inline_ContactInfo extends CRM_Contact_Form_Inline {
/**
- * build the form elements
+ * Build the form object elements
*
* @return void
- * @access public
*/
public function buildQuickForm() {
parent::buildQuickForm();
}
/**
- * set defaults for the form
+ * Set defaults for the form
*
* @return array
- * @access public
*/
public function setDefaultValues() {
return parent::setDefaultValues();
}
/**
- * process the form
+ * Process the form
*
* @return void
- * @access public
*/
public function postProcess() {
$params = $this->exportValues();
CRM_Contact_BAO_Contact::create($params);
- // Saving current employer affects relationship tab
+ // Saving current employer affects relationship tab, and possibly related memberships and contributions
$this->ajaxResponse['updateTabs'] = array(
'#tab_rel' => CRM_Contact_BAO_Contact::getCountComponent('rel', $this->_contactId),
);
+ if (CRM_Core_Permission::access('CiviContribute')) {
+ $this->ajaxResponse['updateTabs']['#tab_contribute'] = CRM_Contact_BAO_Contact::getCountComponent('contribution', $this->_contactId);
+ }
+ if (CRM_Core_Permission::access('CiviMember')) {
+ $this->ajaxResponse['updateTabs']['#tab_member'] = CRM_Contact_BAO_Contact::getCountComponent('membership', $this->_contactId);
+ }
$this->response();
}