Enabled annual data analysis

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/branches/portlets/user/PerformFISH-Apps/1.3@179324 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2019-05-09 14:28:46 +00:00
parent ef0db47f58
commit 1725a16492
1 changed files with 26 additions and 3 deletions

View File

@ -65,6 +65,16 @@ $(function () {
});
}
};
checkBatchesThresholdAnnualData = function (theButton, endpoint, farmId, batchType, farmIdEncoded, batchTypeEncoded, lastValidatedTime, lastPublishedTime) {
var cont = true;
if (lastValidatedTime > lastPublishedTime) {
cont = window.confirm('Please note that a more recent validated form exists for this file, if you continue the analysis will use the last anonymised and published form')
}
if (cont) {
location.href='${AnalyticalToolkitPortletEndpoint}?${batchTypeParamEncoded}='+batchTypeEncoded+'&${farmIdParamEncoded}='+farmIdEncoded+"&YW5udWFs=dHJ1ZQ==";
}
};
});
</script>
<portlet:resourceURL var="publishAndAnonymiseURL"></portlet:resourceURL>
@ -182,11 +192,24 @@ $(function () {
style="margin-left: 10px; margin-right: 10px; color: #666;">${form.status}</span>
<c:if test = "${form.status == 'COMPLETE'}">
<c:choose>
<c:when test= "${form.batchType == 'GROW_OUT_AGGREGATED'
or form.batchType == 'GROW_OUT_AGGREGATED_CLOSED_BATCHES'
or form.batchType == 'HATCHERY_AGGREGATED'}">
<c:when test= "${form.batchType == 'GROW_OUT_AGGREGATED' or form.batchType == 'HATCHERY_AGGREGATED'}">
<button class="btn" type="button" disabled title='Analysis not available for this Batch type'>Analyse</button>
</c:when>
<c:when test= "${form.batchType == 'GROW_OUT_AGGREGATED_CLOSED_BATCHES'}" >
<div style="display: inline;">
<button class="btn" type="button"
onClick="checkBatchesThresholdAnnualData(this,
'${checkBatchesThresholdURL}',
'${farmId}',
'${form.batchType}',
'${farmIdEncoded}',
'${batchTypeEncoded}',
'${lastValidatedTime}',
'${lastPublishedTime}')">
Analyse
</button>
</div>
</c:when>
<c:otherwise>
<div style="display: inline;">
<button class="btn" type="button"