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

code cleaning

parent 7f7aa4dd
...@@ -52,14 +52,14 @@ class tx_nG6_eid { ...@@ -52,14 +52,14 @@ class tx_nG6_eid {
if ($type == 'project') { if ($type == 'project') {
$project_id = trim(t3lib_div::_GP('id')); $project_id = trim(t3lib_div::_GP('id'));
// Select all runs linked to the project // Select all runs linked to the project
$project_runs = tx_nG6_db::get_project_runs($user_group, $project_id); $project_runs = tx_nG6_db::get_project_runs($user_group, $project_id, 'tx_nG6_run.date DESC');
// for each run // for each run
$html_tree = ''; $html_tree = '';
foreach($project_runs as $run_id => $run_values) { foreach($project_runs as $run_id => $run_values) {
$html_tree .= '<li class="jstree-closed" name=\''.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###'), array($run_values["name"], strftime('%d-%m-%y',$run_values["date"])), trim(t3lib_div::_GP('run_short_description'))).'\' id=\''.$run_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###', '###SPAN_NB_SEQ###', '###SPAN_SPECIES###'), array($run_values["name"], strftime('%d-%m-%y',$run_values["date"]), $run_values["nb_sequences"], $run_values["species"]), trim(t3lib_div::_GP('run_description'))).'</a></li>'; $html_tree .= '<li class="jstree-closed" name=\''.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###'), array($run_values['name'], strftime('%d-%m-%y',$run_values['date'])), trim(t3lib_div::_GP('run_short_description'))).'\' id=\''.$run_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###', '###SPAN_DATE###', '###SPAN_NB_SEQ###', '###SPAN_SPECIES###'), array($run_values['name'], strftime('%d-%m-%y',$run_values['date']), $run_values['nb_sequences'], $run_values['species']), trim(t3lib_div::_GP('run_description'))).'</a></li>';
} }
// Then all project analysis // Then all project analysis
$project_analysis = tx_nG6_db::get_project_analysis($user_group, $project_id); $project_analysis = tx_nG6_db::get_project_analysis($user_group, $project_id, 'tx_nG6_analyze.name');
foreach($project_analysis as $analyse_id => $analyse_values) { foreach($project_analysis as $analyse_id => $analyse_values) {
$html_tree .= '<li name=\''.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_description'))).'\' id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_description'))).'</a></li>'; $html_tree .= '<li name=\''.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_description'))).'\' id=\''.$analyse_id.'\'> <a href=\'#\'>'.str_replace(array('###SPAN_NAME###'), array($analyse_values["name"]), trim(t3lib_div::_GP('analyse_description'))).'</a></li>';
} }
...@@ -70,8 +70,8 @@ class tx_nG6_eid { ...@@ -70,8 +70,8 @@ class tx_nG6_eid {
} else if ($type == 'run'){ } else if ($type == 'run'){
$run_id = trim(t3lib_div::_GP('id')); $run_id = trim(t3lib_div::_GP('id'));
// Select all analysis linked to the run and the run information // Select all analysis linked to the run and the run information
$run_analysis = tx_nG6_db::get_run_analysis($user_group, $run_id); $run_analysis = tx_nG6_db::get_run_analysis($user_group, $run_id, 'tx_nG6_analyze.name');
$run_info = tx_nG6_db::get_run($run_id); $run_info = tx_nG6_db::select_run($run_id);
// for each analysis // for each analysis
$html_tree = ''; $html_tree = '';
$html_tree .= '<li name=\'run_'.$run_id.'_'.trim(t3lib_div::_GP("raw_data_description")).'\' id=\'data_'.$run_id.'\'> <a href=\'#\'>'.trim(t3lib_div::_GP("raw_data_description")).'</a></li>'; $html_tree .= '<li name=\'run_'.$run_id.'_'.trim(t3lib_div::_GP("raw_data_description")).'\' id=\'data_'.$run_id.'\'> <a href=\'#\'>'.trim(t3lib_div::_GP("raw_data_description")).'</a></li>';
...@@ -263,7 +263,7 @@ class tx_nG6_eid { ...@@ -263,7 +263,7 @@ class tx_nG6_eid {
if ($val != "undefined" && $val != "") { if ($val != "undefined" && $val != "") {
$id = preg_split("/_/", $val); $id = preg_split("/_/", $val);
if ($id[0] == "data") { if ($id[0] == "data") {
$run = tx_nG6_db::get_run($id[1]); $run = tx_nG6_db::select_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) { if (!in_array($data_folder.$run["directory"], $src_directories)) {
$src_directories[] = $data_folder.$run["directory"]; $src_directories[] = $data_folder.$run["directory"];
$ddest = $output_folder."/Project_".str_replace($char_to_replace, '_', $run["project_name"]); $ddest = $output_folder."/Project_".str_replace($char_to_replace, '_', $run["project_name"]);
...@@ -271,14 +271,14 @@ class tx_nG6_eid { ...@@ -271,14 +271,14 @@ class tx_nG6_eid {
$dest_directories[] = $ddest; $dest_directories[] = $ddest;
} }
} else if ($id[0] == "run") { } else if ($id[0] == "run") {
$run = tx_nG6_db::get_run($id[1]); $run = tx_nG6_db::select_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) { if (!in_array($data_folder.$run["directory"], $src_directories)) {
$src_directories[] = $data_folder.$run["directory"]; $src_directories[] = $data_folder.$run["directory"];
$ddest = $output_folder."/Project_".str_replace($char_to_replace, '_', $run["project_name"]); $ddest = $output_folder."/Project_".str_replace($char_to_replace, '_', $run["project_name"]);
$ddest .= '.'.$run["project_id"]."/Run_".str_replace($char_to_replace, '_', $run["name"]).".".$id[1]."/RawData"; $ddest .= '.'.$run["project_id"]."/Run_".str_replace($char_to_replace, '_', $run["name"]).".".$id[1]."/RawData";
$dest_directories[] = $ddest; $dest_directories[] = $ddest;
} }
foreach(tx_nG6_db::get_run_analysis($user_group, $id[1]) as $analyse_id => $analyse_values) { foreach(tx_nG6_db::get_run_analysis($user_group, $id[1], 'tx_nG6_analyze.name') as $analyse_id => $analyse_values) {
$aid = preg_split("/_/", $analyse_id); $aid = preg_split("/_/", $analyse_id);
if (!in_array($data_folder.$analyse_values["directory"], $src_directories)) { if (!in_array($data_folder.$analyse_values["directory"], $src_directories)) {
$src_directories[] = $data_folder.$analyse_values["directory"]; $src_directories[] = $data_folder.$analyse_values["directory"];
...@@ -289,7 +289,7 @@ class tx_nG6_eid { ...@@ -289,7 +289,7 @@ class tx_nG6_eid {
} }
} }
} else if ($id[0] == "analyse") { } else if ($id[0] == "analyse") {
$analyse = tx_nG6_db::get_analyse($id[1]); $analyse = tx_nG6_db::select_analyse($id[1]);
if (!in_array($data_folder.$analyse["directory"], $src_directories)) { if (!in_array($data_folder.$analyse["directory"], $src_directories)) {
$src_directories[] = $data_folder.$analyse["directory"]; $src_directories[] = $data_folder.$analyse["directory"];
// If it's a project analyse // If it's a project analyse
......
...@@ -42,7 +42,7 @@ class tx_nG6_db { ...@@ -42,7 +42,7 @@ class tx_nG6_db {
* @param string $user_group the user group * @param string $user_group the user group
* @return table with all projects * @return table with all projects
*/ */
function select_all_user_projects($user_group) { function select_all_user_projects($user_group, $orderby='', $limit='') {
$projects = array(); $projects = array();
// If the user is not logged on display demonstration project // If the user is not logged on display demonstration project
...@@ -61,8 +61,8 @@ class tx_nG6_db { ...@@ -61,8 +61,8 @@ class tx_nG6_db {
'FROM' => 'tx_nG6_project', 'FROM' => 'tx_nG6_project',
'WHERE' => $where, 'WHERE' => $where,
'GROUPBY' => '', 'GROUPBY' => '',
'ORDERBY' => '', 'ORDERBY' => $orderby,
'LIMIT' => '' 'LIMIT' => $limit
); );
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$user_groups = t3lib_div::intExplode(',',tx_nG6_db::get_user_groups($user_group)); $user_groups = t3lib_div::intExplode(',',tx_nG6_db::get_user_groups($user_group));
...@@ -85,6 +85,7 @@ class tx_nG6_db { ...@@ -85,6 +85,7 @@ class tx_nG6_db {
$projects['project_'.$project_id] = array( $projects['project_'.$project_id] = array(
'id' => $project_id, 'id' => $project_id,
'name' => $row['project_name'], 'name' => $row['project_name'],
'hidden' => $row['project_hidden'],
'description' => $row['project_description']); 'description' => $row['project_description']);
} }
...@@ -118,24 +119,30 @@ class tx_nG6_db { ...@@ -118,24 +119,30 @@ class tx_nG6_db {
* @param string $project_id the project id * @param string $project_id the project id
* @return hash table with all runs information * @return hash table with all runs information
*/ */
function get_project_runs($user_group, $project_id) { function get_project_runs($user_group, $project_id, $orderby='', $limit='') {
// First select all runs from the database // First select all runs from the database
$queryParts = Array( $queryParts = Array(
'SELECT' => 'tx_nG6_run.uid AS run_id,'. 'SELECT' => 'tx_nG6_run.uid AS run_id,'.
'tx_nG6_run.directory AS run_directory,'. 'tx_nG6_run.directory AS run_directory,'.
'tx_nG6_run.species AS run_species,'. 'tx_nG6_run.species AS run_species,'.
'tx_nG6_run.description AS run_description, '. 'tx_nG6_run.description AS run_description, '.
'tx_nG6_run.data_nature AS run_data_nature, '.
'tx_nG6_run.sequencer AS run_sequencer, '.
'tx_nG6_run.type AS run_type, '.
'tx_nG6_run.name AS run_name, '. 'tx_nG6_run.name AS run_name, '.
'tx_nG6_run.nb_sequences, '. 'tx_nG6_project.uid AS project_id, '.
'tx_nG6_run.nb_sequences AS run_nb_sequences, '.
'tx_nG6_run.full_seq_size AS run_full_seq_size, '.
'tx_nG6_run.date AS run_date, '. 'tx_nG6_run.date AS run_date, '.
'tx_nG6_run.hidden AS run_hidden, '. 'tx_nG6_run.hidden AS run_hidden, '.
'tx_nG6_project.name AS project_name, '.
'tx_nG6_project.fe_group AS project_fe_group', 'tx_nG6_project.fe_group AS project_fe_group',
'FROM' => 'tx_nG6_project INNER JOIN ( tx_nG6_project_run INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid '. 'FROM' => 'tx_nG6_project INNER JOIN ( tx_nG6_project_run INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid '.
' ) ON tx_nG6_project.uid=tx_nG6_project_run.project_id', ' ) ON tx_nG6_project.uid=tx_nG6_project_run.project_id',
'WHERE' => 'tx_nG6_project.uid='.$project_id, 'WHERE' => 'tx_nG6_project.uid='.$project_id,
'GROUPBY' => '', 'GROUPBY' => '',
'ORDERBY' => 'tx_nG6_run.date DESC', 'ORDERBY' => $orderby,
'LIMIT' => '' 'LIMIT' => $limit
); );
// Then create the result hash table // Then create the result hash table
$results = array(); $results = array();
...@@ -158,11 +165,20 @@ class tx_nG6_db { ...@@ -158,11 +165,20 @@ class tx_nG6_db {
if (!isset($results['run_'.$run_id]) and $user_allowed) { if (!isset($results['run_'.$run_id]) and $user_allowed) {
$results['run_'.$run_id] = array( $results['run_'.$run_id] = array(
'id' => $run_id,
'directory' => $row['run_directory'], 'directory' => $row['run_directory'],
'name' => $row['run_name'], 'name' => $row['run_name'],
'project_name' => $row['project_name'],
'fe_group' => $row['project_fe_group'],
'hidden' => $row['run_hidden'],
'species' => $row['run_species'], 'species' => $row['run_species'],
'nb_sequences' => $row['nb_sequences'], 'nb_sequences' => $row['run_nb_sequences'],
'full_seq_size' => $row['run_full_seq_size'],
'project_id' => $row['project_id'],
'date' => $row['run_date'], 'date' => $row['run_date'],
'data_nature' => $row['run_data_nature'],
'sequencer' => $row['run_sequencer'],
'type' => $row['run_type'],
'description' => $row['run_description'] 'description' => $row['run_description']
); );
} }
...@@ -177,13 +193,15 @@ class tx_nG6_db { ...@@ -177,13 +193,15 @@ class tx_nG6_db {
* @param string $project_id the project id * @param string $project_id the project id
* @return hash table with all analysis information * @return hash table with all analysis information
*/ */
function get_project_analysis($user_group, $project_id) { function get_project_analysis($user_group, $project_id, $orderby, $limit) {
// First select all analysis from the database // First select all analysis from the database
$queryParts = array( $queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'. 'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'.
'tx_nG6_analyze.directory AS analyze_directory,'. 'tx_nG6_analyze.directory AS analyze_directory,'.
'tx_nG6_analyze.name AS analyze_name, '. 'tx_nG6_analyze.name AS analyze_name, '.
'tx_nG6_analyze.date AS analyze_date, '. 'tx_nG6_analyze.date AS analyze_date, '.
'tx_nG6_analyze.software AS analyze_software, '.
'tx_nG6_analyze.version AS analyze_version, '.
'tx_nG6_analyze.description AS analyze_description, '. 'tx_nG6_analyze.description AS analyze_description, '.
'tx_nG6_analyze.hidden AS analyze_hidden, '. 'tx_nG6_analyze.hidden AS analyze_hidden, '.
'tx_nG6_project.fe_group AS project_fe_group', 'tx_nG6_project.fe_group AS project_fe_group',
...@@ -191,8 +209,8 @@ class tx_nG6_db { ...@@ -191,8 +209,8 @@ class tx_nG6_db {
'tx_nG6_analyze.uid=tx_nG6_project_analyze.analyze_id) ON tx_nG6_project.uid = tx_nG6_project_analyze.project_id ', 'tx_nG6_analyze.uid=tx_nG6_project_analyze.analyze_id) ON tx_nG6_project.uid = tx_nG6_project_analyze.project_id ',
'WHERE' => 'tx_nG6_project_analyze.project_id='.$project_id, 'WHERE' => 'tx_nG6_project_analyze.project_id='.$project_id,
'GROUPBY' => '', 'GROUPBY' => '',
'ORDERBY' => 'tx_nG6_analyze.name', 'ORDERBY' => $orderby,
'LIMIT' => '' 'LIMIT' => $limit
); );
// Then create the result hash table // Then create the result hash table
$results = array(); $results = array();
...@@ -217,8 +235,12 @@ class tx_nG6_db { ...@@ -217,8 +235,12 @@ class tx_nG6_db {
$results['analyse_'.$analyze_id] = array( $results['analyse_'.$analyze_id] = array(
'directory' => $row['analyze_directory'], 'directory' => $row['analyze_directory'],
'name' => $row['analyze_name'], 'name' => $row['analyze_name'],
'id' => $row['analyze_id'],
'hidden' => $row['analyze_hidden'],
'software' => $row['analyze_software'],
'version' => $row['analyze_version'],
'date' => $row['analyze_date'], 'date' => $row['analyze_date'],
'description' => $row['analyse_description'] 'description' => $row['analyze_description']
); );
} }
} }
...@@ -230,13 +252,94 @@ class tx_nG6_db { ...@@ -230,13 +252,94 @@ class tx_nG6_db {
* Run functions * Run functions
*------------------------------------------------------------*/ *------------------------------------------------------------*/
/**
* Select all run for the specified user
*
* @param string $user_group the user group
* @return table with all projects
*/
function select_all_user_runs($user_group, $orderby='', $limit='') {
// If the user is not logged on display demonstration project
if (!$GLOBALS['TSFE']->loginUser) {
$where = 'fe_group=0';
} else {
$where = 'fe_group IN ('.tx_nG6_db::get_user_groups($user_group).')';
}
// Execute the request
$queryParts = Array(
'SELECT' => 'tx_nG6_run.uid AS run_id,'.
'tx_nG6_run.directory AS run_directory,'.
'tx_nG6_run.species AS run_species,'.
'tx_nG6_run.description AS run_description, '.
'tx_nG6_run.data_nature AS run_data_nature, '.
'tx_nG6_run.sequencer AS run_sequencer, '.
'tx_nG6_run.type AS run_type, '.
'tx_nG6_run.name AS run_name, '.
'tx_nG6_run.nb_sequences AS run_nb_sequences, '.
'tx_nG6_run.full_seq_size AS run_full_seq_size, '.
'tx_nG6_run.date AS run_date, '.
'tx_nG6_run.hidden AS run_hidden, '.
'tx_nG6_project.uid AS project_id, '.
'tx_nG6_project.name AS project_name, '.
'tx_nG6_project.fe_group AS project_fe_group',
'FROM' => 'tx_nG6_project INNER JOIN ( tx_nG6_project_run INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid '.
' ) ON tx_nG6_project.uid=tx_nG6_project_run.project_id',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => $orderby,
'LIMIT' => $limit
);
// Then create the result hash table
$results = array();
$user_groups = t3lib_div::intExplode(',',tx_nG6_db::get_user_groups($user_group));
$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;
} else {
foreach(tx_nG6_db::get_super_groups_of($row['project_fe_group']) AS $valeur) {
if (in_array($valeur, $user_groups)) {
$user_allowed = true;
}
}
}
if (!isset($results['run_'.$run_id]) and $user_allowed) {
$results['run_'.$run_id] = array(
'id' => $run_id,
'directory' => $row['run_directory'],
'name' => $row['run_name'],
'project_name' => $row['project_name'],
'fe_group' => $row['project_fe_group'],
'project_id' => $row['project_id'],
'hidden' => $row['run_hidden'],
'species' => $row['run_species'],
'nb_sequences' => $row['run_nb_sequences'],
'full_seq_size' => $row['run_full_seq_size'],
'date' => $row['run_date'],
'data_nature' => $row['run_data_nature'],
'sequencer' => $row['run_sequencer'],
'type' => $row['run_type'],
'description' => $row['run_description']
);
}
}
return $results;
}
/** /**
* Select all information for the specified run * Select all information for the specified run
* *
* @param string $run_id the run id * @param string $run_id the run id
* @return hash table with all the run information * @return hash table with all the run information
*/ */
function get_run($run_id) { function select_run($run_id) {
// First select the run from the database // First select the run from the database
...@@ -246,7 +349,12 @@ class tx_nG6_db { ...@@ -246,7 +349,12 @@ class tx_nG6_db {
'tx_nG6_run.uid AS run_id,'. 'tx_nG6_run.uid AS run_id,'.
'tx_nG6_run.directory AS run_directory,'. 'tx_nG6_run.directory AS run_directory,'.
'tx_nG6_run.description AS run_description, '. 'tx_nG6_run.description AS run_description, '.
'tx_nG6_run.species AS run_species, '.
'tx_nG6_run.name AS run_name, '. 'tx_nG6_run.name AS run_name, '.
'tx_nG6_run.data_nature AS run_data_nature, '.
'tx_nG6_run.sequencer AS run_sequencer, '.
'tx_nG6_run.type AS run_type, '.
'tx_nG6_run.full_seq_size, '.
'tx_nG6_run.nb_sequences, '. 'tx_nG6_run.nb_sequences, '.
'tx_nG6_run.date AS run_date', 'tx_nG6_run.date AS run_date',
'FROM' => 'tx_nG6_project INNER JOIN ( tx_nG6_project_run INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid '. 'FROM' => 'tx_nG6_project INNER JOIN ( tx_nG6_project_run INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid '.
...@@ -260,19 +368,21 @@ class tx_nG6_db { ...@@ -260,19 +368,21 @@ class tx_nG6_db {
$result = array(); $result = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$run_id = $row['run_id'];
if (!isset ($results['run_'.$run_id])) {
$result = array( $result = array(
'project_id' => $row['project_id'], 'project_id' => $row['project_id'],
'project_name' => $row['project_name'], 'project_name' => $row['project_name'],
'directory' => $row['run_directory'], 'directory' => $row['run_directory'],
'name' => $row['run_name'], 'name' => $row['run_name'],
'type' => $row['run_type'],
'sequencer' => $row['run_sequencer'],
'data_nature' => $row['run_data_nature'],
'full_seq_size' => $row['full_seq_size'],
'species' => $row['run_species'],
'nb_sequences' => $row['nb_sequences'], 'nb_sequences' => $row['nb_sequences'],
'date' => $row['run_date'], 'date' => $row['run_date'],
'description' => $row['run_description'] 'description' => $row['run_description']
); );
} }
}
return $result; return $result;
} }
...@@ -283,13 +393,15 @@ class tx_nG6_db { ...@@ -283,13 +393,15 @@ class tx_nG6_db {
* @param string $run_id the run id * @param string $run_id the run id
* @return hash table with all analysis information * @return hash table with all analysis information
*/ */
function get_run_analysis($user_group, $run_id) { function get_run_analysis($user_group, $run_id, $orderby='', $limit='') {
// First select all analysis from the database // First select all analysis from the database
$queryParts = array( $queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'. 'SELECT' => 'tx_nG6_analyze.uid AS analyze_id,'.
'tx_nG6_analyze.directory AS analyze_directory,'. 'tx_nG6_analyze.directory AS analyze_directory,'.
'tx_nG6_analyze.name AS analyze_name, '. 'tx_nG6_analyze.name AS analyze_name, '.
'tx_nG6_analyze.date AS analyze_date, '. 'tx_nG6_analyze.date AS analyze_date, '.
'tx_nG6_analyze.software AS analyze_software, '.
'tx_nG6_analyze.version AS analyze_version, '.
'tx_nG6_analyze.hidden AS analyze_hidden, '. 'tx_nG6_analyze.hidden AS analyze_hidden, '.
'tx_nG6_analyze.description AS analyze_description, '. 'tx_nG6_analyze.description AS analyze_description, '.
'tx_nG6_project.fe_group AS project_fe_group', 'tx_nG6_project.fe_group AS project_fe_group',
...@@ -298,8 +410,8 @@ class tx_nG6_db { ...@@ -298,8 +410,8 @@ class tx_nG6_db {
') ON tx_nG6_run.uid = tx_nG6_project_run.run_id) ON tx_nG6_project_run.project_id = tx_nG6_project.uid ', ') ON tx_nG6_run.uid = tx_nG6_project_run.run_id) ON tx_nG6_project_run.project_id = tx_nG6_project.uid ',
'WHERE' => 'tx_nG6_run_analyze.run_id='.$run_id, 'WHERE' => 'tx_nG6_run_analyze.run_id='.$run_id,
'GROUPBY' => '', 'GROUPBY' => '',
'ORDERBY' => 'tx_nG6_analyze.name', 'ORDERBY' => $orderby,
'LIMIT' => '' 'LIMIT' => $limit
); );
// Then create the result hash table // Then create the result hash table
$results = array(); $results = array();
...@@ -324,8 +436,12 @@ class tx_nG6_db { ...@@ -324,8 +436,12 @@ class tx_nG6_db {
$results['analyse_'.$analyze_id] = array( $results['analyse_'.$analyze_id] = array(
'directory' => $row['analyze_directory'], 'directory' => $row['analyze_directory'],
'name' => $row['analyze_name'], 'name' => $row['analyze_name'],
'id' => $row['analyze_id'],
'hidden' => $row['analyze_hidden'],
'software' => $row['analyze_software'],
'version' => $row['analyze_version'],
'date' => $row['analyze_date'], 'date' => $row['analyze_date'],
'description' => $row['analyse_description'] 'description' => $row['analyze_description']
); );
} }
} }
...@@ -343,7 +459,7 @@ class tx_nG6_db { ...@@ -343,7 +459,7 @@ class tx_nG6_db {
* @param string $analyse_id the analyse id * @param string $analyse_id the analyse id
* @return hash table with all analyse information * @return hash table with all analyse information
*/ */
function get_analyse($analyse_id) { function select_analyse($analyse_id) {
// First select all analyse information // First select all analyse information
$queryParts = array( $queryParts = array(
......
This diff is collapsed.
...@@ -6,68 +6,62 @@ ...@@ -6,68 +6,62 @@
</meta> </meta>
<data type="array"> <data type="array">
<languageKey index="default" type="array"> <languageKey index="default" type="array">
<label index="listFieldHeader_uid">ID</label>
<label index="listFieldHeader_date">Date</label> <label index="not_authorized">Access denied - You are not authorized to access this page.</label>
<label index="listFieldHeader_downloads">Downloads</label> <label index="not_synchro">Results folder not synchronized yet</label>
<label index="listFieldHeader_description">Description</label> <label index="no_raw">Sorry no results to display</label>
<label index="listFieldHeader_project_name">Project Name</label> <label index="uncorrect_xml">The xml analyse file is not well formated.</label>
<label index="listFieldHeader_run_name">Run Name</label> <label index="no_xsl_found">No xsl file found for this analyse.</label>
<label index="listFieldHeader_name">Name</label> <label index="runs_done">Runs done :</label>
<label index="listFieldHeader_directory">Directory</label> <label index="analyzes_done">Analyzes done :</label>
<label index="listFieldHeader_species">Species</label>
<label index="listFieldHeader_data_nature">Data Nature</label> <label index="uid">ID</label>
<label index="listFieldHeader_type">Type</label> <label index="date">Date</label>
<label index="listFieldHeader_nb_sequences">Number of sequences</label> <label index="downloads">Downloads</label>
<label index="listFieldHeader_full_seq_size">Full sequences length</label> <label index="description">Description</label>
<label index="listFieldHeader_sequencer">Sequencer</label> <label index="project_name">Project Name</label>
<label index="listFieldHeader_software">Sofware</label> <label index="run_name">Run Name</label>
<label index="listFieldHeader_version">Version</label> <label index="name">Name</label>
<label index="listFieldHeader_params">Parameters</label> <label index="directory">Directory</label>
<label index="listFieldHeader_no_raw">Sorry no results to display</label> <label index="species">Species</label>
<label index="listFieldHeader_runs_done">Runs done :</label> <label index="data_nature">Data Nature</label>
<label index="listFieldHeader_analyzes_done">Analyzes done :</label> <label index="type">Type</label>
<label index="listFieldHeader_not_synchro">Results folder not synchronized yet</label> <label index="nb_sequences">Number of sequences</label>
<label index="listFieldHeader_not_authorized">Access denied - You are not authorized to access this page.</label> <label index="full_seq_size">Full sequences length</label>
<label index="listFieldHeader_uncorrect_xml">The xml analyse file is not well formated.</label> <label index="sequencer">Sequencer</label>
<label index="listFieldHeader_no_xsl_found">No xsl file found for this analyse.</label> <label index="software">Sofware</label>
<label index="back">Back</label> <label index="version">Version</label>
<label index="pi_list_browseresults_prev">&lt; Previous</label> <label index="params">Parameters</label>
<label index="pi_list_browseresults_page">Page</label>
<label index="pi_list_browseresults_next">Next &gt;</label>
<label index="pi_list_browseresults_displays">Displaying results ###SPAN_BEGIN###%s to %s&lt;/span&gt; out of ###SPAN_BEGIN###%s&lt;/span&gt;</label>
<label index="pi_list_searchBox_search">Search</label>
</languageKey> </languageKey>
<languageKey index="fr" type="array"> <languageKey index="fr" type="array">
<label index="listFieldHeader_uid">ID</label>
<label index="listFieldHeader_date">Date</label> <label index="not_authorized">Accès refusé - Vous n'avez pas les droits d'accès à cette page.</label>
<label index="listFieldHeader_downloads">T&amp;eacute;l&amp;eacute;chargements</label> <label index="not_synchro">Le répertoire de résultats n'est pas encore synchronisé</label>
<label index="listFieldHeader_description">Description</label> <label index="no_raw">Désolé aucun résultats à afficher</label>
<label index="listFieldHeader_project_name">Nom du projet</label> <label index="uncorrect_xml">Le fichier xml est incorrect.</label>
<label index="listFieldHeader_run_name">Nom du run</label> <label index="no_xsl_found">Aucun fichier xsl pour cette analyse.</label>
<label index="listFieldHeader_name">Nom</label> <label index="runs_done">Runs réalisés :</label>
<label index="listFieldHeader_directory">R&amp;eacute;pertoire</label> <label index="analyzes_done">Analyses réalisées :</label>
<label index="listFieldHeader_species">Esp&amp;egrave;ce</label>
<label index="listFieldHeader_data_nature">Nature des donn&amp;eacute;es</label> <label index="uid">ID</label>
<label index="listFieldHeader_type">Type</label> <label index="date">Date</label>
<label index="listFieldHeader_nb_sequences">Nombre de s&amp;eacute;quences</label> <label index="downloads">Téléchargements</label>
<label index="listFieldHeader_full_seq_size">Taille totale des s&amp;eacute;quences</label> <label index="description">Description</label>
<label index="listFieldHeader_sequencer">S&amp;eacute;quenceur</label> <label index="project_name">Nom du projet</label>
<label index="listFieldHeader_software">Logiciel</label> <label index="run_name">Nom du run</label>
<label index="listFieldHeader_version">Version</label>