Commit bdc332d8 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

if the user is the admin, display action buttons

parent b22c78c4
......@@ -593,6 +593,7 @@ class tx_nG6_eid {
$login_user = intVal(trim(t3lib_div::_GP('login_user')));
$page_id = intVal(trim(t3lib_div::_GP('page_id')));
$project_runs = tx_nG6_db::get_project_runs($project_id);
$is_project_admin = tx_nG6_db::is_administrator($user_id, 'project', $project_id);
$is_at_least_admin_of_1_run = false;
foreach($project_runs as $run_id => $run_values) {
$is_admin = tx_nG6_db::is_administrator($user_id, 'run', $run_values['id']);
......@@ -602,6 +603,7 @@ class tx_nG6_eid {
$project_runs[$run_id]['href'] = $href;
}
$smarty->assign('runs', $project_runs);
$smarty->assign('is_project_admin', $is_project_admin);
$smarty->assign('is_at_least_admin_of_1_run', $is_at_least_admin_of_1_run);
$smarty->assign('login_user', $login_user);
print $smarty->fetch('run_table.tpl');
......
......@@ -73,6 +73,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="is_at_least_admin_of_1_run" value=false}
{/if}
{assign var="runs" value=$project_runs}
{assign var="is_project_admin" value=$projects[key($projects)].is_admin}
{include file='run_table.tpl'}
</div>
......
......@@ -84,7 +84,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if}
{/foreach}
</tbody>
{if $is_at_least_admin_of_1_run && $login_user}
{if ($is_at_least_admin_of_1_run && $login_user) || ($is_project_admin)}
<tfoot>
<tr>
<th align="left" colspan="11">
......
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