function preProcess() {
$this->_mode = CRM_Profile_Form::MODE_CREATE;
+ $this->_onPopupClose = CRM_Utils_Request::retrieve('onPopupClose', 'String', $this);
+
//set the context for the profile
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
//passing the post url to template so the popup form does
//proper redirection and proccess form errors if any
- $popupRedirect = CRM_Utils_System::url('civicrm/profile/edit', $urlParams, FALSE, NULL, FALSE);
+ if (!isset($this->_onPopupClose) || $this->_onPopupClose == 'redirectToProfile') {
+ $popupRedirect = CRM_Utils_System::url('civicrm/profile/edit', $urlParams, FALSE, NULL, FALSE);
+ }
+ elseif ($this->_onPopupClose == 'redirectToTab') {
+ $popupRedirect = CRM_Utils_System::url('civicrm/contact/view',
+ "reset=1&cid={$this->_id}&selectedChild=custom_{$this->_customGroupId}", FALSE, NULL, FALSE);
+ }
+
$this->assign('urlParams', $urlParams);
$this->assign('postUrl', $popupRedirect);
}