3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class generates form components for relationship.
21 class CRM_Campaign_Form_Task
extends CRM_Core_Form_Task
{
24 * The array that holds all the voter ids
31 * Build all the data structures needed to build the form.
33 public function preProcess() {
34 $values = $this->controller
->exportValues('Search');
36 $this->_task
= $values['task'];
38 $ids = $this->getSelectedIDs($values);
41 $qfKey = CRM_Utils_Request
::retrieve('qfKey', 'String', $this);
42 $cacheKey = "civicrm search {$qfKey}";
43 $allCids = Civi
::service('prevnext')->getSelection($cacheKey, "getall");
44 $ids = array_keys($allCids[$cacheKey]);
45 $this->assign('totalSelectedVoters', count($ids));
49 $this->_componentClause
= 'contact_a.id IN ( ' . implode(',', $ids) . ' ) ';
50 $this->assign('totalSelectedVoters', count($ids));
52 $this->_voterIds
= $this->_contactIds
= $this->_componentIds
= $ids;
54 $this->assign('totalSelectedContacts', count($this->_contactIds
));
55 $this->setNextUrl('survey');
59 * Given the voter id, compute the contact id
60 * since its used for things like send email
62 public function setContactIDs() {
63 $this->_contactIds
= $this->_voterIds
;
67 * Simple shell that derived classes can call to add buttons to.
68 * the form with a customized title for the main Submit
70 * @param string $title
71 * Title of the main button.
72 * @param string $nextType
73 * Button type for the form after processing.
74 * @param string $backType
75 * @param bool $submitOnce
77 public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
86 'name' => ts('Cancel'),