BxDolGridConnectionsRequests.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 UnaCore UNA Core
  7. * @{
  8. */
  9. class BxDolGridConnectionsRequests extends BxDolGridConnections
  10. {
  11. public function __construct ($aOptions, $oTemplate = false)
  12. {
  13. parent::__construct ($aOptions, $oTemplate);
  14. }
  15. public function init()
  16. {
  17. $bResult = parent::init();
  18. if(!$bResult)
  19. return $bResult;
  20. $aSQLParts = $this->_oConnection->getConnectedInitiatorsAsSQLParts('p', 'id', $this->_oProfile->id(), $this->_bOwner ? 0 : true);
  21. $this->addMarkers(array(
  22. 'join_connections' => $aSQLParts['join']
  23. ));
  24. return true;
  25. }
  26. public function getCode ($isDisplayHeader = true)
  27. {
  28. if(!isLogged())
  29. bx_require_authentication();
  30. if(!$this->_bOwner)
  31. return MsgBox(_t('_Access denied'));
  32. return parent::getCode($isDisplayHeader);
  33. }
  34. }
  35. /** @} */