Skip to content

Commit

Permalink
Merge pull request joomla#21 from zero-24/aclajax
Browse files Browse the repository at this point in the history
merge conflicts
  • Loading branch information
brianteeman committed May 7, 2016
2 parents 0094c74 + bfed7b2 commit 13c4b4b
Show file tree
Hide file tree
Showing 402 changed files with 7,249 additions and 5,862 deletions.
19 changes: 17 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
- INSTALL_REDIS="yes"

matrix:
fast_finish: true
include:
- php: 5.3
env: INSTALL_APC="yes"
Expand All @@ -23,6 +24,18 @@ matrix:
- php: 7.0
env: INSTALL_APCU="yes" INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled apcu_bc install until https://github.com/travis-ci/travis-ci/issues/5207 is resolved
- php: hhvm
sudo: true
dist: trusty
group: edge # until the next update
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- mysql
- postgresql
env: INSTALL_APCU_BC_BETA="no" INSTALL_MEMCACHE="no" INSTALL_MEMCACHED="no" INSTALL_REDIS="no" # Disabled items that currently do not work in travis-ci hhvm
allow_failures:
- php: hhvm
Expand All @@ -36,8 +49,10 @@ before_script:
# Make sure all dev dependencies are installed
- composer install
# Set up databases for testing
- mysql -e 'create database joomla_ut;'
- mysql joomla_ut < tests/unit/schema/mysql.sql
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql -e 'create database joomla_ut;'; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then mysql joomla_ut < tests/unit/schema/mysql.sql; fi
- if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root -e 'create database joomla_ut;'; fi
- if [[ $TRAVIS_PHP_VERSION = hhvm ]]; then mysql -u root joomla_ut < tests/unit/schema/mysql.sql; fi
- psql -c 'create database joomla_ut;' -U postgres
- psql -d joomla_ut -a -f tests/unit/schema/postgresql.sql
# Set up Apache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ What is this?
---------------------
* This is a Joomla! 3.x installation/upgrade package.
* Joomla's [Official website](https://www.joomla.org).
* Joomla! 3.5 [version history](https://docs.joomla.org/Joomla_3.5_version_history).
* Joomla! 3.6 [version history](https://docs.joomla.org/Joomla_3.6_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/master).

What is Joomla?
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1- What is this?
* This is a Joomla! installation/upgrade package to version 3.x
* Joomla! Official site: https://www.joomla.org
* Joomla! 3.5 version history - https://docs.joomla.org/Joomla_3.5_version_history
* Joomla! 3.6 version history - https://docs.joomla.org/Joomla_3.6_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/master

2- What is Joomla?
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_admin/models/sysinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,11 @@ public function getExtensions()
$installed[$extension->name] = array(
'name' => $extension->name,
'type' => $extension->type,
'state' => $extension->enabled ? JText::_('JENABLED') : JText::_('JDISABLED'),
'author' => 'unknown',
'version' => 'unknown',
'creationDate' => 'unknown',
'authorUrl' => 'unknown'
'authorUrl' => 'unknown',
);

$manifest = json_decode($extension->manifest_cache);
Expand All @@ -481,7 +482,7 @@ public function getExtensions()
'author' => $manifest->author,
'version' => $manifest->version,
'creationDate' => $manifest->creationDate,
'authorUrl' => $manifest->authorUrl
'authorUrl' => $manifest->authorUrl,
);

$installed[$extension->name] = array_merge($installed[$extension->name], $extraData);
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_banners/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
default="5"
showon="save_history:1"
/>
</fieldset>

Expand Down
58 changes: 34 additions & 24 deletions administrator/components/com_banners/models/banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ 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'
'published',
'level', 'c.level',
);
}

Expand Down Expand Up @@ -114,50 +115,51 @@ protected function getListQuery()
'a.publish_down'
)
);
$query->from($db->quoteName('#__banners') . ' AS a');
$query->from($db->quoteName('#__banners', 'a'));

// Join over the language
$query->select('l.title AS language_title, l.image AS language_image')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
->join('LEFT', $db->quoteName('#__languages', 'l') . ' ON l.lang_code = a.language');

// Join over the users for the checked out user.
$query->select('uc.name AS editor')
->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
$query->select($db->quoteName('uc.name', 'editor'))
->join('LEFT', $db->quoteName('#__users', 'uc') . ' ON uc.id = a.checked_out');

// Join over the categories.
$query->select('c.title AS category_title')
->join('LEFT', '#__categories AS c ON c.id = a.catid');
$query->select($db->quoteName('c.title', 'category_title'))
->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON c.id = a.catid');

// Join over the clients.
$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');
$query->select($db->quoteName('cl.name', 'client_name'))
->select($db->quoteName('cl.purchase_type', 'client_purchase_type'))
->join('LEFT', $db->quoteName('#__banner_clients', 'cl') . ' ON cl.id = a.cid');

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

if (is_numeric($published))
{
$query->where('a.state = ' . (int) $published);
$query->where($db->quoteName('a.state') . ' = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.state IN (0, 1))');
$query->where($db->quoteName('a.state') . ' IN (0, 1)');
}

// Filter by category.
$categoryId = $this->getState('filter.category_id');

if (is_numeric($categoryId))
{
$query->where('a.catid = ' . (int) $categoryId);
$query->where($db->quoteName('a.catid') . ' = ' . (int) $categoryId);
}

// Filter by client.
$clientId = $this->getState('filter.client_id');

if (is_numeric($clientId))
{
$query->where('a.cid = ' . (int) $clientId);
$query->where($db->quoteName('a.cid') . ' = ' . (int) $clientId);
}

// Filter by search in title
Expand All @@ -167,7 +169,7 @@ protected function getListQuery()
{
if (stripos($search, 'id:') === 0)
{
$query->where('a.id = ' . (int) substr($search, 3));
$query->where($db->quoteName('a.id') . ' = ' . (int) substr($search, 3));
}
else
{
Expand All @@ -179,14 +181,20 @@ protected function getListQuery()
// Filter on the language.
if ($language = $this->getState('filter.language'))
{
$query->where('a.language = ' . $db->quote($language));
$query->where($db->quoteName('a.language') . ' = ' . $db->quote($language));
}

// Filter on the level.
if ($level = $this->getState('filter.level'))
{
$query->where($db->quoteName('c.level') . ' <= ' . (int) $level);
}

// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'ordering');
$orderCol = $this->state->get('list.ordering', 'a.name');
$orderDirn = $this->state->get('list.direction', 'ASC');

if ($orderCol == 'ordering' || $orderCol == 'category_title')
if ($orderCol == 'a.ordering' || $orderCol == 'category_title')
{
$orderCol = 'c.title ' . $orderDirn . ', a.ordering';
}
Expand Down Expand Up @@ -218,10 +226,11 @@ 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.category_id');
$id .= ':' . $this->getState('filter.client_id');
$id .= ':' . $this->getState('filter.language');
$id .= ':' . $this->getState('filter.level');

return parent::getStoreId($id);
}
Expand Down Expand Up @@ -257,11 +266,12 @@ public function getTable($type = 'Banner', $prefix = 'BannersTable', $config = a
protected function populateState($ordering = 'a.name', $direction = 'asc')
{
// Load the filter state.
$this->setState('filter.search', $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'));
$this->setState('filter.state', $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string'));
$this->setState('filter.category_id', $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', ''));
$this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', ''));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''));
$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', '', 'cmd'));
$this->setState('filter.client_id', $this->getUserStateFromRequest($this->context . '.filter.client_id', 'filter_client_id', '', 'cmd'));
$this->setState('filter.language', $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
$this->setState('filter.level', $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level', '', 'cmd'));

// Load the parameters.
$this->setState('params', JComponentHelper::getParams('com_banners'));
Expand Down
Loading

0 comments on commit 13c4b4b

Please sign in to comment.