controller->exportValues('Search'); $this->_task = $values['task']; $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"); $ids = array_keys($allCids[$cacheKey]); $this->assign('totalSelectedVoters', count($ids)); } if (!empty($ids)) { $this->_componentClause = 'contact_a.id IN ( ' . implode(',', $ids) . ' ) '; $this->assign('totalSelectedVoters', count($ids)); } $this->_voterIds = $this->_contactIds = $this->_componentIds = $ids; $this->assign('totalSelectedContacts', count($this->_contactIds)); $this->setNextUrl('survey'); } /** * Given the voter id, compute the contact id * since its used for things like send email */ public function setContactIDs() { $this->_contactIds = $this->_voterIds; } /** * Simple shell that derived classes can call to add buttons to. * the form with a customized title for the main Submit * * @param string $title * Title of the main button. * @param string $nextType * Button type for the form after processing. * @param string $backType * @param bool $submitOnce */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons([ [ 'type' => $nextType, 'name' => $title, 'isDefault' => TRUE, ], [ 'type' => $backType, 'name' => ts('Cancel'), ], ]); } }