Ajout de la liste des articles à évaluer pour les referee et pc members

This commit is contained in:
Frederic Debuire
2008-02-22 17:18:13 +00:00
parent 105552a41c
commit 15ca90fefc
2 changed files with 169 additions and 31 deletions

View File

@@ -11,44 +11,58 @@
function showConfAll() { function showConfAll() {
if ($('confList').visible()) if ($('confList').visible())
$('confList').style.display = "none"; $('confList').fade();
else else
$('confList').style.display = ""; $('confList').appear();
} }
function showArticleAll() { function showArticleAll() {
if ($('articleList').visible()) if ($('articleList').visible())
$('articleList').style.display = "none"; $('articleList').fade();
else else
$('articleList').style.display = ""; $('articleList').appear();
} }
function showConfChairman() { function showConfChairman() {
if ($('confListChairman').visible()) if ($('confListChairman').visible())
$('confListChairman').style.display = "none"; $('confListChairman').fade();
else else
$('confListChairman').style.display = ""; $('confListChairman').appear();
} }
function showConfPcmember() { function showConfPcmember() {
if ($('confListPcmember').visible()) if ($('confListPcmember').visible())
$('confListPcmember').style.display = "none"; $('confListPcmember').fade();
else else
$('confListPcmember').style.display = ""; $('confListPcmember').appear();
} }
function showConfReferee() { function showConfReferee() {
if ($('confListReferee').visible()) if ($('confListReferee').visible())
$('confListReferee').style.display = "none"; $('confListReferee').fade();
else else
$('confListReferee').style.display = ""; $('confListReferee').appear();
} }
function showConfAuthor() { function showConfAuthor() {
if ($('confListAuthor').visible()) if ($('confListAuthor').visible())
$('confListAuthor').style.display = "none"; $('confListAuthor').fade();
else else
$('confListAuthor').style.display = ""; $('confListAuthor').appear();
}
function showArticlePcMember() {
if ($('articleListPcMember').visible())
$('articleListPcMember').fade();
else
$('articleListPcMember').appear();
}
function showArticleReferee() {
if ($('articleListReferee').visible())
$('articleListReferee').fade();
else
$('articleListReferee').appear();
} }
</script> </script>
@@ -59,14 +73,15 @@ function showConfAuthor() {
<h4 class="title">User Board</h4> <h4 class="title">User Board</h4>
<a name="listConf"></a>
<h3 class="descriptionTitle">Generals informations</h3> <h3 class="descriptionTitle">Generals informations</h3>
<div class="textBox"> <div class="textBox">
You currently follow <b>${numberConference}</b> conference(s)<br /><br /> You currently follow <b>${numberConference}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#" onclick="showConfAll();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConf" onclick="showConfAll();">here</a>.
<div id="confListDiv" class="dynamicFredList">
<div id="confList" style="display: none;"> <div id="confList" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -79,7 +94,7 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</c:if> </c:if>
</div> </div>
@@ -97,11 +112,12 @@ function showConfAuthor() {
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
<a name="listConfChairman"></a>
<br /><br /> <br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#" onclick="showConfChairman();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConfChairman" onclick="showConfChairman();">here</a>.
<div id="confListChairmanDiv" class="dynamicFredList">
<div id="confListChairman" style="display: none;"> <div id="confListChairman" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -118,20 +134,21 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</c:if> </c:if>
</div> </div>
<a name="listConfPcmember"></a>
<h3 class="descriptionTitle">PCMember's informations</h3> <h3 class="descriptionTitle">PCMember's informations</h3>
<div class="textBox"> <div class="textBox">
You are PCMember in <b>${numberPCMember}</b> conference(s)<br /><br /> You are PCMember in <b>${numberPCMember}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#" onclick="showConfPcmember();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConfPcmember" onclick="showConfPcmember();">here</a>.
<div id="confListPcmemberDiv" class="dynamicFredList">
<div id="confListPcmember" style="display: none;"> <div id="confListPcmember" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -148,18 +165,61 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</c:if>
<br /><br /><a name="listArticlePcMember"></a>
You have <b>${numberArticlePCMember}</b> article(s) in your evaluation list.<br /><br />
<c:if test="${not empty listArticlePCMember}">
If you want to see the list of articles you have in your evaluation list, click <a href="#listArticlePcMember" onclick="showArticlePcMember();">here</a>.
<div id="articleListPcMember" style="display: none;">
<table width="100%" align="center">
<tbody>
<c:forEach var="article" items="${listArticlePCMember}" varStatus="i">
<tr>
<td align="center" width="25%">${article.title}</td>
<td align="center" width="25%">
<c:if test="${article.state == 'SUBMITED'}">
To evaluate
</c:if>
<c:if test="${article.state == 'EVALUATED'}">
Evaluated
</c:if>
<c:if test="${article.state == 'REJECTED'}">
Rejected
</c:if>
<c:if test="${article.state == 'ACCEPTED'}">
Accepted
</c:if>
</td>
<td align="center" width="25%">
<a href="chooseConference.htm?idConf=${listConfForArticlePcMember[i.index].id}">${listConfForArticlePcMember[i.index].title}</a>
</td>
<td align="center" width="25%">
<a class="manage_link" id="articleURL" title="Download" href="<c:url value="/download.htm"><c:param name="articleId" value="${article.id}"/></c:url>">Download<img src="./images/cc-download_manager-32x32.png" alt="Download" /></a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div> </div>
</c:if> </c:if>
</div> </div>
<a name="listConfReferee"></a>
<h3 class="descriptionTitle">Referee's informations</h3> <h3 class="descriptionTitle">Referee's informations</h3>
<div class="textBox"> <div class="textBox">
You are Referee in <b>${numberReferee}</b> conference(s)<br /><br /> You are Referee in <b>${numberReferee}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#" onclick="showConfReferee();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConfReferee" onclick="showConfReferee();">here</a>.
<div id="confListRefereeDiv" class="dynamicFredList">
<div id="confListReferee" style="display: none;"> <div id="confListReferee" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -176,18 +236,60 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</c:if>
<br /><br /><a name="listArticleReferee"></a>
You have <b>${numberArticleReferee}</b> article(s) in your evaluation list.<br /><br />
<c:if test="${not empty listArticleReferee}">
If you want to see the list of articles you have in your evaluation list, click <a href="#listArticleReferee" onclick="showArticleReferee();">here</a>.
<div id="articleListReferee" style="display: none;">
<table width="100%" align="center">
<tbody>
<c:forEach var="article" items="${listArticleReferee}" varStatus="i">
<tr>
<td align="center" width="25%">${article.title}</td>
<td align="center" width="25%">
<c:if test="${article.state == 'SUBMITED'}">
To evaluate
</c:if>
<c:if test="${article.state == 'EVALUATED'}">
Evaluated
</c:if>
<c:if test="${article.state == 'REJECTED'}">
Rejected
</c:if>
<c:if test="${article.state == 'ACCEPTED'}">
Accepted
</c:if>
</td>
<td align="center" width="25%">
<a href="chooseConference.htm?idConf=${listConfForArticleReferee[i.index].id}">${listConfForArticleReferee[i.index].title}</a>
</td>
<td align="center" width="25%">
<a class="manage_link" id="articleURL" title="Download" href="<c:url value="/download.htm"><c:param name="articleId" value="${article.id}"/></c:url>">Download<img src="./images/cc-download_manager-32x32.png" alt="Download" /></a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div> </div>
</c:if> </c:if>
</div> </div>
<a name="listConfAuthor"></a>
<h3 class="descriptionTitle">Author's informations</h3> <h3 class="descriptionTitle">Author's informations</h3>
<div class="textBox"> <div class="textBox">
You are Author in <b>${numberAuthor}</b> conference(s)<br /><br /> You are Author in <b>${numberAuthor}</b> conference(s)<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of conferences you are registered in, click <a href="#" onclick="showConfAuthor();">here</a>. If you want to see the list of conferences you are registered in, click <a href="#listConfAuthor" onclick="showConfAuthor();">here</a>.
<div id="confListAuthorDiv" class="dynamicFredList">
<div id="confListAuthor" style="display: none;"> <div id="confListAuthor" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -204,16 +306,16 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</c:if> </c:if>
<br /> <br /><br /><a name="listArticleAuthor"></a>
You have posted <b>${numberArticle}</b> article(s).<br /><br /> You have posted <b>${numberArticle}</b> article(s).<br /><br />
<c:if test="${not empty listConfForUser}"> <c:if test="${not empty listConfForUser}">
If you want to see the list of articles you have submitted, click <a href="#" onclick="showArticleAll();">here</a>. If you want to see the list of articles you have submitted, click <a href="#listArticleAuthor" onclick="showArticleAll();">here</a>.
<div id="articleListDiv" class="dynamicFredList">
<div id="articleList" style="display: none;"> <div id="articleList" style="display: none;">
<table width="100%" align="center"> <table width="100%" align="center">
<tbody> <tbody>
@@ -245,7 +347,7 @@ function showConfAuthor() {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
</c:if> </c:if>
</div> </div>

View File

@@ -117,6 +117,42 @@ public class UserBoardController extends SimpleFormController {
model.put("numberConference", numberConference); model.put("numberConference", numberConference);
model.put("listConfForUser", listConfForUser); model.put("listConfForUser", listConfForUser);
logger.info("Get the list of article of all the conference for the user in PCMember");
List<Article> listArticlePCMember = new ArrayList<Article>();
List<Article> listArticleReferee;
List<Conference> listConfPCMember = new ArrayList<Conference>();
List<Conference> listConfReferee = new ArrayList<Conference>();
for (Conference c : listConfForUser) {
if (userManager.hasRoleForConference(SessionService.getInstance().getCurrentUserLogin(), RoleType.PCMEMBER, c.getId()))
listConfPCMember.add(c);
else if (userManager.hasRoleForConference(SessionService.getInstance().getCurrentUserLogin(), RoleType.REFEREE, c.getId()))
listConfReferee.add(c);
}
for (Conference c : listConfPCMember) {
listArticlePCMember.addAll(articleManager.getArticlesOfMember(c.getId(), SessionService.getInstance().getCurrentUserLogin()));
}
listArticleReferee = articleManager.getArticlesOfReferee(SessionService.getInstance().getCurrentUserLogin());
List<Conference> listConfForArticlePcMember = new ArrayList<Conference>();
for (Article a : listArticlePCMember) {
listConfForArticlePcMember.add(articleManager.getConferenceForArticle(a.getId()));
}
List<Conference> listConfForArticleReferee = new ArrayList<Conference>();
for (Article a : listArticleReferee) {
listConfForArticleReferee.add(articleManager.getConferenceForArticle(a.getId()));
}
model.put("listConfForArticlePcMember", listConfForArticlePcMember);
model.put("listArticlePCMember", listArticlePCMember);
model.put("numberArticlePCMember", listArticlePCMember.size());
model.put("listConfForArticleReferee", listConfForArticleReferee);
model.put("listArticleReferee", listArticleReferee);
model.put("numberArticleReferee", listArticleReferee.size());
logger.info("Get the number of conferences the user can create"); logger.info("Get the number of conferences the user can create");
Integer numberCreationTokens = conferenceManager.conferenceCreationTokens(SessionService.getInstance().getCurrentUserLogin()); Integer numberCreationTokens = conferenceManager.conferenceCreationTokens(SessionService.getInstance().getCurrentUserLogin());
model.put("numberCreationTokens", numberCreationTokens); model.put("numberCreationTokens", numberCreationTokens);