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
21 * This class provides the functionality to participant records
23 class CRM_Event_Form_Task_Print
extends CRM_Event_Form_Task
{
26 * Build all the data structures needed to build the form.
30 public function preProcess() {
33 // set print view, so that print templates are called
34 $this->controller
->setPrint(1);
36 // get the formatted params
37 $queryParams = $this->get('queryParams');
40 if ($this->get(CRM_Utils_Sort
::SORT_ID
)) {
41 $sortID = CRM_Utils_Sort
::sortIDValue($this->get(CRM_Utils_Sort
::SORT_ID
),
42 $this->get(CRM_Utils_Sort
::SORT_DIRECTION
)
46 $selector = new CRM_Event_Selector_Search($queryParams, $this->_action
, $this->_componentClause
);
47 $controller = new CRM_Core_Selector_Controller($selector, NULL, $sortID, CRM_Core_Action
::VIEW
, $this, CRM_Core_Selector_Controller
::SCREEN
);
48 $controller->setEmbedded(TRUE);
53 * Build the form object - it consists of
54 * - displaying the QILL (query in local language)
55 * - displaying elements for saving the search
60 public function buildQuickForm() {
62 // just need to add a javacript to popup the window for printing
67 'name' => ts('Print Participant List'),
68 'js' => ['onclick' => 'window.print()'],
79 * Process the form after the input has been submitted and validated.
84 public function postProcess() {
85 // redirect to the main search page after printing is over