Skip to content

Commit

Permalink
Bug #42 fix: User List - Sort by User name, T&C Title, T&C Code, Vers…
Browse files Browse the repository at this point in the history
…ion and T&C Accepted date are not working. (#43)

* Bug #158103 fix: User List - Sort by User name, T&C Title, T&C Code, Version and T&C Accepted date are not working

* Bug #158103 fix: User List - Sort by User name, T&C Title, T&C Code, Version and T&C Accepted date are not working

* Bug #158103 fix: User List - Sort by User name, T&C Title, T&C Code, Version and T&C Accepted date are not working
  • Loading branch information
paritshivani authored Feb 25, 2020
1 parent ebfa4cb commit 0866bde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/components/com_tc/administrator/models/usertcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ public function __construct($config = array())
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'tc_id', 'a.`tc_id`',
'user_id', 'a.`user_id`',
'name', 'uc.`name`',
'title', 'c.`title`',
'client', 'c.`client`',
'accepted_date', 'a.`accepted_date`',
'version', 'c.`version`'
);
}

Expand All @@ -55,7 +54,7 @@ public function __construct($config = array())
*
* @throws Exception
*/
protected function populateState($ordering = null, $direction = null)
protected function populateState($ordering = 'c.title', $direction = 'asc')
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
Expand All @@ -72,7 +71,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('params', $params);

// List state information.
parent::populateState('c.title', 'asc');
parent::populateState($ordering, $direction);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@
<thead>
<tr>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TC_USERTCS_NAME', 'uc.`name`', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_TC_USERTCS_NAME', 'uc.`name`', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TC_USERTCS_TITLE', 'c.`title`', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_TC_USERTCS_TITLE', 'c.`title`', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TC_USERTCS_TC_CODE', 'c.`client`', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_TC_USERTCS_TC_CODE', 'c.`client`', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TC_CONTENTS_VERSION', 'c.`version`', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_TC_CONTENTS_VERSION', 'c.`version`', $listDirn, $listOrder); ?>
</th>
<th class='left'>
<?php echo JHtml::_('grid.sort', 'COM_TC_USERTCS_ACCEPTED_DATE', 'a.`accepted_date`', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_TC_USERTCS_ACCEPTED_DATE', 'a.`accepted_date`', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
Expand Down Expand Up @@ -118,8 +118,6 @@
<?php
endif; ?>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>"/>
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>"/>
<?php echo JHtml::_('form.token'); ?>
</div>
</form>

0 comments on commit 0866bde

Please sign in to comment.