BxDolGridRelations.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 BxDolGridRelations extends BxDolGridConnectionOut
  10. {
  11. public function __construct ($aOptions, $oTemplate = false)
  12. {
  13. parent::__construct ($aOptions, $oTemplate);
  14. $this->_sConnectionObject = 'sys_profiles_relations';
  15. }
  16. protected function _getCellRelation ($mixedValue, $sKey, $aField, $aRow)
  17. {
  18. return parent::_getCellDefault($this->_oConnection->getRelationTranslation($mixedValue), $sKey, $aField, $aRow);
  19. }
  20. protected function _getCellMutual($mixedValue, $sKey, $aField, $aRow)
  21. {
  22. $mixedValue = _t('_sys_' . ((int)$mixedValue != 1 ? 'un' : '') . 'confirmed');
  23. return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
  24. }
  25. protected function _getDataSql ($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  26. {
  27. if(!$this->_bOwner)
  28. $this->_aOptions['source'] .= " AND `c`.`mutual`='1'";
  29. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  30. }
  31. }
  32. /** @} */