Quelques corrections
AddConference marche
This commit is contained in:
@@ -74,15 +74,6 @@ function clearPerson() {
|
|||||||
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
|
dwr.util.setValues({ id:-1, label:null, min:null, max:null });
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitIfNotEnter(theForm){
|
|
||||||
if(theForm.elements["submit"] || theForm.elements["submit"]){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
writePerson();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -114,6 +105,7 @@ function submitIfNotEnter(theForm){
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
@@ -141,8 +133,8 @@ function submitIfNotEnter(theForm){
|
|||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<input type="submit" align="middle" name="_target2" value="Back" onclick="this.form.elements['submit']=true">
|
<input type="submit" align="middle" name="_target2" value="Back">
|
||||||
<input type="submit" align="middle" name="_target4" value="Next" onclick="this.form.elements['submit']=true" />
|
<input type="submit" align="middle" name="_target4" value="Next"/>
|
||||||
|
|
||||||
|
|
||||||
</form:form>
|
</form:form>
|
||||||
|
|||||||
@@ -72,6 +72,15 @@ function addPerson(eleid) {
|
|||||||
dwr.engine.endBatch();
|
dwr.engine.endBatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addInvitation() {
|
||||||
|
var email = $("emailAddress").value;
|
||||||
|
dwr.engine.beginBatch();
|
||||||
|
AddCriteriaJS.addInvitation(email);
|
||||||
|
fillTable();
|
||||||
|
fillTable2();
|
||||||
|
dwr.engine.endBatch();
|
||||||
|
}
|
||||||
|
|
||||||
function deletePerson(eleid) {
|
function deletePerson(eleid) {
|
||||||
var person = peopleCache[eleid.substring(11)];
|
var person = peopleCache[eleid.substring(11)];
|
||||||
if (confirm("Are you sure you want to delete " + person.name + "?")) {
|
if (confirm("Are you sure you want to delete " + person.name + "?")) {
|
||||||
@@ -114,8 +123,8 @@ function filterUser(el, value) {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Add a new member <br />
|
<fmt:message key="pcmember.invitation.promptMessage"/> <br/>
|
||||||
Mail: <input id="mail" type="text" />
|
Mail: <input id="emailAddress" type="text"/> <input type="button" name="invitationEmail" onclick="addInvitation()"/>
|
||||||
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ public class EvaluationController extends SimpleFormController {
|
|||||||
protected Object formBackingObject(HttpServletRequest request)
|
protected Object formBackingObject(HttpServletRequest request)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
// FIXME mock object: criterionList en attendant criterionManager
|
// FIXME mock object: criterionList en attendant criterionManager
|
||||||
conferenceManager.addConference("myTitre", "myDescirption", "myInfoComplementray", new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008), new Date(1/1/2008));
|
Conference conf=SessionService.getInstance().getCurrentConference();
|
||||||
Conference conf=conferenceManager.getConference(1);
|
|
||||||
ArrayList<Criterion> criterionList = new ArrayList<Criterion>();
|
ArrayList<Criterion> criterionList = new ArrayList<Criterion>();
|
||||||
Criterion c1=new Criterion("respect du theme",new Integer(1),new Integer(5),conf );
|
Criterion c1=new Criterion("respect du theme",new Integer(1),new Integer(5),conf );
|
||||||
|
|
||||||
@@ -81,7 +80,6 @@ public class EvaluationController extends SimpleFormController {
|
|||||||
liste.add(sc);
|
liste.add(sc);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (liste!=null){System.out.println("liste n'est pas null");}
|
|
||||||
fe.setSimpleRatings(liste);
|
fe.setSimpleRatings(liste);
|
||||||
fe.setCommentAuthor("no comment by author");
|
fe.setCommentAuthor("no comment by author");
|
||||||
fe.setCommentPCMember("no comment by pc member");
|
fe.setCommentPCMember("no comment by pc member");
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public class ValideOrRejectController extends SimpleFormController {
|
|||||||
{
|
{
|
||||||
art.setState(State.ACCEPTED);
|
art.setState(State.ACCEPTED);
|
||||||
}
|
}
|
||||||
else if (value.equals("reject"))
|
else if (value.equals("reject")){
|
||||||
{art.setState(State.REJECTED);
|
art.setState(State.REJECTED);
|
||||||
}
|
}
|
||||||
articleManager.updateArticle(art);
|
articleManager.updateArticle(art);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ public class MainController extends SimpleFormController {
|
|||||||
|
|
||||||
logger.info("Returning main view");
|
logger.info("Returning main view");
|
||||||
|
|
||||||
// FIXME : this is no longer necessary
|
|
||||||
request.getSession().setAttribute("user","toto");
|
|
||||||
request.getSession().setAttribute("idCurrentConference",1);
|
|
||||||
//FIXME
|
//FIXME
|
||||||
return new ModelAndView("main");
|
return new ModelAndView("main");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package org.yacos.web.chairman.controller;
|
package org.yacos.web.chairman.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -16,11 +13,13 @@ import org.springframework.validation.Errors;
|
|||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
||||||
import org.springframework.web.servlet.mvc.AbstractWizardFormController;
|
import org.springframework.web.servlet.mvc.AbstractWizardFormController;
|
||||||
|
import org.yacos.core.conferences.Conference;
|
||||||
import org.yacos.core.conferences.IConferenceManager;
|
import org.yacos.core.conferences.IConferenceManager;
|
||||||
import org.yacos.core.users.IUserManager;
|
import org.yacos.core.users.IUserManager;
|
||||||
import org.yacos.core.users.User;
|
import org.yacos.core.users.User;
|
||||||
import org.yacos.web.chairman.form.FormConference;
|
import org.yacos.web.chairman.form.FormConference;
|
||||||
import org.yacos.web.chairman.validation.ConferenceValidator;
|
import org.yacos.web.chairman.validation.ConferenceValidator;
|
||||||
|
import org.yacos.web.system.session.SessionService;
|
||||||
|
|
||||||
|
|
||||||
//TODO : Clean this class
|
//TODO : Clean this class
|
||||||
@@ -58,9 +57,7 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
listPersonAdded = new ArrayList<PersonBean>();
|
listPersonAdded = new ArrayList<PersonBean>();
|
||||||
listPersonFiltered = new ArrayList<PersonBean>();
|
listPersonFiltered = new ArrayList<PersonBean>();
|
||||||
List<User> listUsers = userManager.getUsers();
|
List<User> listUsers = userManager.getUsers();
|
||||||
for (Iterator i = listUsers.iterator(); i.hasNext();) {
|
for (User user : listUsers) {
|
||||||
User user = (User) i.next();
|
|
||||||
|
|
||||||
PersonBean pb = new PersonBean();
|
PersonBean pb = new PersonBean();
|
||||||
pb.setId(getNextPerson());
|
pb.setId(getNextPerson());
|
||||||
pb.setName(user.getFirstName());
|
pb.setName(user.getFirstName());
|
||||||
@@ -74,11 +71,10 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
listPersonFiltered = new ArrayList<PersonBean>();
|
listPersonFiltered = new ArrayList<PersonBean>();
|
||||||
else {
|
else {
|
||||||
listPersonFiltered = new ArrayList<PersonBean>();
|
listPersonFiltered = new ArrayList<PersonBean>();
|
||||||
for (Iterator i = listPersonBean.iterator(); i.hasNext();) {
|
for (PersonBean b : listPersonBean) {
|
||||||
PersonBean b = (PersonBean) i.next();
|
if (b.getName().toLowerCase().contains(text.toLowerCase())){
|
||||||
|
|
||||||
if (b.getName().toLowerCase().contains(text.toLowerCase()))
|
|
||||||
listPersonFiltered.add(b);
|
listPersonFiltered.add(b);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,18 +107,16 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PersonBean getTruePerson(String login) {
|
public PersonBean getTruePerson(String login) {
|
||||||
for (Iterator i = listPersonBean.iterator(); i.hasNext();) {
|
for (PersonBean b : listPersonBean) {
|
||||||
PersonBean b = (PersonBean) i.next();
|
if (b.getLogin().equals(login)){
|
||||||
|
|
||||||
if (b.getLogin().equals(login))
|
|
||||||
return b;
|
return b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Iterator i = listPersonAdded.iterator(); i.hasNext();) {
|
for (PersonBean b : listPersonAdded) {
|
||||||
PersonBean b = (PersonBean) i.next();
|
if (b.getLogin().equals(login)){
|
||||||
|
|
||||||
if (b.getLogin().equals(login))
|
|
||||||
return b;
|
return b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -152,9 +146,9 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
|
|
||||||
private static int nextId = 1;
|
private static int nextId = 1;
|
||||||
|
|
||||||
private Set criteria = new HashSet();;
|
private Set<CriterionBean> criteria = new HashSet<CriterionBean>();;
|
||||||
|
|
||||||
public Set getAllCriteria() {
|
public Set<CriterionBean> getAllCriteria() {
|
||||||
return criteria;
|
return criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,11 +210,34 @@ public class AddConferenceController extends AbstractWizardFormController {
|
|||||||
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) {
|
HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) {
|
||||||
FormConference conference = (FormConference) command;
|
FormConference conference = (FormConference) command;
|
||||||
|
|
||||||
/*this.petStore.insertOrder(orderForm.getOrder());
|
|
||||||
request.getSession().removeAttribute("sessionCart");
|
Conference conf = conferenceManager.addConference(
|
||||||
Map model = new HashMap();
|
conference.getTitle(),
|
||||||
model.put("order", orderForm.getOrder());
|
conference.getDescription(),
|
||||||
model.put("message", "Thank you, your order has been submitted.");*/
|
conference.getOtherInformations(),
|
||||||
|
conference.getDateArticleParsed(),
|
||||||
|
conference.getDateArticleParsed(),
|
||||||
|
conference.getDateEvaluationParsed(),
|
||||||
|
conference.getDateStartParsed(),
|
||||||
|
conference.getDateEndParsed());
|
||||||
|
|
||||||
|
conference.setConferenceId(conf.getId());
|
||||||
|
SessionService.getInstance().setCurrentConference(conf);
|
||||||
|
|
||||||
|
for(CriterionBean criterion : criteria){
|
||||||
|
conferenceManager.addCriterionToConference(
|
||||||
|
conf.getId(),
|
||||||
|
criterion.getLabel(),
|
||||||
|
criterion.getMin(),
|
||||||
|
criterion.getMax());
|
||||||
|
}
|
||||||
|
|
||||||
|
for(PersonBean personBean : listPersonAdded){
|
||||||
|
conferenceManager.addPCMemberToConference(
|
||||||
|
conf.getId(),
|
||||||
|
personBean.getLogin());
|
||||||
|
}
|
||||||
|
|
||||||
return new ModelAndView("main"/*, model*/);
|
return new ModelAndView("main"/*, model*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.yacos.web.chairman.form;
|
package org.yacos.web.chairman.form;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class FormConference {
|
public class FormConference {
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -8,14 +10,20 @@ public class FormConference {
|
|||||||
private String otherInformations;
|
private String otherInformations;
|
||||||
|
|
||||||
private String dateArticle;
|
private String dateArticle;
|
||||||
|
private Date dateArticleParsed;
|
||||||
private String dateEvaluation;
|
private String dateEvaluation;
|
||||||
|
private Date dateEvaluationParsed;
|
||||||
private String dateStart;
|
private String dateStart;
|
||||||
|
private Date dateStartParsed;
|
||||||
private String dateEnd;
|
private String dateEnd;
|
||||||
|
private Date dateEndParsed;
|
||||||
|
|
||||||
private int pageNumber;
|
private int pageNumber;
|
||||||
private String fileType;
|
private String fileType;
|
||||||
private String sendInfo;
|
private String sendInfo;
|
||||||
|
|
||||||
|
private Integer conferenceId;
|
||||||
|
|
||||||
public FormConference () {}
|
public FormConference () {}
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@@ -105,4 +113,68 @@ public class FormConference {
|
|||||||
public void setDateEnd(String dateEnd) {
|
public void setDateEnd(String dateEnd) {
|
||||||
this.dateEnd = dateEnd;
|
this.dateEnd = dateEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the dateArticleParsed
|
||||||
|
*/
|
||||||
|
public Date getDateArticleParsed() {
|
||||||
|
return dateArticleParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dateArticleParsed the dateArticleParsed to set
|
||||||
|
*/
|
||||||
|
public void setDateArticleParsed(Date dateArticleParsed) {
|
||||||
|
this.dateArticleParsed = dateArticleParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the dateEvaluationParsed
|
||||||
|
*/
|
||||||
|
public Date getDateEvaluationParsed() {
|
||||||
|
return dateEvaluationParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dateEvaluationParsed the dateEvaluationParsed to set
|
||||||
|
*/
|
||||||
|
public void setDateEvaluationParsed(Date dateEvaluationParsed) {
|
||||||
|
this.dateEvaluationParsed = dateEvaluationParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the dateStartParsed
|
||||||
|
*/
|
||||||
|
public Date getDateStartParsed() {
|
||||||
|
return dateStartParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dateStartParsed the dateStartParsed to set
|
||||||
|
*/
|
||||||
|
public void setDateStartParsed(Date dateStartParsed) {
|
||||||
|
this.dateStartParsed = dateStartParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the dateEndParsed
|
||||||
|
*/
|
||||||
|
public Date getDateEndParsed() {
|
||||||
|
return dateEndParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param dateEndParsed the dateEndParsed to set
|
||||||
|
*/
|
||||||
|
public void setDateEndParsed(Date dateEndParsed) {
|
||||||
|
this.dateEndParsed = dateEndParsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConferenceId(Integer conferenceId) {
|
||||||
|
this.conferenceId = conferenceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConferenceId() {
|
||||||
|
return conferenceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package org.yacos.web.chairman.validation;
|
package org.yacos.web.chairman.validation;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import org.springframework.validation.Errors;
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.validation.ValidationUtils;
|
import org.springframework.validation.ValidationUtils;
|
||||||
import org.springframework.validation.Validator;
|
import org.springframework.validation.Validator;
|
||||||
@@ -27,6 +32,32 @@ public class ConferenceValidator implements Validator {
|
|||||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEnd", "DATE_REQUIRED", "A date is required");
|
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEnd", "DATE_REQUIRED", "A date is required");
|
||||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateArticle", "DATE_REQUIRED", "A date is required");
|
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateArticle", "DATE_REQUIRED", "A date is required");
|
||||||
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEvaluation", "DATE_REQUIRED", "A date is required");
|
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "dateEvaluation", "DATE_REQUIRED", "A date is required");
|
||||||
|
|
||||||
|
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
try {
|
||||||
|
Date dateStart = format.parse(conference.getDateStart());
|
||||||
|
conference.setDateStartParsed(dateStart);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
errors.reject("dateStart");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date dateEnd = format.parse(conference.getDateEnd());
|
||||||
|
conference.setDateEndParsed(dateEnd);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
errors.reject("dateEnd");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date dateArticle = format.parse(conference.getDateArticle());
|
||||||
|
conference.setDateArticleParsed(dateArticle);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
errors.reject("dateArticle");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Date dateEvaluation = format.parse(conference.getDateEvaluation());
|
||||||
|
conference.setDateEvaluationParsed(dateEvaluation);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
errors.reject("dateEvaluation");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validateThirdPage(FormConference conference, Errors errors) {
|
public void validateThirdPage(FormConference conference, Errors errors) {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.acegisecurity.context.SecurityContextHolder;
|
|||||||
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
||||||
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
|
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
|
||||||
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
|
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
|
||||||
import org.acegisecurity.userdetails.UserDetails;
|
|
||||||
import org.springframework.web.util.WebUtils;
|
import org.springframework.web.util.WebUtils;
|
||||||
import org.yacos.auth.UserDetailsService;
|
import org.yacos.auth.UserDetailsService;
|
||||||
import org.yacos.core.conferences.Conference;
|
import org.yacos.core.conferences.Conference;
|
||||||
|
|||||||
Reference in New Issue
Block a user