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 provides the functionality to print voter records
21 class CRM_Campaign_Form_Task_Print
extends CRM_Campaign_Form_Task
{
24 * Build all the data structures needed to build the form.
26 public function preProcess() {
29 // set print view, so that print templates are called
30 $this->controller
->setPrint(1);
32 // get the formatted params
33 $queryParams = $this->get('queryParams');
36 if ($this->get(CRM_Utils_Sort
::SORT_ID
)) {
37 $sortID = CRM_Utils_Sort
::sortIDValue($this->get(CRM_Utils_Sort
::SORT_ID
),
38 $this->get(CRM_Utils_Sort
::SORT_DIRECTION
)
42 $selector = new CRM_Campaign_Selector_Search($queryParams,
44 $this->_componentClause
46 $controller = new CRM_Core_Selector_Controller($selector,
49 CRM_Core_Action
::VIEW
,
51 CRM_Core_Selector_Controller
::SCREEN
53 $controller->setEmbedded(TRUE);
58 * Build the form object.
61 * - displaying the QILL (query in local language)
62 * - displaying elements for saving the search
64 public function buildQuickForm() {
66 // just need to add a javacript to popup the window for printing
71 'name' => ts('Print Respondents'),
72 'js' => ['onclick' => 'window.print()'],
83 * Process the form after the input has been submitted and validated.
85 public function postProcess() {
86 // redirect to the main search page after printing is over