}
/**
- * Final response from successful form submit
- *
- * @param response: array - data to send to the client
+ * Common function for all inline contact edit forms
+ * Prepares ajaxResponse
*
* @return void
* @protected
*/
- protected function response($response = array()) {
+ protected function response() {
// Load changelog footer from template
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('contactId', $this->_contactId);
'contact_view_options', TRUE
);
$smarty->assign('changeLog', $viewOptions['log']);
- $response = array_merge(
+ $this->ajaxResponse = array_merge(
array(
- 'status' => 'save',
'changeLog' => array(
'count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId),
'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'),
),
),
- $response,
+ $this->ajaxResponse,
CRM_Contact_Form_Inline_Lock::getResponse($this->_contactId)
);
- $this->postProcessHook();
- // CRM-11831 @see http://www.malsup.com/jquery/form/#file-upload
- $xhr = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
- if (!$xhr) {
- echo '<textarea>';
- }
- echo json_encode($response);
- if (!$xhr) {
- echo '</textarea>';
- }
- CRM_Utils_System::civiExit();
+ // Note: Post hooks will be called by CRM_Core_Form::mainProcess
}
}