$this->_task = $values['task'];
- $ids = [];
- if ($values['radio_ts'] == 'ts_sel') {
- foreach ($values as $name => $value) {
- if (substr($name, 0, CRM_Core_Form::CB_PREFIX_LEN) == CRM_Core_Form::CB_PREFIX) {
- $ids[] = substr($name, CRM_Core_Form::CB_PREFIX_LEN);
- }
- }
- }
- else {
+ $ids = $this->getSelectedIDs($values);
+
+ if (!$ids) {
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
$cacheKey = "civicrm search {$qfKey}";
$allCids = Civi::service('prevnext')->getSelection($cacheKey, "getall");
$this->_voterIds = $this->_contactIds = $this->_componentIds = $ids;
$this->assign('totalSelectedContacts', count($this->_contactIds));
-
- //set the context for redirection for any task actions
- $session = CRM_Core_Session::singleton();
- $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String', $this);
- $urlParams = 'force=1';
- if (CRM_Utils_Rule::qfKey($qfKey)) {
- $urlParams .= '&qfKey=' . $qfKey;
- }
- $session->replaceUserContext(CRM_Utils_System::url('civicrm/survey/search', $urlParams));
+ $this->setNextUrl('survey');
}
/**