Commit ba4da55f authored by Gerald Salin's avatar Gerald Salin

#79

parent 364483c5
......@@ -356,6 +356,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<br />
<div class="tx-nG6-wait" id="data_table_obsolete_wait">Please wait while processing ...</span></div>
<div class="alert alert-danger" id="data_table_obsolete_error" style="display:none"></div>
<div id="obsolete_list">
<div>
<p>
......
......@@ -167,7 +167,10 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$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>';
}
if (!$GLOBALS['TSFE']->fe_user->user['uid']){
http_response_code(401);
return "Nobody seems to be authenticated.";
}
#Add purge demand to get id
$purge_demand_id = tx_nG6_db::add_purge_demand($GLOBALS['TSFE']->fe_user->user['uid'],$project_id,$p[$project_id]["total_purgeable_size"],$all_purgeable_runs,$all_purgeable_analysis,$purge_user_id_to);
#Build corresponding string array
......@@ -183,6 +186,8 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$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"];
//$headers[] = 'From: gerald.salin@inra.fr';
$headers[] = 'Errors-To: '.$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["email_copy"];
$headers[] = 'X-Mailer: PHP/' . phpversion();
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=utf-8';
......@@ -207,6 +212,7 @@ class tx_nG6_pi6 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$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"];
$headers[] = 'Errors-To: '.$GLOBALS['TSFE']->tmpl->setup["plugin."]["tx_nG6_pi6."]["email_copy"];
$headers[] = 'X-Mailer: PHP/' . phpversion();
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=utf-8';
......
......@@ -383,16 +383,21 @@ $(function () {
url: "index.php?eID=tx_nG6&type=purge_managment_mail&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_project_obsolete(purge_table["obsolete"]);
refresh_purge_demand(purge_table["demand"]);
$("#purge_demand_error").hide()
},
error: function(returnval){
//TODO Afficher alerte en cas d'erreur de mail
$('#data_table_obsolete_wait').hide();
$("#purge_demand_error").html("<div class='tx-nG6-pi6-error'>Error mail sending.</div>");
$("#purge_demand_error").show();
$('#obsolete_list').show();
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("<div class='tx-nG6-pi6-error'>Error : "+message+"</div>");
$("#data_table_obsolete_error").show();
$('#obsolete_list').show();
}
});
......@@ -592,7 +597,7 @@ $(function () {
error: function(val) {
//TO PRINT ERROR
$('#purge_demand_error').html ('Error while extend date ' + val );
$('#purge_demand_error').html ('Error while extending date ' + val );
$('#purge_demand_error').show();
$("#ng6modal").modal('hide');
......
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