<% String projectId = person.getProject(); String title = null; String description = null; String requiredMark = "*"; Issue issue = null; if (issueId > 0) { //edit.jsp title = label.get("view_edit", projectId); description = new StringBuffer() .append(label.get("issue_response", projectId)) .append(requiredMark) .append("") .append("
") .append(label.get("issue_response_detail", projectId)) .append("
").toString(); try { issue = Issue.load(projectId, issueId); } catch (Exception e) { out.print("
"); out.print(e.getMessage()); out.print("
"); return; } } else { //create.jsp title = label.get("create_new", projectId); description = new StringBuffer() .append(label.get("issue_description", projectId)) .append(requiredMark) .append("") .append("
") .append(label.get("issue_description_detail", projectId)) .append("
").toString(); } String formId = request.getParameter("formId"); IssueForm issueForm = null; if (formId == null) { formId = IdGenerator.getId(); if (issue != null) { issueForm = new IssueForm(issue); //edit.jsp // the issueForm below is for the original issue, need a different instance. session.setAttribute("issue"+issueId, new IssueForm(issue)); } else { issueForm = new IssueForm(projectId); //create.jsp } session.setAttribute("issueForm"+formId, issueForm); } else { issueForm = (IssueForm)session.getAttribute("issueForm"+formId); } if (issueForm == null) { out.print("
"); out.print(MessageCode.get("servlet.issue.state_invalid")); out.print("
"); return; } Project conf = Project.getInstance(projectId); String[] nextAllowed = null; String forbiddenState = null; if (issue != null) { //we need these only for edit.jsp nextAllowed = conf.getWorkflow().nextAllowed(issue.get("state"), person.getGroup()); forbiddenState=issue.get("state"); for (int i=0; i

field'))return false; <% if (issue != null) { %> if(!assert(state.options[state.selectedIndex].value != '<%=forbiddenState%>','Please change the <%=label.getEscaped("state")%> appropriately'))return false; <% } %> if(!validEmailList(cc_mail))return false; if(isEmpty(issue_description,'Please fill in the <%=label.getEscaped("issue_response", projectId)%> field'))return false; }"> <% if (issue != null) { %> <% if (current_assigned != null) { %> <% } } %> <% if( (field=conf.getField("project_area")) != null && (optionList=field.getValue()) != null) { %> <% } %> <% for (int i=1; i<=CUSTOM_FIELDS; i++) { String fieldName = "field_"+i; if( (field = conf.getField(fieldName)) != null && (optionList=field.getValue()) != null) { %> <% } else if (field.isTextField()) { %> <% } else { %> <% }}} %> <% if((optionList=conf.getField("issue_type").getValue()) != null) { %> <% } %> <% if (issue != null) { %> <% } %> <% if((optionList=conf.getField("severity").getValue()) != null) { %> <% } %> <% if ( !Group.isGuest(person.getGroup()) ) { // this is for non-guest // Users of group guest are not allowed to manually assign or re-assign // priority/responsible by default. // You can change this policy by editing this block of the code if((optionList=conf.getField("priority").getValue()) != null) { %> <% } %> <% } else { if((optionList=conf.getField("priority").getValue()) != null) { if (issue != null) { %> <% } else { //create.jsp, add a hidden NA %> <% } } if (issue != null) { //edit.jsp, show only the current responsible %> <% } } //code block ends here %> <% String cc_mail = issueForm.get("cc_mail"); // if you want the original submitter always get the email, uncomment the following block. /* if (issue != null) { // only for edit.jsp String submitter_email = conf.getAccess().getEmail(issue.get("author")); if (submitter_email != null) { if (cc_mail == null) { cc_mail = submitter_email; } else if (cc_mail.indexOf(submitter_email)==-1) { cc_mail = submitter_email+';'+cc_mail; } } } */ %>
<%=title%> <% if (issue != null) { %> (<%=label.get("issue_id", projectId)%> <%=issueId%>) <% } %>
<%=label.get("required_field_asterisks")%>
<%=label.get("project_area", projectId)%>
<%=label.get(fieldName, projectId)%> <% if (field.isTextAreaField()) { %>
<%=label.get("issue_type", projectId)%>
<%=label.get("state", projectId)%>
<%=label.get("severity", projectId)%>
<%=label.get("priority", projectId)%>
<%=label.get("responsible", projectId)%>
<%=label.get("priority", projectId)%>
<%=label.get("responsible", projectId)%>
<%=label.get("synopsis", projectId)%><%=requiredMark%>
<%=description%>
<%=label.get("attachment", projectId)%> <% Attachment attachment = issueForm.getAttachment(); if (attachment != null) { String[] filenames = attachment.getFilenames(); if (filenames != null) { for (int i=0; i 0) out.print(";"); out.print(filenames[i]); } } } %>  
<%=label.get("cc_mail", projectId)%>
<% if (issue==null || nextAllowed.length > 0) { String checked = ""; if (issueForm.get("no_email") != null) { checked = "checked"; } %> No email notification >     "> "> <% } else { %> <%=HtmlParser.escapeTag(MessageCode.get("jsp.no_allowed_state"))%> <% } %>