Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solves hathor searchtools bugs and some regressions #35

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions administrator/components/com_banners/models/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ public function __construct($config = array())
'clicks', 'a.clicks',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'state', 'sticky', 'a.sticky',
'sticky', 'a.sticky',
'client_id',
'category_id',
'published'
);
}

Expand Down Expand Up @@ -132,14 +131,14 @@ protected function getListQuery()
$query->select('cl.name AS client_name,cl.purchase_type as client_purchase_type')
->join('LEFT', '#__banner_clients AS cl ON cl.id = a.cid');

// Filter by published state
$published = $this->getState('filter.published');
// Filter by state
$state = $this->getState('filter.state');

if (is_numeric($published))
if (is_numeric($state))
{
$query->where('a.state = ' . (int) $published);
$query->where('a.state = ' . (int) $state);
}
elseif ($published === '')
elseif ($state === '')
{
$query->where('(a.state IN (0, 1))');
}
Expand Down Expand Up @@ -218,8 +217,7 @@ protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.access');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.category_id');
$id .= ':' . $this->getState('filter.language');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="js-stools-search-string"
/>
<field
name="published"
name="state"
type="status"
label="JOPTION_SELECT_PUBLISHED"
description="JOPTION_SELECT_PUBLISHED_DESC"
Expand All @@ -29,15 +29,15 @@
<option value="">JOPTION_SELECT_CATEGORY</option>
</field>
<field
name="client_id"
type="bannerclient"
label="COM_BANNERS_FILTER_CLIENT"
extension="com_content"
description="COM_BANNERS_FILTER_CLIENT_DESC"
onchange="this.form.submit();"
>
<option value="">COM_BANNERS_SELECT_CLIENT</option>
</field>
name="client_id"
type="bannerclient"
label="COM_BANNERS_FILTER_CLIENT"
extension="com_content"
description="COM_BANNERS_FILTER_CLIENT_DESC"
onchange="this.form.submit();"
>
<option value="">COM_BANNERS_SELECT_CLIENT</option>
</field>
<field
name="language"
type="contentlanguage"
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_banners/models/tracks.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ protected function populateState($ordering = 'b.name', $direction = 'asc')
{
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', null, 'int'));
$this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', null, 'int'));
$this->setState('filter.type', $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', null, 'int'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'cmd'));
$this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', '', 'cmd'));
$this->setState('filter.type', $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type', '', 'cmd'));
$this->setState('filter.begin', $this->getUserStateFromRequest($this->context . '.filter.begin', 'filter_begin', '', 'string'));
$this->setState('filter.end', $this->getUserStateFromRequest($this->context . '.filter.end', 'filter_end', '', 'string'));

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_categories/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ protected function populateState($ordering = 'a.lft', $direction = 'asc')

$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.search', 'filter_search', '', 'string'));
$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'cmd'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.tag', $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '', 'string'));
$this->setState('filter.level', $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', '', 'string'));

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_contact/models/contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ protected function populateState($ordering = 'a.name', $direction = 'asc')
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'string'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'cmd'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.tag', $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '', 'string'));

// List state information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function populateState($ordering = 'a.ordering', $direction = 'asc')
{
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));

// Load the parameters.
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_modules/models/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ protected function populateState($ordering = 'a.position', $direction = 'asc')
// If in backend (modal or not) we get the same fields from the user request.
else
{
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'cmd'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'cmd'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'));
}

// Special case for the client id.
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_newsfeeds/models/newsfeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ protected function populateState($ordering = 'a.name', $direction = 'asc')
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', null, 'int'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'cmd'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '', 'cmd'));
$this->setState('filter.access', $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.tag', $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '', 'string'));

// Load the parameters.
Expand Down
12 changes: 6 additions & 6 deletions administrator/components/com_plugins/models/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string');
$this->setState('filter.search', $search);

$accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
$accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'cmd');
$this->setState('filter.access', $accessId);

$state = $this->getUserStateFromRequest($this->context . '.filter.enabled', 'filter_enabled', '', 'string');
$state = $this->getUserStateFromRequest($this->context . '.filter.enabled', 'filter_enabled', '', 'cmd');
$this->setState('filter.enabled', $state);

$folder = $this->getUserStateFromRequest($this->context . '.filter.folder', 'filter_folder', null, 'cmd');
$folder = $this->getUserStateFromRequest($this->context . '.filter.folder', 'filter_folder', '', 'string');
$this->setState('filter.folder', $folder);

$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string');
$this->setState('filter.language', $language);

// Load the parameters.
Expand All @@ -100,7 +100,7 @@ protected function getStoreId($id = '')
// Compile the store id.
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.access');
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.enabled');
$id .= ':' . $this->getState('filter.folder');
$id .= ':' . $this->getState('filter.language');

Expand Down
8 changes: 3 additions & 5 deletions administrator/components/com_users/models/notes.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function __construct($config = array())
'review_time', 'a.review_time',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'published',
);
}

Expand Down Expand Up @@ -152,7 +153,7 @@ protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.state');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.category_id');
$id .= ':' . $this->getState('filter.user_id');

Expand Down Expand Up @@ -202,11 +203,8 @@ protected function populateState($ordering = 'a.review_time', $direction = 'desc
}

$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'));

$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string'));

$this->setState('filter.published', $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '', 'string'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id'));

$this->setState('filter.user_id', $this->getUserStateFromRequest($this->context . '.filter.user_id', 'filter_user_id'));

parent::populateState($ordering, $direction);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_users/models/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ protected function populateState($ordering = 'a.name', $direction = 'asc')

// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '', 'string'));
$this->setState('filter.active', $this->getUserStateFromRequest($this->context . '.filter.active', 'filter_active', null, 'int'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', null, 'int'));
$this->setState('filter.active', $this->getUserStateFromRequest($this->context . '.filter.active', 'filter_active', '', 'cmd'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'cmd'));
$this->setState('filter.group_id', $this->getUserStateFromRequest($this->context . '.filter.group_id', 'filter_group_id', null, 'int'));
$this->setState('filter.range', $this->getUserStateFromRequest($this->context . '.filter.range', 'filter_range', '', 'cmd'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<?php foreach ($this->items as $i => $item) :?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<?php echo $item->name;?>
<?php echo $item->banner_name;?>
</td>
<td>
<?php echo $item->client_name;?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</label>
<select name="filter_status" id="filter_status">
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
<?php echo JHtml::_('select.options', InstallerHelper::getExtensionTypes(), 'value', 'text', $this->state->get('filter.status'), true);?>
<?php echo JHtml::_('select.options', InstallerHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.status'), true);?>
</select>

<label class="selectlabel" for="filter_type">
Expand All @@ -43,12 +43,12 @@
<?php echo JHtml::_('select.options', InstallerHelper::getExtensionTypes(), 'value', 'text', $this->state->get('filter.type'), true);?>
</select>

<label class="selectlabel" for="filter_group">
<label class="selectlabel" for="filter_folder">
<?php echo JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT'); ?>
</label>
<select name="filter_group" id="filter_group">
<select name="filter_folder" id="filter_folder">
<option value=""><?php echo JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT');?></option>
<?php echo JHtml::_('select.options', array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))), 'value', 'text', $this->state->get('filter.group'), true);?>
<?php echo JHtml::_('select.options', array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))), 'value', 'text', $this->state->get('filter.folder'), true);?>
</select>

<button type="submit" id="filter-go">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</label>
<select name="filter_published" id="filter_published">
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
<?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true);?>
<?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
</select>

<label class="selectlabel" for="filter_category_id">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
</div>

<div class="filter-select">
<label class="selectlabel" for="filter_state">
<label class="selectlabel" for="filter_enabled">
<?php echo JText::_('JOPTION_SELECT_PUBLISHED'); ?>
</label>
<select name="filter_state" id="filter_state">
<select name="filter_enabled" id="filter_enabled">
<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
<?php echo JHtml::_('select.options', PluginsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true);?>
<?php echo JHtml::_('select.options', PluginsHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.enabled'), true);?>
</select>

<label class="selectlabel" for="filter_folder">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<?php
echo JHtml::_(
'select.options', JHtml::_('jgrid.publishedOptions'),
'value', 'text', $this->state->get('filter.state'), true
'value', 'text', $this->state->get('filter.published'), true
); ?>
</select>

Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
},
"vendor-dir": "libraries/vendor"
},
"support": {
"issues":"https://issues.joomla.org",
"irc":"http://irc.lc/freenode/joomla/",
"forum":"http://forum.joomla.org/",
"docs":"https://docs.joomla.org"
},
"require": {
"php": ">=5.3.10",
"joomla/application": "~1.5",
Expand Down