Commit 3a4065e3 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

change download archive strucuture

parent 1ae0fcfd
......@@ -61,18 +61,18 @@ class tx_nG6_eid {
$run = $this->get_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) {
$src_directories[] = $data_folder.$run["directory"];
$dest_directories[] = $temporary_dir."/".str_replace(' ', '_', $run["name"])."_".$id[1];
$dest_directories[] = $temporary_dir."/Project_".str_replace(' ', '_', $run["project_name"]).'.'.$run["project_id"]."/Run_".str_replace(' ', '_', $run["name"]).".".$id[1]."/RawDatas";
}
} else if ($id[0] == "run") {
$run = $this->get_run($id[1]);
if (!in_array($data_folder.$run["directory"], $src_directories)) {
$src_directories[] = $data_folder.$run["directory"];
$dest_directories[] = $temporary_dir."/".str_replace(' ', '_', $run["name"])."_".$id[1];
$dest_directories[] = $temporary_dir."/Project_".str_replace(' ', '_', $run["project_name"]).'.'.$run["project_id"]."/Run_".str_replace(' ', '_', $run["name"]).".".$id[1]."/RawDatas";
}
foreach($this->get_run_analysis($id[1]) as $analyse_id => $analyse_values) {
if (!in_array($data_folder.$analyse_values["directory"], $src_directories)) {
$src_directories[] = $data_folder.$analyse_values["directory"];
$dest_directories[] = $temporary_dir."/".str_replace(' ', '_', $run["name"])."_".$id[1]."/".str_replace(' ', '_', $analyse_values["name"])."_".$analyse_id;
$dest_directories[] = $temporary_dir."/Project_".str_replace(' ', '_', $run["project_name"]).'.'.$run["project_id"]."/Run_".str_replace(' ', '_', $run["name"]).".".$id[1]."/Analyse_".str_replace(' ', '_', $analyse_values["name"]).".".$analyse_id;
}
}
} else if ($id[0] == "analyse") {
......@@ -81,13 +81,11 @@ class tx_nG6_eid {
$src_directories[] = $data_folder.$analyse["directory"];
// If it's a project analyse
if ($analyse["run_id"] == 'None') {
$dest_directories[] = $temporary_dir."/".str_replace(' ', '_', $analyse["project_name"])."_".$analyse["project_id"]."/".str_replace(' ', '_', $analyse["name"])."_".$id[1];
$dest_directories[] = $temporary_dir."/Project_".str_replace(' ', '_', $analyse["project_name"]).".".$analyse["project_id"]."/Project_analyses/".str_replace(' ', '_', $analyse["name"]).".".$id[1];
} else {
$dest_directories[] = $temporary_dir."/".str_replace(' ', '_', $analyse["project_name"])."_".$analyse["project_id"]."/".str_replace(' ', '_', $analyse["run_name"])."_".$analyse["run_id"]."/".str_replace(' ', '_', $analyse["name"])."_".$id[1];
$dest_directories[] = $temporary_dir."/Project_".str_replace(' ', '_', $analyse["project_name"]).".".$analyse["project_id"]."/Run_".str_replace(' ', '_', $analyse["run_name"]).".".$analyse["run_id"]."/Analyse_".str_replace(' ', '_', $analyse["name"]).".".$id[1];
}
}
} else if ($id[0] == "project") {
//TODO
}
}
}
......@@ -166,13 +164,16 @@ class tx_nG6_eid {
$result = array();
$queryParts = Array(
'SELECT' => 'tx_nG6_run.uid AS run_id,'.
'SELECT' => 'tx_nG6_project.uid AS project_id,'.
'tx_nG6_project.name AS project_name,'.
'tx_nG6_run.uid AS run_id,'.
'tx_nG6_run.directory AS run_directory,'.
'tx_nG6_run.description AS run_description, '.
'tx_nG6_run.name AS run_name, '.
'tx_nG6_run.nb_sequences, '.
'tx_nG6_run.date AS run_date',
'FROM' => 'tx_nG6_run',
'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' => 'tx_nG6_run.uid='.$run_id,
'GROUPBY' => '',
'ORDERBY' => 'tx_nG6_run.date DESC',
......@@ -186,6 +187,8 @@ class tx_nG6_eid {
if (! isset ($results['run_'.$run_id]) )
{
$result = array(
'project_id' => $row['project_id'],
'project_name' => $row['project_name'],
'directory' => $row['run_directory'],
'name' => $row['run_name'],
'nb_sequences' => $row['nb_sequences'],
......
Supports Markdown
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