Esempio n. 1
0
 /**
  * Final response from successful form submit
  *
  * @param response: array - data to send to the client
  *
  * @return void
  * @protected
  */
 protected function response($response = array())
 {
     // Load changelog footer from template
     $smarty = CRM_Core_Smarty::singleton();
     $smarty->assign('contactId', $this->_contactId);
     $smarty->assign('external_identifier', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'external_identifier'));
     $smarty->assign('lastModified', CRM_Core_BAO_Log::lastModified($this->_contactId, 'civicrm_contact'));
     $viewOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_view_options', TRUE);
     $smarty->assign('changeLog', $viewOptions['log']);
     $response = array_merge(array('status' => 'save', 'changeLog' => array('count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId), 'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'))), $response, 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();
 }
Esempio n. 2
0
 /**
  * Common function for all inline contact edit forms.
  * Prepares ajaxResponse
  *
  * @return void
  */
 protected function response()
 {
     $this->ajaxResponse = array_merge(self::renderFooter($this->_contactId), $this->ajaxResponse, CRM_Contact_Form_Inline_Lock::getResponse($this->_contactId));
     // Note: Post hooks will be called by CRM_Core_Form::mainProcess
 }
Esempio n. 3
0
 /**
  * Common function for all inline contact edit forms
  * Prepares ajaxResponse
  *
  * @return void
  * @protected
  */
 protected function response()
 {
     // Load changelog footer from template
     $smarty = CRM_Core_Smarty::singleton();
     $smarty->assign('contactId', $this->_contactId);
     $smarty->assign('external_identifier', CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'external_identifier'));
     $smarty->assign('lastModified', CRM_Core_BAO_Log::lastModified($this->_contactId, 'civicrm_contact'));
     $viewOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_view_options', TRUE);
     $smarty->assign('changeLog', $viewOptions['log']);
     $this->ajaxResponse = array_merge(array('changeLog' => array('count' => CRM_Contact_BAO_Contact::getCountComponent('log', $this->_contactId), 'markup' => $smarty->fetch('CRM/common/contactFooter.tpl'))), $this->ajaxResponse, CRM_Contact_Form_Inline_Lock::getResponse($this->_contactId));
     // Note: Post hooks will be called by CRM_Core_Form::mainProcess
 }