BxDonationsGridList.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup Donations Donations
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. require_once('BxDonationsGridListAll.php');
  12. class BxDonationsGridList extends BxDonationsGridListAll
  13. {
  14. public function __construct ($aOptions, $oTemplate = false)
  15. {
  16. parent::__construct ($aOptions, $oTemplate);
  17. $iProfileId = bx_get_logged_profile_id();
  18. if($iProfileId !== false)
  19. $this->_aQueryAppend['profile_id'] = (int)$iProfileId;
  20. }
  21. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  22. {
  23. if(empty($this->_aQueryAppend['profile_id']))
  24. return array();
  25. $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `te`.`profile_id`=?", $this->_aQueryAppend['profile_id']);
  26. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  27. }
  28. }
  29. /** @} */