Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 976 → Rev 977

/kickup/trunk/src/ak/kickup/core/RegistrationMail.txt
6,7 → 6,7
или изменить свои данные.
 
Участие в "%eventName%" стоит %eventPrice% евро.
Переведите, полжалуйста, деньги на счет:
Переведите, пожалуйста, деньги на счет:
 
%eventMoneyAccount%
 
/kickup/trunk/src/ak/kickup/core/action/ParticipantAction.java
40,7 → 40,8
throws Exception
{
if("submit".equals(mapping.getParameter()) || "update".equals(mapping.getParameter())
|| "unregister".equals(mapping.getParameter()) || "login".equals(mapping.getParameter()))
|| "unregister".equals(mapping.getParameter()) || "login".equals(mapping.getParameter())
|| "remind".equals(mapping.getParameter()))
{
DynaActionForm theForm = (DynaActionForm)form;
Long eventId = StringConverter.parseLong(theForm.get("event"));
303,6 → 304,30
request.setAttribute("participant", participant);
return mapping.findForward("default");
}
else if("remind".equals(mapping.getParameter())) {
DynaActionForm theForm = (DynaActionForm)form;
Long eventId = StringConverter.parseLong(theForm.get("event"));
Event event = EventManager.getInstance().get(eventId, true);
String email = ((String)theForm.get("email")).trim();
 
request.setAttribute("event", event);
 
Participant participant = ParticipantManager.getInstance().findForEmail(email);
 
if(participant == null) {
Thread.sleep(1000);
throw new UserException("ak.kickup.core.participant.remind.email.notfound");
}
 
try {
Messages.sendRemindMessage(participant, request.getRemoteAddr());
}
catch(Exception ex) {
throw ex;
}
 
return mapping.findForward("default");
}
else {
throw new Exception("unknown mapping parameter");
}
/kickup/trunk/src/ak/kickup/core/CoreResources.properties
39,8 → 39,12
ak.kickup.core.participant.edit.registration.unavailable=Время регистрации прошло
ak.kickup.core.participant.edit.unregistration.unavailable=Время отмены регистрации прошло
ak.kickup.core.participant.edit.payed.wrong=Оплаченная сумма должна быть числом, например 12,35
ak.kickup.core.participant.remind.email.required=Вы не указали свой e-mail
ak.kickup.core.participant.remind.email.wrong=Некорректный e-mail
ak.kickup.core.participant.remind.email.notfound=Этот e-mail не зарегистрирован
ak.kickup.core.mail.send.error=Не могу отправить вам e-mail. Проверьте свой адрес и обратитесь к организаторам.
ak.kickup.core.mail.read.error=Не могу отправить вам e-mail. Ошибка в системе.
ak.kickup.core.mail.subject=Registration for {0}
ak.kickup.core.remindmail.subject=Registration number remind for {0}
 
org.apache.struts.taglib.bean.format.sql.timestamp=dd.MM.yyyy HH:mm:ss.SSS
/kickup/trunk/src/ak/kickup/core/RemindMail.txt
0,0 → 1,13
Высылаем вам запрошенную информацию.
 
Регистрационный номер: %ident%.
 
Участие в "%eventName%" стоит %eventPrice% евро.
Переведите, пожалуйста, деньги на счет:
 
%eventMoneyAccount%
 
В качестве Verwendungszweck укажите ваш номер, %ident%.
 
Если у вас есть вопросы, обращайтесь к организаторам
(%eventAdmins%) по адресу %eventEmail% или телефонам %eventPhones%
/kickup/trunk/src/ak/kickup/core/model/ParticipantManager.java
86,6 → 86,25
}
}
 
public Participant findForEmail(String email)
throws ModelException
{
try {
List list = HibernateUtil.currentSession().find(
"from Participant where email = ?",
email, Hibernate.STRING );
 
if(list.size() == 0)
return null;
else
return (Participant)list.get(0);
}
catch(HibernateException ex)
{
throw new ModelException(ex);
}
}
 
public boolean emailExists(Participant participant, String email)
throws ModelException
{
/kickup/trunk/src/ak/kickup/core/mail/Messages.java
16,7 → 16,7
 
public abstract class Messages
{
public static final String HOST = "localhost";
public static final String HOST = "26th.net";
public static final String CHARSET = "windows-1251";
 
public static void send(String from, String to, String subject, String body)
46,12 → 46,24
public static void sendRegistrationMessage(Participant participant, String ip)
throws UserException
{
prepareMail(participant, ip, "ak.kickup.core.mail.subject", "ak/kickup/core/RegistrationMail.txt");
}
 
public static void sendRemindMessage(Participant participant, String ip)
throws UserException
{
prepareMail(participant, ip, "ak.kickup.core.remindmail.subject", "ak/kickup/core/RemindMail.txt");
}
 
private static void prepareMail(Participant participant, String ip, String subjectKey, String messageFile)
throws UserException
{
String subject;
StringBuffer message = new StringBuffer();
 
// get subject
ResourceBundle res = ResourceBundle.getBundle("ak/kickup/core/CoreResources");
String subjectString = res.getString("ak.kickup.core.mail.subject");
String subjectString = res.getString(subjectKey);
subject = MessageFormat.format(subjectString,
new String[] { participant.getEvent().getName() } );
 
61,7 → 73,7
if(cl == null) cl = ClassLoader.getSystemClassLoader();
 
BufferedReader file = new BufferedReader(new InputStreamReader(cl.getResourceAsStream(
"ak/kickup/core/RegistrationMail.txt"), "UTF8"));
messageFile), "UTF-8"));
char[] buf = new char[2048];
int bufLen;
while((bufLen = file.read(buf)) >= 0) {