<%@ include file="/shared/initBeans.inc" %> <%@ include file="/shared/header.inc" %> <%@ page language="Java" import="kotkabeans.*,java.util.*,java.sql.*,java.net.*,kakibeans.*" session="true" autoFlush="true" isThreadSafe="true" isErrorPage="false" errorPage="/shared/showError.jsp" %> <% /***************************************************************************** * PAGE DESCRIPTION ****************************************************************************** * * NAME: addComment.jsp * LANGUAGE: JSP * DATE: 03.03.2004 * AUTHOR: Antti Tourunen, Jyväskylän yliopisto, Kuikka-ryhmä * ****************************************************************************** * COPYRIGHT (C) KUIKKA team * Limited rights granted. Please refer to license *****************************************************************************/ /***************************************************************************** * UPDATES ****************************************************************************** * * 03.03.2004 * - First version * 14.05.2004 * - Final version * *****************************************************************************/ // Minimum user right check. // Rights can be found from shared/userCheck.inc. // Must have at least studentrights. pageContext.setAttribute("checkMethod", "SIMPLE"); %> <%@ include file="/shared/userCheck.inc" %> <% // Is form sent? String send = RequestHandler.getString(request, "comment_submit",""); String send2 = RequestHandler.getString(request, "comment_submit_return",""); // Values of form String title = RequestHandler.getString(request, "title",""); String comment = RequestHandler.getString(request, "comment", ""); int type = RequestHandler.getInteger(request, "comment_type", 0); // Event String action = RequestHandler.getString(request,"action","0"); // Possible id's int unitID = RequestHandler.getInteger(request,"unitID",0); int planid = RequestHandler.getInteger(request,"planid",0); int commentID = RequestHandler.getInteger(request,"commentid",0); int editID = RequestHandler.getInteger(request,"editid",0); //int delID = RequestHandler.getInteger(request,"delid",0); //Varmistuksen parametrit //String confirm = RequestHandler.getString(request,"confirm","0"); //String cancel = RequestHandler.getString(request,"cancel","0"); StudyUnitComment editcomment = null; if(action.equals("edit") && editID > 0) { editcomment = new StudyUnitComment(editID); } //no need for delete action /*if(action.equals("delete") && delID > 0) { if(confirm.equals("0") && cancel.equals("0")) { response.sendRedirect("/kotka/shared/confirm.jsp?action=delete&title="+user.T("Oletko varma että haluat poistaa kommentin") +"&delid="+delID); } if(!confirm.equals("0")) { StudyUnitComment delcomment = new StudyUnitComment(delID); delcomment.removeFromDB(); } }*/ if(!title.trim().equals("") && !comment.trim().equals("") && type > 0) { //Different constructors for editing and creating new if(commentID > 0) { StudyUnitComment commentobj = new StudyUnitComment(commentID, type, unitID, user.getPersonID(), user.getCallName()+" "+user.getLastName(), title,comment,new Timestamp(Calendar.getInstance().getTimeInMillis())); commentobj.saveToDB(); }else { StudyUnitComment commentobj = new StudyUnitComment(type, unitID, user.getPersonID(), user.getCallName()+" "+user.getLastName(), title,comment,new Timestamp(Calendar.getInstance().getTimeInMillis())); commentobj.saveToDB(); } } if(!send2.equals("")) { response.sendRedirect("modifyStudyProgram.jsp?planid="+planid); } %> <%@ include file="/shared/menus.inc" %>

<%=user.T("Opintojen suunnittelu")%> > <%=user.T("Muokkaa opintosuunnitelmaa")%> > Perustelut

<%=user.T("FM Tietotekniikka: ")%> <%=user.T("Pakolliset kokonaisuudet: ")%> <%=user.T("Vapaavalintaiset opinnot")%>

<%=user.T("Perustelut")%>

<%@ include file="/shared/showErrorBlock.code" %>
<%if(editID != 0) {%> <%}%>
" size="50" />

<%=StudyUnitComment.printOptions((editID != 0 ? editcomment.getCommentTypeID() : 1 ))%>
" name="comment_submit" /> " name="comment_submit_return" />


<% //New comment object StudyUnitComments commat = new StudyUnitComments(); //Print comments out.println(commat.printCommentsCommentpage(commat.getUnitComments(unitID),user,request)); %> <%@ include file="/shared/footer.inc" %>