Début du CU modify conference...
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<h4><fmt:message key="menu.chairman.title" /></h4>
|
||||
<ul>
|
||||
<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="validateArticle.htm"/>"><fmt:message key="menu.chairman.article.validate" /></a></li>
|
||||
</ul>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.yacos.web.chairman.controller;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -215,45 +217,129 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
protected Object formBackingObject(HttpServletRequest request) throws ModelAndViewDefiningException {
|
||||
logger.info(this.getClass().toString() + " dans le formBackingObject");
|
||||
|
||||
|
||||
FormConference conference = new FormConference();
|
||||
|
||||
criteria = new HashSet<CriterionBean>();
|
||||
criteriaAll = new HashSet<CriterionBean>();
|
||||
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();
|
||||
String action = request.getParameter("action");
|
||||
if (action == null || action.equals(""))
|
||||
{
|
||||
// TODO : tester ici si le gars a le droit d'<27>tre ici
|
||||
// a-t-il le droit de cr<63>er une conf<6E>rence ?
|
||||
|
||||
criteria = new HashSet<CriterionBean>();
|
||||
criteriaAll = new HashSet<CriterionBean>();
|
||||
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);
|
||||
}
|
||||
|
||||
return conference;
|
||||
}
|
||||
|
||||
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);
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
}*/
|
||||
else {
|
||||
throw new ModelAndViewDefiningException(new ModelAndView("404error"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void validatePage(Object command, Errors errors, int page) {
|
||||
FormConference conference = (FormConference) command;
|
||||
ConferenceValidator conferenceValidator = (ConferenceValidator) getValidator();
|
||||
@@ -304,7 +390,7 @@ public class AddConferenceController extends AbstractWizardFormController {
|
||||
|
||||
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