/** * 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); }