Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 968 → Rev 32

/kickup/trunk/src/ak/kickup/core/action/ActAction.java
File deleted
/kickup/trunk/src/ak/kickup/core/action/ParticipantAction.java
236,14 → 236,7
 
ParticipantManager.getInstance().save(participant);
 
try {
Messages.sendRegistrationMessage(participant, request.getRemoteAddr());
}
catch(Exception ex) {
request.setAttribute("event", event);
initLists(request, event);
throw ex;
}
Messages.sendRegistrationMessage(participant, request.getRemoteAddr());
 
response.sendRedirect(BackPath.findBackPath(request).getBackwardUrl());
return null;
/kickup/trunk/src/ak/kickup/core/action/AdminParticipantAction.java
205,16 → 205,8
participant.setPrivateComment((String)theForm.get("privateComment"));
 
ParticipantManager.getInstance().save(participant);
if(newParticipant) {
try {
Messages.sendRegistrationMessage(participant, null);
}
catch(Exception ex) {
request.setAttribute("event", event);
initLists(request, event);
throw ex;
}
}
if(newParticipant)
Messages.sendRegistrationMessage(participant, null);
 
response.sendRedirect(BackPath.findBackPath(request).getBackwardUrl());
return null;
/kickup/trunk/src/ak/kickup/core/action/TransportAction.java
33,7 → 33,7
Long eventId = StringConverter.parseLong(theForm.get("event"));
Event event = EventManager.getInstance().get(eventId, true);
List list = new ArrayList(ParticipantManager.getInstance().listFreeTransport(event));
Collections.sort(list, ParticipantManager.FROM_ZIP_COMPARATOR);
Collections.sort(list, ParticipantManager.NICK_COMPARATOR);
request.setAttribute("participants", list);
request.setAttribute("event", event);
return mapping.findForward("default");
/kickup/trunk/src/ak/kickup/core/CoreResources.properties
29,8 → 29,7
ak.kickup.core.participant.edit.nick.required=Ник обязателен
ak.kickup.core.participant.edit.email.required=e-mail обязателен
ak.kickup.core.participant.edit.email.wrong=Некорректный e-mail
ak.kickup.core.participant.edit.persons.required=Количество не указано
ak.kickup.core.participant.edit.persons.wrong=Количество должно быть положительным целым числом
ak.kickup.core.participant.edit.persons.wrong=Количество должно быть целым числом
ak.kickup.core.participant.edit.freetransport.wrong=Количество мест в машине должно быть целым числом
ak.kickup.core.participant.edit.departure.wrong=Время отправления дожно быть, например, 20.10.2004 13:55
ak.kickup.core.participant.edit.freesleep.wrong=Количество спальных мест должно быть целым числом
/kickup/trunk/src/ak/kickup/core/model/ParticipantManager.java
200,22 → 200,6
}
}
 
public Collection listForAct(EventAct act)
throws ModelException
{
try {
return HibernateUtil.currentSession().find(
"select pa from Participant as p, ParticipantAct as pa"
+ " where p.event = ? and pa.participant = p and pa.act = ?",
new Object[] { act.getEvent(), act.getAct() },
new Type[] { Hibernate.entity(Event.class), Hibernate.entity(Act.class) } );
}
catch(HibernateException ex)
{
throw new ModelException(ex);
}
}
 
public ParticipantAct createAct()
throws ModelException
{
238,8 → 222,6
}
 
public static final Comparator NICK_COMPARATOR = new NickComparator();
public static final Comparator ACT_NICK_COMPARATOR = new ActNickComparator();
public static final Comparator FROM_ZIP_COMPARATOR = new FromZipComparator();
 
private static class NickComparator
implements Comparator
267,58 → 249,4
return (obj instanceof NickComparator);
}
}
 
private static class ActNickComparator
implements Comparator
{
public int compare(Object o1, Object o2)
{
if(!(o1 instanceof ParticipantAct) || !(o2 instanceof ParticipantAct))
throw new ClassCastException("not a ParticipantAct");
 
ParticipantAct a1 = (ParticipantAct)o1;
ParticipantAct a2 = (ParticipantAct)o2;
 
if(a1 == null && a2 == null)
return 0;
else if(a1 == null && a2 != null)
return -1;
else if(a1 != null && a2 == null)
return 1;
else
return a1.getParticipant().getNick().compareToIgnoreCase(a2.getParticipant().getNick());
}
 
public boolean equals(Object obj)
{
return (obj instanceof ActNickComparator);
}
}
 
private static class FromZipComparator
implements Comparator
{
public int compare(Object o1, Object o2)
{
if(!(o1 instanceof Participant) || !(o2 instanceof Participant))
throw new ClassCastException("not a Participant");
 
Participant a1 = (Participant)o1;
Participant a2 = (Participant)o2;
 
if((a1 == null || a1.getFromZip() == null) && (a2 == null || a2.getFromZip() == null))
return 0;
else if((a1 == null || a1.getFromZip() == null) && (a2 != null && a2.getFromZip() != null))
return -1;
else if((a1 != null && a1.getFromZip() == null) && (a2 == null || a2.getFromZip() == null))
return 1;
else
return a1.getFromZip().compareToIgnoreCase(a2.getFromZip());
}
 
public boolean equals(Object obj)
{
return (obj instanceof FromZipComparator);
}
}
}