<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* Entity sub type of the table id
*
* @var string
- * @access protected
*/
protected $_entitySubType;
* Custom group id
*
* @int
- * @access public
*/
public $_groupID;
public $_multiRecordDisplay;
public $_copyValueId;
+
/**
* Pre processing work done here.
*
* @param
*
* @return void
- *
- * @access public
- *
*/
- function preProcess() {
+ public function preProcess() {
$this->_cdType = CRM_Utils_Array::value('type', $_GET);
$this->assign('cdType', FALSE);
$this->_multiRecordDisplay = CRM_Utils_Request::retrieve('multiRecordDisplay', 'String', $this);
// this is due to some condition inside it which restricts it from saving in session
// so doing this for multi record edit action
$entityId = CRM_Utils_Request::retrieve('entityID', 'Positive', $this);
- if(!empty($entityId)) {
+ if (!empty($entityId)) {
$subType = CRM_Contact_BAO_Contact::getContactSubType($entityId, ',');
}
CRM_Custom_Form_CustomData::preProcess($this, NULL, $subType, NULL, NULL, $entityId);
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
- * @access public
*/
public function buildQuickForm() {
if ($this->_cdType || $this->_multiRecordDisplay == 'single') {
);
if ($isMultiple) {
$this->assign('multiRecordDisplay', $this->_multiRecordDisplay);
- $saveButtonName = $this->_copyValueId ? 'Save a Copy': 'Save';
+ $saveButtonName = $this->_copyValueId ? 'Save a Copy' : 'Save';
$this->addButtons(array(
array(
'type' => 'upload',
}
/**
- * Set the default form values
+ * Set the default form values.
*
- * @access protected
*
- * @return array the default array reference
+ * @return array
+ * the default array reference
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
if ($this->_cdType || $this->_multiRecordDisplay == 'single') {
if ($this->_copyValueId) {
// cached tree is fetched
/**
* Process the user submitted custom data values.
*
- * @access public
*
* @return void
*/
$cgcount += 1;
$buttonName = $this->controller->getButtonName();
if ($buttonName == $this->getButtonName('upload', 'new')) {
- CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
+ CRM_Core_Session::singleton()
+ ->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/cd/edit', "reset=1&type={$this->_contactType}&groupID={$this->_groupID}&entityID={$this->_tableID}&cgcount={$cgcount}&multiRecordDisplay=single&mode=add"));
}
+
+ // Add entry in the log table
+ CRM_Core_BAO_Log::register($this->_tableID,
+ 'civicrm_contact',
+ $this->_tableID
+ );
+
+ if (CRM_Core_Resources::isAjaxMode()) {
+ $this->ajaxResponse += CRM_Contact_Form_Inline::renderFooter($this->_tableID);
+ }
+
// reset the group contact cache for this group
CRM_Contact_BAO_GroupContactCache::remove();
}
-}
\ No newline at end of file
+
+}