Пример #1
0
 /**
  * Build all the data structures needed to build the form.
  *
  * @return void
  */
 public function preProcess()
 {
     parent::preProcess();
     //check permission for delete.
     if (!CRM_Core_Permission::checkActionPermission('CiviGrant', CRM_Core_Action::DELETE)) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
     }
 }
 /**
  * Build all the data structures needed to build the form.
  *
  * @return void
  */
 public function preProcess()
 {
     parent::preProcess();
     $rows = array();
     // display name and grant details of all selectced contacts
     $grantIDs = implode(',', $this->_grantIds);
     $query = "\n    SELECT grt.decision_date  as decision_date,\n           grt.amount_total   as amount_total,\n           grt.amount_granted as amount_granted,\n           ct.display_name    as display_name\n      FROM civicrm_grant grt\nINNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id )\n     WHERE grt.id IN ( {$grantIDs} )";
     $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
     while ($dao->fetch()) {
         $rows[] = array('display_name' => $dao->display_name, 'decision_date' => $dao->decision_date, 'amount_requested' => $dao->amount_total, 'amount_granted' => $dao->amount_granted);
     }
     $this->assign('rows', $rows);
 }
Пример #3
0
 /**
  * Build all the data structures needed to build the form.
  *
  * @return void
  */
 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_Grant_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();
 }