Correction d'un bug, un user peut evaluer un article deja evalue
This commit is contained in:
@@ -17,28 +17,32 @@
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<a title="Download" href="<c:url value="/download.htm"><c:param name="articleId" value="${article.id}"/></c:url>"><b>${article.title}</b></a> by ${article.mainAuthor.firstName} ${article.mainAuthor.lastName}
|
||||
<a title="Download" href="<c:url value="/download.htm"><c:param name="articleId" value="${article.article.id}"/></c:url>"><b>${article.article.title}</b></a> by ${article.article.mainAuthor.firstName} ${article.article.mainAuthor.lastName}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Topic: <b>${article.topic}</b><br/>
|
||||
Abstract: ${article.abstractText}
|
||||
Topic: <b>${article.article.topic}</b><br/>
|
||||
Abstract: ${article.article.abstractText}
|
||||
</td>
|
||||
<td align="right">
|
||||
<c:if test="${article.state eq 'SUBMITED'}">
|
||||
<a title="Click to evaluate" href="<c:url value="evaluation.htm?id=${article.id}"/>">Evaluate <img src="./images/button_follow_32x32.png" alt="Click to evaluate" /></a>
|
||||
<c:if test="${article.evaluated == false}">
|
||||
<c:if test="${article.article.state != 'REJECTED' and article.article.state != 'ACCEPTED'}">
|
||||
<a title="Click to evaluate" href="<c:url value="evaluation.htm?id=${article.article.id}"/>">Evaluate <img src="./images/button_follow_32x32.png" alt="Click to evaluate" /></a>
|
||||
</c:if>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${article.state eq 'EVALUATED'}">
|
||||
<a title="Click to modify evaluation" href="<c:url value="evaluation.htm?id=${article.id}&action=modify"/>">Modify the evaluation <img src="./images/cc-kedit-32x32.png" alt="Click to modify evaluation" /></a>
|
||||
<c:if test="${article.evaluated == true}">
|
||||
<c:if test="${article.article.state != 'REJECTED' and article.article.state != 'ACCEPTED'}">
|
||||
<a title="Click to modify evaluation" href="<c:url value="evaluation.htm?id=${article.article.id}&action=modify"/>">Modify the evaluation <img src="./images/cc-kedit-32x32.png" alt="Click to modify evaluation" /></a>
|
||||
</c:if>
|
||||
</c:if>
|
||||
|
||||
<c:if test="${article.state eq 'REJECTED'}">
|
||||
<c:if test="${article.article.state eq 'REJECTED'}">
|
||||
Rejected <img src="./images/cancel32.png" alt="This article has been rejected" />
|
||||
</c:if>
|
||||
|
||||
<c:if test="${article.state eq 'ACCEPTED'}">
|
||||
<c:if test="${article.article.state eq 'ACCEPTED'}">
|
||||
Accepted <img src="./images/ok32.png" alt="This article has been accepted" />
|
||||
</c:if>
|
||||
</td>
|
||||
|
||||
@@ -280,6 +280,7 @@
|
||||
class="org.yacos.web.PCmember.controller.ListEvaluationController">
|
||||
<property name="articleManager" ref="articleManager" />
|
||||
<property name="userManager" ref="userManager" />
|
||||
<property name="evaluationManager" ref="evaluationManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="StateArticleController"
|
||||
|
||||
@@ -15,8 +15,11 @@ import org.springframework.web.servlet.mvc.SimpleFormController;
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.article.IArticleManager;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.evaluation.IEvaluationManager;
|
||||
import org.yacos.core.evaluation.Report;
|
||||
import org.yacos.core.users.IUserManager;
|
||||
import org.yacos.core.users.Role.RoleType;
|
||||
import org.yacos.web.PCmember.form.EvaluationArticleBean;
|
||||
import org.yacos.web.system.controller.NoConferenceSelectedException;
|
||||
import org.yacos.web.system.session.SessionService;
|
||||
|
||||
@@ -26,6 +29,16 @@ public class ListEvaluationController extends SimpleFormController {
|
||||
|
||||
private IArticleManager articleManager;
|
||||
private IUserManager userManager;
|
||||
private IEvaluationManager evaluationManager;
|
||||
|
||||
|
||||
public IEvaluationManager getEvaluationManager() {
|
||||
return evaluationManager;
|
||||
}
|
||||
|
||||
public void setEvaluationManager(IEvaluationManager evaluationManager) {
|
||||
this.evaluationManager = evaluationManager;
|
||||
}
|
||||
|
||||
public IArticleManager getArticleManager() {
|
||||
return articleManager;
|
||||
@@ -53,14 +66,29 @@ public class ListEvaluationController extends SimpleFormController {
|
||||
return new ModelAndView("main","end","evaluation");
|
||||
}
|
||||
List<Article> listArticle = new ArrayList<Article>();
|
||||
|
||||
List<EvaluationArticleBean> listArticleBean = new ArrayList<EvaluationArticleBean>();
|
||||
|
||||
String person = request.getParameter("role");
|
||||
|
||||
|
||||
// TODO : renvoyer un truc s'il n'a pas le role
|
||||
|
||||
|
||||
if (person.equals("pcmember")) {
|
||||
if (userManager.hasRoleForConference(SessionService.getInstance().getCurrentUserLogin(), RoleType.PCMEMBER, conf.getId())) {
|
||||
listArticle = articleManager.getArticlesOfMember(conf.getId(), SessionService.getInstance().getCurrentUserLogin());
|
||||
for (Article a: listArticle) {
|
||||
EvaluationArticleBean eab = new EvaluationArticleBean();
|
||||
eab.setArticle(a);
|
||||
|
||||
Report rpt = evaluationManager.getReportforArticleAndReferee(a.getId(), SessionService.getInstance().getCurrentUserLogin());
|
||||
if (rpt == null) {
|
||||
eab.setEvaluated(false);
|
||||
}
|
||||
else {
|
||||
eab.setEvaluated(true);
|
||||
}
|
||||
listArticleBean.add(eab);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (person.equals("referee")) {
|
||||
@@ -70,9 +98,23 @@ public class ListEvaluationController extends SimpleFormController {
|
||||
if (listArticleTmp != null) {
|
||||
for (Article a : listArticleTmp) {
|
||||
Conference confTmp = articleManager.getConferenceForArticle(a.getId());
|
||||
if (confTmp.getId() == conf.getId())
|
||||
if (confTmp.getId().equals(conf.getId()))
|
||||
listArticle.add(a);
|
||||
}
|
||||
for (Article a: listArticle) {
|
||||
EvaluationArticleBean eab = new EvaluationArticleBean();
|
||||
eab.setArticle(a);
|
||||
|
||||
Report rpt = evaluationManager.getReportforArticleAndReferee(a.getId(), SessionService.getInstance().getCurrentUserLogin());
|
||||
if (rpt == null) {
|
||||
eab.setEvaluated(false);
|
||||
}
|
||||
else {
|
||||
eab.setEvaluated(true);
|
||||
}
|
||||
listArticleBean.add(eab);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,6 +122,6 @@ public class ListEvaluationController extends SimpleFormController {
|
||||
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||
|
||||
|
||||
return new ModelAndView("listEvaluation", "listArticle", listArticle);
|
||||
return new ModelAndView("listEvaluation", "listArticle", listArticleBean);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.yacos.web.PCmember.form;
|
||||
|
||||
import org.yacos.core.article.Article;
|
||||
|
||||
public class EvaluationArticleBean {
|
||||
|
||||
private Article article;
|
||||
private boolean evaluated;
|
||||
|
||||
public Article getArticle() {
|
||||
return article;
|
||||
}
|
||||
public void setArticle(Article article) {
|
||||
this.article = article;
|
||||
}
|
||||
public boolean isEvaluated() {
|
||||
return evaluated;
|
||||
}
|
||||
public void setEvaluated(boolean evaluated) {
|
||||
this.evaluated = evaluated;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user