Commit 5c9e2015 authored by Celine Noirot's avatar Celine Noirot
Browse files

add resend mail #1

parent facbcf96
...@@ -838,13 +838,11 @@ class tx_nG6_eid { ...@@ -838,13 +838,11 @@ class tx_nG6_eid {
print json_encode(tx_nG6_db::select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate)); print json_encode(tx_nG6_db::select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate));
} elseif ($type == 'purge_managment_mail') { } elseif ($type == 'purge_managment_mail') {
//TODO check if user is still logged $all_projects = trim(t3lib_div::_GP('project'));
if ($user_id == ""){ print json_encode(tx_nG6_pi6::send_purge_demand_mail($all_projects));
print json_encode("Error: reconnect"); } elseif ($type == 'purge_managment_resend_mail') {
} else { $purge_ids = trim(t3lib_div::_GP('purge_demand'));
$all_projects = trim(t3lib_div::_GP('project')); print json_encode(tx_nG6_pi6::resend_purge_demand_mail($purge_ids));
print json_encode(tx_nG6_pi6::send_purge_demand_mail($user_id,$all_projects));
}
} elseif ($type == 'refresh_purge_demand') { } elseif ($type == 'refresh_purge_demand') {
$purge_delay = trim(t3lib_div::_GP('purge_delay')); $purge_delay = trim(t3lib_div::_GP('purge_delay'));
print json_encode(tx_nG6_db::get_purge_demand_list($purge_delay)); print json_encode(tx_nG6_db::get_purge_demand_list($purge_delay));
...@@ -856,24 +854,13 @@ class tx_nG6_eid { ...@@ -856,24 +854,13 @@ class tx_nG6_eid {
$create_users = trim(t3lib_div::_GP('create_users')); $create_users = trim(t3lib_div::_GP('create_users'));
//Change date format //Change date format
print json_encode(tx_nG6_db::filter_list_retention_data_info($filter_size,$max_retention_date,$create_users, $without_laboratories_id,$with_laboratories_id)); print json_encode(tx_nG6_db::filter_list_retention_data_info($filter_size,$max_retention_date,$create_users, $without_laboratories_id,$with_laboratories_id));
} elseif ($type == 'purge_managment_resend_mail') {
$purge_ids = trim(t3lib_div::_GP('purge_demand'));
$data_folder = trim(t3lib_div::_GP('user_id'));
print json_encode(tx_nG6_pi6::resend_purge_demand_mail($user_id,$purge_demand));
} elseif ($type == 'delete_purge_data') { } elseif ($type == 'delete_purge_data') {
//TODO recuperer user password et faire comme pour pi1 //Delete data link to the list of purge demand
if ($user_id == ""){
print json_encode("Error: reconnect");
} else {
//Delete data link to the list of purge demand
$purge_ids = trim(t3lib_div::_GP('purge_demand')); $purge_ids = trim(t3lib_div::_GP('purge_demand'));
$data_folder = trim(t3lib_div::_GP('data_folder')); $data_folder = trim(t3lib_div::_GP('data_folder'));
$user_login = trim(t3lib_div::_GP('user_login')); $user_login = trim(t3lib_div::_GP('user_login'));
$user_pwd = trim(t3lib_div::_GP('user_pwd')); $user_pwd = trim(t3lib_div::_GP('user_pwd'));
//EXPECT : delete_purge_demand($demand_ids,$user_login, $user_pwd, $data_folder) // check login and password
// check login and password
$res = 0; $res = 0;
if (isset($user_login) && isset($user_pwd) && $user_login != 'undefined' && $user_pwd != 'undefined') { if (isset($user_login) && isset($user_pwd) && $user_login != 'undefined' && $user_pwd != 'undefined') {
$connection = ssh2_connect('127.0.0.1', 22); $connection = ssh2_connect('127.0.0.1', 22);
...@@ -886,13 +873,8 @@ class tx_nG6_eid { ...@@ -886,13 +873,8 @@ class tx_nG6_eid {
$res = tx_nG6_db::delete_purge_demand($purge_ids,$user_login, $user_pwd, $data_folder); $res = tx_nG6_db::delete_purge_demand($purge_ids,$user_login, $user_pwd, $data_folder);
} }
print $res; print $res;
}
} elseif ($type == 'extend_retention_date') { } elseif ($type == 'extend_retention_date') {
//Extend the retention date for the //Extend the retention date for the
//TODO check if user is still logged
if ($user_id == ""){
print json_encode("Error: reconnect");
} else {
$purge_ids = trim(t3lib_div::_GP('purge_demand')); $purge_ids = trim(t3lib_div::_GP('purge_demand'));
$value = trim(t3lib_div::_GP('date_value')); $value = trim(t3lib_div::_GP('date_value'));
$type_extend = trim(t3lib_div::_GP('type_extend')); //all project or only run/analyse obsolete $type_extend = trim(t3lib_div::_GP('type_extend')); //all project or only run/analyse obsolete
...@@ -900,8 +882,6 @@ class tx_nG6_eid { ...@@ -900,8 +882,6 @@ class tx_nG6_eid {
$date = explode('/', $value); $date = explode('/', $value);
$timestamp = mktime (0, 0, 1, $date[1], $date[0], $date[2]); $timestamp = mktime (0, 0, 1, $date[1], $date[0], $date[2]);
print json_encode(tx_nG6_db::extend_retention_date(explode(',',$purge_ids),$timestamp,$type_extend)); print json_encode(tx_nG6_db::extend_retention_date(explode(',',$purge_ids),$timestamp,$type_extend));
}
} }
} }
......
...@@ -392,7 +392,8 @@ $(function () { ...@@ -392,7 +392,8 @@ $(function () {
}); });
//resend email //resend email
$("#btn_demand_resend_mail").click(function(){ $("#btn_demand_resend_mail").click(function(){
var demands = getDatatableCheckedValue(purge_table["demand"], "demand");
var demands = getPurgeDatatableCheckedValue(purge_table["demand"],"demand");
$.ajax({ $.ajax({
url: "index.php?eID=tx_nG6&type=purge_managment_resend_mail&purge_demand="+demands.join(',')+"&user_id="+$('input[id=user_id]').val(), url: "index.php?eID=tx_nG6&type=purge_managment_resend_mail&purge_demand="+demands.join(',')+"&user_id="+$('input[id=user_id]').val(),
dataType: 'json', dataType: 'json',
...@@ -705,7 +706,6 @@ function getPurgeDatatableCheckedValue(oTable, type){ ...@@ -705,7 +706,6 @@ function getPurgeDatatableCheckedValue(oTable, type){
values.push($(this).val()); values.push($(this).val());
}); });
}); });
console.log(values);
return values return values
} }
......
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