###URL_PRICE##
return $mail;
}
+ static function get_purge_mail_without_extension($project_name, $project_id, $nb_run_purgeable,$nb_analyse_purgeable, $demand_id,
+ $purgeable_size, $project_size, $purge_delay, $url_price, $min_extention_duration,
+ $min_extention_size, $emails, $runs_list, $analyse_list) {
+
+ $template_mail= '
+
+
+ Data Purge on nG6
+
+
+Dear user,
+
+The data storage period of part or whole ###PROJECT_NAME### project (###nb_run### run(s) and ###nb_analyse### analyse(s)) is ended.
+
+This purge alert No ###DEMAND_ID### corresponds to ###SIZE_STR### see list of impacted files below.
+
+In ###PURGE_DELAY### days, your data will be deleted.
+
+Yours sincerely
+nG6 team (for GeT-Genotoul and Bioinfo-Genotoul facilities)
+
+Files impacted of:
+
+Runs : ###RUNS_LIST###
+ Analyzes : ###ANALYSES_LIST###
+
+
+
+';
+
+ $size_str = $purgeable_size . " purgeable data on ". $project_size ." of whole project";
+ if ($purgeable_size == $project_size) {
+ $size_str = "whole project (".$purgeable_size . ")";
+ }
+ $search=array("###nb_run###","###nb_analyse###","###PROJECT_NAME###","###PROJET_ID###","###DEMAND_ID###",
+ "###EMAILS###","###RUNS_LIST###","###ANALYSES_LIST###","###SIZE_STR###",
+ "###EXTENSION_DURATION###","###EXTENSION_SIZE###","###URL_PRICE###","###PURGE_DELAY###");
+
+ $replace=array($nb_run_purgeable,$nb_analyse_purgeable,$project_name,$project_id, $demand_id ,
+ $emails, $runs_list, $analyse_list, $size_str,
+ $min_extention_duration, $min_extention_size, $url_price, $purge_delay);
+
+ $mail=str_replace($search, $replace, $template_mail);
+
+ return $mail;
+ }
+
+
/**
* hash password (using default encryption method)
* @param string $password
diff --git a/ui/nG6/pi6/administration_view.tpl b/ui/nG6/pi6/administration_view.tpl
index 6fa57074406c6b3175a67844b39d78e10d65d50b..b93883cf7282c96b5b5c7ad2afabb96ce20c829d 100644
--- a/ui/nG6/pi6/administration_view.tpl
+++ b/ui/nG6/pi6/administration_view.tpl
@@ -451,6 +451,7 @@ along with this program. If not, see .
With selection :
Send mail
+ Send mail without extension
diff --git a/ui/nG6/pi6/class.tx_nG6_pi6.php b/ui/nG6/pi6/class.tx_nG6_pi6.php
index 1f9e21b6d94b1c1990f6d121b475833ed763284d..87076c2b5cd67c88c2788b4cd85f885f0ee63a58 100755
--- a/ui/nG6/pi6/class.tx_nG6_pi6.php
+++ b/ui/nG6/pi6/class.tx_nG6_pi6.php
@@ -106,7 +106,7 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
return $smarty->fetch('administration_view.tpl');
}
- static function send_purge_demand_mail($project_ids) {
+ static function send_purge_demand_mail($project_ids, $extension_allowed = 1) {
$project_name="";
foreach(explode(",", $project_ids) as $project_id){
@@ -197,13 +197,21 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
#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);
-
- $mail = tx_nG6_utils::get_purge_mail($p[$project_id]["project_name"],$project_id, $nb_run_purgeable,$nb_analyse_purgeable, $purge_demand_id,
+
+ if($extension_allowed == 1){
+ $mail = tx_nG6_utils::get_purge_mail($p[$project_id]["project_name"],$project_id, $nb_run_purgeable,$nb_analyse_purgeable, $purge_demand_id,
tx_nG6_utils::get_octet_string_representation($p[$project_id]["total_purgeable_size"]), tx_nG6_utils::get_octet_string_representation($total_project_size),
$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["delay_purge"],
$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["extension_url_price"], $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["min_extension_duration"],
$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["min_extension_size"], $email_warn, join(', ', $run_info), join(', ', $analyses_info));
-
+ }else{
+ $mail = tx_nG6_utils::get_purge_mail_without_extension($p[$project_id]["project_name"],$project_id, $nb_run_purgeable,$nb_analyse_purgeable, $purge_demand_id,
+ tx_nG6_utils::get_octet_string_representation($p[$project_id]["total_purgeable_size"]), tx_nG6_utils::get_octet_string_representation($total_project_size),
+ $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["delay_purge"],
+ $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["extension_url_price"], $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["min_extension_duration"],
+ $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["min_extension_size"], $email_warn, join(', ', $run_info), join(', ', $analyses_info));
+ }
+
$to = $purge_email_to;
$subject = '[nG6 purge] No '.$purge_demand_id.' - Project '.$p[$project_id]["project_name"];
$headers[] = 'From: '.$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["email_from"];
diff --git a/ui/nG6/res/js/tx_nG6_pi6.js b/ui/nG6/res/js/tx_nG6_pi6.js
index 9619bceb1a2c8bfa4ded0fbf7ea2e063d1eef74d..23906635a138ba39d19283f2d57405a3d54b0a76 100644
--- a/ui/nG6/res/js/tx_nG6_pi6.js
+++ b/ui/nG6/res/js/tx_nG6_pi6.js
@@ -567,6 +567,38 @@ $(function () {
}
});
});
+
+ $("#btn_obsolete_mail_without_extension").click(function(){
+
+ $('#data_table_obsolete_wait').show();
+ $('#obsolete_list').hide();
+ var all_project=Array();
+ $("#ng6modal").modal('hide');
+ all_project = getPurgeDatatableCheckedValue(purge_table["obsolete"], "obsolete")
+
+ $.ajax({
+ url: "index.php?eID=tx_nG6&type=purge_managment_mail_without_extension&project="+all_project.join(',')+"&user_id="+$('input[id=user_id]').val(),
+ dataType: 'json',
+ success: function(val, status, xhr) {
+ refresh_project_obsolete(purge_table["obsolete"]);
+ refresh_purge_demand(purge_table["demand"]);
+ $("#purge_demand_error").hide()
+ },
+ error: function(returnval){
+ alert(returnval.status)
+ //TODO Afficher alerte en cas d'erreur de mail
+ var message = 'nG6 was unable to perform your action.';
+ if (returnval.status == 401){
+ message = 'it seems your session expired. Please re-authenticate!';
+ }
+ $('#data_table_obsolete_wait').hide();
+ $("#data_table_obsolete_error").html("Error : "+message+"
");
+ $("#data_table_obsolete_error").show();
+ $('#obsolete_list').show();
+
+ }
+ });
+ });
/****************************************
* tab process mail demand