Commit 0201ef62 authored by Penom Nom's avatar Penom Nom
Browse files

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

parent 6405ac02
......@@ -129,10 +129,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_project_display = false;
// If a single element
if ($this->piVars['project_id']) {
if (tx_nG6_db::user_is_authorized($user_id, $this->piVars['project_id'], $this->piVars['run_id'])) {
$projects = array('project_'.$this->piVars['project_id'] => tx_nG6_db::select_project($this->piVars['project_id']));
$single_project_display = true ;
}
} else {
$projects = tx_nG6_db::select_all_user_projects($user_id, 'tx_nG6_project.name');
......@@ -170,9 +172,10 @@ class tx_nG6_pi1 extends tslib_pibase {
$smarty->assign('project_ids', substr($project_ids,0,-1));
$smarty->assign('pid', $this->conf['userpidList']);
$smarty->assign('server_url', $this->conf['server_url']);
$smarty->assign('single_project_display', $single_project_display);
// If it's a single project, add runs and analysis information
if (count($projects) == 1) {
if ($single_project_display) {
// Get all users on project
$project_users = tx_nG6_db::get_all_users_on_project($projects[key($projects)]['id']);
......
......@@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="alert alert-info">Sorry no results to display</div>
{* If a single project has to be displayed *}
{elseif $projects|@count == 1}
{elseif $single_project_display}
<div class="sub-content sc-top">
<input type="hidden" id="is_project_admin" value="{$projects[key($projects)].is_admin}" />
......
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