<%@ page import="com.atlassian.jira.util.BrowserUtils"%> <%@ page import="org.apache.commons.lang.StringUtils"%> <%@ page import="org.apache.log4j.Logger" %> <%@ taglib uri="webwork" prefix="ww" %> <%@ taglib uri="webwork" prefix="aui" %> <%@ taglib uri="sitemesh-decorator" prefix="decorator" %> <%-- PARAMETERS: (all are optional) action - the URI to submit this form too submitName - the name of the submit button submitId - the id of the submit button (ALWAYS USE THIS!) submitClassName - class name of submit button cancelURI - the location to redirect to for the cancel button (no cancel button if this isn't present) leftButtons - any other buttons to put to the left of the submit button buttons - any other buttons to put next to the submit button autoSelectFirst - unless this is present and "false", the first element of the form will be selected automatically using JavaScript title - a title for this form (HTML) notable - if this is specified, JIRA form will not output a border table (HTML) width - the width of the border table (HTML) multipart - if this parameter is present, the form will be a multipart form helpURL - the URL of a help link related to this form helpURLFragment - the #fragment identifier to append to the helpURL. Value must include the # columns - the number of columns the underlying form will have method - the method of the form to submit (get or post) messageFooter - any HTML content you want to appear in the bottom table row - under the buttons enableFormErrors - disable general errors displayed by hasErrorMessages suppressAtlToken - disable the xsrf token, by default it is enabled --%> <%! private static final Logger log = Logger.getLogger("jiraform.jsp"); %> <% // Set some defaults String columns = (p.isPropertySet("columns")) ? p.getProperty("columns") : "2"; boolean displayGeneralErrors = (p.isPropertySet("enableFormErrors")) ? p.getBooleanProperty("enableFormErrors") : true; int columnsInt = Integer.parseInt(columns); request.setAttribute("modifierKey", BrowserUtils.getModifierKey()); %> <% if (StringUtils.isNotBlank(p.getProperty("labelWidth"))) { %> <% } %> <% if (p.isPropertySet("action")) { %>
" method="" name="" <% if (p.isPropertySet("onsubmit")) { %>onsubmit="" <% } else { %>onsubmit="if (this.submitted) return false; this.submitted = true; return true"<% } %> <% if (p.isPropertySet("multipart")) { %> ENCTYPE="multipart/form-data"<% } %><% if (p.isPropertySet("autocomplete")) { %> autocomplete=""<% } %> <% if (p.isPropertySet("class")) { %> class=""<% } %>> <% } %> <% if (!p.isPropertySet("notable")) { %> maxWidth<%}%>" <% if (p.isPropertySet("jiraformId")) { %>id=""<%}%> <% if (p.isPropertySet("width") && !p.getProperty("width").equals("100%")){%>width=""<%}%>> <% } %> <% if (p.isPropertySet("title") && StringUtils.isNotBlank(p.getProperty("title"))) { %> <% } %> <% if (StringUtils.isNotBlank(p.getProperty("description"))) { %> <% } %> <% if (StringUtils.isNotBlank(p.getProperty("instructions"))) { %> <% } %> <%-- formwide error messages --%> <% if (displayGeneralErrors) { %> <% } %> <% if (p.isPropertySet("wizard") && "true".equalsIgnoreCase(p.getProperty("wizard"))) { %> <% } else if (p.isPropertySet("cancelURI") || p.isPropertySet("buttons") || p.isPropertySet("submitName") || p.isPropertySet("leftButtons")){%> <% if (columnsInt > 1) { %> <% } %> <%-- Forward the return url --%> <% if (p.isPropertySet("messageFooter")) { %> <% } %> <% if (!p.isPropertySet("notable")) { %>
<% if (p.isPropertySet("pretitle")) { %> <% } if (p.isPropertySet("localHelpAction")) { String action = p.getProperty("localHelpAction"); %> <%=action%> this style="float:right;" <% } if (p.isPropertySet("helpURL")) { String helpUrl = "'" + p.getProperty("helpURL") + "'"; String helpURLFragment = ""; if (p.isPropertySet("helpURLFragment")) helpURLFragment = p.getProperty("helpURLFragment"); %> <%= helpURLFragment %> <% } %>

<% if (p.isPropertySet("wizard") && "true".equalsIgnoreCase(p.getProperty("wizard"))) { %> ( )<%}%>

<% if (p.isPropertySet("postTitle") && StringUtils.isNotBlank(p.getProperty("postTitle"))) { %> <%}%>
error

<% if (!p.isPropertySet("finishButton")) { %> <% } else { request.setAttribute("nextLabel", p.getProperty("finishButton")); } %> " /> " accesskey="N" /> " accesskey="P" disabled="disabled" /> " accesskey="" title=" " /> <% if (p.isPropertySet("buttons")) { %> <% } %> <% if (p.isPropertySet("cancelURI")) { %> <%= request.getContextPath() %>" id="cancelButton" class="aui-button aui-button-link" accesskey="" title=" ( + )" name=""> <% } %>
  <% } else { %> <% } %>
<% if (p.isPropertySet("leftButtons")) { %> <% } %> <% if (StringUtils.isNotBlank(p.getProperty("submitName"))) { %> " value="" <% if (StringUtils.isBlank(p.getProperty("submitId"))) { %> id="" <% log.info("i18n problem: id defined by localised value: " + p.getProperty("submitName")); } else {%> id="" <% } %> <% if (StringUtils.isBlank(p.getProperty("submitAccessKey"))) { %> accesskey="" title=" " <% } else {%> accesskey="" title=" ( + )" <%}%> <% if (p.isPropertySet("onclicksubmit")) { %>onclick=""<% } %> class="aui-button <% if (p.isPropertySet("submitClassName")) { %><% } %>" /> <% } %> <% if (p.isPropertySet("buttons")) { %> <% } %> <% if (p.isPropertySet("cancelURI")) { %> <%= request.getContextPath() %>" id="cancelButton" class="aui-button aui-button-link" accesskey="" title=" ( + )" name=""> <% } %>
<% } %> <% if (p.isPropertySet("action")) { %> <% if (!p.isPropertySet("suppressAtlToken")) { %> <% } %> <%-- This enables the first element of the form to be automatically selected. Always on unless autoSelectFirst=false --%> <% if (!p.isPropertySet("autoSelectFirst") || !p.getProperty("autoSelectFirst").equals("false")) { %> <% } %> <% } %>