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 {
print json_encode(tx_nG6_db::select_storage_evolution($values, $by, $role, $get_analyzes, $octet, $cumulate));
} elseif ($type == 'purge_managment_mail') {
//TODO check if user is still logged
if ($user_id == ""){
print json_encode("Error: reconnect");
} else {
$all_projects = trim(t3lib_div::_GP('project'));
print json_encode(tx_nG6_pi6::send_purge_demand_mail($user_id,$all_projects));
}
print json_encode(tx_nG6_pi6::send_purge_demand_mail($all_projects));
} elseif ($type == 'purge_managment_resend_mail') {
$purge_ids = trim(t3lib_div::_GP('purge_demand'));
print json_encode(tx_nG6_pi6::resend_purge_demand_mail($purge_ids));
} elseif ($type == 'refresh_purge_demand') {
$purge_delay = trim(t3lib_div::_GP('purge_delay'));
print json_encode(tx_nG6_db::get_purge_demand_list($purge_delay));
......@@ -856,23 +854,12 @@ class tx_nG6_eid {
$create_users = trim(t3lib_div::_GP('create_users'));
//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));
} 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') {
//TODO recuperer user password et faire comme pour pi1
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'));
$data_folder = trim(t3lib_div::_GP('data_folder'));
$user_login = trim(t3lib_div::_GP('user_login'));
$user_pwd = trim(t3lib_div::_GP('user_pwd'));
//EXPECT : delete_purge_demand($demand_ids,$user_login, $user_pwd, $data_folder)
// check login and password
$res = 0;
if (isset($user_login) && isset($user_pwd) && $user_login != 'undefined' && $user_pwd != 'undefined') {
......@@ -886,13 +873,8 @@ class tx_nG6_eid {
$res = tx_nG6_db::delete_purge_demand($purge_ids,$user_login, $user_pwd, $data_folder);
}
print $res;
}
} elseif ($type == 'extend_retention_date') {
//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'));
$value = trim(t3lib_div::_GP('date_value'));
$type_extend = trim(t3lib_div::_GP('type_extend')); //all project or only run/analyse obsolete
......@@ -901,8 +883,6 @@ class tx_nG6_eid {
$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));
}
}
}
}
......
......@@ -392,7 +392,8 @@ $(function () {
});
//resend email
$("#btn_demand_resend_mail").click(function(){
var demands = getDatatableCheckedValue(purge_table["demand"], "demand");
var demands = getPurgeDatatableCheckedValue(purge_table["demand"],"demand");
$.ajax({
url: "index.php?eID=tx_nG6&type=purge_managment_resend_mail&purge_demand="+demands.join(',')+"&user_id="+$('input[id=user_id]').val(),
dataType: 'json',
......@@ -705,7 +706,6 @@ function getPurgeDatatableCheckedValue(oTable, type){
values.push($(this).val());
});
});
console.log(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