/** * Build all the data structures needed to build the form. * * @return void */ public function preProcess() { // initialize the task and row fields parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviEvent', CRM_Core_Action::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } parent::preProcess(); }
/** * Build all the data structures needed to build the form. */ public function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); parent::preProcess(); // we have all the participant ids, so now we get the contact ids parent::setContactIDs(); $this->assign('single', $this->_single); }
/** * Build all the data structures needed to build the form. * * @return void */ public function preProcess() { // initialize the task and row fields parent::preProcess(); parent::setContactIDs(); $this->_context = $this->get('context'); $this->_id = $this->get('amtgID'); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false); if ($cid) { CRM_Contact_Form_Task_EmailCommon::preProcessSingle($this, $cid); } else { parent::preProcess(); // we have all the contribution ids, so now we get the contact ids parent::setContactIDs(); } $this->assign('single', $this->_single); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviEvent', CRM_Core_Action::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page')); } parent::preProcess(); foreach ($this->_participantIds as $participantId) { if (CRM_Event_BAO_Participant::isPrimaryParticipant($participantId)) { $this->assign('additionalParticipants', TRUE); } } }
/** * Build all the data structures needed to build the form. * * @return void */ public function preProcess() { parent::preProcess(); $rows = array(); // display name and participation details of participants $participantIDs = implode(',', $this->_participantIds); $query = "\n SELECT p.fee_amount as amount,\n p.register_date as register_date,\n p.source as source,\n ct.display_name as display_name\n FROM civicrm_participant p\n INNER JOIN civicrm_contact ct ON ( p.contact_id = ct.id )\n WHERE p.id IN ( {$participantIDs} )"; $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray); while ($dao->fetch()) { $rows[] = array('display_name' => $dao->display_name, 'amount' => $dao->amount, 'register_date' => CRM_Utils_Date::customFormat($dao->register_date), 'source' => $dao->source); } $this->assign('rows', $rows); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); //get the contact read only fields to display. $readOnlyFields = array_merge(array('sort_name' => ts('Name')), CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'contact_autocomplete_options', TRUE, NULL, FALSE, 'name', TRUE)); //get the read only field data. $returnProperties = array_fill_keys(array_keys($readOnlyFields), 1); $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_participantIds, 'CiviEvent', $returnProperties); $this->assign('contactDetails', $contactDetails); $this->assign('readOnlyFields', $readOnlyFields); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preprocess(); // set print view, so that print templates are called $this->controller->setPrint(1); // get the formatted params $queryParams = $this->get('queryParams'); $sortID = NULL; if ($this->get(CRM_Utils_Sort::SORT_ID)) { $sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID), $this->get(CRM_Utils_Sort::SORT_DIRECTION)); } $selector = new CRM_Event_Selector_Search($queryParams, $this->_action, $this->_componentClause); $controller = new CRM_Core_Selector_Controller($selector, NULL, $sortID, CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::SCREEN); $controller->setEmbedded(TRUE); $controller->run(); }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); //get the contact read only fields to display. require_once 'CRM/Core/BAO/Preferences.php'; $readOnlyFields = array_merge(array('sort_name' => ts('Name')), CRM_Core_BAO_Preferences::valueOptions('contact_autocomplete_options', true, null, false, 'name', true)); //get the read only field data. $returnProperties = array_fill_keys(array_keys($readOnlyFields), 1); require_once 'CRM/Contact/BAO/Contact/Utils.php'; $contactDetails = CRM_Contact_BAO_Contact_Utils::contactDetails($this->_participantIds, 'CiviEvent', $returnProperties); $this->assign('contactDetails', $contactDetails); $this->assign('readOnlyFields', $readOnlyFields); }
/** * build all the data structures needed to build the form * * @param * * @return void * @access public */ function preProcess() { $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this); if ($this->_context == 'view') { $this->_single = TRUE; $participantID = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->_participantIds = array($participantID); $this->_componentClause = " civicrm_participant.id = {$participantID} "; $this->assign('totalSelectedParticipants', 1); // also set the user context to send back to view page $session = CRM_Core_Session::singleton(); $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view/participant', "reset=1&action=view&id={$participantID}&cid={$contactID}")); } else { parent::preProcess(); } }
/** * Build all the data structures needed to build the form. * * @return void */ public function preProcess() { // initialize the task and row fields parent::preProcess(); $session = CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('Update multiple participants')); $validate = FALSE; //validations if (count($this->_participantIds) > $this->_maxParticipations) { CRM_Core_Session::setStatus("The maximum number of records you can select for Update multiple participants is {$this->_maxParticipations}. You have selected " . count($this->_participantIds) . ". Please select fewer participantions from your search results and try again."); $validate = TRUE; } // then redirect if ($validate) { CRM_Utils_System::redirect($this->_userContext); } }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { /* * initialize the task and row fields */ parent::preProcess(); $session =& CRM_Core_Session::singleton(); $this->_userContext = $session->readUserContext(); CRM_Utils_System::setTitle(ts('Batch Update for Event Participants')); $validate = false; //validations if (count($this->_participantIds) > $this->_maxParticipations) { CRM_Core_Session::setStatus("The maximum number of event participations you can select for Batch Update is {$this->_maxParticipations}. You have selected " . count($this->_participantIds) . ". Please select fewer participantions from your search results and try again."); $validate = true; } if ($validate) { // then redirect CRM_Utils_System::redirect($this->_userContext); } }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preProcess(); $this->_id = NULL; }
/** * build all the data structures needed to build the form * * @return void * @access public */ function preProcess() { parent::preProcess(); $this->_id = null; }
/** * build all the data structures needed to build the form * * @param * @return void * @access public */ function preProcess() { //special case for custom search, directly give option to download csv file $customSearchID = $this->get('customSearchID'); if ($customSearchID) { require_once 'CRM/Export/BAO/Export.php'; CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'), $this->get('formValues'), $this->get(CRM_Utils_Sort::SORT_ORDER)); } $this->_selectAll = false; $this->_exportMode = self::CONTACT_EXPORT; // get the submitted values based on search if ($this->_action == CRM_Core_Action::ADVANCED) { $values = $this->controller->exportValues('Advanced'); } else { if ($this->_action == CRM_Core_Action::PROFILE) { $values = $this->controller->exportValues('Builder'); } else { if ($this->_action == CRM_Core_Action::COPY) { $values = $this->controller->exportValues('Custom'); } else { // we need to determine component export $stateMachine =& $this->controller->getStateMachine(); $formName = CRM_Utils_System::getClassName($stateMachine); $componentName = explode('_', $formName); $components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity'); if (in_array($componentName[1], $components)) { eval('$this->_exportMode = self::' . strtoupper($componentName[1]) . '_EXPORT;'); require_once "CRM/{$componentName[1]}/Form/Task.php"; eval('CRM_' . $componentName[1] . '_Form_Task::preProcessCommon( $this, true );'); $values = $this->controller->exportValues('Search'); } else { $values = $this->controller->exportValues('Basic'); } } } } $componentMode = $this->get('component_mode'); switch ($componentMode) { case 2: require_once "CRM/Contribute/Form/Task.php"; CRM_Contribute_Form_Task::preProcessCommon($this, true); $this->_exportMode = self::CONTRIBUTE_EXPORT; $componentName = array('', 'Contribute'); break; case 3: require_once "CRM/Event/Form/Task.php"; CRM_Event_Form_Task::preProcessCommon($this, true); $this->_exportMode = self::EVENT_EXPORT; $componentName = array('', 'Event'); break; case 4: require_once "CRM/Activity/Form/Task.php"; CRM_Activity_Form_Task::preProcessCommon($this, true); $this->_exportMode = self::ACTIVITY_EXPORT; $componentName = array('', 'Activity'); break; } require_once 'CRM/Contact/Task.php'; $this->_task = $values['task']; if ($this->_exportMode == self::CONTACT_EXPORT) { $contactTasks = CRM_Contact_Task::taskTitles(); $taskName = $contactTasks[$this->_task]; require_once "CRM/Contact/Form/Task.php"; CRM_Contact_Form_Task::preProcessCommon($this, true); } else { $this->assign('taskName', "Export {$componentName['1']}"); eval('$componentTasks = CRM_' . $componentName[1] . '_Task::tasks();'); $taskName = $componentTasks[$this->_task]; } if ($this->_componentTable) { $query = "\nSELECT count(*)\nFROM {$this->_componentTable}\n"; $totalSelectedRecords = CRM_Core_DAO::singleValueQuery($query); } else { $totalSelectedRecords = count($this->_componentIds); } $this->assign('totalSelectedRecords', $totalSelectedRecords); $this->assign('taskName', $taskName); // all records actions = save a search if ($values['radio_ts'] == 'ts_all' || $this->_task == CRM_Contact_Task::SAVE_SEARCH) { $this->_selectAll = true; $this->assign('totalSelectedRecords', $this->get('rowCount')); } $this->set('componentIds', $this->_componentIds); $this->set('selectAll', $this->_selectAll); $this->set('exportMode', $this->_exportMode); $this->set('componentClause', $this->_componentClause); $this->set('componentTable', $this->_componentTable); }
/** * Build all the data structures needed to build the form. * * @param * * @return void */ public function preProcess() { //special case for custom search, directly give option to download csv file $customSearchID = $this->get('customSearchID'); if ($customSearchID) { CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'), $this->get('formValues'), $this->get(CRM_Utils_Sort::SORT_ORDER)); } $this->_selectAll = FALSE; $this->_exportMode = self::CONTACT_EXPORT; $this->_componentIds = array(); $this->_componentClause = NULL; // get the submitted values based on search if ($this->_action == CRM_Core_Action::ADVANCED) { $values = $this->controller->exportValues('Advanced'); } elseif ($this->_action == CRM_Core_Action::PROFILE) { $values = $this->controller->exportValues('Builder'); } elseif ($this->_action == CRM_Core_Action::COPY) { $values = $this->controller->exportValues('Custom'); } else { // we need to determine component export $stateMachine = $this->controller->getStateMachine(); $formName = CRM_Utils_System::getClassName($stateMachine); $componentName = explode('_', $formName); $components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity'); if (in_array($componentName[1], $components)) { switch ($componentName[1]) { case 'Contribute': $this->_exportMode = self::CONTRIBUTE_EXPORT; break; case 'Member': $this->_exportMode = self::MEMBER_EXPORT; break; case 'Event': $this->_exportMode = self::EVENT_EXPORT; break; case 'Pledge': $this->_exportMode = self::PLEDGE_EXPORT; break; case 'Case': $this->_exportMode = self::CASE_EXPORT; break; case 'Grant': $this->_exportMode = self::GRANT_EXPORT; break; case 'Activity': $this->_exportMode = self::ACTIVITY_EXPORT; break; } $className = "CRM_{$componentName[1]}_Form_Task"; $className::preProcessCommon($this, TRUE); $values = $this->controller->exportValues('Search'); } else { $values = $this->controller->exportValues('Basic'); } } $count = 0; $this->_matchingContacts = FALSE; if (CRM_Utils_Array::value('radio_ts', $values) == 'ts_sel') { foreach ($values as $key => $value) { if (strstr($key, 'mark_x')) { $count++; } if ($count > 2) { $this->_matchingContacts = TRUE; break; } } } $componentMode = $this->get('component_mode'); switch ($componentMode) { case 2: CRM_Contribute_Form_Task::preProcessCommon($this, TRUE); $this->_exportMode = self::CONTRIBUTE_EXPORT; $componentName = array('', 'Contribute'); break; case 3: CRM_Event_Form_Task::preProcessCommon($this, TRUE); $this->_exportMode = self::EVENT_EXPORT; $componentName = array('', 'Event'); break; case 4: CRM_Activity_Form_Task::preProcessCommon($this, TRUE); $this->_exportMode = self::ACTIVITY_EXPORT; $componentName = array('', 'Activity'); break; case 5: CRM_Member_Form_Task::preProcessCommon($this, TRUE); $this->_exportMode = self::MEMBER_EXPORT; $componentName = array('', 'Member'); break; case 6: CRM_Case_Form_Task::preProcessCommon($this, TRUE); $this->_exportMode = self::CASE_EXPORT; $componentName = array('', 'Case'); break; } $this->_task = $values['task']; if ($this->_exportMode == self::CONTACT_EXPORT) { $contactTasks = CRM_Contact_Task::taskTitles(); $taskName = $contactTasks[$this->_task]; $component = FALSE; CRM_Contact_Form_Task::preProcessCommon($this, TRUE); } else { $this->assign('taskName', "Export {$componentName['1']}"); $className = "CRM_{$componentName[1]}_Task"; $componentTasks = $className::tasks(); $taskName = $componentTasks[$this->_task]; $component = TRUE; } if ($this->_componentTable) { $query = "\nSELECT count(*)\nFROM {$this->_componentTable}\n"; $totalSelectedRecords = CRM_Core_DAO::singleValueQuery($query); } else { $totalSelectedRecords = count($this->_componentIds); } $this->assign('totalSelectedRecords', $totalSelectedRecords); $this->assign('taskName', $taskName); $this->assign('component', $component); // all records actions = save a search if ($values['radio_ts'] == 'ts_all' || $this->_task == CRM_Contact_Task::SAVE_SEARCH) { $this->_selectAll = TRUE; $rowCount = $this->get('rowCount'); if ($rowCount > 2) { $this->_matchingContacts = TRUE; } $this->assign('totalSelectedRecords', $rowCount); } $this->assign('matchingContacts', $this->_matchingContacts); $this->set('componentIds', $this->_componentIds); $this->set('selectAll', $this->_selectAll); $this->set('exportMode', $this->_exportMode); $this->set('componentClause', $this->_componentClause); $this->set('componentTable', $this->_componentTable); }