Commit 63a9b899 authored by Celine Noirot's avatar Celine Noirot
Browse files

Correct list run/analyse list for opened project #10

parent e132614c
......@@ -168,14 +168,14 @@ class tx_nG6_db {
################################
# OBSOLETE / PURGE management
################################
//Get list of obsolete run/analyses per project
function filter_list_retention_data_info($filter_size, $max_retention_date, $create_user_id, $without_user_group_id,$with_user_group_id) {
$where = ' DATEDIFF( FROM_UNIXTIME( retention_date ) , now( ) ) <0';
$where .= ' AND purge_demand_id IS NULL ';
$where .= ' AND state IN ( \'stored\', \'extended\') ';
if ($max_retention_date != "") {
if ($max_retention_date != "") {
$where = ' DATEDIFF( FROM_UNIXTIME( retention_date ) , STR_TO_DATE( "'.$max_retention_date.'", "%d/%m/%Y" ) ) <0';
}
$where .= ' AND purge_demand_id IS NULL ';
$where .= ' AND state IN ( \'stored\', \'extended\') ';
if ($filter_size != "") {
$where .=" AND storage_size > $filter_size";
}
......@@ -190,7 +190,8 @@ class tx_nG6_db {
}
function select_a_project_retention_data_info($project_id) {
$where =" project_id = " . $project_id ;
$where = ' DATEDIFF( FROM_UNIXTIME( retention_date ) , now( ) ) <0';
$where .=" AND project_id = " . $project_id ;
return(tx_nG6_db::select_list_retention_data_info($where));
}
......@@ -1930,7 +1931,8 @@ function get_project_runs($project_id, $orderby='', $limit='') {
'purged_date' => time(),
'data_state' => "purged",
'purged_size' => $storage_size,
'storage_size' => 0,
'storage_size' => 0
);
$res = tx_nG6_utils::purge_directory($user_login, $user_pwd, $data_folder.$my_run['directory']);
......
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