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

Adds current version to Extension Update Manager #8768

Closed
wants to merge 4 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
25 changes: 14 additions & 11 deletions administrator/components/com_installer/models/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,38 @@ protected function getListQuery()
$group = $this->getState('filter.group');

// Grab updates ignoring new installs
$query->select('*')
->from('#__updates')
->where('extension_id != 0')
->order($this->getState('list.ordering') . ' ' . $this->getState('list.direction'));
$query = $db->getQuery(true)
->select('u.*')
->select('e.manifest_cache')
->from($db->quoteName('#__updates', 'u'))
->join('LEFT', $db->quoteName('#__extensions', 'e') . ' ON ' . $db->quoteName('e.extension_id') . ' = ' . $db->quoteName('u.extension_id'))
->where($db->quoteName('u.extension_id') . ' != 0')
->order($db->quoteName('u.' . $this->getState('list.ordering')) . ' ' . $this->getState('list.direction'));

if ($type)
{
$query->where('type=' . $db->quote($type));
$query->where('u.type = ' . $db->quote($type));
}

if ($client != '')
{
$query->where('client_id = ' . intval($client));
$query->where('u.client_id = ' . intval($client));
}

if ($group != '' && in_array($type, array('plugin', 'library', '')))
{
$query->where('folder=' . $db->quote($group == '*' ? '' : $group));
$query->where('u.folder = ' . $db->quote($group == '*' ? '' : $group));
}

// Filter by extension_id
if ($eid = $this->getState('filter.extension_id'))
{
$query->where($db->quoteName('extension_id') . ' = ' . $db->quote((int) $eid));
$query->where($db->quoteName('u.extension_id') . ' = ' . $db->quote((int) $eid));
}
else
{
$query->where($db->quoteName('extension_id') . ' != ' . $db->quote(0))
->where($db->quoteName('extension_id') . ' != ' . $db->quote(700));
$query->where($db->quoteName('u.extension_id') . ' != ' . $db->quote(0))
->where($db->quoteName('u.extension_id') . ' != ' . $db->quote(700));
}

// Filter by search
Expand All @@ -133,7 +136,7 @@ protected function getListQuery()
if (!empty($search))
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('name LIKE ' . $search);
$query->where('u.name LIKE ' . $search);
}

return $query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
<?php echo JHtml::_('grid.sort', 'COM_INSTALLER_HEADING_TYPE', 'type', $listDirn, $listOrder); ?>
</th>
<th width="10%">
<?php echo JText::_('JVERSION'); ?>
<?php echo JText::_('COM_INSTALLER_CURRENT_VERSION'); ?>
</th>
<th width="10%">
<?php echo JText::_('COM_INSTALLER_NEW_VERSION'); ?>
</th>
<th>
<?php echo JHtml::_('grid.sort', 'COM_INSTALLER_HEADING_FOLDER', 'folder', $listDirn, $listOrder); ?>
Expand All @@ -71,10 +74,12 @@
</tr>
</tfoot>
<tbody>
<?php
foreach ($this->items as $i => $item) :
$client = $item->client_id ? JText::_('JADMINISTRATOR') : JText::_('JSITE');
?>
<?php foreach ($this->items as $i => $item) : ?>
<?php
$client = $item->client_id ? JText::_('JADMINISTRATOR') : JText::_('JSITE');
$manifest = json_decode($item->manifest_cache);
$current_version = isset($manifest->version) ? $manifest->version : JText::_('JLIB_UNKNOWN');
?>
<tr class="row<?php echo $i % 2; ?>">
<td>
<?php echo JHtml::_('grid.id', $i, $item->update_id); ?>
Expand All @@ -93,7 +98,10 @@
<?php echo JText::_('COM_INSTALLER_TYPE_' . $item->type) ?>
</td>
<td>
<?php echo $item->version ?>
<span class="label label-warning"><?php echo $current_version; ?></span>
</td>
<td>
<span class="label label-success"><?php echo $item->version; ?></span>
</td>
<td>
<?php echo @$item->folder != '' ? $item->folder : JText::_('COM_INSTALLER_TYPE_NONAPPLICABLE'); ?>
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COM_INSTALLER_AUTHOR_INFORMATION="Author Information"
COM_INSTALLER_CACHETIMEOUT_DESC="For how many hours should Joomla cache extension update information."
COM_INSTALLER_CACHETIMEOUT_LABEL="Updates Caching (in hours)"
COM_INSTALLER_CONFIGURATION="Installer: Options"
COM_INSTALLER_CURRENT_VERSION="Installed"
COM_INSTALLER_ENABLED_UPDATES_1=", 1 disabled site was enabled."
COM_INSTALLER_ENABLED_UPDATES_MORE=", %s disabled sites were enabled."
COM_INSTALLER_ERROR_DISABLE_DEFAULT_TEMPLATE_NOT_PERMITTED="Disable default template is not permitted."
Expand Down Expand Up @@ -151,6 +152,7 @@ COM_INSTALLER_N_UPDATESITES_PUBLISHED_1="%d update site successfully enabled."
COM_INSTALLER_N_UPDATESITES_UNPUBLISHED="%d update sites successfully disabled."
COM_INSTALLER_N_UPDATESITES_UNPUBLISHED_1="%d update site successfully disabled."
COM_INSTALLER_NEW_INSTALL="New Install"
COM_INSTALLER_NEW_VERSION="Available"
COM_INSTALLER_NO_INSTALL_TYPE_FOUND="No Install Type Found"
COM_INSTALLER_PACKAGE_DOWNLOAD_FAILED="Failed to download package. Download it and install manually from <a href='%1$s'>%1$s</a>."
COM_INSTALLER_PACKAGE_FILE="Package File"
Expand Down