Début du CU modify conference...
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<h4><fmt:message key="menu.chairman.title" /></h4>
|
<h4><fmt:message key="menu.chairman.title" /></h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<c:url value="addConference.htm"/>"><fmt:message key="menu.chairman.conference.create" /></a></li>
|
<li><a href="<c:url value="addConference.htm"/>"><fmt:message key="menu.chairman.conference.create" /></a></li>
|
||||||
<li><a href="<c:url value="#"/>"><fmt:message key="menu.chairman.conference.modify" /></a></li>
|
<li><a href="<c:url value="addConference.htm?action=modify"/>"><fmt:message key="menu.chairman.conference.modify" /></a></li>
|
||||||
<li><a href="<c:url value="dispatchArticle.htm"/>"><fmt:message key="menu.chairman.article.dispatch" /></a></li>
|
<li><a href="<c:url value="dispatchArticle.htm"/>"><fmt:message key="menu.chairman.article.dispatch" /></a></li>
|
||||||
<li><a href="<c:url value="validateArticle.htm"/>"><fmt:message key="menu.chairman.article.validate" /></a></li>
|
<li><a href="<c:url value="validateArticle.htm"/>"><fmt:message key="menu.chairman.article.validate" /></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.yacos.web.chairman.controller;
|
package org.yacos.web.chairman.controller;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -215,44 +217,128 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
protected Object formBackingObject(HttpServletRequest request) throws ModelAndViewDefiningException {
|
protected Object formBackingObject(HttpServletRequest request) throws ModelAndViewDefiningException {
|
||||||
logger.info(this.getClass().toString() + " dans le formBackingObject");
|
logger.info(this.getClass().toString() + " dans le formBackingObject");
|
||||||
|
|
||||||
|
|
||||||
FormConference conference = new FormConference();
|
FormConference conference = new FormConference();
|
||||||
|
|
||||||
criteria = new HashSet<CriterionBean>();
|
String action = request.getParameter("action");
|
||||||
criteriaAll = new HashSet<CriterionBean>();
|
if (action == null || action.equals(""))
|
||||||
List<Criterion> listCriterion = evaluationManager.getCriterions();
|
{
|
||||||
for (Criterion crit : listCriterion) {
|
// TODO : tester ici si le gars a le droit d'<27>tre ici
|
||||||
CriterionBean cb = new CriterionBean();
|
// a-t-il le droit de cr<63>er une conf<6E>rence ?
|
||||||
cb.setId(crit.getId());
|
|
||||||
cb.setLabel(crit.getName());
|
criteria = new HashSet<CriterionBean>();
|
||||||
cb.setMax(crit.getMax_rating());
|
criteriaAll = new HashSet<CriterionBean>();
|
||||||
cb.setMin(crit.getMin_rating());
|
List<Criterion> listCriterion = evaluationManager.getCriterions();
|
||||||
criteriaAll.add(cb);
|
for (Criterion crit : listCriterion) {
|
||||||
getNextId();
|
CriterionBean cb = new CriterionBean();
|
||||||
|
cb.setId(crit.getId());
|
||||||
|
cb.setLabel(crit.getName());
|
||||||
|
cb.setMax(crit.getMax_rating());
|
||||||
|
cb.setMin(crit.getMin_rating());
|
||||||
|
criteriaAll.add(cb);
|
||||||
|
getNextId();
|
||||||
|
}
|
||||||
|
|
||||||
|
listPersonBean = new ArrayList<PersonBean>();
|
||||||
|
listPersonAdded = new ArrayList<PersonBean>();
|
||||||
|
listPersonFiltered = listPersonBean;
|
||||||
|
List<User> listUsers = userManager.getUsers();
|
||||||
|
for (User user : listUsers) {
|
||||||
|
PersonBean pb = new PersonBean();
|
||||||
|
pb.setId(getNextPerson());
|
||||||
|
pb.setFirstName(user.getFirstName());
|
||||||
|
pb.setLastName(user.getLastName());
|
||||||
|
pb.setLogin(user.getLogin());
|
||||||
|
listPersonBean.add(pb);
|
||||||
|
}
|
||||||
|
|
||||||
|
return conference;
|
||||||
|
}
|
||||||
|
else if (action.equals("modify")) {
|
||||||
|
Conference conf = SessionService.getInstance().getCurrentConference();
|
||||||
|
|
||||||
|
criteria = new HashSet<CriterionBean>();
|
||||||
|
criteriaAll = new HashSet<CriterionBean>();
|
||||||
|
|
||||||
|
List<Criterion> listCriterionForConf = evaluationManager.getCriterions(conf.getId());
|
||||||
|
for (Criterion crit : listCriterionForConf) {
|
||||||
|
CriterionBean cb = new CriterionBean();
|
||||||
|
cb.setId(crit.getId());
|
||||||
|
cb.setLabel(crit.getName());
|
||||||
|
cb.setMax(crit.getMax_rating());
|
||||||
|
cb.setMin(crit.getMin_rating());
|
||||||
|
criteria.add(cb);
|
||||||
|
getNextId();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Criterion> listCriterion = evaluationManager.getCriterions();
|
||||||
|
for (Criterion crit : listCriterion) {
|
||||||
|
CriterionBean cb = new CriterionBean();
|
||||||
|
cb.setId(crit.getId());
|
||||||
|
cb.setLabel(crit.getName());
|
||||||
|
cb.setMax(crit.getMax_rating());
|
||||||
|
cb.setMin(crit.getMin_rating());
|
||||||
|
criteriaAll.add(cb);
|
||||||
|
getNextId();
|
||||||
|
}
|
||||||
|
|
||||||
|
listPersonBean = new ArrayList<PersonBean>();
|
||||||
|
listPersonAdded = new ArrayList<PersonBean>();
|
||||||
|
listPersonFiltered = listPersonBean;
|
||||||
|
List<User> listUsers = userManager.getUsers();
|
||||||
|
for (User user : listUsers) {
|
||||||
|
PersonBean pb = new PersonBean();
|
||||||
|
pb.setId(getNextPerson());
|
||||||
|
pb.setFirstName(user.getFirstName());
|
||||||
|
pb.setLastName(user.getLastName());
|
||||||
|
pb.setLogin(user.getLogin());
|
||||||
|
listPersonBean.add(pb);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME : bug here when we remove a person
|
||||||
|
// and remove the person added from the list above
|
||||||
|
List<User> listUsersForConf = userManager.getUsers(conf.getId());
|
||||||
|
for (User user : listUsersForConf) {
|
||||||
|
PersonBean pb = new PersonBean();
|
||||||
|
pb.setId(getNextPerson());
|
||||||
|
pb.setFirstName(user.getFirstName());
|
||||||
|
pb.setLastName(user.getLastName());
|
||||||
|
pb.setLogin(user.getLogin());
|
||||||
|
listPersonAdded.add(pb);
|
||||||
|
}
|
||||||
|
|
||||||
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
|
conference.setTitle(conf.getTitle());
|
||||||
|
conference.setDateArticleParsed(conf.getDateArticle());
|
||||||
|
conference.setDateArticle(format.format(conf.getDateArticle()));
|
||||||
|
conference.setDateEndParsed(conf.getDateEnd());
|
||||||
|
conference.setDateEnd(format.format(conf.getDateEnd()));
|
||||||
|
conference.setDateEvaluationParsed(conf.getDateEvaluation());
|
||||||
|
conference.setDateEvaluation(format.format(conf.getDateEvaluation()));
|
||||||
|
conference.setDateStartParsed(conf.getDateStart());
|
||||||
|
conference.setDateStart(format.format(conf.getDateStart()));
|
||||||
|
conference.setDescription(conf.getDescription());
|
||||||
|
conference.setOtherInformations(conf.getOtherInformations());
|
||||||
|
|
||||||
|
// TODO : ajouter ca ds conf ejb...
|
||||||
|
/*conference.setPageNumber(pageNumber);
|
||||||
|
conference.setSendInfo(sendInfo);
|
||||||
|
conference.setTypeLatec(typeLatec);
|
||||||
|
conference.setTypeODT(typeODT);
|
||||||
|
conference.setTypePDF(typePDF);
|
||||||
|
conference.setTypeWord(typeWord);*/
|
||||||
|
|
||||||
|
return conference;
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
listPersonBean = new ArrayList<PersonBean>();
|
|
||||||
listPersonAdded = new ArrayList<PersonBean>();
|
|
||||||
listPersonFiltered = listPersonBean;
|
|
||||||
List<User> listUsers = userManager.getUsers();
|
|
||||||
for (User user : listUsers) {
|
|
||||||
PersonBean pb = new PersonBean();
|
|
||||||
pb.setId(getNextPerson());
|
|
||||||
pb.setFirstName(user.getFirstName());
|
|
||||||
pb.setLastName(user.getLastName());
|
|
||||||
pb.setLogin(user.getLogin());
|
|
||||||
listPersonBean.add(pb);
|
|
||||||
}
|
|
||||||
|
|
||||||
return conference;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onBindAndValidate(HttpServletRequest request, Object command, BindException errors, int page) {
|
|
||||||
/*if (page == 0 && request.getParameter("shippingAddressRequired") == null) {
|
|
||||||
OrderForm orderForm = (OrderForm) command;
|
|
||||||
orderForm.setShippingAddressRequired(false);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void validatePage(Object command, Errors errors, int page) {
|
protected void validatePage(Object command, Errors errors, int page) {
|
||||||
FormConference conference = (FormConference) command;
|
FormConference conference = (FormConference) command;
|
||||||
@@ -304,7 +390,7 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
|
|
||||||
conferenceManager.addRole(RoleType.CHAIRMAN, SessionService.getInstance().getCurrentUserLogin(), conf.getId());
|
conferenceManager.addRole(RoleType.CHAIRMAN, SessionService.getInstance().getCurrentUserLogin(), conf.getId());
|
||||||
|
|
||||||
return new ModelAndView("main"/*, model*/);
|
return new ModelAndView("main");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user