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

cumulate with project evolution ok

parent 7b27790b
......@@ -685,7 +685,11 @@ class tx_nG6_eid {
$values = split(",", trim(t3lib_div::_GP('values')));
$by = trim(t3lib_div::_GP('by'));
$role = trim(t3lib_div::_GP('role'));
print json_encode(tx_nG6_db::select_projects_evolution($values, $by, $role));
$cumulate = false;
if(trim(t3lib_div::_GP('cumulate')) == '1'){
$cumulate = true;
}
print json_encode(tx_nG6_db::select_projects_evolution($values, $by, $role, $cumulate));
} elseif($type == 'data_distribution'){
$values = split(",", trim(t3lib_div::_GP('values')));
$by = trim(t3lib_div::_GP('by'));
......@@ -699,7 +703,24 @@ class tx_nG6_eid {
$octet = false;
}
print json_encode(tx_nG6_db::select_storage_distribution($values, $by, $role, $get_analyzes, $octet));
}
} elseif($type == 'data_evolution'){
$values = split(",", trim(t3lib_div::_GP('values')));
$by = trim(t3lib_div::_GP('by'));
$role = trim(t3lib_div::_GP('role'));
$get_analyzes = false;
if(trim(t3lib_div::_GP('get_analyzes')) == '1'){
$get_analyzes = true;
}
$octet = true;
if(trim(t3lib_div::_GP('octet')) == '1'){
$octet = false;
}
$cumulate = false;
if(trim(t3lib_div::_GP('cumulate')) == '1'){
$cumulate = true;
}
print json_encode(tx_nG6_db::select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate));
}
}
/**
......
......@@ -245,7 +245,7 @@ class tx_nG6_db {
}
}
function select_projects_evolution($values, $by, $role) {
function select_projects_evolution($values, $by, $role, $cumulate) {
if ($by == "organism" || $by == "location") {
$by = "tx_nG6_".$by;
}
......@@ -274,7 +274,11 @@ class tx_nG6_db {
$results = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$results[] = array($res_row["crdate"], $res_row["nb"]);
if ($cumulate && count($results) > 0) {
$results[] = array($res_row["crdate"], $res_row["nb"] + $results[count($results)-1][1]);
} else {
$results[] = array($res_row["crdate"], $res_row["nb"]);
}
}
return $results;
......@@ -389,6 +393,10 @@ class tx_nG6_db {
$final_results[] = array( $group_key, $group_values );
}
return $final_results;
}
function select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate) {
}
/*
......
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