BxTasksGridCommon.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Tasks Tasks
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxTasksGridCommon extends BxBaseModTextGridCommon
  12. {
  13. protected $_sFilter3Name;
  14. protected $_sFilter3Value;
  15. protected $_aFilter3Values;
  16. public function __construct ($aOptions, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_tasks';
  19. parent::__construct ($aOptions, $oTemplate);
  20. $this->_sTableAlias = 'tt';
  21. $this->_initFilter(3, $this->_oModule->getContexts());
  22. }
  23. protected function _getCellContextModule($mixedValue, $sKey, $aField, $aRow)
  24. {
  25. return parent::_getCellDefault($this->_oModule->getModuleTitle($mixedValue), $sKey, $aField, $aRow);
  26. }
  27. protected function _getFilterControls()
  28. {
  29. $sContent = $this->_getFilterSelectOne($this->_sFilter3Name, $this->_sFilter3Value, $this->_aFilter3Values);
  30. return $sContent . parent::_getFilterControls();
  31. }
  32. protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
  33. {
  34. $this->_parseFilterValue($sFilter);
  35. if(!empty($this->_sFilter3Value))
  36. $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND `tp`.`type`=?", $this->_sFilter3Value);
  37. return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
  38. }
  39. }
  40. /** @} */