rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0); } /** * Function to build the form * * @return void * @access public */ public function buildQuickForm() { $groupList = array('' => ts('- All Contacts -')) + CRM_Core_PseudoConstant::nestedGroup(); $this->add('select', 'group_id', ts('Select Group'), $groupList, FALSE, array('class' => 'crm-select2 huge')); $this->addButtons(array( array( 'type' => 'next', 'name' => ts('Continue'), 'isDefault' => TRUE, ), //hack to support cancel button functionality array( 'type' => 'submit', 'name' => ts('Cancel'), ), ) ); } function setDefaultValues() { return $this->_defaults; } /** * Function to process the form * * @access public * * @return void */ public function postProcess() { $values = $this->exportValues(); if (!empty($_POST['_qf_DedupeFind_submit'])) { //used for cancel button CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/deduperules', 'reset=1')); return; } if ($values['group_id']) { $url = CRM_Utils_System::url('civicrm/contact/dedupefind', "reset=1&action=update&rgid={$this->rgid}&gid={$values['group_id']}"); } else { $url = CRM_Utils_System::url('civicrm/contact/dedupefind', "reset=1&action=update&rgid={$this->rgid}"); } CRM_Utils_System::redirect($url); } }