Commit e73629da authored by Romain Therville's avatar Romain Therville 🐭
Browse files

Merge branch 'issue#31' into 'master'

Merge branch Issue#31 with master

See merge request !39
parents 66ce4315 127ca022
......@@ -232,7 +232,7 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
<p>Files impacted of:</p>
<ul>
<li>Runs : ###RUNS_LIST###
<li>analyses ids: ###ANALYSES_LIST###</li>
<li>Analyzes : ###ANALYSES_LIST###</li>
</ul>
</body>
</html>
......
......@@ -164,8 +164,10 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$run_info[] = '<a href="'.str_replace($search, $replace, $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["run_link_url"]).'">'.$run["name"].' ('.$run_id.')</a>';
}
foreach($all_purgeable_analysis as $analysis_id ){
$analysis = tx_nG6_db::select_analyse($analysis_id);
$analysis_name = $analysis["name"];
$replace=array("analyze_id",$analysis_id,$project_id);
$analyses_info[] = '<a href="'.str_replace($search, $replace, $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["run_link_url"]).'">'.$analysis_id.'</a>';
$analyses_info[] = '<a href="'.str_replace($search, $replace, $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["run_link_url"]).'">'.$analysis_name.' ('.$analysis_id.')</a>';
}
if (!$GLOBALS['TSFE']->fe_user->user['uid']){
http_response_code(401);
......@@ -198,17 +200,36 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
return "Mail sent";
}
static function resend_purge_demand_mail ($demands_id) {
static function resend_purge_demand_mail ($demands_id) {
$res_demands = tx_nG6_db::get_purge_demand_from_id($demands_id);
foreach($res_demands as $res_demand){
$res_project = tx_nG6_db::select_project($res_demand["project_id"]);
$total_project_size = tx_nG6_db::get_project_size($res_demand["project_id"], true) ;
$run_info=Array();
$analyses_info=Array();
$search=array("###TYPE_OBJECT###","###RUN_ID###","###PROJECT_ID###");
$project_id = $res_demand["project_id"];
$all_purgeable_runs = explode(',',$res_demand["run_ids"]);
$all_purgeable_analysis = explode(',',$res_demand["analyze_ids"]);
foreach($all_purgeable_runs as $run_id ){
$run = tx_nG6_db::select_run($run_id);
$run_name = $run["name"];
$replace=array("run_id",$run_id,$project_id);
$run_info[] = '<a href="'.str_replace($search, $replace, $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["run_link_url"]).'">'.$run["name"].' ('.$run_id.')</a>';
}
foreach($all_purgeable_analysis as $analysis_id ){
$analysis = tx_nG6_db::select_analyse($analysis_id);
$analysis_name = $analysis["name"];
$replace=array("analyze_id",$analysis_id,$project_id);
$analyses_info[] = '<a href="'.str_replace($search, $replace, $GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["run_link_url"]).'">'.$analysis_name.' ('.$analysis_id.')</a>';
}
$mail = tx_nG6_utils::get_purge_mail($res_project["name"],$res_demand["project_id"],
count(explode(",", $res_demand["run_ids"])), count(explode(",", $res_demand["analyze_ids"])), $res_demand["demand_id"],
tx_nG6_utils::get_octet_string_representation($res_demand["purge_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"], "This email was send to ". join(', ',$res_demand["emails"]).". ", $res_demand["run_ids"], $res_demand["analyze_ids"]);
$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["min_extension_size"], "This email was send to ". join(', ',$res_demand["emails"]).". ", join(', ', $run_info), join(', ', $analyses_info));
$subject = '[nG6 purge / reminder] No '.$res_demand["demand_id"].' - Project '.$res_project["name"];
$headers[] = 'From: '.$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["email_from"];
......
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