33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 19:09:00 +00:00

Removing unnecessary template overrides

Raising minimum Joomla version to 4.0
This commit is contained in:
Hannes Papenberg 2019-10-17 22:32:19 +02:00
parent 7a6c898975
commit 32eaf72bc4
8 changed files with 175 additions and 601 deletions

View File

@ -6,130 +6,158 @@
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \PatchTester\View\Pulls\PullsHtmlView $this */
/** @var \PatchTester\View\Pulls\PullsHtmlView $this */
$searchToolsOptions = array(
'filtersHidden' => true,
'filterButton' => true,
'defaultLimit' => Factory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'selectorFieldName' => 'client_id',
'showSelector' => false,
'orderFieldSelector' => '#list_fullordering',
'showNoResults' => false,
'noResultsText' => '',
'formSelector' => '#adminForm',
);
HTMLHelper::_('behavior.core');
HTMLHelper::_('bootstrap.tooltip');
HTMLHelper::_('formbehavior.chosen', 'select');
HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions);
HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true));
HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true));
$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC'));
$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC'));
$listLimit = (int) ($this->state->get('list.limit'));
$filterApplied = $this->escape($this->state->get('filter.applied'));
$filterBranch = $this->escape($this->state->get('filter.branch'));
$filterRtc = $this->escape($this->state->get('filter.rtc'));
$filterBranch = $this->escape($this->state->get('filter.branch'));
$filterRtc = $this->escape($this->state->get('filter.rtc'));
?>
<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm"
id="adminForm" data-order="<?php echo $listOrder; ?>">
<div id="j-main-container">
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search"
class="element-invisible"><?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?></label>
<input type="text" name="filter_search"
placeholder="<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>"
id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>"
title="<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>"/>
</div>
<div class="btn-group pull-left hidden-phone">
<button class="btn tip hasTooltip" type="submit"
title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button class="btn tip hasTooltip" type="button"
onclick="document.getElementById('filter_search').value='';this.form.submit();"
title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit"
class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right">
<label for="list_fullordering"
class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY'); ?></label>
<select name="list_fullordering" id="list_fullordering" class="input-medium"
onchange="this.form.submit();">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?>
</select>
</div>
<div class="btn-group pull-right">
<label for="filter_applied"
class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label>
<select name="filter_applied" class="input-medium" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option>
<option value="yes"<?php if ($filterApplied == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option>
<option value="no"<?php if ($filterApplied == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="filter_rtc" class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label>
<select name="filter_rtc" class="input-medium" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option>
<option value="yes"<?php if ($filterRtc == 'yes') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option>
<option value="no"<?php if ($filterRtc == 'no') echo ' selected="selected"'; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="filter_branch"
class="element-invisible"><?php echo Text::_('JSEARCH_TOOLS_DESC'); ?></label>
<select name="filter_branch" class="input-medium" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?>
</select>
<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<div class="js-stools" role="search">
<div class="js-stools-container-bar">
<div class="btn-toolbar">
<div class="btn-group mr-2">
<div class="input-group">
<label for="filter_search" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>
</label>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="form-control" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>">
<div role="tooltip" id="filter_search-desc">
<?php echo $this->escape(Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION')); ?>
</div>
<span class="input-group-append">
<button type="submit" class="btn btn-primary" aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>">
<span class="fa fa-search" aria-hidden="true"></span>
</button>
</span>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary hasTooltip js-stools-btn-filter">
<?php echo Text::_('JFILTER_OPTIONS'); ?>
<span class="fa fa-angle-down" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-primary js-stools-btn-clear mr-2">
<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>
</button>
</div>
<div class="ordering-select">
<div class="js-stools-field-list">
<select name="list_fullordering" id="list_fullordering" class="custom-select" onchange="this.form.submit()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?>
</select>
</div>
<div class="js-stools-field-list">
<span class="sr-only">
<label id="list_limit-lbl" for="list_limit">Select number of items per page.</label>
</span>
<select name="list_limit" id="list_limit" class="custom-select" onchange="this.form.submit()">
<?php echo HTMLHelper::_('select.options', $this->getLimitOptions(), 'value', 'text', $listLimit); ?>
</select>
</div>
</div>
</div>
</div>
<!-- Filters div -->
<div class="js-stools-container-filters clearfix">
<div class="js-stools-field-filter">
<select name="filter_applied" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option>
<option value="yes"<?php echo $filterApplied == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option>
<option value="no"<?php echo $filterApplied == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_rtc" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option>
<option value="yes"<?php echo $filterRtc == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option>
<option value="no"<?php echo $filterRtc == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_branch" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?>
</select>
</div>
</div>
</div>
<div id="j-main-container" class="j-main-container">
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_PULLS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<th scope="col" style="width:5%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?>
</th>
<th scope="col" style="min-width:100px">
<?php echo Text::_('JGLOBAL_TITLE'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?>
</th>
<th scope="col" style="width:10%" class="text-center">
<?php echo Text::_('JSTATUS'); ?>
</th>
<th scope="col" style="width:15%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</th>
</tr>
</thead>
<tbody>
<?php echo $this->loadTemplate('items'); ?>
</tbody>
</table>
<?php endif; ?>
<?php echo $this->pagination->getListFooter(); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="pull_id" id="pull_id" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped">
<thead>
<tr>
<th width="5%" class="nowrap center">
<?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?>
</th>
<th class="nowrap">
<?php echo Text::_('JGLOBAL_TITLE'); ?>
</th>
<th width="8%" class="nowrap center hidden-phone">
<?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?>
</th>
<th width="8%" class="nowrap center hidden-phone">
<?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?>
</th>
<th width="8%" class="nowrap center">
<?php echo Text::_('COM_PATCHTESTER_GITHUB'); ?>
</th>
<?php if ($this->trackerAlias !== false) : ?>
<th width="8%" class="nowrap center">
<?php echo Text::_('COM_PATCHTESTER_JISSUES'); ?>
</th>
<?php endif; ?>
<th width="10%" class="nowrap center">
<?php echo Text::_('JSTATUS'); ?>
</th>
<th width="15%" class="nowrap center">
<?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</th>
</tr>
</thead>
<tbody>
<?php echo $this->loadTemplate('items'); ?>
</tbody>
</table>
<?php endif; ?>
<?php echo $this->pagination->getListFooter(); ?>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="boxchecked" value="0"/>
<input type="hidden" name="pull_id" id="pull_id" value=""/>
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</form>

View File

@ -14,62 +14,59 @@ foreach ($this->items as $i => $item) :
$status = '';
if ($item->applied) :
$status = ' class="success"';
$status = ' class="table-active"';
endif;
?>
?>
<tr<?php echo $status; ?>>
<td class="center">
<th scope="row" class="text-center">
<?php echo $item->pull_id; ?>
</td>
</th>
<td>
<span class="hasTooltip"
title="<strong>Info</strong><br/><?php echo $this->escape($item->description); ?>"><?php echo $this->escape($item->title); ?></span>
<?php if ($item->applied) : ?>
<div class="small">
<span class="label label-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
<span><?php echo $this->escape($item->title); ?></span>
<div role="tooltip" id="tip<?php echo $i; ?>">
<?php echo $this->escape($item->description); ?>
</div>
<div class="row">
<div class="col-md-auto">
<a class="badge badge-info" href="<?php echo $item->pull_url; ?>" target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
</a>
</div>
<?php endif; ?>
<div class="col-md-auto">
<a class="badge badge-info"
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
</a>
</div>
<?php if ($item->applied) : ?>
<div class="col-md-auto">
<span class="badge badge-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
</div>
<?php endif; ?>
</div>
</td>
<td class="center hidden-phone">
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->branch); ?>
</td>
<td class="center hidden-phone">
<td class="d-none d-md-table-cell text-center">
<?php if ($item->is_rtc) : ?>
<span class="label label-success"><?php echo Text::_('JYES'); ?></span>
<span class="badge badge-success"><?php echo Text::_('JYES'); ?></span>
<?php else : ?>
<span class="label label-primary"><?php echo Text::_('JNO'); ?></span>
<span class="badge badge-secondary"><?php echo Text::_('JNO'); ?></span>
<?php endif; ?>
</td>
<td class="center">
<a class="btn btn-small btn-info" href="<?php echo $item->pull_url; ?>" target="_blank">
<span class="octicon octicon-mark-github"></span> <?php echo Text::_('COM_PATCHTESTER_GITHUB'); ?>
</a>
</td>
<?php if ($this->trackerAlias !== false) : ?>
<td class="center">
<a class="btn btn-small btn-warning"
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
target="_blank">
<i class="icon-joomla"></i> <?php echo Text::_('COM_PATCHTESTER_JISSUE'); ?>
</a>
</td>
<?php endif; ?>
<td class="center">
<td class="text-center">
<?php if ($item->applied) : ?>
<div>
<span class="label label-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
</div>
<span class="badge badge-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
<?php else : ?>
<span class="label">
<?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?>
</span>
<span class="badge badge-secondary"><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></span>
<?php endif; ?>
</td>
<td class="center">
<td class="text-center">
<?php if ($item->applied) : ?>
<button type="button" class="btn btn-sm btn-success submitPatch"
data-task="revert-<?php echo (int) $item->applied; ?>"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
<br/>
<?php else : ?>
<button type="button" class="btn btn-sm btn-primary submitPatch"
data-task="apply-<?php echo (int) $item->pull_id; ?>"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="component" version="3.6" method="upgrade">
<extension type="component" version="4.0" method="upgrade">
<name>com_patchtester</name>
<author>Joomla! Project</author>
<creationDate>17-October-2019</creationDate>
@ -15,7 +15,6 @@
<file driver="mysql" charset="utf8">install/sql/mysql/install.sql</file>
<file driver="postgresql" charset="utf8">install/sql/postgresql/install.sql</file>
<file driver="pgsql" charset="utf8">install/sql/postgresql/install.sql</file>
<file driver="sqlsrv" charset="utf8">install/sql/sqlsrv/install.sql</file>
</sql>
</install>
<uninstall>
@ -23,7 +22,6 @@
<file driver="mysql" charset="utf8">install/sql/mysql/uninstall.sql</file>
<file driver="postgresql" charset="utf8">install/sql/postgresql/uninstall.sql</file>
<file driver="pgsql" charset="utf8">install/sql/postgresql/uninstall.sql</file>
<file driver="sqlsrv" charset="utf8">install/sql/sqlsrv/uninstall.sql</file>
</sql>
</uninstall>
<update>
@ -31,7 +29,6 @@
<schemapath type="mysql">install/sql/updates/mysql</schemapath>
<schemapath type="postgresql">install/sql/updates/postgresql</schemapath>
<schemapath type="pgsql">install/sql/updates/postgresql</schemapath>
<schemapath type="sqlsrv">install/sql/updates/sqlsrv</schemapath>
</schemas>
</update>
<media destination="com_patchtester" folder="media">

View File

@ -1,180 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Folder;
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
use Joomla\CMS\Installer\InstallerScript;
use Joomla\CMS\Language\Text;
/**
* Installation class to perform additional changes during install/uninstall/update
*
* @since 2.0
*/
class Com_PatchtesterInstallerScript extends InstallerScript
{
/**
* Array of templates with supported overrides
*
* @var array
* @since 2.0
*/
protected $templateOverrides = array('atum');
/**
* Extension script constructor.
*
* @since 3.0.0
*/
public function __construct()
{
$this->minimumJoomla = '3.9';
$this->minimumPhp = JOOMLA_MINIMUM_PHP;
$this->deleteFiles = array(
'/administrator/components/com_patchtester/PatchTester/View/Pulls/tmpl/default_errors.php',
'/administrator/templates/hathor/html/com_patchtester/pulls/default.php',
'/administrator/templates/hathor/html/com_patchtester/pulls/default_items.php',
);
$this->deleteFolders = array(
'/administrator/components/com_patchtester/PatchTester/Table',
'/administrator/templates/hathor/html/com_patchtester/pulls',
'/administrator/templates/hathor/html/com_patchtester',
'/components/com_patchtester',
);
}
/**
* Function to perform changes during install
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function install($parent)
{
$this->copyLayouts();
}
/**
* Function to perform changes during update
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function update($parent)
{
$this->copyLayouts();
}
/**
* Function to perform changes during uninstall
*
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 2.0
*/
public function uninstall($parent)
{
// Initialize the error array
$errorTemplates = array();
// Loop the supported templates
foreach ($this->templateOverrides as $template)
{
// Set the file paths
$tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template;
$overrideFolder = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester';
// Make sure the template is actually installed
if (is_dir($tmplRoot))
{
// If there's a failure in copying the overrides, log it to the error array
if (Folder::delete($overrideFolder))
{
$errorTemplates[] = ucfirst($template);
}
}
}
// If we couldn't remove any overrides, notify the user
if (count($errorTemplates) > 0)
{
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_REMOVE_OVERRIDES', implode(', ', $errorTemplates)));
}
}
/**
* Function to perform changes during postflight
*
* @param string $type The action being performed
* @param ComponentAdapter $parent The class calling this method
*
* @return void
*
* @since 3.0.0
*/
public function postflight($type, $parent)
{
$this->removeFiles();
}
/**
* Function to copy layout overrides for core templates at install or update
*
* @return void
*
* @since 2.0
*/
private function copyLayouts()
{
// Initialize the error array
$errorTemplates = array();
// Loop the supported templates
foreach ($this->templateOverrides as $template)
{
// Set the file paths
$source = __DIR__ . '/' . $template;
$tmplRoot = JPATH_ADMINISTRATOR . '/templates/' . $template;
$destination = JPATH_ADMINISTRATOR . '/templates/' . $template . '/html/com_patchtester';
// Make sure the template is actually installed
if (is_dir($tmplRoot))
{
// If there's a failure in copying the overrides, log it to the error array
try
{
if (Folder::copy($source, $destination, '', true))
{
$errorTemplates[] = ucfirst($template);
}
}
catch (RuntimeException $exception)
{
$errorTemplates[] = ucfirst($template);
}
}
}
// If we couldn't remove any overrides, notify the user
if (count($errorTemplates) > 0)
{
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_PATCHTESTER_COULD_NOT_INSTALL_OVERRIDES', implode(', ', $errorTemplates)));
}
}
}

View File

@ -1,28 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
/** @var \PatchTester\View\DefaultHtmlView $this */
HTMLHelper::_('jquery.framework');
HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'com_patchtester/fetcher.js', array('version' => 'auto', 'relative' => true));
?>
<div id="patchtester-container">
<h1 id="patchtester-progress-header"><?php echo Text::_('COM_PATCHTESTER_FETCH_INITIALIZING'); ?></h1>
<p id="patchtester-progress-message"><?php echo Text::_('COM_PATCHTESTER_FETCH_INITIALIZING_DESCRIPTION'); ?></p>
<div id="progress" class="progress">
<div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-animated bg-success" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" role="progressbar"></div>
</div>
<input id="patchtester-token" type="hidden" name="<?php echo Factory::getSession()->getFormToken(); ?>" value="1" />
</div>

View File

@ -1,163 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \PatchTester\View\Pulls\PullsHtmlView $this */
$searchToolsOptions = array(
'filtersHidden' => true,
'filterButton' => true,
'defaultLimit' => Factory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'selectorFieldName' => 'client_id',
'showSelector' => false,
'orderFieldSelector' => '#list_fullordering',
'showNoResults' => false,
'noResultsText' => '',
'formSelector' => '#adminForm',
);
HTMLHelper::_('behavior.core');
HTMLHelper::_('searchtools.form', '#adminForm', $searchToolsOptions);
HTMLHelper::_('stylesheet', 'com_patchtester/octicons.css', array('version' => '3.5.0', 'relative' => true));
HTMLHelper::_('script', 'com_patchtester/patchtester.js', array('version' => 'auto', 'relative' => true));
$listOrder = $this->escape($this->state->get('list.fullordering', 'a.pull_id DESC'));
$listLimit = (int) ($this->state->get('list.limit'));
$filterApplied = $this->escape($this->state->get('filter.applied'));
$filterBranch = $this->escape($this->state->get('filter.branch'));
$filterRtc = $this->escape($this->state->get('filter.rtc'));
?>
<form action="<?php echo Route::_('index.php?option=com_patchtester&view=pulls'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<div class="js-stools" role="search">
<div class="js-stools-container-bar">
<div class="btn-toolbar">
<div class="btn-group mr-2">
<div class="input-group">
<label for="filter_search" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION'); ?>
</label>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="form-control" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>">
<div role="tooltip" id="filter_search-desc">
<?php echo $this->escape(Text::_('COM_PATCHTESTER_FILTER_SEARCH_DESCRIPTION')); ?>
</div>
<span class="input-group-append">
<button type="submit" class="btn btn-primary" aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>">
<span class="fa fa-search" aria-hidden="true"></span>
</button>
</span>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary hasTooltip js-stools-btn-filter">
<?php echo Text::_('JFILTER_OPTIONS'); ?>
<span class="fa fa-angle-down" aria-hidden="true"></span>
</button>
<button type="button" class="btn btn-primary js-stools-btn-clear mr-2">
<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>
</button>
</div>
<div class="ordering-select">
<div class="js-stools-field-list">
<select name="list_fullordering" id="list_fullordering" class="custom-select" onchange="this.form.submit()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->getSortFields(), 'value', 'text', $listOrder); ?>
</select>
</div>
<div class="js-stools-field-list">
<span class="sr-only">
<label id="list_limit-lbl" for="list_limit">Select number of items per page.</label>
</span>
<select name="list_limit" id="list_limit" class="custom-select" onchange="this.form.submit()">
<?php echo HTMLHelper::_('select.options', $this->getLimitOptions(), 'value', 'text', $listLimit); ?>
</select>
</div>
</div>
</div>
</div>
<!-- Filters div -->
<div class="js-stools-container-filters clearfix">
<div class="js-stools-field-filter">
<select name="filter_applied" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_APPLIED_PATCHES'); ?></option>
<option value="yes"<?php echo $filterApplied == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></option>
<option value="no"<?php echo $filterApplied == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_rtc" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_RTC_PATCHES'); ?></option>
<option value="yes"<?php echo $filterRtc == 'yes' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_RTC'); ?></option>
<option value="no"<?php echo $filterRtc == 'no' ? ' selected="selected"' : ''; ?>><?php echo Text::_('COM_PATCHTESTER_NOT_RTC'); ?></option>
</select>
</div>
<div class="js-stools-field-filter">
<select name="filter_branch" class="custom-select" onchange="this.form.submit();">
<option value=""><?php echo Text::_('COM_PATCHTESTER_FILTER_BRANCH'); ?></option>
<?php echo HTMLHelper::_('select.options', $this->branches, 'text', 'text', $filterBranch, false); ?>
</select>
</div>
</div>
</div>
<div id="j-main-container" class="j-main-container">
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_PATCHTESTER_PULLS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
<thead>
<tr>
<th scope="col" style="width:5%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_PULL_ID'); ?>
</th>
<th scope="col" style="min-width:100px">
<?php echo Text::_('JGLOBAL_TITLE'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_BRANCH'); ?>
</th>
<th scope="col" style="width:8%" class="d-none d-md-table-cell text-center">
<?php echo Text::_('COM_PATCHTESTER_READY_TO_COMMIT'); ?>
</th>
<th scope="col" style="width:10%" class="text-center">
<?php echo Text::_('JSTATUS'); ?>
</th>
<th scope="col" style="width:15%" class="text-center">
<?php echo Text::_('COM_PATCHTESTER_TEST_THIS_PATCH'); ?>
</th>
</tr>
</thead>
<tbody>
<?php echo $this->loadTemplate('items'); ?>
</tbody>
</table>
<?php endif; ?>
<?php echo $this->pagination->getListFooter(); ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="pull_id" id="pull_id" value="" />
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</div>
</div>
</form>

View File

@ -1,76 +0,0 @@
<?php
/**
* Patch testing component for the Joomla! CMS
*
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later
*/
use Joomla\CMS\Language\Text;
/** @var \PatchTester\View\DefaultHtmlView $this */
foreach ($this->items as $i => $item) :
$status = '';
if ($item->applied) :
$status = ' class="table-active"';
endif;
?>
<tr<?php echo $status; ?>>
<th scope="row" class="text-center">
<?php echo $item->pull_id; ?>
</th>
<td>
<span><?php echo $this->escape($item->title); ?></span>
<div role="tooltip" id="tip<?php echo $i; ?>">
<?php echo $this->escape($item->description); ?>
</div>
<div class="row">
<div class="col-md-auto">
<a class="badge badge-info" href="<?php echo $item->pull_url; ?>" target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_GITHUB'); ?>
</a>
</div>
<div class="col-md-auto">
<a class="badge badge-info"
href="https://issues.joomla.org/tracker/<?php echo $this->trackerAlias; ?>/<?php echo $item->pull_id; ?>"
target="_blank">
<?php echo Text::_('COM_PATCHTESTER_VIEW_ON_JOOMLA_ISSUE_TRACKER'); ?>
</a>
</div>
<?php if ($item->applied) : ?>
<div class="col-md-auto">
<span class="badge badge-info"><?php echo Text::sprintf('COM_PATCHTESTER_APPLIED_COMMIT_SHA', substr($item->sha, 0, 10)); ?></span>
</div>
<?php endif; ?>
</div>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($item->branch); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php if ($item->is_rtc) : ?>
<span class="badge badge-success"><?php echo Text::_('JYES'); ?></span>
<?php else : ?>
<span class="badge badge-secondary"><?php echo Text::_('JNO'); ?></span>
<?php endif; ?>
</td>
<td class="text-center">
<?php if ($item->applied) : ?>
<span class="badge badge-success"><?php echo Text::_('COM_PATCHTESTER_APPLIED'); ?></span>
<?php else : ?>
<span class="badge badge-secondary"><?php echo Text::_('COM_PATCHTESTER_NOT_APPLIED'); ?></span>
<?php endif; ?>
</td>
<td class="text-center">
<?php if ($item->applied) : ?>
<button type="button" class="btn btn-sm btn-success submitPatch"
data-task="revert-<?php echo (int) $item->applied; ?>"><?php echo Text::_('COM_PATCHTESTER_REVERT_PATCH'); ?></button>
<?php else : ?>
<button type="button" class="btn btn-sm btn-primary submitPatch"
data-task="apply-<?php echo (int) $item->pull_id; ?>"><?php echo Text::_('COM_PATCHTESTER_APPLY_PATCH'); ?></button>
<?php endif; ?>
</td>
</tr>
<?php endforeach;

View File

@ -8,7 +8,6 @@ cp -r administrator/templates/atum/html/com_patchtester build/packaging/atum
cp -r media/com_patchtester build/packaging/media
rm -rf build/packaging/admin/backups/*.txt
mv build/packaging/admin/patchtester.xml build/packaging/patchtester.xml
mv build/packaging/admin/script.php build/packaging/script.php
cd build/packaging
tar jcf ../packages/com_patchtester.tar.bz2 .
tar zcf ../packages/com_patchtester.tar.gz .