1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 pageEncoding="ISO-8859-1"%>
3 <%@ taglib prefix="s" uri="/struts-tags"%>
5 <script language="JavaScript">
6 // Flags whether a validation cycle of a document type has Review state.
7 var hasReview = new Array();
8 <s:iterator value="reviewable" status="stat">
9 hasReview[<s:property value="#stat.index"/>]=<s:property />;
12 $(document).ready(function () {
13 $("#bring input[name='documentName']").focus();
14 <s:if test="%{reference == null}">
15 // if versioning then the document name and state can not be modified.
16 $("#bring input[name='documentName']").prop("disabled", false);
17 $("#bring input[name='documentState']").prop("disabled", false);
19 $("#bring #documentType").change(function () {
20 // Hide or show inDraft according to the selected document type
21 if (hasReview[document.bring.documentType.selectedIndex]) {
23 $("#bring #documentState option[value='inDRAFT']").show();
25 // Deselect inDraft if it is selected
26 if (document.bring.documentState.value == 'inDRAFT') {
27 document.bring.documentState.selectedIndex = 0;
30 $("#bring #documentState option[value='inDRAFT']").hide();
34 //hack for displaying document title error message above field labels
36 bring.addEventListener("DOMNodeInserted", function(e) {
41 $('[errorfor="documentName"]').insertAfter($('#fieldError'));
48 ===========================================================================
50 <div id="article-box">
51 <div id="section"><s:text name="title.import" /></div>
52 <div id="article-body" class="text">
53 <table width="100%" cellpadding="0" cellspacing="0" border="0"
55 <tr height="25" valign="middle">
56 <td><s:text name="message.upload">
58 <s:property value="%{fileName}" />
62 <tr height="1" bgcolor="#AAAAAA">
67 <s:form name="bring" id="bring" action="valid-import" method="post" validate="true" cssClass="text">
68 <s:hidden name="fileName" /> <s:hidden name="reference" /> <s:hidden
69 name="documentTitle" value="%{documentName}" /> <s:hidden
70 name="defaultDocumentType" value="%{documentType}" /> <s:hidden
71 name="defaultDocumentState" value="%{documentState}" /> <s:hidden
72 name="version" /> <s:hidden name="documentDate" />
78 <td align="right"><s:text name="field.documentype" /> </td>
79 <td align="left"> <s:text name="field.documentitle" /> <span class="error">*</span></td>
82 <td><s:select theme="simple" name="documentType"
83 id="documentType" list="documentTypes" listKey="index"
84 listValue="%{getText('type.document.' + getName())}" /> </td>
85 <td><s:textfield theme="simple" id="documentName"
86 name="documentName" disabled="true" /></td>
88 <s:if test="defaultDocumentUses.size > 0">
90 <td align="right"><s:text name="label.uses" />:</td>
92 <s:iterator value="defaultDocumentUses">
94 <td align="right"><input type="checkbox" name="uses"
95 value="<s:property value="index"/>" checked></td>
96 <td><s:property value="title" /></td>
105 <s:a action="step-study">
106 <button type='button'><s:text name="button.cancel"/></button>
109 <td align="left"><s:submit theme="simple" name="save"
110 key="button.import" /> <s:select theme="simple" id="documentState"
111 name="documentState" list="documentStates" listKey="value"
112 listValue="%{getText(key)}" disabled="" /></td>