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

clean some code

parent b90f03ff
......@@ -70,7 +70,7 @@ class tx_nG6_eid {
} else if ($type == 'run'){
$run_id = trim(t3lib_div::_GP('id'));
// Select all analysis linked to the run and the run information
$run_analysis = tx_nG6_db::get_run_analysis($user_id, $run_id, 'tx_nG6_analyze.name');
$run_analysis = tx_nG6_db::get_run_analysis($run_id, 'tx_nG6_analyze.name');
$run_info = tx_nG6_db::select_run($run_id);
// for each analysis
$html_tree = '';
......@@ -131,7 +131,7 @@ class tx_nG6_eid {
if ($hide_level == 'project') {
foreach($tab_ids as $id => $value) {
tx_nG6_db::hide_project($value, $user_id);
tx_nG6_db::hide_project($value);
}
} else if ($hide_level == 'run') {
foreach($tab_ids as $id => $value) {
......@@ -153,15 +153,15 @@ class tx_nG6_eid {
if ($unhide_level == 'project') {
foreach($tab_ids as $id => $value) {
tx_nG6_db::unhide_project($value, $user_id);
tx_nG6_db::unhide_project($value);
}
} else if ($unhide_level == 'run') {
foreach($tab_ids as $id => $value) {
tx_nG6_db::unhide_run($value, $user_id);
tx_nG6_db::unhide_run($value, true);
}
} else if ($unhide_level == 'analysis') {
foreach($tab_ids as $id => $value) {
tx_nG6_db::unhide_analysis($value, $user_id);
tx_nG6_db::unhide_analysis($value, true);
}
}
......@@ -190,12 +190,12 @@ class tx_nG6_eid {
if ($res == 0) {
if ($delete_level == 'project') {
foreach($tab_ids as $id => $value) {
$res = tx_nG6_db::delete_project($user_id, $value, $user_login, $user_pwd, $data_folder);
$res = tx_nG6_db::delete_project($value, $user_login, $user_pwd, $data_folder);
if ($res != 0) { break; }
}
} else if ($delete_level == 'run') {
foreach($tab_ids as $id => $value) {
$res = tx_nG6_db::delete_run($user_id, $value, $user_login, $user_pwd, $data_folder);
$res = tx_nG6_db::delete_run($value, $user_login, $user_pwd, $data_folder);
if ($res != 0) { break; }
}
} else if ($delete_level == 'analysis') {
......@@ -214,7 +214,7 @@ class tx_nG6_eid {
// project_id to array (1;2;3;...) -> [1;2;3;...]
$tab_ids = explode(";",$ids);
foreach($tab_ids as $id => $value) {
tx_nG6_db::publish_project($value, $user_id);
tx_nG6_db::publish_project($value);
}
// If asked to unpublish a project
......@@ -236,9 +236,9 @@ class tx_nG6_eid {
$full_size = 0;
foreach($tab_ids as $id => $value) {
if ($view == "run") {
$full_size += tx_nG6_db::get_run_size($value, $data_folder, $user_id);
$full_size += tx_nG6_db::get_run_size($value, $data_folder);
} else if ($view == "project") {
$full_size += tx_nG6_db::get_project_size($value, $data_folder, $user_id);
$full_size += tx_nG6_db::get_project_size($value, $data_folder);
}
}
print tx_nG6_utils::get_octet_string_representation($full_size);
......@@ -649,7 +649,7 @@ class tx_nG6_eid {
$ddest .= '.'.$run["project_id"]."/Run_".str_replace($char_to_replace, '_', $run["name"]).".".$id[1]."/RawData";
$dest_directories[] = $ddest;
}
foreach(tx_nG6_db::get_run_analysis($user_id, $id[1], 'tx_nG6_analyze.name') as $analyse_id => $analyse_values) {
foreach(tx_nG6_db::get_run_analysis($id[1], 'tx_nG6_analyze.name') as $analyse_id => $analyse_values) {
$aid = preg_split("/_/", $analyse_id);
if (!in_array($data_folder.$analyse_values["directory"], $src_directories)) {
$src_directories[] = $data_folder.$analyse_values["directory"];
......
......@@ -86,14 +86,7 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$project_id = $row['project_id'];
// Is the user allowed to see this project
$user_allowed = false;
if ($row['project_hidden'] == 0 || $row['project_public'] == 0) {
$user_allowed = true;
}
if (!isset ($projects['project_'.$project_id]) and $user_allowed) {
if (!isset ($projects['project_'.$project_id])) {
$projects['project_'.$project_id] = array(
'id' => $project_id,
'name' => $row['project_name'],
......@@ -170,14 +163,7 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$run_id = $row['run_id'];
// Is the user allowed to see this run
$user_allowed = false;
if ($row['run_hidden'] == 0) {
$user_allowed = true;
}
if (!isset($results['run_'.$run_id]) and $user_allowed) {
if (!isset($results['run_'.$run_id])) {
$results['run_'.$run_id] = array(
'id' => $run_id,
'directory' => $row['run_directory'],
......@@ -233,14 +219,7 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$analyze_id = $row['analyze_id'];
// Is the user allowed to see this analyse
$user_allowed = false;
if ($row['analyze_hidden'] == 0) {
$user_allowed = true;
}
if (!isset ($results['analyse_'.$analyze_id]) and $user_allowed) {
if (!isset ($results['analyse_'.$analyze_id])) {
$results['analyse_'.$analyze_id] = array(
'directory' => $row['analyze_directory'],
'name' => $row['analyze_name'],
......@@ -263,14 +242,13 @@ class tx_nG6_db {
* Hide a project and sublevels (runs & analyzes) datas from database project
*
* @param string $p_id the project id to hide
* @param string $user_id the current user id
*/
function hide_project($p_id, $user_id) {
function hide_project($p_id) {
// First change all project runs
$project_runs = tx_nG6_db::get_project_runs($p_id);
foreach($project_runs as $run_id => $run_values) {
tx_nG6_db::hide_run($run_values['id'], $user_id);
tx_nG6_db::hide_run($run_values['id']);
}
// Then all project analysis
......@@ -287,14 +265,13 @@ class tx_nG6_db {
* Unhide a project and sublevels (runs & analyzes) datas
*
* @param string $p_id the project id to hide
* @param string $user_id the current user id
*/
function unhide_project($p_id, $user_id) {
function unhide_project($p_id) {
// First change all project runs
$project_runs = tx_nG6_db::get_project_runs($p_id);
foreach($project_runs as $run_id => $run_values) {
tx_nG6_db::unhide_run($run_values['id'], $user_id);
tx_nG6_db::unhide_run($run_values['id']);
}
// Then all project analysis
......@@ -311,11 +288,10 @@ class tx_nG6_db {
* Publish the project
*
* @param string $p_id the project id to publish
* @param int $user_id the current user id
*/
function publish_project($p_id, $user_id) {
function publish_project($p_id) {
// First unhide the project
tx_nG6_db::unhide_project($p_id, $user_id);
tx_nG6_db::unhide_project($p_id);
// The set the project as visible
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_project', 'uid='.$p_id, array('public' => '0'));
}
......@@ -332,13 +308,12 @@ class tx_nG6_db {
/**
* Delete a project and sublevels (runs & analyzes) datas from database project
*
* @param string $user_id the user id
* @param string $p_id the project id
* @param string $user_login the user login
* @param string $user_pwd the user password
* @param string $data_folder the data folder
*/
function delete_project($user_id, $p_id, $user_login, $user_pwd, $data_folder) {
function delete_project($p_id, $user_login, $user_pwd, $data_folder) {
$res = 0;
// All runs
......@@ -346,7 +321,7 @@ class tx_nG6_db {
foreach($project_runs as $run_id => $run_values) {
if ($run_values['id'] != 'undefined' && $run_values['id'] != '') {
//delete the run sublevels
$res = tx_nG6_db::delete_run($user_id, $run_values['id'], $user_login, $user_pwd, $data_folder);
$res = tx_nG6_db::delete_run($run_values['id'], $user_login, $user_pwd, $data_folder);
if ($res != 0) { break; }
}
}
......@@ -379,15 +354,14 @@ class tx_nG6_db {
*
* @param string $p_id the project id to return the size
* @param string $data_folder the data folder
* @param string $user_id the user id
*/
function get_project_size($p_id, $data_folder, $user_id) {
function get_project_size($p_id, $data_folder) {
$full_size = 0;
// All runs
$project_runs = tx_nG6_db::get_project_runs($p_id);
foreach($project_runs as $run_id => $run_values) {
$full_size += tx_nG6_db::get_run_size($run_values['id'], $data_folder, $user_id);
$full_size += tx_nG6_db::get_run_size($run_values['id'], $data_folder);
}
// All analysis
$project_analysis = tx_nG6_db::get_project_analysis($p_id);
......@@ -445,14 +419,7 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$run_id = $row['run_id'];
// Is the user allowed to see this run
$user_allowed = false;
if ($row['run_hidden'] == 0) {
$user_allowed = true;
}
if (!isset($results['run_'.$run_id]) and $user_allowed) {
if (!isset($results['run_'.$run_id])) {
$results['run_'.$run_id] = array(
'id' => $run_id,
'directory' => $row['run_directory'],
......@@ -562,11 +529,10 @@ class tx_nG6_db {
/**
* Select all analysis linked to the specified run
*
* @param int $user_id the user id
* @param string $run_id the run id
* @return hash table with all analysis information
*/
function get_run_analysis($user_id, $run_id, $orderby='', $limit='') {
function get_run_analysis($run_id, $orderby='', $limit='') {
// First select all analysis from the database
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'.
......@@ -580,13 +546,9 @@ class tx_nG6_db {
'tx_nG6_analyze.hidden AS analyze_hidden, '.
'tx_nG6_analyze.description AS analyze_description, '.
'tx_nG6_analyze.parent_uid AS analyze_parent_uid ',
'FROM' => 'fe_rights '.
'INNER JOIN tx_nG6_project ON tx_nG6_project.uid=fe_rights.project_id '.
'INNER JOIN tx_nG6_project_run ON tx_nG6_project_run.project_id = tx_nG6_project.uid '.
'INNER JOIN tx_nG6_run ON tx_nG6_run.uid = tx_nG6_project_run.run_id '.
'INNER JOIN tx_nG6_run_analyze ON tx_nG6_run_analyze.run_id = tx_nG6_run.uid '.
'FROM' => 'tx_nG6_run_analyze '.
'INNER JOIN tx_nG6_analyze ON tx_nG6_analyze.uid = tx_nG6_run_analyze.analyze_id ',
'WHERE' => 'tx_nG6_run_analyze.run_id='.$run_id.' AND fe_rights.fe_user_id='.$user_id,
'WHERE' => 'tx_nG6_run_analyze.run_id='.$run_id,
'GROUPBY' => '',
'ORDERBY' => $orderby,
'LIMIT' => $limit
......@@ -596,14 +558,7 @@ class tx_nG6_db {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$analyze_id = $row['analyze_id'];
// Is the user allowed to see this analyse
$user_allowed = false;
if ($row['analyze_hidden'] == 0) {
$user_allowed = true;
}
if (!isset ($results['analyse_'.$analyze_id]) and $user_allowed) {
if (!isset ($results['analyse_'.$analyze_id])) {
$results['analyse_'.$analyze_id] = array(
'directory' => $row['analyze_directory'],
'name' => $row['analyze_name'],
......@@ -625,16 +580,15 @@ class tx_nG6_db {
/**
* Delete a run, sample and sublevel (analyzes) datas from database project
*
* @param int $user_id the user id
* @param string $r_id the run id
* @param string $user_login the user login
* @param string $user_pwd the user password
* @param string $data_folder the data folder
*/
function delete_run($user_id, $r_id, $user_login, $user_pwd, $data_folder) {
function delete_run($r_id, $user_login, $user_pwd, $data_folder) {
$res = 0;
$run_analysis = tx_nG6_db::get_run_analysis($user_id, $r_id);
$run_analysis = tx_nG6_db::get_run_analysis($r_id);
foreach($run_analysis as $analyse_id => $analyze_values) {
if ($analyze_values['id'] != 'undefined' && $analyze_values['id'] != '') {
// delete table 'analyze' entries
......@@ -678,11 +632,10 @@ class tx_nG6_db {
*
* @param string $r_id the run id to return the size
* @param string $data_folder the data folder
* @param int $user_id the user id
*/
function get_run_size($r_id, $data_folder, $user_id) {
function get_run_size($r_id, $data_folder) {
$full_size = 0;
$run_analysis = tx_nG6_db::get_run_analysis($user_id, $r_id);
$run_analysis = tx_nG6_db::get_run_analysis($r_id);
foreach($run_analysis as $analyse_id => $analyze_values) {
$full_size += tx_nG6_db::get_analysis_size($analyze_values['id'], $data_folder);
}
......@@ -700,12 +653,11 @@ class tx_nG6_db {
* Hide a run and sublevels (analysis)
*
* @param string $r_id the run id to hide
* @param int $user_id the current user id
*/
function hide_run($r_id, $user_id) {
function hide_run($r_id) {
// First select all run analysis
$run_analysis = tx_nG6_db::get_run_analysis($user_id, $r_id);
$run_analysis = tx_nG6_db::get_run_analysis($r_id);
foreach($run_analysis as $analysis_id => $analysis_values) {
tx_nG6_db::hide_analysis($analysis_values['id']);
}
......@@ -718,22 +670,23 @@ class tx_nG6_db {
* Unhide a run and sublevels (analysis)
*
* @param string $r_id the run id to hide
* @param int $user_id the current user id
*/
function unhide_run($r_id, $user_id) {
// Then all run analysis
$run_analysis = tx_nG6_db::get_run_analysis($user_id, $r_id);
foreach($run_analysis as $analysis_id => $analysis_values) {
tx_nG6_db::unhide_analysis($analysis_values['id']);
}
function unhide_run($r_id, $unhide_up=false) {
if ($unhide_up) {
// Unhide the project
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery (
'tx_nG6_project, tx_nG6_project_run',
'tx_nG6_project.uid = tx_nG6_project_run.project_id AND tx_nG6_project_run.run_id = '.$r_id ,
array('tx_nG6_project.hidden' => '0')
);
}
// Then all run analysis
$run_analysis = tx_nG6_db::get_run_analysis($r_id);
foreach($run_analysis as $analysis_id => $analysis_values) {
tx_nG6_db::unhide_analysis($analysis_values['id']);
}
// Finaly change the run itself
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_run', 'uid='.$r_id, array('hidden' => '0'));
......@@ -913,7 +866,9 @@ class tx_nG6_db {
*
* @param string $a_id the analysis id to hide
*/
function unhide_analysis($a_id) {
function unhide_analysis($a_id, $unhide_up=false) {
if ($unhide_up) {
$queryParts = array(
'SELECT' => 'tx_nG6_project_analyze.uid',
'FROM' => 'tx_nG6_project_analyze',
......@@ -948,6 +903,7 @@ class tx_nG6_db {
array('tx_nG6_project.hidden' => '0', 'tx_nG6_run.hidden' => '0')
) ;
}
}
// Change the analysis itself
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery ('tx_nG6_analyze', 'uid='.$a_id, array('hidden' => '0'));
......
......@@ -165,11 +165,11 @@ class tx_nG6_pi1 extends tslib_pibase {
foreach($projects as $project_id => $project_values) {
// project admin ?
if (tx_nG6_db::is_project_administrator($GLOBALS['TSFE']->fe_user->user['uid'], $project_values['id']) ) {
$projects[$project_id]['is_project_admin'] = true;
}else{
$projects[$project_id]['is_project_admin'] = false;
}
$projects[$project_id]['is_admin'] = tx_nG6_db::is_project_administrator($GLOBALS['TSFE']->fe_user->user['uid'], $project_values['id']);
// project manager ?
$projects[$project_id]['is_manager'] = tx_nG6_db::is_project_manager($GLOBALS['TSFE']->fe_user->user['uid'], $project_values['id']);
// project member ?
$projects[$project_id]['is_member'] = tx_nG6_db::is_project_member($GLOBALS['TSFE']->fe_user->user['uid'], $project_values['id']);
$project_ids .= $project_values['id'].",";
$projects[$project_id]['href'] = $this->pi_list_linkSingle($project_values['name'],$project_values['id'],1, array('project_id'=>$project_values['id']));
......@@ -189,46 +189,18 @@ class tx_nG6_pi1 extends tslib_pibase {
$project_users = tx_nG6_db::get_all_users_on_project($projects[key($projects)]['id']);
$smarty->assign('project_users', $project_users);
// test current user
if (tx_nG6_db::is_project_administrator($GLOBALS['TSFE']->fe_user->user['uid'], $projects[key($projects)]['id']) ) {
$smarty->assign('current_user_is_project_admin', true);
}else{
$smarty->assign('current_user_is_project_admin', false);
}
if (tx_nG6_db::is_project_manager($GLOBALS['TSFE']->fe_user->user['uid'], $projects[key($projects)]['id']) ) {
$smarty->assign('current_user_is_project_manager', true);
}else{
$smarty->assign('current_user_is_project_manager', false);
}
if (tx_nG6_db::is_project_member($GLOBALS['TSFE']->fe_user->user['uid'], $projects[key($projects)]['id']) ) {
$smarty->assign('current_user_is_project_member', true);
}else{
$smarty->assign('current_user_is_project_member', false);
}
// Add some information to the table
$project_runs = tx_nG6_db::get_project_runs($projects[key($projects)]['id']);
foreach($project_runs as $run_id => $run_values) {
if (tx_nG6_db::is_administrator($user_id, 'run', $run_values['id']) ) {
$project_runs[$run_id]['is_run_admin'] = true;
} else {
$project_runs[$run_id]['is_run_admin'] = false;
}
$project_runs[$run_id]['is_admin'] = tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'run', $run_values['id']);
$project_runs[$run_id]['href'] = $this->pi_list_linkSingle($run_values['name'],$run_values['id'],1, array('run_id'=>$run_values['id'], 'project_id'=>$run_values['project_id']));
}
$smarty->assign('project_runs', $project_runs);
$project_analysis = tx_nG6_db::get_project_analysis($projects[key($projects)]['id']);
// Add some information to the table
foreach($project_analysis as $analysis_id => $analysis_values) {
if (tx_nG6_db::is_administrator($user_id, 'analyze', $analysis_values['id']) ) {
$project_analysis[$analysis_id]['is_analyze_admin'] = true;
} else {
$project_analysis[$analysis_id]['is_analyze_admin'] = false;
}
$project_analysis[$analysis_id]['is_admin'] = tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'analyze', $analysis_values['id']);
$project_analysis[$analysis_id]['href'] = $this->pi_list_linkSingle($analysis_values['name'],$analysis_values['id'],1, array('analyze_id'=>$analysis_values['id'], 'project_id'=>$this->piVars['project_id']));
}
$smarty->assign('h_project_analysis', tx_nG6_utils::trace_hierarchy($project_analysis));
......@@ -283,7 +255,6 @@ class tx_nG6_pi1 extends tslib_pibase {
}
}
$smarty->assign('runs', $runs);
$smarty->assign('first_id', key($runs));
$smarty->assign('login_user', $GLOBALS['TSFE']->loginUser);
$smarty->assign('user_id', $GLOBALS['TSFE']->fe_user->user['uid']);
$smarty->assign('data_folder', $this->conf["data"]);
......@@ -292,14 +263,10 @@ class tx_nG6_pi1 extends tslib_pibase {
// If it's a single run, add analysis information
if (count($runs) == 1) {
$run_analysis = tx_nG6_db::get_run_analysis($GLOBALS['TSFE']->fe_user->user['uid'], $runs[key($runs)]['id']);
$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) {
if (tx_nG6_db::is_administrator($user_id, 'analyze', $analysis_values['id']) ) {
$run_analysis[$analysis_id]['is_admin'] = true;
} else {
$run_analysis[$analysis_id]['is_admin'] = false;
}
$run_analysis[$analysis_id]['is_admin'] = tx_nG6_db::is_administrator($GLOBALS['TSFE']->fe_user->user['uid'], 'analyze', $analysis_values['id']);
if ($this->piVars['project_id']) {
$run_analysis[$analysis_id]['href'] = $this->pi_list_linkSingle($analysis_values['name'],$analysis_values['id'],1, array('analyze_id'=>$analysis_values['id'], 'project_id'=>$this->piVars['project_id'], 'run_id'=>$this->piVars['run_id']));
} else {
......
......@@ -105,7 +105,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="hidden" id="right_level_manager" value="{$llang.right_level_manager}" />
<input type="hidden" id="right_level_member" value="{$llang.right_level_member}" />
<input type="hidden" id="is_admin" value="{$is_admin}" />
<input type="hidden" id="multi_user_delete" value="{$llang.multi_user_delete}" />
<input type="hidden" id="single_user_delete" value="{$llang.single_user_delete}" />
......@@ -128,45 +127,37 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<br />
{* If there is some runs to display *}
{if $project_runs|@count > 0}
<h3> {$llang.runs_done} </h3>
<div class="underline"> </div>
<br />
{* Find out if the current user is super user of a run *}
{assign var="run_admin" value=false}
{foreach from=$project_runs key=run_id item=run_values}
{if $run_values.is_run_admin && !$run_admin}
{assign var="run_admin" value=true}
{elseif !$run_admin}
{assign var="run_admin" value=false}
{if $projects[key($projects)].is_admin}
{assign var="is_at_least_admin_of_1_run" value=true}
{else}
{assign var="is_at_least_admin_of_1_run" value=false}
{/if}
{/foreach}
{assign var="runs" value=$project_runs}
{include file='run_table.tpl'}
{/if}
{* If there is some analysis to display *}
{if $project_analysis|@count > 0}
<br />
{* Find out if an analysis table should be displayed *}
{assign var="display_analysis_result" value=false}
{foreach from=$h_project_analysis key=analysis_id item=analysis_values}
{if $analysis_values.is_admin && $analysis_values.hidden == 1}
{assign var="display_analysis_result" value=true}
{elseif $analysis_values.hidden == 0}
{assign var="display_analysis_result" value=true}
{/if}
{/foreach}
<h3> {$llang.analyzes_done} </h3>
<div class="underline"> </div>
<br />
{* Find out if the current user is super user of an analysis *}
{assign var="analyze_admin" value=false}
{foreach from=$project_analysis key=analysis_id item=analysis_values}
{if $analysis_values.is_analyze_admin && !$analyze_admin}
{assign var="analyze_admin" value=true}
{elseif !$analyze_admin}
{assign var="analyze_admin" value=false}
{/if}
{/foreach}
<table class="display" id="analysis_data_table">
<thead>
<tr>
{if $analyze_admin && $login_user}
{if $projects[key($projects)].is_admin && $login_user && $display_analysis_result}
<th><center><input type="checkbox" id="chk_all_analysis"></center></th>
{/if}
<th nowrap>{$llang.name}</th>
......@@ -178,7 +169,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tbody>
{include file="recursive_list_analysis_display.tpl" element=$h_project_analysis prof=0}
</tbody>
{if $analyze_admin && $login_user}
{if $projects[key($projects)].is_admin && $login_user && $display_analysis_result}
<tfoot>
<tr>
<th align="left" colspan="5">
......@@ -190,37 +181,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tfoot>
{/if}
</table>
{/if}
<br />
<br />
{* If the current user is connected and is admin/manager/member *}
{if $login_user && ($current_user_is_project_admin || $current_user_is_project_manager || $current_user_is_project_member)}
{* If the current user is connected *}
{if $login_user}
{* manager has created some people *}
{if $current_user_is_project_manager}
{assign var="has_created_user" value=false}
{* Find out if the current user needs comboboxes *}
{assign var="needs_action" value=false}
{foreach from=$project_users key=c_user_id item=user_values}
{if $user_values.cruser_id==$user_id && !$has_created_user}
{assign var="has_created_user" value=true}
{elseif !$has_created_user}
{assign var="has_created_user" value=false}
{if $projects[key($projects)].is_admin && $user_values.id!=$user_id}
{assign var="needs_action" value=true}
{elseif $projects[key($projects)].is_manager && $user_values.id!=$user_id && $user_values.right_id!='2'}
{assign var="needs_action" value=true}
{/if}
{/foreach}
{/if}
<h3> {$llang.manage_users} </h3>
<div class="underline"> </div>
<br />
<input type="hidden" id="current_project_id" value="{$projects[key($projects)].id}" />
<table class="display" id="users_data_table">
<thead>
<tr>
{if $current_user_is_project_admin || $has_created_user}
{if $needs_action}
<th><center><input type="checkbox" id="chk_all_user"></center></th>
{/if}
<th nowrap>{$llang.user_name}</th>
<th>{$llang.lastlogin}</th>
<th>{$llang.cruser}</th>
......@@ -242,28 +227,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<tr id="tr_user_{$user_values.id}" class="{$emphasis}">
{if $current_user_is_project_admin}
{if $user_values.id!=$user_id}
{if ($projects[key($projects)].is_admin && $user_values.id!=$user_id)
|| ($projects[key($projects)].is_manager && $user_values.id!=$user_id && $user_values.right_id!='2')}
<td><center><input type="checkbox" id="chk_user_{$user_values.id}" value="user_{$user_values.id}" /></center></td>
{elseif $current_user_is_project_admin && $user_values.id==$user_id}
<td></td>