}else if(complementaryButon != null){
String[] positions = RequestUtils.getStringParameters(request, "positionsPis");
String position = "";
String pis;
Integer pi_ref;
Etat e = new Etat();
e.setState(Folder.FOLDER_COMPLEMENTARY);
for (int i = 0; i < positions.length; i++) {
pis = positions[i];
pi_ref = Integer.parseInt(pis);
position = request.getParameter(pis);
if(!position.equals("")){
try{
e.setComplemantary_pos(Integer.parseInt(position));
foldermanager.storeAdvancement(pi_ref, e, p.getFormation());
}catch(NumberFormatException nfe){
message = "Vous avez entre autre chose qu'un entier!";
page.add("Echec");
model.put("page", page);
model.put("message", message);
return new ModelAndView("responsable", model);
}
}
}
message = "Les positions sur la liste complementaire ont ete mise a jour";
page.add("Confirmation");
model.put("page", page);
model.put("message", message);
}else if(interviewButon != null){
String[] positions = RequestUtils.getStringParameters(request, "positionsPisHoraire");
String interview = "";
String pis;
Integer pi_ref;
int updates = 0;
Etat e = new Etat();
e.setState(Folder.FOLDER_INTERVIEW);
for (int i = 0; i < positions.length; i++) {
pis = positions[i];
pi_ref = Integer.parseInt(pis);
interview = request.getParameter(pis);
if(!interview.equals("")){
e.setInterview(interview);
updates += foldermanager.storeAdvancement(pi_ref, e, p.getFormation());
}
}
if(updates == positions.length){
message = "Les horaires d'entretiens ont �t� mis a jour";
page.add("Confirmation");
model.put("page", page);
model.put("message", message);
}else{
message = "Les horaires d'entretiens n'ont pas �t� mis a jour correctement. V�rifier les horaires des entretiens.";
page.add("Echec");
model.put("page", page);
model.put("message", message);
}
}else if(convocationButon!=null){
message = "";
List advancementsInterviews = foldermanager.findByStateAndFormation(Folder.FOLDER_INTERVIEW, p.getFormation());
String path = request.getSession().getServletContext().getRealPath("/");
MailSenDer mdInterview = new MailSenDer(path+"mail.properties");
boolean send = true;
for (Iterator iterAdvancements = advancementsInterviews.iterator(); iterAdvancements
.hasNext();) {
Advancement advancement = (Advancement) iterAdvancements.next();
Formation f = (Formation)advancement.getAdvancement().keySet().iterator().next();
Etat interview = advancement.getAdvancement().get(f);
boolean convoq = mdInterview.sendInterviewMail(advancement, p, interview);
send = send && convoq;
if(!convoq){
message += advancement.getPi().getEmail()+" ";
}