001: /*
002: ====================================================================
003: Project Name: bugtracker
004: File Name: /src/com/espada/bugtracker/servlets/RemoveBug.java
005: Author: Kishan Peiris <kishan@espadanet.com>
006: Description: View bug details
007: CVS Repository: goliath:/projects/repository/cvsroot/
008: CVS Module: bugtracker
009: Version: CVS $Id: RemoveBug.java,v 1.3 2001/03/15 13:39:23 maxb Exp $
010: ====================================================================
011:
012: ====================================================================
013: Copyright (C) 2001, Silk Road (Pvt.) Ltd.
014: ====================================================================
015: */
016:
017: package com.espada.bugtracker.servlets;
018:
019: import com.sr.espada.se.util.config.*;
020: import com.sr.espada.se.util.logwriter.*;
021: import com.sr.espada.se.util.mail.*;
022:
023: // webmacro resources
024: import org.webmacro.*;
025: import org.webmacro.broker.*;
026: import org.webmacro.resource.*;
027: import org.webmacro.servlet.WebContext;
028:
029: // servlet libraries
030: import javax.servlet.http.*;
031: import javax.servlet.*;
032:
033: // java library
034: import javax.mail.MessagingException;
035: import java.util.*;
036:
037: // bugtracker java apps
038: import com.espada.bugtracker.app.*;
039:
040: public class RemoveBug extends BTServlet {
041:
042: protected void doAction(HttpServletRequest request,
043: HttpServletResponse response, WebContext c) {
044: deleteAbug(request, response, c);
045: };
046:
047: /**************************** Start Of Method deleteAbug ********************************************/
048: /** View bug details of a selected project */
049:
050: public void deleteAbug(HttpServletRequest request,
051: HttpServletResponse response, WebContext c) {
052: HttpSession session = request.getSession();
053:
054: String SuccessLoggedIn = (String) session
055: .getAttribute("loggedIn");
056:
057: boolean loggedIn = false;
058: String update = new String();
059:
060: if (SuccessLoggedIn != null) {
061: if (SuccessLoggedIn.equals("true")) {
062: defaultTemplate = "errorMesg.wm";
063:
064: loggedIn = true;
065:
066: c.put("USER", session.getAttribute("USER"));
067:
068: c.put("currentProject", session
069: .getAttribute("currentProject"));
070:
071: c.put("waite", String.valueOf(session
072: .getAttribute("page")));
073:
074: Bug b = new Bug(Integer.parseInt(request
075: .getParameter("bid")));
076:
077: if (b.delete()) {
078: defaultTemplate = "errorMesg.wm";
079: c.put("errorId", "22");
080: }
081:
082: } else {
083: loggedIn = false;
084:
085: defaultTemplate = "errorMesg.wm";
086:
087: c.put("errorId", "9");
088: }
089: } else {
090: loggedIn = false;
091:
092: defaultTemplate = "errorMesg.wm";
093:
094: c.put("errorId", "9");
095: }
096:
097: c.put("loggedIn", String.valueOf(loggedIn));
098: c.put("myRoleId", session.getAttribute("USERROLE"));
099:
100: } //end of method
101:
102: /**************************** End Of Method deleteAbug ********************************************/
103:
104: } //end of class
|