mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2025-01-02 22:50:27 +00:00
Fixed column ordering
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
parent
d1419dc893
commit
321f60eaee
@ -86,6 +86,8 @@
|
||||
name="fullordering"
|
||||
type="list"
|
||||
onchange="this.form.submit();"
|
||||
default="pulls.pull_id DESC"
|
||||
validate="options"
|
||||
>
|
||||
<option value="pulls.title ASC">JGLOBAL_TITLE_ASC</option>
|
||||
<option value="pulls.title DESC">JGLOBAL_TITLE_DESC</option>
|
||||
|
@ -39,6 +39,7 @@ class PullsModel extends ListModel
|
||||
* @since 2.0
|
||||
*/
|
||||
protected $context;
|
||||
|
||||
/**
|
||||
* Array of fields the list can be sorted on
|
||||
*
|
||||
@ -75,7 +76,7 @@ class PullsModel extends ListModel
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
protected function populateState($ordering = 'pulls.pull_id', $direction = 'DESC')
|
||||
protected function populateState($ordering = null, $direction = null)
|
||||
{
|
||||
parent::populateState(
|
||||
$ordering,
|
||||
@ -307,6 +308,7 @@ class PullsModel extends ListModel
|
||||
|
||||
$ordering = $this->getState()->get('list.ordering', 'pulls.pull_id');
|
||||
$direction = $this->getState()->get('list.direction', 'DESC');
|
||||
|
||||
if (!empty($ordering)) {
|
||||
$query->order(
|
||||
$db->escape($ordering) . ' ' . $db->escape($direction)
|
||||
|
@ -20,6 +20,9 @@ use Joomla\CMS\Router\Route;
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', ['version' => '3.5.0', 'relative' => true]);
|
||||
HTMLHelper::_('script', 'com_patchtester/patchtester.js', ['version' => 'auto', 'relative' => true]);
|
||||
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="row">
|
||||
@ -43,10 +46,10 @@ HTMLHelper::_('script', 'com_patchtester/patchtester.js', ['version' => 'auto',
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" style="width:5%" class="text-center">
|
||||
<?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?>
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'COM_PATCHTESTER_PULL_ID', 'pulls.pull_id', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" style="min-width:100px">
|
||||
<?php echo Text::_('JGLOBAL_TITLE'); ?>
|
||||
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'pulls.title', $listDirn, $listOrder); ?>
|
||||
</th>
|
||||
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
|
||||
<?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?>
|
||||
|
Loading…
Reference in New Issue
Block a user