Commit b6aeeb5f authored by Gerald Salin's avatar Gerald Salin
Browse files

Corrected initialisation array in detailed view in project view (run and analyses states)

parent 17244827
......@@ -191,9 +191,10 @@ class tx_nG6_db {
function select_list_retention_data_info($where) {
$by_project=array();
$res = tx_nG6_db::select_all_in_view( "tx_nG6_view_project_run" , $where);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (!isset ($by_project[$res_row['project_id']])) {
if (!isset ($by_project[$res_row['project_id']])) {
$by_project[$res_row['project_id']]= array(
'project_id' => $res_row['project_id'],
'project_name' => $res_row['project_name'],
......@@ -216,9 +217,9 @@ class tx_nG6_db {
}
}
$res = tx_nG6_db::select_all_in_view("tx_nG6_view_project_run_analyze",$where);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (!isset ($by_project[$res_row['project_id']])) {
$by_project[$res_row['project_id']]= array(
......@@ -231,9 +232,15 @@ class tx_nG6_db {
'nb_runs' =>0,
'nb_analyses' =>0);
}
}else{
if (!isset ($by_project[$res_row['project_id']]['state'][$res_row['state']]['analysis_ids'])){
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array_merge($by_project[$res_row['project_id']]['state'][$res_row['state']],array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']));
if (!isset($by_project[$res_row['project_id']]['state'][$res_row['state']])){
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']);
}else{
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array_merge($by_project[$res_row['project_id']]['state'][$res_row['state']],array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']));
}
$by_project[$res_row['project_id']]['total_purgeable_size'] += $res_row['storage_size'];
} else {
$by_project[$res_row['project_id']]['state'][$res_row['state']]['nb_analyze'] += 1;
......@@ -241,8 +248,10 @@ class tx_nG6_db {
$by_project[$res_row['project_id']]['state'][$res_row['state']]['analysis_ids'].=",".$res_row['analyze_id'];
$by_project[$res_row['project_id']]['total_purgeable_size'] += $res_row['storage_size'];
}
}
}
$res = tx_nG6_db::select_all_in_view("tx_nG6_view_project_analyze", $where);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (!isset ($by_project[$res_row['project_id']])) {
......@@ -255,7 +264,11 @@ class tx_nG6_db {
'nb_analyses' =>0);
}
if (!isset ($by_project[$res_row['project_id']]['state'][$res_row['state']]['analysis_ids'])){
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array_merge($by_project[$res_row['project_id']]['state'][$res_row['state']],array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']));
if (!isset($by_project[$res_row['project_id']]['state'][$res_row['state']])){
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']);
}else{
$by_project[$res_row['project_id']]['state'][$res_row['state']] = array_merge($by_project[$res_row['project_id']]['state'][$res_row['state']],array("nb_analyze"=>1, "size_analyze"=>$res_row['storage_size']+$res_row['purged_size'],'analysis_ids'=>$res_row['analyze_id']));
}
$by_project[$res_row['project_id']]['total_purgeable_size'] += $res_row['storage_size'];
}
else
......
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