<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @access public
*/
public function setDefaultValues() {
- $defaults = parent::setDefaultValues();
-
- if ($this->_contactType == 'Individual') {
- // set current employer details
- $currentEmployer = CRM_Contact_BAO_Relationship::getCurrentEmployer(array($this->_contactId));
- $defaults['current_employer_id'] = CRM_Utils_Array::value('org_id', $currentEmployer[$this->_contactId]);
-
- $this->assign('currentEmployer', CRM_Utils_Array::value('current_employer_id', $defaults));
- }
-
- return $defaults;
+ return parent::setDefaultValues();
}
/**
CRM_Contact_BAO_Contact::create($params);
+ // Saving current employer affects relationship tab
+ $this->ajaxResponse['updateTabs'] = array(
+ '#tab_rel' => CRM_Contact_BAO_Contact::getCountComponent('rel', $this->_contactId),
+ );
+
$this->response();
}
}