Skip to content

Commit

Permalink
[com_associations] Creating missing filters
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 committed Mar 15, 2017
1 parent 08c4ec0 commit ef77a55
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@ protected function getListQuery()
// Filter on the level.
if ($level = $this->getState('filter.level'))
{
$tableAlias = in_array($extensionName, array('com_menus', 'com_categories')) ? 'a' : 'c';
$query->where($db->qn($tableAlias . '.level') . ' <= ' . ((int) $level + (int) $baselevel - 1));
$query->where($db->qn( 'a.level') . ' <= ' . ((int) $level + (int) $baselevel - 1));
}

// Filter by menu type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function display($tpl = null)
unset($this->activeFilters['state']);
$this->filterForm->removeField('state', 'filter');
}
if ($type !== 'category')
if (empty($support['category']))
{
unset($this->activeFilters['category_id']);
$this->filterForm->removeField('category_id', 'filter');
Expand All @@ -138,7 +138,7 @@ public function display($tpl = null)
unset($this->activeFilters['menutype']);
$this->filterForm->removeField('menutype', 'filter');
}
if (!in_array($extensionName, array('com_categories', 'com_menus')))
if (empty($support['level']))
{
unset($this->activeFilters['level']);
$this->filterForm->removeField('level', 'filter');
Expand Down Expand Up @@ -213,7 +213,7 @@ protected function addToolbar()
{
JToolbarHelper::title(JText::_('COM_ASSOCIATIONS_TITLE_LIST_SELECT'), 'contract');
}

if ($user->authorise('core.admin', 'com_associations') || $user->authorise('core.options', 'com_associations'))
{
if (!isset($this->typeName))
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_contact/helpers/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['category'] = true;

$tables = array(
'a' => '#__contact_details'
Expand All @@ -170,6 +171,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;

$tables = array(
'a' => '#__categories'
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_content/helpers/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['category'] = true;

$tables = array(
'a' => '#__content'
Expand All @@ -168,6 +169,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;

$tables = array(
'a' => '#__categories'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;

$tables = array(
'a' => '#__menu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['category'] = true;

$tables = array(
'a' => '#__newsfeeds'
Expand All @@ -171,6 +172,7 @@ public function getType($typeName = '')
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;

$tables = array(
'a' => '#__categories'
Expand Down

0 comments on commit ef77a55

Please sign in to comment.