Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 968 → Rev 969

/kickup/trunk/src/ak/kickup/core/action/AdminParticipantAction.java
102,7 → 102,7
showForm.set("transportComment", participant.getTransportComment());
showForm.set("freeSleep", StringConverter.toString(participant.getFreeSleep()));
showForm.set("sleepComment", participant.getSleepComment());
showForm.set("payed", participant.getPayed());
showForm.set("payed", StringConverter.toCurrency(participant.getPayed()));
showForm.set("comment", participant.getComment());
showForm.set("privateComment", participant.getPrivateComment());
}
200,7 → 200,7
participant.setTransportComment((String)theForm.get("transportComment"));
participant.setFreeSleep(StringConverter.parseInteger(theForm.get("freeSleep")));
participant.setSleepComment((String)theForm.get("sleepComment"));
participant.setPayed((Boolean)theForm.get("payed"));
participant.setPayed(StringConverter.parseCurrency(theForm.get("payed")));
participant.setComment((String)theForm.get("comment"));
participant.setPrivateComment((String)theForm.get("privateComment"));
 
/kickup/trunk/src/ak/kickup/core/CoreResources.properties
37,6 → 37,7
ak.kickup.core.participant.edit.ident.wrong=Неизвестный номер
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.mail.send.error=Не могу отправить вам e-mail. Проверьте свой адрес и обратитесь к организаторам.
ak.kickup.core.mail.read.error=Не могу отправить вам e-mail. Ошибка в системе.
ak.kickup.core.mail.subject=Регистрация на {0}
/kickup/trunk/src/ak/kickup/core/model/Participant.java
1,5 → 1,6
package ak.kickup.core.model;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
17,6 → 18,12
public class Participant
extends GeneralModelObject
{
public static final int PAYED_NULL = 0; // event price is nto defined
public static final int PAYED_NONE = 1; // noit yet payed
public static final int PAYED_LESS = 2; // payed but less then needed
public static final int PAYED_EXACTLY = 3; // payed exactly as needed
public static final int PAYED_MORE = 4; // payed more then needed
 
private String ident;
private String nick;
private String email;
32,7 → 39,7
private String transportComment;
private Integer freeSleep;
private String sleepComment;
private Boolean payed;
private BigDecimal payed;
private String comment;
private String privateComment;
private Collection acts; // Collection(ParticipantAct)
261,16 → 268,36
*
* @hibernate.property
*/
public Boolean getPayed()
public BigDecimal getPayed()
{
return payed;
}
 
public void setPayed(Boolean payed)
public void setPayed(BigDecimal payed)
{
this.payed = payed;
}
 
public BigDecimal getMustPay()
{
if(event.getPrice() == null || persons == null) return null;
 
return new BigDecimal(event.getPrice().doubleValue() * persons.intValue());
}
 
public int getPayedStatus()
{
if(event.getPrice() == null || persons == null) return PAYED_NULL;
if(payed == null) return PAYED_NONE;
 
double needed = event.getPrice().doubleValue() * persons.intValue();
double p = payed.doubleValue();
 
if(Math.abs(needed - p) < 0.001) return PAYED_EXACTLY;
else if(needed < p) return PAYED_MORE;
else return PAYED_LESS;
}
 
/**
*
* @hibernate.property
/kickup/trunk/src/ak/kickup/core/taglib/CurrentLinkTag.java
0,0 → 1,230
// based on Jakarta Struts
package ak.kickup.core.taglib;
 
import java.net.MalformedURLException;
import java.util.Map;
import java.util.HashMap;
import javax.servlet.jsp.JspException;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.taglib.logic.IterateTag;
 
import ak.backpath.taglib.ForwardLinkTag;
 
public class CurrentLinkTag
extends ForwardLinkTag
{
protected String paramId2 = null;
 
public String getParamId2()
{
return this.paramId2;
}
 
public void setParamId2(String paramId2)
{
this.paramId2 = paramId2;
}
 
protected String paramName2 = null;
 
public String getParamName2()
{
return this.paramName2;
}
 
public void setParamName2(String paramName2)
{
this.paramName2 = paramName2;
}
 
protected String paramProperty2 = null;
 
public String getParamProperty2()
{
return this.paramProperty2;
}
 
public void setParamProperty2(String paramProperty2)
{
this.paramProperty2 = paramProperty2;
}
 
protected String paramScope2 = null;
 
public String getParamScope2()
{
return this.paramScope2;
}
 
public void setParamScope2(String paramScope2)
{
this.paramScope2 = paramScope2;
}
 
protected String paramId3 = null;
 
public String getParamId3()
{
return this.paramId3;
}
 
public void setParamId3(String paramId3)
{
this.paramId3 = paramId3;
}
 
protected String paramName3 = null;
 
public String getParamName3()
{
return this.paramName3;
}
 
public void setParamName3(String paramName3)
{
this.paramName3 = paramName3;
}
 
protected String paramProperty3 = null;
 
public String getParamProperty3()
{
return this.paramProperty3;
}
 
public void setParamProperty3(String paramProperty3)
{
this.paramProperty3 = paramProperty3;
}
 
protected String paramScope3 = null;
 
public String getParamScope3()
{
return this.paramScope3;
}
 
public void setParamScope3(String paramScope3)
{
this.paramScope3 = paramScope3;
}
 
protected String paramId4 = null;
 
public String getParamId4()
{
return this.paramId4;
}
 
public void setParamId4(String paramId4)
{
this.paramId4 = paramId4;
}
 
protected String paramName4 = null;
 
public String getParamName4()
{
return this.paramName4;
}
 
public void setParamName4(String paramName4)
{
this.paramName4 = paramName4;
}
 
protected String paramProperty4 = null;
 
public String getParamProperty4()
{
return this.paramProperty4;
}
 
public void setParamProperty4(String paramProperty4)
{
this.paramProperty4 = paramProperty4;
}
 
protected String paramScope4 = null;
 
public String getParamScope4()
{
return this.paramScope4;
}
 
public void setParamScope4(String paramScope4)
{
this.paramScope4 = paramScope4;
}
 
public void release()
{
super.release();
paramId2 = null;
paramName2 = null;
paramProperty2 = null;
paramScope2 = null;
paramId3 = null;
paramName3 = null;
paramProperty3 = null;
paramScope3 = null;
paramId4 = null;
paramName4 = null;
paramProperty4 = null;
paramScope4 = null;
}
 
protected String calculateURL()
throws JspException
{
Map params = RequestUtils.computeParameters(pageContext, paramId, paramName, paramProperty, paramScope,
name, property, scope, transaction);
 
Map params2 = RequestUtils.computeParameters(pageContext, paramId2, paramName2, paramProperty2, paramScope2,
null, null, null, false);
if(params2 != null) params.putAll(params2);
 
Map params3 = RequestUtils.computeParameters(pageContext, paramId3, paramName3, paramProperty3, paramScope3,
null, null, null, false);
if(params3 != null) params.putAll(params3);
 
Map params4 = RequestUtils.computeParameters(pageContext, paramId4, paramName4, paramProperty4, paramScope4,
null, null, null, false);
if(params4 != null) params.putAll(params4);
 
if(indexed) {
IterateTag iterateTag = (IterateTag) findAncestorWithClass(this, IterateTag.class);
if(iterateTag == null) {
JspException e = new JspException(messages.getMessage("indexed.noEnclosingIterate"));
RequestUtils.saveException(pageContext, e);
throw e;
}
 
if(params == null) params = new HashMap();
if(indexId != null)
params.put(indexId, Integer.toString(iterateTag.getIndex()));
else
params.put("index", Integer.toString(iterateTag.getIndex()));
}
 
String url = null;
try {
url = RequestUtils.computeURL(pageContext, forward, href, page, action, params, anchor, false);
}
catch(MalformedURLException ex) {
RequestUtils.saveException(pageContext, ex);
throw new JspException(messages.getMessage("rewrite.url", ex.toString()));
}
 
if(url == null) return null;
 
// add backpath
String currentParams = findBackPath().getCurrentParams();
if(currentParams == null) return url;
 
if(url.indexOf("?") > 0)
return url + "&" + backPathParam + "=" + currentParams;
else
return url + "?" + backPathParam + "=" + currentParams;
}
}