Commit 52b67959 authored by Penom Nom's avatar Penom Nom
Browse files

Always display the run table even if there is only one run available

parent 0201ef62
......@@ -214,10 +214,12 @@ class tx_nG6_pi1 extends tslib_pibase {
if (!$GLOBALS['TSFE']->loginUser) { $user_id = null; }
else { $user_id = $GLOBALS['TSFE']->fe_user->user['uid']; }
$single_run_display = false;
// If a single element
if ($this->piVars['run_id']) {
if (tx_nG6_db::user_is_authorized($user_id, $this->piVars['project_id'], $this->piVars['run_id'])) {
$runs = array('run_'.$this->piVars['run_id'] => tx_nG6_db::select_run($this->piVars['run_id']));
$single_run_display = true;
}
} else {
$runs = tx_nG6_db::select_all_user_runs($user_id);
......@@ -255,9 +257,10 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->assign('server_name', $this->conf["server_name"]);
$smarty->assign('server_url', $this->conf['server_url']);
$smarty->assign('run_ids', substr($run_ids,0,-1));
$smarty->assign('single_run_display', $single_run_display);
// If it's a single run, add analysis information
if (count($runs) == 1) {
if ($single_run_display) {
$run_analysis = tx_nG6_db::get_run_analysis($runs[key($runs)]['id']);
// Add some information to the table
foreach($run_analysis as $analysis_id => $analysis_values) {
......
......@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Sorry no results to display
{* If a single run has to be displayed *}
{elseif $runs|@count == 1}
{elseif $single_run_display}
<div class="sub-content sc-top">
<div class="ng6-content-header-left run">
<h2>Run <small>{$runs[key($runs)].name}</small></h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment