/** * Process the user submitted custom data values. * * @access public * @return void */ function postProcess() { parent::postProcess(); }
/** * Process the user submitted custom data values. * * @access public * * @return void */ public function postProcess() { parent::postProcess(); // this is special case when we create contact using Dialog box if ($this->_context == 'dialog') { $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'display_name'); $sortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'sort_name'); $returnArray = array('contactID' => $this->_id, 'displayName' => $displayName, 'sortName' => $sortName, 'newContactSuccess' => TRUE); echo json_encode($returnArray); CRM_Utils_System::civiExit(); } //for delete record handling if (!CRM_Utils_Array::value($this->_deleteButtonName, $_POST)) { CRM_Core_Session::setStatus(ts('Your information has been saved.'), ts('Thank you.'), 'success'); } $session = CRM_Core_Session::singleton(); // only replace user context if we do not have a postURL if (!$this->_postURL) { $gidString = $this->_gid; if (!empty($this->_profileIds)) { $gidString = implode(',', $this->_profileIds); } $urlParams = "reset=1&id={$this->_id}&gid={$gidString}"; if ($this->_isContactActivityProfile && $this->_activityId) { $urlParams .= "&aid={$this->_activityId}"; } // Get checksum if present if ($this->get('cs')) { $urlParams .= "&cs=" . $this->get('cs'); } elseif (!CRM_Contact_BAO_Contact_Permission::allow($this->_id)) { $urlParams .= "&cs=" . CRM_Contact_BAO_Contact_Utils::generateChecksum($this->_id); } $url = CRM_Utils_System::url('civicrm/profile/view', $urlParams); } else { // Replace tokens from post URL $contactParams = array('contact_id' => $this->_id, 'version' => 3); $contact = civicrm_api('contact', 'get', $contactParams); $contact = reset($contact['values']); $dummyMail = new CRM_Mailing_BAO_Mailing(); $dummyMail->body_text = $this->_postURL; $tokens = $dummyMail->getTokens(); $url = CRM_Utils_Token::replaceContactTokens($this->_postURL, $contact, FALSE, CRM_Utils_Array::value('text', $tokens)); } $session->replaceUserContext($url); }
/** * Process the user submitted custom data values. * * * @return void */ public function postProcess() { parent::postProcess(); $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'display_name'); $sortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'sort_name'); $this->ajaxResponse['label'] = $sortName; // When saving (not deleting) and not in an ajax popup if (empty($_POST[$this->_deleteButtonName]) && $this->_context != 'dialog') { CRM_Core_Session::setStatus(ts('Your information has been saved.'), ts('Thank you.'), 'success'); } $session = CRM_Core_Session::singleton(); // only replace user context if we do not have a postURL if (!$this->_postURL) { $gidString = $this->_gid; if (!empty($this->_profileIds)) { $gidString = implode(',', $this->_profileIds); } $urlParams = "reset=1&id={$this->_id}&gid={$gidString}"; if ($this->_isContactActivityProfile && $this->_activityId) { $urlParams .= "&aid={$this->_activityId}"; } // Get checksum if present if ($this->get('cs')) { $urlParams .= "&cs=" . $this->get('cs'); } elseif (!CRM_Contact_BAO_Contact_Permission::allow($this->_id)) { $urlParams .= "&cs=" . CRM_Contact_BAO_Contact_Utils::generateChecksum($this->_id); } $url = CRM_Utils_System::url('civicrm/profile/view', $urlParams); } else { // Replace tokens from post URL $contactParams = array('contact_id' => $this->_id, 'version' => 3); $contact = civicrm_api('contact', 'get', $contactParams); $contact = reset($contact['values']); $dummyMail = new CRM_Mailing_BAO_Mailing(); $dummyMail->body_text = $this->_postURL; $tokens = $dummyMail->getTokens(); $url = CRM_Utils_Token::replaceContactTokens($this->_postURL, $contact, FALSE, CRM_Utils_Array::value('text', $tokens)); } $session->replaceUserContext($url); }
/** * Process the user submitted custom data values. * * @access public * @return void */ public function postProcess() { parent::postProcess(); // this is special case when we create contact using Dialog box if ($this->_context == 'dialog') { $sortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'sort_name'); $returnArray = array('contactID' => $this->_id, 'sortName' => $sortName, 'newContactSuccess' => true); echo json_encode($returnArray); exit; } CRM_Core_Session::setStatus(ts('Thank you. Your information has been saved.')); $session =& CRM_Core_Session::singleton(); // only replace user context if we do not have a postURL if (!$this->_postURL) { $url = CRM_Utils_System::url('civicrm/profile/view', "reset=1&id={$this->_id}&gid={$this->_gid}"); } $session->replaceUserContext($url); }