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

add analysis project

parent 68bef960
......@@ -125,7 +125,7 @@ class tx_nG6_db {
// get all runs the usergroup can access to
$queryParts = array(
'SELECT' => 'tx_nG6_run.uid as run_id, tx_nG6_run.name as name',
'SELECT' => 'tx_nG6_run.uid as run_id',
'FROM' => 'tx_nG6_project '
.' INNER JOIN tx_nG6_project_run ON tx_nG6_project.uid=tx_nG6_project_run.project_id '
.' INNER JOIN tx_nG6_run ON tx_nG6_project_run.run_id=tx_nG6_run.uid ',
......@@ -134,11 +134,33 @@ class tx_nG6_db {
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size += tx_nG6_db::get_run_size($res_row['run_id'], $data_folder, $get_analyzes);
}
// get all project analysis the usergroup can access to
if ($get_analyzes) {
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid as analyze_id',
'FROM' => 'tx_nG6_project '
.' INNER JOIN tx_nG6_project_analyze ON tx_nG6_project.uid=tx_nG6_project_analyze.project_id '
.' INNER JOIN tx_nG6_analyze ON tx_nG6_project_analyze.analyze_id=tx_nG6_analyze.uid ',
'WHERE' => $where,
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
if ($usergroup != "0") {
$where = 'tx_nG6_project.uid IN ('.implode(",",$project_list_final).') AND tx_nG6_analyze.date BETWEEN '.$date_cursors.' AND '.$date_cursore;
} else {
$where = 'tx_nG6_analyze.date BETWEEN '.$date_cursors.' AND '.$date_cursore;
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size += tx_nG6_db::get_analysis_size($res_row['analyze_id'], $data_folder);
}
}
$cumulated_size += $current_size;
if ($date_cursore+$total_day_count_tstamp > $date_end) {
......
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