Commit c8ba73b6 authored by Romain Therville's avatar Romain Therville 🐭
Browse files

Update to tx_nG6_db.php

2 functions have a new parameter 'get_hidden'

Issues #193, #178
parent 414b438c
......@@ -1183,7 +1183,7 @@ INNER JOIN fe_groups ON fe_groups.uid = fe_users.usergroup',
* @param string $project_id the project id
* @return hash table with all runs information
*/
static function get_project_runs($project_id, $orderby='', $limit='') {
static function get_project_runs($project_id, $get_hidden=TRUE, $orderby='', $limit='') {
// First select all runs from the database
$queryParts = Array(
......@@ -1214,6 +1214,10 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
'ORDERBY' => $orderby,
'LIMIT' => $limit
);
if(!$get_hidden){
$queryParts['WHERE'] .= ' AND tx_nG6_run.hidden = 0';
}
// Then create the result hash table
......@@ -1334,7 +1338,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
* @param string $project_id the project id
* @return hash table with all analysis information
*/
static function get_project_analysis($project_id, $orderby='', $limit='') {
static function get_project_analysis($project_id, $get_hidden=TRUE, $orderby='', $limit='') {
// First select all analysis from the database
$queryParts = array(
......@@ -1363,6 +1367,11 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
'ORDERBY' => $orderby,
'LIMIT' => $limit
);
if(!$get_hidden){
$queryParts['WHERE'] .= ' AND tx_nG6_analyze.hidden = 0';
}
// Then create the result hash table
$results = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
......@@ -1599,19 +1608,20 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
*
* @param string $p_id the project id to return the size
* @param string $data_folder the data folder
* @param boolean $get_analyzes get analyzes size ?
* @param boolean $get_analyzes get analyzes size ?
* @param boolean $get_hidden get the hidden runs and analyzes ?
*/
static function get_project_size($p_id, $get_analyzes=false) {
static function get_project_size($p_id, $get_analyzes=false, $get_hidden=true) {
$full_size = 0;
// All runs
$project_runs = tx_nG6_db::get_project_runs($p_id);
$project_runs = tx_nG6_db::get_project_runs($p_id, $get_hidden);
foreach($project_runs as $run_id => $run_values) {
$full_size += tx_nG6_db::get_run_size($run_values['id'], $get_analyzes);
}
if ($get_analyzes) {
if ($get_analyzes) {
// All analysis
$project_analysis = tx_nG6_db::get_project_analysis($p_id);
$project_analysis = tx_nG6_db::get_project_analysis($p_id, $get_hidden);
foreach($project_analysis as $analyse_id => $analyze_values) {
$full_size += tx_nG6_db::get_analysis_size($analyze_values['id']);
}
......
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