Пример #1
0
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     //check for delete
     if (!CRM_Core_Permission::checkActionPermission('CiviPledge', 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
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     parent::preProcess();
     $rows = array();
     // display name and pledge details of all selected contacts
     $pledgeIDs = implode(',', $this->_pledgeIds);
     $query = "\n    SELECT plg.amount      as amount,\n           plg.create_date as create_date,\n           ct.display_name as display_name\n      FROM civicrm_pledge plg\nINNER JOIN civicrm_contact ct ON ( plg.contact_id = ct.id )       \n     WHERE plg.id IN ( {$pledgeIDs} )";
     $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
     while ($dao->fetch()) {
         $rows[] = array('display_name' => $dao->display_name, 'amount' => $dao->amount, 'create_date' => CRM_Utils_Date::customFormat($dao->create_date));
     }
     $this->assign('rows', $rows);
 }