Commit 364483c5 authored by Gerald Salin's avatar Gerald Salin

#77 : process mail demands with no records

#78 : process mail demands with delay exceeded always to No
parent aab89e56
......@@ -408,11 +408,11 @@ class tx_nG6_db {
static function get_purge_demand_list($delay_in_days){
#select all demand id not processed
$queryParts=array(
$queryParts=array(
'SELECT' => 'tx_nG6_purge_demand.uid AS demand_id, `tx_nG6_purge_demand`.project_id AS project_id, tx_nG6_project.name as project_name,
`tx_nG6_purge_demand`.purge_size AS purge_size, `tx_nG6_purge_demand`.mail_sent_date, `tx_nG6_purge_demand`.demand_state,
`fe_users`.username, `fe_groups`.title AS user_group_title,
DATEDIFF( FROM_UNIXTIME( `tx_nG6_purge_demand`.mail_sent_date ) , now( ) ) >'.$delay_in_days.' AS delay_excedeed',
DATEDIFF( now( ), FROM_UNIXTIME( `tx_nG6_purge_demand`.mail_sent_date ) ) >'.$delay_in_days.' AS delay_excedeed',
'FROM' => '`tx_nG6_purge_demand`
INNER JOIN tx_nG6_project ON tx_nG6_project.uid = tx_nG6_purge_demand.project_id
INNER JOIN `tx_nG6_purge_demand_fe_users` ON `tx_nG6_purge_demand_fe_users`.`purge_demand_id` = tx_nG6_purge_demand.uid
......@@ -474,7 +474,7 @@ INNER JOIN fe_groups ON fe_groups.uid = fe_users.usergroup',
$all_project_filter = " project_id in (".$projects_ids. ") AND DATEDIFF( FROM_UNIXTIME( retention_date ), FROM_UNIXTIME(" .$date. ") ) <0
AND state in ('extended','stored') ";
$all_project=tx_nG6_db::get_purge_demand_from_id( join(', ', $demand_ids));
//$all_project=tx_nG6_db::get_purge_demand_from_id( join(', ', $demand_ids));
$res_project_analyze = tx_nG6_db::select_all_in_view("tx_nG6_view_project_analyze", $all_project_filter);
$res_project_run = tx_nG6_db::select_all_in_view("tx_nG6_view_project_run", $all_project_filter);
$res_project_run_analyze = tx_nG6_db::select_all_in_view("tx_nG6_view_project_run_analyze", $all_project_filter);
......@@ -500,6 +500,7 @@ INNER JOIN fe_groups ON fe_groups.uid = fe_users.usergroup',
tx_nG6_db::extend_runs_analyses ($all_runs, $all_analyses, $date);
if ($check_purge == True){
$purge_uniq = array_unique ($purge_ids);
if (count($purge_uniq) > 0) {
tx_nG6_db::update_field('tx_nG6_purge_demand',$purge_uniq,
array("processed_date","demand_state"),
......
......@@ -208,7 +208,7 @@ class tx_nG6_utils {
<head>
<title>Data Purge on nG6</title>
</head>
<body><p>Mail automatique / en phase de TEST</p>
<body>
<p>Dear user,</p>
<p>The two years data storage period of part or whole ###PROJECT_NAME### project (###nb_run### run(s) and ###nb_analyse### analyse(s)) is ended.</p>
......
......@@ -97,7 +97,7 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$smarty->assign('distribution', $distribution);
$smarty->assign('ng6_admin_users', tx_nG6_db::get_ng6_admin_users() );
$smarty->assign('ng6_purge_delay',$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ng6']['delay_purge']);
$smarty->assign('ng6_purge_delay',$this->conf['delay_purge']);
return $smarty->fetch('administration_view.tpl');
}
......
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