Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
0201ef62
Commit
0201ef62
authored
Jul 16, 2014
by
Penom Nom
Browse files
Always display the project table even if there is only one project available
parent
6405ac02
Changes
2
Hide whitespace changes
Inline
Side-by-side
ui/nG6/pi1/class.tx_nG6_pi1.php
View file @
0201ef62
...
...
@@ -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'
]);
...
...
ui/nG6/pi1/project_view.tpl
View file @
0201ef62
...
...
@@ -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
}
"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment