1
2
3 package com.pnpconsult.zeiterfassung.actions.user;
4
5 import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse;
7
8 import org.apache.struts.action.ActionForm;
9 import org.apache.struts.action.ActionForward;
10 import org.apache.struts.action.ActionMapping;
11
12 import com.pnpconsult.zeiterfassung.actions.EditSubmitAction;
13 import com.pnpconsult.zeiterfassung.helper.UserManager;
14
15 /***
16 * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a>
17 * @version $Id: InputSubmitAction.java,v 1.7 2004/06/24 20:54:20 powerpete Exp $
18 */
19 public class InputSubmitAction extends EditSubmitAction
20 {
21
22 /***
23 * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
24 */
25 public ActionForward execute(
26 ActionMapping mapping,
27 ActionForm form,
28 HttpServletRequest request,
29 HttpServletResponse response)
30 throws Exception
31 {
32 InputForm inputForm = (InputForm) form;
33 if (inputForm.isAllProjects())
34 {
35 return mapping.getInputForward();
36 }
37 String submit = inputForm.getSubmit();
38 if (submit.matches(".bernehmen"))
39 {
40 if (inputForm.needsCheck())
41 {
42 return mapping.findForward("check");
43 }
44 }
45 else if (submit.equals("Abbrechen"))
46 {
47 inputForm.clear();
48 return mapping.findForward("menu");
49 }
50 else if (submit.equals("Sichern"))
51 {
52 String login = request.getUserPrincipal().getName();
53 new UserManager().saveEntries(login);
54 return mapping.findForward("menu");
55 }
56 ActionForward forward = super.execute(mapping, form, request, response);
57 inputForm.clear();
58 return forward;
59 }
60
61 }