Moved filter above list admin view. Number of other bug fixes with JCB 2.12.2

This commit is contained in:
Llewellyn van der Merwe 2020-12-10 18:23:44 +02:00
parent 4f7858e4b0
commit 85490b1a3d
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
50 changed files with 1702 additions and 934 deletions

View File

@ -8,18 +8,18 @@ A component to keep track of release checking.
+ *Author*: [Joomla! Project](mailto:admin@joomla.org)
+ *Name*: [Track Release Checking](http://www.joomla.org)
+ *First Build*: 29th July, 2020
+ *Last Build*: 19th November, 2020
+ *Last Build*: 10th December, 2020
+ *Version*: 1.0.x
+ *Copyright*: (C) 2020 Open Source Matters, Inc.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
## Some Fun Numbers
+ *Line count*: **20351**
+ *File count*: **191**
+ *Line count*: **21121**
+ *File count*: **200**
+ *Folder count*: **56**
**57 Hours** or **7 Eight Hour Days** (actual time the author saved -
**59 Hours** or **7 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,

View File

@ -8,18 +8,18 @@ A component to keep track of release checking.
+ *Author*: [Joomla! Project](mailto:admin@joomla.org)
+ *Name*: [Track Release Checking](http://www.joomla.org)
+ *First Build*: 29th July, 2020
+ *Last Build*: 19th November, 2020
+ *Last Build*: 10th December, 2020
+ *Version*: 1.0.x
+ *Copyright*: (C) 2020 Open Source Matters, Inc.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
## Some Fun Numbers
+ *Line count*: **20351**
+ *File count*: **191**
+ *Line count*: **21121**
+ *File count*: **200**
+ *Folder count*: **56**
**57 Hours** or **7 Eight Hour Days** (actual time the author saved -
**59 Hours** or **7 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,

View File

@ -53,7 +53,7 @@ class Release_checkingControllerActions extends JControllerAdmin
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
ArrayHelper::toInteger($pks);
$pks = ArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Actions');
// get the data to export

View File

@ -53,7 +53,7 @@ class Release_checkingControllerContexts extends JControllerAdmin
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
ArrayHelper::toInteger($pks);
$pks = ArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Contexts');
// get the data to export

View File

@ -53,7 +53,7 @@ class Release_checkingControllerJoomla_versions extends JControllerAdmin
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
ArrayHelper::toInteger($pks);
$pks = ArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Joomla_versions');
// get the data to export

View File

@ -53,7 +53,7 @@ class Release_checkingControllerRelease_checks extends JControllerAdmin
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// Sanitize the input
ArrayHelper::toInteger($pks);
$pks = ArrayHelper::toInteger($pks);
// Get the model
$model = $this->getModel('Release_checks');
// get the data to export

View File

@ -166,6 +166,35 @@ COM_RELEASE_CHECKING_EDIT_VERSIONS_DESC="Allows users in this group to edit vers
COM_RELEASE_CHECKING_EXPORT_DATA="Export Data"
COM_RELEASE_CHECKING_EXPORT_DATA_DESC="Allows users in this group to export data."
COM_RELEASE_CHECKING_EXPORT_FAILED="Export Failed"
COM_RELEASE_CHECKING_FILTER_ACTION_ASCENDING="Action ascending"
COM_RELEASE_CHECKING_FILTER_ACTION_DESCENDING="Action descending"
COM_RELEASE_CHECKING_FILTER_CONTEXT_ASCENDING="Context ascending"
COM_RELEASE_CHECKING_FILTER_CONTEXT_DESCENDING="Context descending"
COM_RELEASE_CHECKING_FILTER_CREATED_BY_ASCENDING="Created By ascending"
COM_RELEASE_CHECKING_FILTER_CREATED_BY_DESCENDING="Created By descending"
COM_RELEASE_CHECKING_FILTER_JOOMLA_VERSION_ASCENDING="Joomla Version ascending"
COM_RELEASE_CHECKING_FILTER_JOOMLA_VERSION_DESCENDING="Joomla Version descending"
COM_RELEASE_CHECKING_FILTER_NAME_ASCENDING="Name ascending"
COM_RELEASE_CHECKING_FILTER_NAME_DESCENDING="Name descending"
COM_RELEASE_CHECKING_FILTER_OUTCOME_ASCENDING="Outcome ascending"
COM_RELEASE_CHECKING_FILTER_OUTCOME_DESCENDING="Outcome descending"
COM_RELEASE_CHECKING_FILTER_PUBLISHED="Status"
COM_RELEASE_CHECKING_FILTER_PUBLISHED_ACTIONS="Status options for actions"
COM_RELEASE_CHECKING_FILTER_PUBLISHED_CONTEXTS="Status options for contexts"
COM_RELEASE_CHECKING_FILTER_PUBLISHED_JOOMLA_VERSIONS="Status options for joomla versions"
COM_RELEASE_CHECKING_FILTER_PUBLISHED_RELEASE_CHECKS="Status options for release checks"
COM_RELEASE_CHECKING_FILTER_SEARCH="Searchrelease checks"
COM_RELEASE_CHECKING_FILTER_SEARCH_ACTIONS="Search the action items. Prefix with ID: to search for an item by ID."
COM_RELEASE_CHECKING_FILTER_SEARCH_CONTEXTS="Search the context items. Prefix with ID: to search for an item by ID."
COM_RELEASE_CHECKING_FILTER_SEARCH_JOOMLA_VERSIONS="Search the joomla version items. Prefix with ID: to search for an item by ID."
COM_RELEASE_CHECKING_FILTER_SEARCH_RELEASE_CHECKS="Search the release check items. Prefix with ID: to search for an item by ID."
COM_RELEASE_CHECKING_FILTER_SELECT_ACCESS="Select Access"
COM_RELEASE_CHECKING_FILTER_SELECT_ACTION="Select Action"
COM_RELEASE_CHECKING_FILTER_SELECT_CONTEXT="Select Context"
COM_RELEASE_CHECKING_FILTER_SELECT_CREATED_BY="Select Created By"
COM_RELEASE_CHECKING_FILTER_SELECT_JOOMLA_VERSION="Select Joomla Version"
COM_RELEASE_CHECKING_FILTER_SELECT_NAME="Select Name"
COM_RELEASE_CHECKING_FILTER_SELECT_OUTCOME="Select Outcome"
COM_RELEASE_CHECKING_HELP_MANAGER="Help"
COM_RELEASE_CHECKING_IMPORT_CONTINUE="Continue"
COM_RELEASE_CHECKING_IMPORT_DATA="Import Data"

View File

@ -0,0 +1,40 @@
<?php
/**
* @package Joomla.CMS
* @subpackage com_release_checking
*
* @copyright (C) 2020 Open Source Matters, Inc. <http://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm();
// get the layout fields override method name (from layout path/ID)
$layout_path_array = explode('.', $this->getLayoutId());
// Since we cannot pass the layout and tab names as parameters to the model method
// this name combination of tab and layout in the method name is the only work around
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
// example of layout name: details_left.php
// example of method name: getFields_details_left()
$fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'name'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -24,7 +24,6 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'name',
'alias'
);
@ -32,12 +31,10 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
</div>
<?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?>
<?php endif; ?>

View File

@ -24,21 +24,28 @@ class Release_checkingModelActions extends JModelList
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.access','access',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
'a.name','name',
'g.name'
'g.name','context'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -48,30 +55,46 @@ class Release_checkingModelActions extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
}
// Check if the form was submitted
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
}
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
$this->setState('filter.name', $name);
if ($formSubmited)
{
$name = $app->input->post->get('name');
$this->setState('filter.name', $name);
}
$context = $this->getUserStateFromRequest($this->context . '.filter.context', 'filter_context');
$this->setState('filter.context', $context);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
if ($formSubmited)
{
$context = $app->input->post->get('context');
$this->setState('filter.context', $context);
}
// List state information.
parent::populateState($ordering, $direction);
@ -132,9 +155,17 @@ class Release_checkingModelActions extends JModelList
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (Release_checkingHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_release_checking'))
@ -158,9 +189,21 @@ class Release_checkingModelActions extends JModelList
}
// Filter by Name.
if ($name = $this->getState('filter.name'))
$_name = $this->getState('filter.name');
if (is_numeric($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($name)));
if (is_float($_name))
{
$query->where('a.name = ' . (float) $_name);
}
else
{
$query->where('a.name = ' . (int) $_name);
}
}
elseif (Release_checkingHelper::checkString($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
// Add the list ordering clause.
@ -310,6 +353,18 @@ class Release_checkingModelActions extends JModelList
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_access = $this->getState('filter.access');
if (Release_checkingHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_access);
}
// Check if this is only an int or string
elseif (is_numeric($_access)
|| Release_checkingHelper::checkString($_access))
{
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');

View File

@ -24,6 +24,7 @@ class Release_checkingModelContexts extends JModelList
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.access','access',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
@ -33,11 +34,17 @@ class Release_checkingModelContexts extends JModelList
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -47,27 +54,39 @@ class Release_checkingModelContexts extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
}
// Check if the form was submitted
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
}
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
$this->setState('filter.name', $name);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
if ($formSubmited)
{
$name = $app->input->post->get('name');
$this->setState('filter.name', $name);
}
// List state information.
parent::populateState($ordering, $direction);
@ -124,9 +143,17 @@ class Release_checkingModelContexts extends JModelList
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (Release_checkingHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_release_checking'))
@ -150,9 +177,21 @@ class Release_checkingModelContexts extends JModelList
}
// Filter by Name.
if ($name = $this->getState('filter.name'))
$_name = $this->getState('filter.name');
if (is_numeric($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($name)));
if (is_float($_name))
{
$query->where('a.name = ' . (float) $_name);
}
else
{
$query->where('a.name = ' . (int) $_name);
}
}
elseif (Release_checkingHelper::checkString($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
// Add the list ordering clause.
@ -294,6 +333,18 @@ class Release_checkingModelContexts extends JModelList
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_access = $this->getState('filter.access');
if (Release_checkingHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_access);
}
// Check if this is only an int or string
elseif (is_numeric($_access)
|| Release_checkingHelper::checkString($_access))
{
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');

View File

@ -162,7 +162,9 @@ class JFormFieldActions extends JFormFieldList
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', 'Select an action');
if ($this->multiple === false) {
$options[] = JHtml::_('select.option', '', 'Select an option');
}
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->action_name);

View File

@ -0,0 +1,65 @@
<?php
/**
* @package Joomla.CMS
* @subpackage com_release_checking
*
* @copyright (C) 2020 Open Source Matters, Inc. <http://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Actionsfiltername Form Field class for the Release_checking component
*/
class JFormFieldActionsfiltername extends JFormFieldList
{
/**
* The actionsfiltername field type.
*
* @var string
*/
public $type = 'actionsfiltername';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__release_checking_action'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_NAME') . ' -');
if ($results)
{
$results = array_unique($results);
foreach ($results as $name)
{
// Now add the name and its text to the options array
$_filter[] = JHtml::_('select.option', $name, $name);
}
}
return $_filter;
}
}

View File

@ -161,7 +161,9 @@ class JFormFieldContexts extends JFormFieldList
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', 'Select an option');
if ($this->multiple === false) {
$options[] = JHtml::_('select.option', '', 'Select an option');
}
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->context_name);

View File

@ -0,0 +1,65 @@
<?php
/**
* @package Joomla.CMS
* @subpackage com_release_checking
*
* @copyright (C) 2020 Open Source Matters, Inc. <http://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Contextsfiltername Form Field class for the Release_checking component
*/
class JFormFieldContextsfiltername extends JFormFieldList
{
/**
* The contextsfiltername field type.
*
* @var string
*/
public $type = 'contextsfiltername';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__release_checking_context'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_NAME') . ' -');
if ($results)
{
$results = array_unique($results);
foreach ($results as $name)
{
// Now add the name and its text to the options array
$_filter[] = JHtml::_('select.option', $name, $name);
}
}
return $_filter;
}
}

View File

@ -161,7 +161,9 @@ class JFormFieldJoomlaversions extends JFormFieldList
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', 'Select an option');
if ($this->multiple === false) {
$options[] = JHtml::_('select.option', '', 'Select an option');
}
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->joomla_version_name);

View File

@ -0,0 +1,64 @@
<?php
/**
* @package Joomla.CMS
* @subpackage com_release_checking
*
* @copyright (C) 2020 Open Source Matters, Inc. <http://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Releasechecksfiltercreatedby Form Field class for the Release_checking component
*/
class JFormFieldReleasechecksfiltercreatedby extends JFormFieldList
{
/**
* The releasechecksfiltercreatedby field type.
*
* @var string
*/
public $type = 'releasechecksfiltercreatedby';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('created_by'));
$query->from($db->quoteName('#__release_checking_release_check'));
$query->order($db->quoteName('created_by') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
if ($results)
{
$results = array_unique($results);
foreach ($results as $created_by)
{
// Now add the created_by and its text to the options array
$_filter[] = JHtml::_('select.option', $created_by, JFactory::getUser($created_by)->name);
}
}
return $_filter;
}
}

View File

@ -0,0 +1,68 @@
<?php
/**
* @package Joomla.CMS
* @subpackage com_release_checking
*
* @copyright (C) 2020 Open Source Matters, Inc. <http://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Releasechecksfilteroutcome Form Field class for the Release_checking component
*/
class JFormFieldReleasechecksfilteroutcome extends JFormFieldList
{
/**
* The releasechecksfilteroutcome field type.
*
* @var string
*/
public $type = 'releasechecksfilteroutcome';
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
protected function getOptions()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('outcome'));
$query->from($db->quoteName('#__release_checking_release_check'));
$query->order($db->quoteName('outcome') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
$_filter = array();
if ($results)
{
// get release_checksmodel
$model = Release_checkingHelper::getModel('release_checks');
$results = array_unique($results);
foreach ($results as $outcome)
{
// Translate the outcome selection
$text = $model->selectionTranslation($outcome,'outcome');
// Now add the outcome and its text to the options array
$_filter[] = JHtml::_('select.option', $outcome, JText::_($text));
}
}
return $_filter;
}
}

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_release_checking/models/rules"
addfieldpath="/administrator/components/com_release_checking/models/fields"
>
<fields name="filter">
<field
type="text"
name="search"
inputmode="search"
label="COM_RELEASE_CHECKING_FILTER_SEARCH"
description="COM_RELEASE_CHECKING_FILTER_SEARCH_ACTIONS"
hint="JSEARCH_FILTER"
/>
<field
type="status"
name="published"
label="COM_RELEASE_CHECKING_FILTER_PUBLISHED"
description="COM_RELEASE_CHECKING_FILTER_PUBLISHED_ACTIONS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
type="accesslevel"
name="access"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<field
type="actionsfiltername"
name="name"
label="COM_RELEASE_CHECKING_ACTION_NAME_LABEL"
multiple="false"
onchange="this.form.submit();"
/>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id desc"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.name ASC">COM_RELEASE_CHECKING_FILTER_NAME_ASCENDING</option>
<option value="a.name DESC">COM_RELEASE_CHECKING_FILTER_NAME_DESCENDING</option>
<option value="g.name ASC">COM_RELEASE_CHECKING_FILTER_CONTEXT_ASCENDING</option>
<option value="g.name DESC">COM_RELEASE_CHECKING_FILTER_CONTEXT_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_release_checking/models/rules"
addfieldpath="/administrator/components/com_release_checking/models/fields"
>
<fields name="filter">
<field
type="text"
name="search"
inputmode="search"
label="COM_RELEASE_CHECKING_FILTER_SEARCH"
description="COM_RELEASE_CHECKING_FILTER_SEARCH_CONTEXTS"
hint="JSEARCH_FILTER"
/>
<field
type="status"
name="published"
label="COM_RELEASE_CHECKING_FILTER_PUBLISHED"
description="COM_RELEASE_CHECKING_FILTER_PUBLISHED_CONTEXTS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
type="accesslevel"
name="access"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<field
type="contextsfiltername"
name="name"
label="COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL"
multiple="false"
onchange="this.form.submit();"
/>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id desc"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.name ASC">COM_RELEASE_CHECKING_FILTER_NAME_ASCENDING</option>
<option value="a.name DESC">COM_RELEASE_CHECKING_FILTER_NAME_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_release_checking/models/rules"
addfieldpath="/administrator/components/com_release_checking/models/fields"
>
<fields name="filter">
<field
type="text"
name="search"
inputmode="search"
label="COM_RELEASE_CHECKING_FILTER_SEARCH"
description="COM_RELEASE_CHECKING_FILTER_SEARCH_JOOMLA_VERSIONS"
hint="JSEARCH_FILTER"
/>
<field
type="status"
name="published"
label="COM_RELEASE_CHECKING_FILTER_PUBLISHED"
description="COM_RELEASE_CHECKING_FILTER_PUBLISHED_JOOMLA_VERSIONS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
type="accesslevel"
name="access"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id desc"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.name ASC">COM_RELEASE_CHECKING_FILTER_NAME_ASCENDING</option>
<option value="a.name DESC">COM_RELEASE_CHECKING_FILTER_NAME_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>

View File

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_release_checking/models/rules"
addfieldpath="/administrator/components/com_release_checking/models/fields"
>
<fields name="filter">
<field
type="text"
name="search"
inputmode="search"
label="COM_RELEASE_CHECKING_FILTER_SEARCH"
description="COM_RELEASE_CHECKING_FILTER_SEARCH_RELEASE_CHECKS"
hint="JSEARCH_FILTER"
/>
<field
type="status"
name="published"
label="COM_RELEASE_CHECKING_FILTER_PUBLISHED"
description="COM_RELEASE_CHECKING_FILTER_PUBLISHED_RELEASE_CHECKS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
type="accesslevel"
name="access"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
multiple="true"
class="multipleAccessLevels"
onchange="this.form.submit();"
/>
<field
type="contexts"
name="context"
label="COM_RELEASE_CHECKING_RELEASE_CHECK_CONTEXT_LABEL"
class="multipleContexts"
multiple="true"
onchange="this.form.submit();"
/>
<field
type="actions"
name="action"
label="COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL"
class="multipleActions"
multiple="true"
onchange="this.form.submit();"
/>
<field
type="releasechecksfilteroutcome"
name="outcome"
label="COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL"
class="multipleReleasechecksfilteroutcome"
multiple="true"
onchange="this.form.submit();"
/>
<field
type="joomlaversions"
name="joomla_version"
label="COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL"
class="multipleJoomlaversions"
multiple="true"
onchange="this.form.submit();"
/>
<field
type="releasechecksfiltercreatedby"
name="created_by"
label="COM_RELEASE_CHECKING_RELEASE_CHECK_CREATED_BY_LABEL"
class="multipleReleasechecksfiltercreatedby"
multiple="true"
onchange="this.form.submit();"
/>
<input type="hidden" name="form_submited" value="1"/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id desc"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="g.name ASC">COM_RELEASE_CHECKING_FILTER_CONTEXT_ASCENDING</option>
<option value="g.name DESC">COM_RELEASE_CHECKING_FILTER_CONTEXT_DESCENDING</option>
<option value="h.name ASC">COM_RELEASE_CHECKING_FILTER_ACTION_ASCENDING</option>
<option value="h.name DESC">COM_RELEASE_CHECKING_FILTER_ACTION_DESCENDING</option>
<option value="a.outcome ASC">COM_RELEASE_CHECKING_FILTER_OUTCOME_ASCENDING</option>
<option value="a.outcome DESC">COM_RELEASE_CHECKING_FILTER_OUTCOME_DESCENDING</option>
<option value="i.name ASC">COM_RELEASE_CHECKING_FILTER_JOOMLA_VERSION_ASCENDING</option>
<option value="i.name DESC">COM_RELEASE_CHECKING_FILTER_JOOMLA_VERSION_DESCENDING</option>
<option value="a.created_by ASC">COM_RELEASE_CHECKING_FILTER_CREATED_BY_ASCENDING</option>
<option value="a.created_by DESC">COM_RELEASE_CHECKING_FILTER_CREATED_BY_DESCENDING</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="COM_CONTENT_LIST_LIMIT"
description="COM_CONTENT_LIST_LIMIT_DESC"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>

View File

@ -26,8 +26,10 @@ class Release_checkingModelJoomla_version extends JModelAdmin
*/
protected $tabLayoutFields = array(
'details' => array(
'above' => array(
'name',
'left' => array(
'name'
),
'right' => array(
'alias'
)
)

View File

@ -24,6 +24,7 @@ class Release_checkingModelJoomla_versions extends JModelList
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.access','access',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
@ -33,11 +34,17 @@ class Release_checkingModelJoomla_versions extends JModelList
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -47,27 +54,39 @@ class Release_checkingModelJoomla_versions extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
}
// Check if the form was submitted
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
}
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
$this->setState('filter.name', $name);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
if ($formSubmited)
{
$name = $app->input->post->get('name');
$this->setState('filter.name', $name);
}
// List state information.
parent::populateState($ordering, $direction);
@ -124,9 +143,17 @@ class Release_checkingModelJoomla_versions extends JModelList
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (Release_checkingHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_release_checking'))
@ -289,6 +316,18 @@ class Release_checkingModelJoomla_versions extends JModelList
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_access = $this->getState('filter.access');
if (Release_checkingHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_access);
}
// Check if this is only an int or string
elseif (is_numeric($_access)
|| Release_checkingHelper::checkString($_access))
{
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');

View File

@ -24,23 +24,30 @@ class Release_checkingModelRelease_checks extends JModelList
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.access','access',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by',
'g.name',
'h.name',
'g.name','context',
'h.name','action',
'a.outcome','outcome',
'i.name'
'i.name','joomla_version'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
*
*/
protected function populateState($ordering = null, $direction = null)
{
@ -50,39 +57,64 @@ class Release_checkingModelRelease_checks extends JModelList
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
}
// Check if the form was submitted
$formSubmited = $app->input->post->get('form_submited');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
if ($formSubmited)
{
$access = $app->input->post->get('access');
$this->setState('filter.access', $access);
}
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$context = $this->getUserStateFromRequest($this->context . '.filter.context', 'filter_context');
$this->setState('filter.context', $context);
if ($formSubmited)
{
$context = $app->input->post->get('context');
$this->setState('filter.context', $context);
}
$action = $this->getUserStateFromRequest($this->context . '.filter.action', 'filter_action');
$this->setState('filter.action', $action);
if ($formSubmited)
{
$action = $app->input->post->get('action');
$this->setState('filter.action', $action);
}
$outcome = $this->getUserStateFromRequest($this->context . '.filter.outcome', 'filter_outcome');
$this->setState('filter.outcome', $outcome);
if ($formSubmited)
{
$outcome = $app->input->post->get('outcome');
$this->setState('filter.outcome', $outcome);
}
$joomla_version = $this->getUserStateFromRequest($this->context . '.filter.joomla_version', 'filter_joomla_version');
$this->setState('filter.joomla_version', $joomla_version);
if ($formSubmited)
{
$joomla_version = $app->input->post->get('joomla_version');
$this->setState('filter.joomla_version', $joomla_version);
}
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by');
$this->setState('filter.created_by', $created_by);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
if ($formSubmited)
{
$created_by = $app->input->post->get('created_by');
$this->setState('filter.created_by', $created_by);
}
// List state information.
parent::populateState($ordering, $direction);
@ -203,9 +235,17 @@ class Release_checkingModelRelease_checks extends JModelList
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
$_access = $this->getState('filter.access');
if ($_access && is_numeric($_access))
{
$query->where('a.access = ' . (int) $access);
$query->where('a.access = ' . (int) $_access);
}
elseif (Release_checkingHelper::checkArray($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
// Filter by the Access Array.
$query->where('a.access IN (' . implode(',', $_access) . ')');
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_release_checking'))
@ -228,30 +268,205 @@ class Release_checkingModelRelease_checks extends JModelList
}
}
// Filter by context.
if ($context = $this->getState('filter.context'))
// Filter by Context.
$_context = $this->getState('filter.context');
if (is_numeric($_context))
{
$query->where('a.context = ' . $db->quote($db->escape($context)));
if (is_float($_context))
{
$query->where('a.context = ' . (float) $_context);
}
else
{
$query->where('a.context = ' . (int) $_context);
}
}
// Filter by action.
if ($action = $this->getState('filter.action'))
elseif (Release_checkingHelper::checkString($_context))
{
$query->where('a.action = ' . $db->quote($db->escape($action)));
$query->where('a.context = ' . $db->quote($db->escape($_context)));
}
elseif (Release_checkingHelper::checkArray($_context))
{
// Secure the array for the query
$_context = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (Release_checkingHelper::checkString($val))
{
return $db->quote($db->escape($val));
}
}, $_context);
// Filter by the Context Array.
$query->where('a.context IN (' . implode(',', $_context) . ')');
}
// Filter by Action.
$_action = $this->getState('filter.action');
if (is_numeric($_action))
{
if (is_float($_action))
{
$query->where('a.action = ' . (float) $_action);
}
else
{
$query->where('a.action = ' . (int) $_action);
}
}
elseif (Release_checkingHelper::checkString($_action))
{
$query->where('a.action = ' . $db->quote($db->escape($_action)));
}
elseif (Release_checkingHelper::checkArray($_action))
{
// Secure the array for the query
$_action = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (Release_checkingHelper::checkString($val))
{
return $db->quote($db->escape($val));
}
}, $_action);
// Filter by the Action Array.
$query->where('a.action IN (' . implode(',', $_action) . ')');
}
// Filter by Outcome.
if ($outcome = $this->getState('filter.outcome'))
$_outcome = $this->getState('filter.outcome');
if (is_numeric($_outcome))
{
$query->where('a.outcome = ' . $db->quote($db->escape($outcome)));
if (is_float($_outcome))
{
$query->where('a.outcome = ' . (float) $_outcome);
}
else
{
$query->where('a.outcome = ' . (int) $_outcome);
}
}
// Filter by joomla_version.
if ($joomla_version = $this->getState('filter.joomla_version'))
elseif (Release_checkingHelper::checkString($_outcome))
{
$query->where('a.joomla_version = ' . $db->quote($db->escape($joomla_version)));
$query->where('a.outcome = ' . $db->quote($db->escape($_outcome)));
}
elseif (Release_checkingHelper::checkArray($_outcome))
{
// Secure the array for the query
$_outcome = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (Release_checkingHelper::checkString($val))
{
return $db->quote($db->escape($val));
}
}, $_outcome);
// Filter by the Outcome Array.
$query->where('a.outcome IN (' . implode(',', $_outcome) . ')');
}
// Filter by Joomla_version.
$_joomla_version = $this->getState('filter.joomla_version');
if (is_numeric($_joomla_version))
{
if (is_float($_joomla_version))
{
$query->where('a.joomla_version = ' . (float) $_joomla_version);
}
else
{
$query->where('a.joomla_version = ' . (int) $_joomla_version);
}
}
elseif (Release_checkingHelper::checkString($_joomla_version))
{
$query->where('a.joomla_version = ' . $db->quote($db->escape($_joomla_version)));
}
elseif (Release_checkingHelper::checkArray($_joomla_version))
{
// Secure the array for the query
$_joomla_version = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (Release_checkingHelper::checkString($val))
{
return $db->quote($db->escape($val));
}
}, $_joomla_version);
// Filter by the Joomla_version Array.
$query->where('a.joomla_version IN (' . implode(',', $_joomla_version) . ')');
}
// Filter by Created_by.
if ($created_by = $this->getState('filter.created_by'))
$_created_by = $this->getState('filter.created_by');
if (is_numeric($_created_by))
{
$query->where('a.created_by = ' . $db->quote($db->escape($created_by)));
if (is_float($_created_by))
{
$query->where('a.created_by = ' . (float) $_created_by);
}
else
{
$query->where('a.created_by = ' . (int) $_created_by);
}
}
elseif (Release_checkingHelper::checkString($_created_by))
{
$query->where('a.created_by = ' . $db->quote($db->escape($_created_by)));
}
elseif (Release_checkingHelper::checkArray($_created_by))
{
// Secure the array for the query
$_created_by = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (Release_checkingHelper::checkString($val))
{
return $db->quote($db->escape($val));
}
}, $_created_by);
// Filter by the Created_by Array.
$query->where('a.created_by IN (' . implode(',', $_created_by) . ')');
}
// Add the list ordering clause.
@ -428,13 +643,68 @@ class Release_checkingModelRelease_checks extends JModelList
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
// Check if the value is an array
$_access = $this->getState('filter.access');
if (Release_checkingHelper::checkArray($_access))
{
$id .= ':' . implode(':', $_access);
}
// Check if this is only an int or string
elseif (is_numeric($_access)
|| Release_checkingHelper::checkString($_access))
{
$id .= ':' . $_access;
}
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.context');
$id .= ':' . $this->getState('filter.action');
$id .= ':' . $this->getState('filter.outcome');
$id .= ':' . $this->getState('filter.joomla_version');
// Check if the value is an array
$_context = $this->getState('filter.context');
if (Release_checkingHelper::checkArray($_context))
{
$id .= ':' . implode(':', $_context);
}
// Check if this is only an int or string
elseif (is_numeric($_context)
|| Release_checkingHelper::checkString($_context))
{
$id .= ':' . $_context;
}
// Check if the value is an array
$_action = $this->getState('filter.action');
if (Release_checkingHelper::checkArray($_action))
{
$id .= ':' . implode(':', $_action);
}
// Check if this is only an int or string
elseif (is_numeric($_action)
|| Release_checkingHelper::checkString($_action))
{
$id .= ':' . $_action;
}
// Check if the value is an array
$_outcome = $this->getState('filter.outcome');
if (Release_checkingHelper::checkArray($_outcome))
{
$id .= ':' . implode(':', $_outcome);
}
// Check if this is only an int or string
elseif (is_numeric($_outcome)
|| Release_checkingHelper::checkString($_outcome))
{
$id .= ':' . $_outcome;
}
// Check if the value is an array
$_joomla_version = $this->getState('filter.joomla_version');
if (Release_checkingHelper::checkArray($_joomla_version))
{
$id .= ':' . implode(':', $_joomla_version);
}
// Check if this is only an int or string
elseif (is_numeric($_joomla_version)
|| Release_checkingHelper::checkString($_joomla_version))
{
$id .= ':' . $_joomla_version;
}
return parent::getStoreId($id);
}

View File

@ -282,9 +282,4 @@ INSERT INTO `#__release_checking_action` (`id`, `alias`, `context`, `description
--
-- Always insure this column rules is large enough for all the access control values.
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.';
--
-- Always insure this column name is large enough for long component and view names.
--
ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.';
ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control.';

View File

@ -2,3 +2,9 @@ DROP TABLE IF EXISTS `#__release_checking_release_check`;
DROP TABLE IF EXISTS `#__release_checking_joomla_version`;
DROP TABLE IF EXISTS `#__release_checking_context`;
DROP TABLE IF EXISTS `#__release_checking_action`;
--
-- Always insure this column rules is reversed to Joomla defaults on uninstall. (as on 1st Dec 2020)
--
ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';

View File

@ -10,10 +10,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>

View File

@ -10,74 +10,55 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_release_checking&task=actions.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'actionList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=actions'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="actionList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_ACTIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=actions'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="actionList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_ACTIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -23,11 +23,8 @@ $edit = "index.php?option=com_release_checking&view=actions&task=action.edit";
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('core.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -14,7 +14,7 @@ defined('_JEXEC') or die('Restricted access');
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
@ -28,17 +28,17 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_ACTION_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_ACTION_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_ACTION_CONTEXT_LABEL', 'g.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_ACTION_CONTEXT_LABEL', 'g.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JText::_('COM_RELEASE_CHECKING_ACTION_DESCRIPTION_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_ACTION_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_ACTION_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
@ -46,6 +46,6 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_ACTION_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_ACTION_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -32,10 +32,14 @@ class Release_checkingViewActions extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
$this->activeFilters = $this->get('ActiveFilters');
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -150,69 +154,46 @@ class Release_checkingViewActions extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_release_checking');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Set Name Selection
$this->nameOptions = $this->getTheNameSelections();
// We do some sanitation for Name filter
if (Release_checkingHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->nameOptions[0]->value))
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
unset($this->nameOptions[0]);
}
// Only load Name filter if it has values
if (Release_checkingHelper::checkArray($this->nameOptions))
{
// Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_ACTION_NAME_LABEL').' -',
'filter_name',
JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name'))
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load access batch if create, edit and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Only load Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Name Selection
$this->nameOptions = JFormHelper::loadFieldType('actionsfiltername')->options;
// We do some sanitation for Name filter
if (Release_checkingHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->nameOptions[0]->value))
{
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_ACTION_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
unset($this->nameOptions[0]);
}
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_ACTION_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
}
}
@ -257,43 +238,11 @@ class Release_checkingViewActions extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_RELEASE_CHECKING_ACTION_NAME_LABEL'),
'g.name' => JText::_('COM_RELEASE_CHECKING_ACTION_CONTEXT_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
protected function getTheNameSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__release_checking_action'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
$results = array_unique($results);
$_filter = array();
foreach ($results as $name)
{
// Now add the name and its text to the options array
$_filter[] = JHtml::_('select.option', $name, $name);
}
return $_filter;
}
return false;
}
}

View File

@ -10,10 +10,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>

View File

@ -10,74 +10,55 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_release_checking&task=contexts.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'contextList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=contexts'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="contextList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_CONTEXTS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=contexts'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="contextList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_CONTEXTS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -23,11 +23,8 @@ $edit = "index.php?option=com_release_checking&view=contexts&task=context.edit";
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('core.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -14,7 +14,7 @@ defined('_JEXEC') or die('Restricted access');
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
@ -28,11 +28,11 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_CONTEXT_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_CONTEXT_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
@ -40,6 +40,6 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_CONTEXT_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_CONTEXT_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -32,10 +32,14 @@ class Release_checkingViewContexts extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
$this->activeFilters = $this->get('ActiveFilters');
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -150,69 +154,46 @@ class Release_checkingViewContexts extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_release_checking');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Set Name Selection
$this->nameOptions = $this->getTheNameSelections();
// We do some sanitation for Name filter
if (Release_checkingHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->nameOptions[0]->value))
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
unset($this->nameOptions[0]);
}
// Only load Name filter if it has values
if (Release_checkingHelper::checkArray($this->nameOptions))
{
// Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL').' -',
'filter_name',
JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name'))
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load access batch if create, edit and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Only load Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Name Selection
$this->nameOptions = JFormHelper::loadFieldType('contextsfiltername')->options;
// We do some sanitation for Name filter
if (Release_checkingHelper::checkArray($this->nameOptions) &&
isset($this->nameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->nameOptions[0]->value))
{
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
unset($this->nameOptions[0]);
}
// Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL').' -',
'batch[name]',
JHtml::_('select.options', $this->nameOptions, 'value', 'text')
);
}
}
@ -257,42 +238,10 @@ class Release_checkingViewContexts extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_RELEASE_CHECKING_CONTEXT_NAME_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
protected function getTheNameSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('name'));
$query->from($db->quoteName('#__release_checking_context'));
$query->order($db->quoteName('name') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
$results = array_unique($results);
$_filter = array();
foreach ($results as $name)
{
// Now add the name and its text to the options array
$_filter[] = JHtml::_('select.option', $name, $name);
}
return $_filter;
}
return false;
}
}

View File

@ -10,10 +10,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
@ -42,13 +42,18 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="release_checking_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('joomla_version.details_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'joomla_versionTab', array('active' => 'details')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'joomla_versionTab', 'details', JText::_('', true)); ?>
<?php echo JHtml::_('bootstrap.addTab', 'joomla_versionTab', 'details', JText::_('COM_RELEASE_CHECKING_JOOMLA_VERSION_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('joomla_version.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('joomla_version.details_right', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>

View File

@ -10,74 +10,55 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_release_checking&task=joomla_versions.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'joomla_versionList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=joomla_versions'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="joomla_versionList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_JOOMLA_VERSIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=joomla_versions'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="joomla_versionList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_JOOMLA_VERSIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -23,11 +23,8 @@ $edit = "index.php?option=com_release_checking&view=joomla_versions&task=joomla_
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('core.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -14,7 +14,7 @@ defined('_JEXEC') or die('Restricted access');
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
@ -28,11 +28,11 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
@ -40,6 +40,6 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_JOOMLA_VERSION_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -32,10 +32,14 @@ class Release_checkingViewJoomla_versions extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
$this->activeFilters = $this->get('ActiveFilters');
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -150,39 +154,26 @@ class Release_checkingViewJoomla_versions extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_release_checking');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
// Only load access batch if create, edit and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -227,7 +218,7 @@ class Release_checkingViewJoomla_versions extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_RELEASE_CHECKING_JOOMLA_VERSION_NAME_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')

View File

@ -10,10 +10,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>

View File

@ -10,74 +10,60 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleContexts', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_CONTEXT') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleActions', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_ACTION') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleReleasechecksfilteroutcome', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_OUTCOME') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleJoomlaversions', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_JOOMLA_VERSION') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleReleasechecksfiltercreatedby', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_CREATED_BY') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_RELEASE_CHECKING_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_release_checking&task=release_checks.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'release_checkList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<script type="text/javascript">
Joomla.orderTable = function()
{
table = document.getElementById("sortTable");
direction = document.getElementById("directionTable");
order = table.options[table.selectedIndex].value;
if (order != '<?php echo $this->listOrder; ?>')
{
dirn = 'asc';
}
else
{
dirn = direction.options[direction.selectedIndex].value;
}
Joomla.tableOrdering(order, dirn, '');
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=release_checks'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (empty($this->items)): ?>
<?php echo $this->loadTemplate('toolbar');?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo $this->loadTemplate('toolbar');?>
<table class="table table-striped" id="release_checkList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php //Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_RELEASE_CHECKS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="filter_order" value="<?php echo $this->listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->listDirn; ?>" />
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<form action="<?php echo JRoute::_('index.php?option=com_release_checking&view=release_checks'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="release_checkList">
<thead><?php echo $this->loadTemplate('head');?></thead>
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
<tbody><?php echo $this->loadTemplate('body');?></tbody>
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_RELEASE_CHECKING_RELEASE_CHECKS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
); ?>
<?php endif; ?>
<input type="hidden" name="boxchecked" value="0" />
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

View File

@ -23,11 +23,8 @@ $edit = "index.php?option=com_release_checking&view=release_checks&task=release_
<td class="order nowrap center hidden-phone">
<?php if ($canDo->get('core.edit.state')): ?>
<?php
if ($this->saveOrder)
{
$iconClass = ' inactive';
}
else
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
}

View File

@ -14,7 +14,7 @@ defined('_JEXEC') or die('Restricted access');
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
@ -28,20 +28,20 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECKS_DETAILS', 'g.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECKS_DETAILS', 'g.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL', 'h.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL', 'h.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL', 'a.outcome', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL', 'a.outcome', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL', 'i.name', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL', 'i.name', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
@ -49,6 +49,6 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('grid.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'COM_RELEASE_CHECKING_RELEASE_CHECK_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -32,10 +32,14 @@ class Release_checkingViewRelease_checks extends JViewLegacy
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
$this->activeFilters = $this->get('ActiveFilters');
// Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering';
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions
@ -150,189 +154,126 @@ class Release_checkingViewRelease_checks extends JViewLegacy
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_release_checking');
}
if ($this->canState)
{
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);
// only load if batch allowed
if ($this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
}
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
// Set Context Name Selection
$this->contextNameOptions = JFormHelper::loadFieldType('Contexts')->options;
// We do some sanitation for Context Name filter
if (Release_checkingHelper::checkArray($this->contextNameOptions) &&
isset($this->contextNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->contextNameOptions[0]->value))
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
unset($this->contextNameOptions[0]);
}
// Only load Context Name filter if it has values
if (Release_checkingHelper::checkArray($this->contextNameOptions))
{
// Context Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CONTEXT_LABEL').' -',
'filter_context',
JHtml::_('select.options', $this->contextNameOptions, 'value', 'text', $this->state->get('filter.context'))
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Context Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CONTEXT_LABEL').' -',
'batch[context]',
JHtml::_('select.options', $this->contextNameOptions, 'value', 'text')
);
}
}
// Set Action Name Selection
$this->actionNameOptions = JFormHelper::loadFieldType('Actions')->options;
// We do some sanitation for Action Name filter
if (Release_checkingHelper::checkArray($this->actionNameOptions) &&
isset($this->actionNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->actionNameOptions[0]->value))
// Only load access batch if create, edit and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
unset($this->actionNameOptions[0]);
}
// Only load Action Name filter if it has values
if (Release_checkingHelper::checkArray($this->actionNameOptions))
{
// Action Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL').' -',
'filter_action',
JHtml::_('select.options', $this->actionNameOptions, 'value', 'text', $this->state->get('filter.action'))
JHtmlBatch_::addListSelection(
JText::_('COM_RELEASE_CHECKING_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load Context Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Context Name Selection
$this->contextNameOptions = JFormHelper::loadFieldType('Contexts')->options;
// We do some sanitation for Context Name filter
if (Release_checkingHelper::checkArray($this->contextNameOptions) &&
isset($this->contextNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->contextNameOptions[0]->value))
{
// Action Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL').' -',
'batch[action]',
JHtml::_('select.options', $this->actionNameOptions, 'value', 'text')
);
unset($this->contextNameOptions[0]);
}
}
// Set Outcome Selection
$this->outcomeOptions = $this->getTheOutcomeSelections();
// We do some sanitation for Outcome filter
if (Release_checkingHelper::checkArray($this->outcomeOptions) &&
isset($this->outcomeOptions[0]->value) &&
!Release_checkingHelper::checkString($this->outcomeOptions[0]->value))
{
unset($this->outcomeOptions[0]);
}
// Only load Outcome filter if it has values
if (Release_checkingHelper::checkArray($this->outcomeOptions))
{
// Outcome Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL').' -',
'filter_outcome',
JHtml::_('select.options', $this->outcomeOptions, 'value', 'text', $this->state->get('filter.outcome'))
// Context Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CONTEXT_LABEL').' -',
'batch[context]',
JHtml::_('select.options', $this->contextNameOptions, 'value', 'text')
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load Action Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Action Name Selection
$this->actionNameOptions = JFormHelper::loadFieldType('Actions')->options;
// We do some sanitation for Action Name filter
if (Release_checkingHelper::checkArray($this->actionNameOptions) &&
isset($this->actionNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->actionNameOptions[0]->value))
{
// Outcome Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL').' -',
'batch[outcome]',
JHtml::_('select.options', $this->outcomeOptions, 'value', 'text')
);
unset($this->actionNameOptions[0]);
}
}
// Set Joomla Version Name Selection
$this->joomla_versionNameOptions = JFormHelper::loadFieldType('Joomlaversions')->options;
// We do some sanitation for Joomla Version Name filter
if (Release_checkingHelper::checkArray($this->joomla_versionNameOptions) &&
isset($this->joomla_versionNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->joomla_versionNameOptions[0]->value))
{
unset($this->joomla_versionNameOptions[0]);
}
// Only load Joomla Version Name filter if it has values
if (Release_checkingHelper::checkArray($this->joomla_versionNameOptions))
{
// Joomla Version Name Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL').' -',
'filter_joomla_version',
JHtml::_('select.options', $this->joomla_versionNameOptions, 'value', 'text', $this->state->get('filter.joomla_version'))
// Action Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL').' -',
'batch[action]',
JHtml::_('select.options', $this->actionNameOptions, 'value', 'text')
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load Outcome batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Outcome Selection
$this->outcomeOptions = JFormHelper::loadFieldType('releasechecksfilteroutcome')->options;
// We do some sanitation for Outcome filter
if (Release_checkingHelper::checkArray($this->outcomeOptions) &&
isset($this->outcomeOptions[0]->value) &&
!Release_checkingHelper::checkString($this->outcomeOptions[0]->value))
{
// Joomla Version Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL').' -',
'batch[joomla_version]',
JHtml::_('select.options', $this->joomla_versionNameOptions, 'value', 'text')
);
unset($this->outcomeOptions[0]);
}
}
// Set Created By Selection
$this->created_byOptions = $this->getTheCreated_bySelections();
// We do some sanitation for Created By filter
if (Release_checkingHelper::checkArray($this->created_byOptions) &&
isset($this->created_byOptions[0]->value) &&
!Release_checkingHelper::checkString($this->created_byOptions[0]->value))
{
unset($this->created_byOptions[0]);
}
// Only load Created By filter if it has values
if (Release_checkingHelper::checkArray($this->created_byOptions))
{
// Created By Filter
JHtmlSidebar::addFilter(
'- Select '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CREATED_BY_LABEL').' -',
'filter_created_by',
JHtml::_('select.options', $this->created_byOptions, 'value', 'text', $this->state->get('filter.created_by'))
// Outcome Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_OUTCOME_LABEL').' -',
'batch[outcome]',
JHtml::_('select.options', $this->outcomeOptions, 'value', 'text')
);
}
if ($this->canBatch && $this->canCreate && $this->canEdit)
// Only load Joomla Version Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Joomla Version Name Selection
$this->joomla_versionNameOptions = JFormHelper::loadFieldType('Joomlaversions')->options;
// We do some sanitation for Joomla Version Name filter
if (Release_checkingHelper::checkArray($this->joomla_versionNameOptions) &&
isset($this->joomla_versionNameOptions[0]->value) &&
!Release_checkingHelper::checkString($this->joomla_versionNameOptions[0]->value))
{
// Created By Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CREATED_BY_LABEL').' -',
'batch[created_by]',
JHtml::_('select.options', $this->created_byOptions, 'value', 'text')
);
unset($this->joomla_versionNameOptions[0]);
}
// Joomla Version Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_JOOMLA_VERSION_LABEL').' -',
'batch[joomla_version]',
JHtml::_('select.options', $this->joomla_versionNameOptions, 'value', 'text')
);
}
// Only load Created By batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Created By Selection
$this->created_byOptions = JFormHelper::loadFieldType('releasechecksfiltercreatedby')->options;
// We do some sanitation for Created By filter
if (Release_checkingHelper::checkArray($this->created_byOptions) &&
isset($this->created_byOptions[0]->value) &&
!Release_checkingHelper::checkString($this->created_byOptions[0]->value))
{
unset($this->created_byOptions[0]);
}
// Created By Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CREATED_BY_LABEL').' -',
'batch[created_by]',
JHtml::_('select.options', $this->created_byOptions, 'value', 'text')
);
}
}
@ -377,7 +318,7 @@ class Release_checkingViewRelease_checks extends JViewLegacy
protected function getSortFields()
{
return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'g.name' => JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CONTEXT_LABEL'),
'h.name' => JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_ACTION_LABEL'),
@ -386,73 +327,5 @@ class Release_checkingViewRelease_checks extends JViewLegacy
'a.created_by' => JText::_('COM_RELEASE_CHECKING_RELEASE_CHECK_CREATED_BY_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
);
}
protected function getTheOutcomeSelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('outcome'));
$query->from($db->quoteName('#__release_checking_release_check'));
$query->order($db->quoteName('outcome') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
// get model
$model = $this->getModel();
$results = array_unique($results);
$_filter = array();
foreach ($results as $outcome)
{
// Translate the outcome selection
$text = $model->selectionTranslation($outcome,'outcome');
// Now add the outcome and its text to the options array
$_filter[] = JHtml::_('select.option', $outcome, JText::_($text));
}
return $_filter;
}
return false;
}
protected function getTheCreated_bySelections()
{
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select the text.
$query->select($db->quoteName('created_by'));
$query->from($db->quoteName('#__release_checking_release_check'));
$query->order($db->quoteName('created_by') . ' ASC');
// Reset the query using our newly populated query object.
$db->setQuery($query);
$results = $db->loadColumn();
if ($results)
{
$results = array_unique($results);
$_filter = array();
foreach ($results as $created_by)
{
// Now add the created_by and its text to the options array
$_filter[] = JHtml::_('select.option', $created_by, JFactory::getUser($created_by)->name);
}
return $_filter;
}
return false;
}
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_RELEASE_CHECKING</name>
<creationDate>19th November, 2020</creationDate>
<creationDate>10th December, 2020</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>http://www.joomla.org</authorUrl>
<copyright>(C) 2020 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.4</version>
<version>1.0.5</version>
<description><![CDATA[
<h1>Track Release Checking (v.1.0.4)</h1>
<h1>Track Release Checking (v.1.0.5)</h1>
<div style="clear: both;"></div>
<p>A component to keep track of release checking.</p>
<p>Created by <a href="http://www.joomla.org" target="_blank">Joomla! Project</a><br /><small>Development started 29th July, 2020</small></p>

View File

@ -73,7 +73,7 @@ class com_release_checkingInstallerScript
$release_check_done = $db->execute();
if ($release_check_done)
{
// If succesfully remove Release_check add queued success message.
// If successfully remove Release_check add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.release_check) type alias was removed from the <b>#__content_type</b> table'));
}
@ -88,7 +88,7 @@ class com_release_checkingInstallerScript
$release_check_done = $db->execute();
if ($release_check_done)
{
// If succesfully remove Release_check add queued success message.
// If successfully remove Release_check add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.release_check) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -103,7 +103,7 @@ class com_release_checkingInstallerScript
$release_check_done = $db->execute();
if ($release_check_done)
{
// If succesfully remove Release_check add queued success message.
// If successfully removed Release_check add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.release_check) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -159,7 +159,7 @@ class com_release_checkingInstallerScript
$joomla_version_done = $db->execute();
if ($joomla_version_done)
{
// If succesfully remove Joomla_version add queued success message.
// If successfully remove Joomla_version add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.joomla_version) type alias was removed from the <b>#__content_type</b> table'));
}
@ -174,7 +174,7 @@ class com_release_checkingInstallerScript
$joomla_version_done = $db->execute();
if ($joomla_version_done)
{
// If succesfully remove Joomla_version add queued success message.
// If successfully remove Joomla_version add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.joomla_version) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -189,7 +189,7 @@ class com_release_checkingInstallerScript
$joomla_version_done = $db->execute();
if ($joomla_version_done)
{
// If succesfully remove Joomla_version add queued success message.
// If successfully removed Joomla_version add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.joomla_version) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -245,7 +245,7 @@ class com_release_checkingInstallerScript
$context_done = $db->execute();
if ($context_done)
{
// If succesfully remove Context add queued success message.
// If successfully remove Context add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.context) type alias was removed from the <b>#__content_type</b> table'));
}
@ -260,7 +260,7 @@ class com_release_checkingInstallerScript
$context_done = $db->execute();
if ($context_done)
{
// If succesfully remove Context add queued success message.
// If successfully remove Context add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.context) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -275,7 +275,7 @@ class com_release_checkingInstallerScript
$context_done = $db->execute();
if ($context_done)
{
// If succesfully remove Context add queued success message.
// If successfully removed Context add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.context) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -331,7 +331,7 @@ class com_release_checkingInstallerScript
$action_done = $db->execute();
if ($action_done)
{
// If succesfully remove Action add queued success message.
// If successfully remove Action add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.action) type alias was removed from the <b>#__content_type</b> table'));
}
@ -346,7 +346,7 @@ class com_release_checkingInstallerScript
$action_done = $db->execute();
if ($action_done)
{
// If succesfully remove Action add queued success message.
// If successfully remove Action add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.action) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
}
@ -361,7 +361,7 @@ class com_release_checkingInstallerScript
$action_done = $db->execute();
if ($action_done)
{
// If succesfully remove Action add queued success message.
// If successfully removed Action add queued success message.
$app->enqueueMessage(JText::_('The (com_release_checking.action) type alias was removed from the <b>#__ucm_content</b> table'));
}
@ -405,7 +405,7 @@ class com_release_checkingInstallerScript
$action_done = $db->execute();
if ($action_done)
{
// If succesfully remove release_checking add queued success message.
// If successfully removed release_checking add queued success message.
$app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> table'));
}
@ -889,7 +889,7 @@ class com_release_checkingInstallerScript
echo '<a target="_blank" href="http://www.joomla.org" title="Track Release Checking">
<img src="components/com_release_checking/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 1.0.4 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 1.0.5 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -7,7 +7,7 @@
<version>1.0.0</version>
<infourl title="Track Release Checking!">http://www.joomla.org</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/joomla-projects/com_release_checking/releases/download/v1.0.4/TRC_v1.0.4.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/joomla-projects/com_release_checking/releases/download/v1.0.5/TRC_v1.0.5.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
@ -21,10 +21,10 @@
<description>Track Release Checking</description>
<element>com_release_checking</element>
<type>component</type>
<version>1.0.4</version>
<version>1.0.5</version>
<infourl title="Track Release Checking!">http://www.joomla.org</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/joomla-projects/com_release_checking/releases/download/v1.0.4/TRC_v1.0.4.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/joomla-projects/com_release_checking/releases/download/v1.0.5/TRC_v1.0.5.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>