Преглед изворни кода

Ticket #5273 - Get rid of duplicates in code.

AntonLV пре 11 месеци
родитељ
комит
e2a233de08

+ 88 - 0
modules/base/general/classes/BxBaseModGeneralGrid.php

@@ -0,0 +1,88 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseGeneral Base classes for modules
+ * @ingroup     UnaModules
+ * @{
+ */
+
+class BxBaseModGeneralGrid extends BxTemplGrid
+{
+    protected $MODULE;
+    protected $_sModule;
+    protected $_oModule;
+
+    protected $_sParamsDivider;
+
+    protected $_sJsObject;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        $this->MODULE = $this->MODULE ?: $this->_sModule;
+        $this->_sModule = $this->_sModule ?: $this->MODULE;
+    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
+
+        parent::__construct ($aOptions, $oTemplate ?: $this->_oModule->_oTemplate);
+
+        $this->_sParamsDivider = '#-#';
+    }
+
+    protected function _getFilterOnChange()
+    {
+        return '';
+    }
+
+    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = true)
+    {
+        if(empty($sFilterName))
+            return '';
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $aInputValues = [];
+        if($bAddSelectOne)
+            $aInputValues[''] = _t($CNF['T']['filter_item_select_one_' . $sFilterName] ?? '_Select_one');
+
+        foreach($aFilterValues as $mixedKey => $mixedValue)
+            if(is_array($mixedValue) && isset($mixedValue['key'], $mixedValue['value']))
+                $aInputValues[$mixedValue['key']] = _t($mixedValue['value']);
+            else
+                $aInputValues[$mixedKey] = _t($mixedValue);
+
+        $aInputModules = [
+            'type' => 'select',
+            'name' => $sFilterName,
+            'attrs' => [
+                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
+                'onChange' => 'javascript:' . $this->_getFilterOnChange()
+            ],
+            'value' => $sFilterValue,
+            'values' => $aInputValues
+        ];
+
+        $oForm = new BxTemplFormView([]);
+        return $oForm->genRow($aInputModules);
+    }
+
+    protected function _getSearchInput()
+    {
+        $sOnChange = $this->_getFilterOnChange();
+
+        $aInputSearch = [
+            'type' => 'text',
+            'name' => 'search',
+            'attrs' => [
+                'id' => 'bx-grid-search-' . $this->_sObject,
+                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sOnChange,
+                'onBlur' => 'javascript:' . $sOnChange,
+            ]
+        ];
+
+        $oForm = new BxTemplFormView([]);
+        return $oForm->genRow($aInputSearch);
+    }
+}
+
+/** @} */

+ 15 - 67
modules/base/general/classes/BxBaseModGeneralGridAdministration.php

@@ -11,11 +11,8 @@
 define('BX_DOL_MANAGE_TOOLS_ADMINISTRATION', 'administration');
 define('BX_DOL_MANAGE_TOOLS_COMMON', 'common');
 
-class BxBaseModGeneralGridAdministration extends BxTemplGrid
+class BxBaseModGeneralGridAdministration extends BxBaseModGeneralGrid
 {
-    protected $MODULE;
-    protected $_oModule;
-
     protected $_sManageType;
     protected $_sParamsDivider;
 
@@ -26,10 +23,6 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
 
     public function __construct ($aOptions, $oTemplate = false)
     {
-    	$this->_oModule = BxDolModule::getInstance($this->MODULE);
-    	if(!$oTemplate)
-            $oTemplate = $this->_oModule->_oTemplate;
-
         parent::__construct ($aOptions, $oTemplate);
 
         $this->_aQueryReset = array($this->_aOptions['filter_get'], $this->_aOptions['paginate_get_start'], $this->_aOptions['paginate_get_per_page']);
@@ -182,55 +175,12 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
         return parent::_getFilterControlsAPI($aFilters);
     }
 
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = true)
-    {
-        if(empty($sFilterName) || empty($aFilterValues))
-            return '';
-
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-        $aInputValues = [];
-        if($bAddSelectOne)
-            $aInputValues[''] = _t($CNF['T']['filter_item_select_one_' . $sFilterName]);
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aInputValues[$sKey] = _t($sValue);
-
-        $aInputModules = [
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => [
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ],
-            'value' => $sFilterValue,
-            'values' => $aInputValues
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputModules);
-    }
-
-    protected function _getSearchInput()
+    protected function _getFilterOnChange()
     {
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-        $aInputSearch = array(
-            'type' => 'text',
-            'name' => 'search',
-            'attrs' => array(
-                'id' => 'bx-grid-search-' . $this->_sObject,
-                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
-                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
-            )
-        );
-
-        $oForm = new BxTemplFormView(array());
-        return $oForm->genRow($aInputSearch);
+        return $this->_oModule->_oConfig->getJsObject('manage_tools') . '.onChangeFilter(this)';
     }
 
-	protected function _getContentInfo($iId)
+    protected function _getContentInfo($iId)
     {
     	return $this->_oModule->_oDb->getContentInfoById($iId);
     }
@@ -240,25 +190,23 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
         return BxDolProfile::getInstanceMagic($iId);
     }
 
-	protected function _getManageAccountUrl($sFilter = '')
+    protected function _getManageAccountUrl($sFilter = '')
     {
     	$sModuleAccounts = 'bx_accounts';
     	if(!BxDolModuleQuery::getInstance()->isEnabledByName($sModuleAccounts))
-    		return '';
-
-		$sTypeUpc = strtoupper($this->_sManageType);
-		$oModuleAccounts = BxDolModule::getInstance($sModuleAccounts);
-		if(!$oModuleAccounts || empty($oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc]))
-			return '';
+            return '';
 
-		$sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc];
+        $sTypeUpc = strtoupper($this->_sManageType);
+        $oModuleAccounts = BxDolModule::getInstance($sModuleAccounts);
+        if(!$oModuleAccounts || empty($oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc]))
+            return '';
 
-		$sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sLink));
-		
-		if(!empty($sFilter))
-			$sLink = bx_append_url_params($sLink, array('filter' => $sFilter));
+        $sLink = $oModuleAccounts->_oConfig->CNF['URL_MANAGE_' . $sTypeUpc];
+        $sLink = bx_absolute_url(BxDolPermalinks::getInstance()->permalink($sLink));
+        if(!empty($sFilter))
+            $sLink = bx_append_url_params($sLink, ['filter' => $sFilter]);
 
-		return $sLink;
+        return $sLink;
     }
 
     protected function _enable ($mixedId, $isChecked)

+ 1 - 28
modules/boonex/convos/classes/BxCnvGrid.php

@@ -13,7 +13,6 @@ require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
 
 class BxCnvGrid extends BxBaseModGeneralGridAdministration
 {
-    protected $MODULE;
     protected $_sFilter1Name;
     protected $_sFilter1Value;
     protected $_aFilter1Values;
@@ -58,38 +57,12 @@ class BxCnvGrid extends BxBaseModGeneralGridAdministration
     }
     
     //--- Layout methods ---//
-	protected function _getFilterControls()
+    protected function _getFilterControls()
     {
         parent::_getFilterControls();
 
         return  $this->_getFilterSelectOne($this->_sFilter1Name, $this->_sFilter1Value, $this->_aFilter1Values) . $this->_getSearchInput();
     }
-    
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = true)
-    {
-        if(empty($sFilterName) || empty($aFilterValues))
-            return '';
-
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aFilterValues[$sKey] = _t($sValue);
-
-        $aInputModules = array(
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => array(
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ),
-            'value' => $sFilterValue,
-            'values' => $aFilterValues
-        );
-
-        $oForm = new BxTemplFormView(array());
-        return $oForm->genRow($aInputModules);
-    }
 
     public function performActionCompose()
     {

+ 14 - 52
modules/boonex/forum/classes/BxForumGrid.php

@@ -23,11 +23,10 @@ define('BX_FORUM_FILTER_ORDER_FEATURED', 'featured');
 define('BX_FORUM_FILTER_ORDER_FAVORITE', 'favorite');
 define('BX_FORUM_FILTER_ORDER_PARTAKEN', 'partaken');
 
-class BxForumGrid extends BxTemplGrid
+class BxForumGrid extends BxBaseModGeneralGrid
 {
-    protected $_oModule;
     protected $_sDefaultSource; 
-    
+
     protected $_sFilter1Name;
     protected $_sFilter1Value;
     protected $_aFilter1Values;
@@ -39,12 +38,10 @@ class BxForumGrid extends BxTemplGrid
     protected $_sFilter3Name;
     protected $_sFilter3Value;
     protected $_aFilter3Values;
-    
-    protected $_sParamsDivider;
 
     public function __construct ($aOptions, $oTemplate = false)
     {
-        $this->_oModule = BxDolModule::getInstance('bx_forum');
+        $this->_sModule = 'bx_forum';
 
         parent::__construct ($aOptions, $oTemplate);
         
@@ -55,7 +52,7 @@ class BxForumGrid extends BxTemplGrid
             BX_FORUM_FILTER_STATUS_UNRESOLVED => _t('_bx_forum_grid_filter_resolved_unresolved'),
         ];
 
-        if(($sFilter1 = bx_get($this->_sFilter1Name))) {
+        if(($sFilter1 = bx_get($this->_sFilter1Name)) !== false) {
             $this->_sFilter1Value = bx_process_input($sFilter1);
             $this->_aQueryAppend['filter1'] = $this->_sFilter1Value;
         }
@@ -71,11 +68,11 @@ class BxForumGrid extends BxTemplGrid
                 $this->_aFilter2Values[$aBadge['id']] = $aBadge['text'];
         }
 
-        if(($sFilter2 = bx_get($this->_sFilter2Name))) {
+        if(($sFilter2 = bx_get($this->_sFilter2Name)) !== false) {
             $this->_sFilter2Value = bx_process_input($sFilter2);
             $this->_aQueryAppend['filter2'] = $this->_sFilter2Value;
         }
-        
+
         $this->_sFilter3Name = 'filter3';
         $this->_aFilter3Values = [
             BX_FORUM_FILTER_ORDER_RECENT => _t('_bx_forum_grid_filter_order_updated'),
@@ -86,14 +83,12 @@ class BxForumGrid extends BxTemplGrid
             BX_FORUM_FILTER_ORDER_FAVORITE => _t('_bx_forum_grid_filter_order_favorite'),
             BX_FORUM_FILTER_ORDER_PARTAKEN => _t('_bx_forum_grid_filter_order_partaken'),
         ];
-        
-        if(($sFilter3 = bx_get($this->_sFilter3Name))) {
+
+        if(($sFilter3 = bx_get($this->_sFilter3Name)) !== false) {
             $this->_sFilter1Value = bx_process_input($sFilter3);
             $this->_aQueryAppend['filter3'] = $this->_sFilter1Value;
         }
 
-        $this->_sParamsDivider = '#-#';
-
         $this->_sDefaultSortingOrder = 'DESC';
         $this->_sDefaultSource = $this->_aOptions['source'];
     }
@@ -647,48 +642,15 @@ class BxForumGrid extends BxTemplGrid
         parent::_getFilterControls();
         return  $this->_getFilterSelectOne($this->_sFilter3Name, $this->_sFilter3Value, $this->_aFilter3Values) . $this->_getFilterSelectOne($this->_sFilter1Name, $this->_sFilter1Value, $this->_aFilter1Values) . (count($this->_aFilter2Values) > 0 ? $this->_getFilterSelectOne($this->_sFilter2Name, $this->_sFilter2Value, $this->_aFilter2Values) : '') . $this->_getSearchInput();
     }
-    
-    protected function _getSearchInput()
+
+    protected function _getFilterOnChange()
     {
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
-        $aInputSearch = array(
-            'type' => 'text',
-            'name' => 'search',
-            'attrs' => array(
-                'id' => 'bx-grid-search-' . $this->_sObject,
-                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
-                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
-            )
-        );
-
-        $oForm = new BxTemplFormView(array());
-        return $oForm->genRow($aInputSearch);
+        return $this->_oModule->_oConfig->getJsObject('main') . '.onChangeFilter(this)';
     }
-    
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues)
-    {
-        if(empty($sFilterName) || empty($aFilterValues))
-            return '';
 
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aFilterValues[$sKey] = _t($sValue);
-
-        $aInputModules = array(
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => array(
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ),
-            'value' => $sFilterValue,
-            'values' => $aFilterValues
-        );
-
-        $oForm = new BxTemplFormView(array());
-        return $oForm->genRow($aInputModules);
+    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = false)
+    {
+        return parent::_getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne);
     }
 }
 

+ 5 - 48
modules/boonex/invites/classes/BxInvGrid.php

@@ -9,11 +9,8 @@
  * @{
  */
 
-class BxInvGrid extends BxTemplGrid
+class BxInvGrid extends BxBaseModGeneralGrid
 {
-    protected $_sModule;
-    protected $_oModule;
-
     protected $_sFilter1Name;
     protected $_sFilter1Value;
     protected $_aFilter1Values;
@@ -21,12 +18,9 @@ class BxInvGrid extends BxTemplGrid
     
     public function __construct ($aOptions, $oTemplate = false)
     {
-        parent::__construct ($aOptions, $oTemplate);
-
         $this->_sModule = 'bx_invites';
-        $this->_oModule = BxDolModule::getInstance($this->_sModule);
 
-        $this->_sParamsDivider = '#-#';
+        parent::__construct ($aOptions, $oTemplate);
     }
 
     public function getFormCallBackUrlAPI($sAction, $iId = 0)
@@ -75,50 +69,13 @@ class BxInvGrid extends BxTemplGrid
     protected function _getFilterControls ()
     {
         parent::_getFilterControls();
+
         return  $this->_getFilterSelectOne($this->_sFilter1Name, $this->_sFilter1Value, $this->_aFilter1Values) . $this->_getSearchInput();
     }
     
-    protected function _getSearchInput()
-    {
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
-        $aInputSearch = [
-            'type' => 'text',
-            'name' => 'search',
-            'attrs' => [
-                'id' => 'bx-grid-search-' . $this->_sObject,
-                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
-                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
-            ]
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputSearch);
-    }
-    
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues)
+    protected function _getFilterOnChange()
     {
-        if(empty($sFilterName) || empty($aFilterValues))
-            return '';
-
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('main');
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aFilterValues[$sKey] = _t($sValue);
-
-        $aInputModules = [
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => [
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ],
-            'value' => $sFilterValue,
-            'values' => $aFilterValues
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputModules);
+        return $this->_oModule->_oConfig->getJsObject('main') . '.onChangeFilter(this)';
     }
 
     protected function _getId()

+ 5 - 57
modules/boonex/reputation/classes/BxReputationGridHandlers.php

@@ -9,29 +9,21 @@
  * @{
  */
 
-class BxReputationGridHandlers extends BxTemplGrid
+class BxReputationGridHandlers extends BxBaseModGeneralGrid
 {
-    protected $_sModule;
-    protected $_oModule;
-
     protected $_sFilter;
     protected $_sFilter1Name;
     protected $_sFilter1Value;
     protected $_aFilter1Values;
 
-    protected $_sParamsDivider;
-    
     public function __construct ($aOptions, $oTemplate = false)
     {
         $this->_sModule = 'bx_reputation';
-        $this->_oModule = BxDolModule::getInstance($this->_sModule);
 
         parent::__construct ($aOptions, $oTemplate);
 
         $this->_aQueryReset = array($this->_aOptions['filter_get'], $this->_aOptions['paginate_get_start'], $this->_aOptions['paginate_get_per_page']);
 
-        $this->_sParamsDivider = '#-#';
-
         $this->_sFilter = '';
         if(($sFilter = $this->_getFilterValue()))
             $this->_sFilter = $sFilter;
@@ -44,8 +36,7 @@ class BxReputationGridHandlers extends BxTemplGrid
             foreach($aUnits as $sUnit) 
                 $this->_aFilter1Values[$sUnit] = $this->_oModule->getUnitTitle($sUnit);
 
-    	$sFilter1 = bx_get($this->_sFilter1Name);
-        if(!empty($sFilter1)) {
+        if(($sFilter1 = bx_get($this->_sFilter1Name)) !== false) {
             $this->_sFilter1Value = bx_process_input($sFilter1);
             $this->_aQueryAppend['filter1'] = $this->_sFilter1Value;
         }
@@ -140,53 +131,10 @@ class BxReputationGridHandlers extends BxTemplGrid
         $sContent .= $this->_getSearchInput();
         return $sContent;
     }
-
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = true)
-    {
-        if(empty($sFilterName) || empty($aFilterValues))
-            return '';
-
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('handlers');
-
-        $aInputValues = [];
-        if($bAddSelectOne)
-            $aInputValues[''] = _t($CNF['T']['filter_item_select_one_' . $sFilterName]);
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aInputValues[$sKey] = _t($sValue);
-
-        $aInputModules = [
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => [
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ],
-            'value' => $sFilterValue,
-            'values' => $aInputValues
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputModules);
-    }
-
-    protected function _getSearchInput()
+    
+    protected function _getFilterOnChange()
     {
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('handlers');
-
-        $aInputSearch = [
-            'type' => 'text',
-            'name' => 'search',
-            'attrs' => [
-                'id' => 'bx-grid-search-' . $this->_sObject,
-                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
-                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
-            ]
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputSearch);
+        return $this->_oModule->_oConfig->getJsObject('handlers') . '.onChangeFilter(this)';
     }
 
     protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)

+ 6 - 58
modules/boonex/tasks/classes/BxTasksGridTimeAdministration.php

@@ -8,14 +8,10 @@
  * @{
  */
 
-class BxTasksGridTimeAdministration extends BxTemplGrid
+class BxTasksGridTimeAdministration extends BxBaseModGeneralGrid
 {
-    protected $_sModule;
-    protected $_oModule;
-
     protected $_iContextPid;
 
-    protected $_sParamsDivider;
     protected $_sFilter1Name;
     protected $_sFilter1Value;
     protected $_aFilter1Values;
@@ -26,9 +22,6 @@ class BxTasksGridTimeAdministration extends BxTemplGrid
     public function __construct ($aOptions, $oTemplate = false)
     {
         $this->_sModule = 'bx_tasks';
-    	$this->_oModule = BxDolModule::getInstance($this->_sModule);
-    	if(!$oTemplate)
-            $oTemplate = $this->_oModule->_oTemplate;
 
         parent::__construct ($aOptions, $oTemplate);
 
@@ -36,8 +29,6 @@ class BxTasksGridTimeAdministration extends BxTemplGrid
 
         if(($iContextPid = bx_get('context_pid')) !== false) 
             $this->setContextPid($iContextPid);
-
-        $this->_sParamsDivider = '#-#';
     }
 
     public function setContextPid($iContextPid)
@@ -184,6 +175,11 @@ class BxTasksGridTimeAdministration extends BxTemplGrid
         return $sContent;
     }
 
+    protected function _getFilterOnChange()
+    {
+        return $this->_oModule->_oConfig->getJsObject('manage_tools') . '.onChangeFilter(this)';
+    }
+
     protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
     {
         $this->_aOptions['source'] .= $this->_oModule->_oDb->prepareAsString(" AND ABS(`tt`.`allow_view_to`)=?", $this->_iContextPid);
@@ -208,54 +204,6 @@ class BxTasksGridTimeAdministration extends BxTemplGrid
         return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
     }
 
-    protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValues, $bAddSelectOne = true)
-    {
-        if(empty($sFilterName))
-            return '';
-
-        $CNF = &$this->_oModule->_oConfig->CNF;
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-        $aInputValues = [];
-        if($bAddSelectOne)
-            $aInputValues[''] = _t($CNF['T']['filter_item_select_one_' . $sFilterName]);
-
-        foreach($aFilterValues as $sKey => $sValue)
-            $aInputValues[$sKey] = _t($sValue);
-
-        $aInputModules = [
-            'type' => 'select',
-            'name' => $sFilterName,
-            'attrs' => [
-                'id' => 'bx-grid-' . $sFilterName . '-' . $this->_sObject,
-                'onChange' => 'javascript:' . $sJsObject . '.onChangeFilter(this)'
-            ],
-            'value' => $sFilterValue,
-            'values' => $aInputValues
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputModules);
-    }
-
-    protected function _getSearchInput()
-    {
-        $sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-        $aInputSearch = [
-            'type' => 'text',
-            'name' => 'search',
-            'attrs' => [
-                'id' => 'bx-grid-search-' . $this->_sObject,
-                'onKeyup' => 'javascript:$(this).off(\'keyup focusout\'); ' . $sJsObject . '.onChangeFilter(this)',
-                'onBlur' => 'javascript:' . $sJsObject . '.onChangeFilter(this)',
-            ]
-        ];
-
-        $oForm = new BxTemplFormView([]);
-        return $oForm->genRow($aInputSearch);
-    }
-
     protected function _getEntryLink($sTitle, $sUrl, $aRow)
     {
         return $this->_oTemplate->parseHtmlByName('title_link.html', [