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'));
46 $(document).ready(function () {
47 $("#bring #documentType").change(function () {
50 url:'update-uses.action?documentType=' + $('#documentType').val(),
51 success: function(data){
52 $("#bring .dynamic").remove();
53 $(data).insertBefore("#bring .inner");
61 ===========================================================================
63 <div id="article-box">
64 <div id="section"><s:text name="title.import" /></div>
65 <div id="article-body" class="text">
66 <table width="100%" cellpadding="0" cellspacing="0" border="0"
68 <tr height="25" valign="middle">
69 <td><s:text name="message.upload">
71 <s:property value="%{fileName}" />
75 <tr height="1" bgcolor="#AAAAAA">
80 <s:form name="bring" id="bring" action="valid-import" method="post" validate="true" cssClass="text">
81 <s:hidden name="fileName" /> <s:hidden name="reference" /> <s:hidden
82 name="documentTitle" value="%{documentName}" /> <s:hidden
83 name="defaultDocumentType" value="%{documentType}" /> <s:hidden
84 name="defaultDocumentState" value="%{documentState}" /> <s:hidden
85 name="version" /> <s:hidden name="documentDate" />
91 <td align="right"><s:text name="field.documentype" /> </td>
92 <td align="left"> <s:text name="field.documentitle" /> <span class="error">*</span></td>
95 <td><s:select theme="simple" name="documentType"
96 id="documentType" list="documentTypes" listKey="index"
97 listValue="%{getText('type.document.' + getName())}" /> </td>
98 <td><s:textfield theme="simple" id="documentName"
99 name="documentName" disabled="true" /></td>
101 <s:if test="defaultDocumentUses.size > 0">
103 <td align="right"><s:text name="label.uses" />:</td>
105 <s:iterator value="defaultDocumentUses">
107 <td align="right"><input type="checkbox" name="uses"
108 value="<s:property value="index"/>" checked></td>
109 <td><s:property value="title" /></td>
114 <tr height="10" class ="inner">
119 <s:a action="step-study">
120 <button type='button'><s:text name="button.cancel"/></button>
123 <td align="left"><s:submit theme="simple" name="save"
124 key="button.import" /> <s:select theme="simple" id="documentState"
125 name="documentState" list="documentStates" listKey="value"
126 listValue="%{getText(key)}" disabled="" /></td>