Opraveno generování e-mailu po odeslání vyúčtování služební cesty ke schválení. Text a URL se nyní vygeneruje správně.
closes #219Verze_2.0
parent
933f5e784b
commit
a6799064f7
@ -0,0 +1,29 @@
|
|||||||
|
package info.bukova.isspst;
|
||||||
|
|
||||||
|
import info.bukova.isspst.data.TripBillApproval;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Pepa Rokos
|
||||||
|
*/
|
||||||
|
public class TripBillAprovalUrlResolver implements EntityUrlResolver {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String entityUrl(Object entity) {
|
||||||
|
String defUrl = request.getRequestURL().toString();
|
||||||
|
defUrl = defUrl.substring(0, defUrl.indexOf(request.getServletPath()));
|
||||||
|
|
||||||
|
if (entity instanceof TripBillApproval) {
|
||||||
|
String url = Constants.URL_MAP.get(entity.getClass());
|
||||||
|
|
||||||
|
return defUrl + url + "?select=" + String.valueOf(((TripBillApproval)entity).getBill().getRequirement().getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return defUrl + "/app";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue