Added link to JoomlaCode issue.
Added default values to parameter retrieval so it is no longer necessary to configure the repo.
This commit is contained in:
parent
a6bad02833
commit
e97da33546
|
@ -11,3 +11,4 @@ COM_PATCHTESTER_FIELD_ORG_DESC="Github Username"
|
|||
COM_PATCHTESTER_FIELD_ORG_LABEL="Name of account on Github of which to monitor pull requests"
|
||||
COM_PATCHTESTER_FIELD_REPO_DESC="Github Repository"
|
||||
COM_PATCHTESTER_FIELD_REPO_LABEL="Name of repository on Github of which to monitor pull requests"
|
||||
COM_PATCHTESTER_JOOMLACODE_ISSUE="Joomlacode Issue"
|
||||
|
|
|
@ -55,8 +55,8 @@ class PatchtesterModelPulls extends JModelList
|
|||
$params = JComponentHelper::getParams('com_patchtester');
|
||||
|
||||
$this->setState('params', $params);
|
||||
$this->setState('github_user', $params->get('org'));
|
||||
$this->setState('github_repo', $params->get('repo'));
|
||||
$this->setState('github_user', $params->get('org', 'joomla'));
|
||||
$this->setState('github_repo', $params->get('repo', 'joomla-cms'));
|
||||
// List state information.
|
||||
parent::populateState('title', 'asc');
|
||||
}
|
||||
|
@ -100,6 +100,13 @@ class PatchtesterModelPulls extends JModelList
|
|||
$github = new JGithub();
|
||||
$pulls = $github->pulls->getAll($this->getState('github_user'), $this->getState('github_repo'));
|
||||
usort($pulls, array($this, 'sortItems'));
|
||||
|
||||
foreach ($pulls AS &$pull)
|
||||
{
|
||||
$matches = array();
|
||||
preg_match('#\[\#([0-9]+)\]#', $pull->title, $matches);
|
||||
$pull->joomlacode_issue = isset($matches[1]) ? $matches[1] : 0;
|
||||
}
|
||||
return $pulls;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
defined('_JEXEC') or die;
|
||||
|
||||
JHtml::_('behavior.tooltip');
|
||||
JHtml::_('behavior.modal');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
@ -29,6 +30,9 @@ JHtml::_('behavior.tooltip');
|
|||
<th class="title">
|
||||
<?php echo JText::_('JGLOBAL_TITLE'); ?>
|
||||
</th>
|
||||
<th class="title">
|
||||
<?php echo JText::_('COM_PATCHTESTER_JOOMLACODE_ISSUE'); ?>
|
||||
</th>
|
||||
<th width="20%">
|
||||
<?php echo JText::_('JSTATUS'); ?>
|
||||
</th>
|
||||
|
@ -58,6 +62,15 @@ JHtml::_('behavior.tooltip');
|
|||
<td>
|
||||
<a href="<?php echo $item->html_url; ?>" title="<?php echo htmlspecialchars($item->body); ?>"><?php echo $item->title; ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($item->joomlacode_issue > 0) {
|
||||
echo '<a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=';
|
||||
echo $item->joomlacode_issue . '" class="modal" rel="{handler: \'iframe\', size: {x: 900, y: 500}}">';
|
||||
echo '[#' . $item->joomlacode_issue . ']</a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php
|
||||
if ($patch && $patch->applied) {
|
||||
|
|
Loading…
Reference in New Issue