diff --git a/ui/nG6/class.tx_nG6_eid.php b/ui/nG6/class.tx_nG6_eid.php index 86514e81dc289fc19333873ec4c5b135615e21f1..7867684bfb8d5f9a8510fd7eded5ee87f0d96c41 100644 --- a/ui/nG6/class.tx_nG6_eid.php +++ b/ui/nG6/class.tx_nG6_eid.php @@ -929,6 +929,8 @@ class tx_nG6_eid { $purge_delay = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_delay')); $purge_demand_filter_space = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_demand_filter_space')); $purge_demand_filter_delay_exceeded = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_demand_filter_delay_exceeded')); + + print json_encode(tx_nG6_db::get_purge_demand_list($purge_delay,$purge_demand_filter_space,$purge_demand_filter_delay_exceeded)); } elseif ($type == 'refresh_purge_list') { $max_retention_date = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('max_retention_date')); @@ -937,8 +939,6 @@ class tx_nG6_eid { $without_laboratories_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('without_lab')); $with_laboratories_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('with_lab')); $create_users = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('create_users')); - //Change date format - //print ('test'); print json_encode(tx_nG6_db::filter_list_retention_data_info($filter_space,$max_retention_date,$create_users, $without_laboratories_id,$with_laboratories_id)); } elseif ($type == 'delete_purge_data') { //Delete data link to the list of purge demand diff --git a/ui/nG6/lib/class.tx_nG6_db.php b/ui/nG6/lib/class.tx_nG6_db.php index 616711abff25cd2d3744e8b7bc020d21ba0ff78f..7377906a18400ba79cc9ac61c8251ddf9442ba58 100644 --- a/ui/nG6/lib/class.tx_nG6_db.php +++ b/ui/nG6/lib/class.tx_nG6_db.php @@ -194,6 +194,10 @@ class tx_nG6_db { $conditions[] = "project_id in (" . $project_list_ids.")" ; } $where = join(' AND ', $conditions); + + $log_file_path = tx_nG6_utils::get_log_path(); + error_log(date("d/m/Y, h:i:s")." IN filter_list_retention_data_info(), where=".$where." \n", 3, $log_file_path); + //error_log(" IN filter_list_retention_data_info(), where=".$where." \n", 3, $log_file_path); return (tx_nG6_db::select_list_retention_data_info($where)); } @@ -214,6 +218,7 @@ class tx_nG6_db { } static function select_list_retention_data_info($where) { + $by_project=array(); $empty_res_structure = array( 'project_name' => "", @@ -333,6 +338,10 @@ class tx_nG6_db { } } + $log_file_path = tx_nG6_utils::get_log_path(); + error_log(date("d/m/Y, h:i:s")." IN filter_list_retention_data_info(), return=".print_r($by_project,TRUE)." \n", 3, $log_file_path); + //error_log(" IN filter_list_retention_data_info(), return=".print_r($by_project,TRUE)." \n", 3, $log_file_path); + return($by_project); } diff --git a/ui/nG6/lib/class.tx_nG6_utils.php b/ui/nG6/lib/class.tx_nG6_utils.php index e0adb3d546885075f83926630f99d9809be5ee19..d404d5d6500877a6c87971f8d8903cde6dac7480 100644 --- a/ui/nG6/lib/class.tx_nG6_utils.php +++ b/ui/nG6/lib/class.tx_nG6_utils.php @@ -440,6 +440,29 @@ $template_mail.='<p>Yours sincerely</p> return($path_to_save_dir); } + + static function get_log_path(){ + $config_file_content = tx_nG6_utils::get_config_content(); + $array_config_content = explode(PHP_EOL, $config_file_content); + $pattern_to_find = "log_file = "; + $log_file_path_found = FALSE; + + //We want to return the log file path + foreach($array_config_content as $line_id => $line_content){ + //if we found the right line + if(strpos ( $line_content , $pattern_to_find) === 0){ + $log_file_path_found = TRUE; + } + + if($log_file_path_found){ + $log_file_path = str_replace($pattern_to_find,'',$line_content); + return($log_file_path); + } + } + return('0'); + } + + static function convert_epoch_timestamp_to_nice_date( $epoch_date ){ //return(gmdate('D, d M Y', $epoch_date)); return(gmdate('l jS \of F Y', $epoch_date)); diff --git a/ui/nG6/pi6/class.tx_nG6_pi6.php b/ui/nG6/pi6/class.tx_nG6_pi6.php index 5e45422c642d5f65a714d80b5fd0675a2c3dab5c..03be3567c955e8297c3d3217ce7a6c3bb9f7dec4 100755 --- a/ui/nG6/pi6/class.tx_nG6_pi6.php +++ b/ui/nG6/pi6/class.tx_nG6_pi6.php @@ -169,6 +169,10 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { //Retrieve purgeable information for email $run_info=Array(); $analyses_info=Array(); + + $log_file_path = tx_nG6_utils::get_log_path(); + error_log(date("d/m/Y, h:i:s")." IN tx_nG6_pi6.php, 'add_purge_demand' \n p = ".print_r($p, TRUE), 3, $log_file_path); + $all_purgeable_runs=array_merge($p[$project_id]["state"]["stored"]["run_ids"],$p[$project_id]["state"]["extended"]["run_ids"]); $all_purgeable_analysis=array_merge($p[$project_id]["state"]["stored"]["analysis_ids"],$p[$project_id]["state"]["extended"]["analysis_ids"]); $nb_run_purgeable = $p[$project_id]["state"]["stored"]["nb_run"]+ $p[$project_id]["state"]["extended"]["nb_run"]; @@ -192,8 +196,14 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { http_response_code(401); return "Nobody seems to be authenticated."; } + + $log_file_path = tx_nG6_utils::get_log_path(); + error_log(date("d/m/Y, h:i:s")." IN tx_nG6_pi6.php, 'add_purge_demand' \n all_purgeable_runs = ".print_r($all_purgeable_runs, TRUE), 3, $log_file_path); + #Add purge demand to get id $purge_demand_id = tx_nG6_db::add_purge_demand($GLOBALS['TSFE']->fe_user->user['uid'],$project_id,$p[$project_id]["total_purgeable_size"],$all_purgeable_runs,$all_purgeable_analysis,$purge_user_id_to); + + #Build corresponding string array //TODO RETURN TOTAL SIZE tx_nG6_utils::get_octet_string_representation($p[$project_id]["total_size"] $total_project_size = tx_nG6_db::get_project_size($project_id, true);