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();
37 ===========================================================================
39 <div id="article-box">
40 <div id="section"><s:text name="title.import" /></div>
41 <div id="article-body" class="text">
42 <table width="100%" cellpadding="0" cellspacing="0" border="0"
44 <tr height="25" valign="middle">
45 <td><s:text name="message.upload">
47 <s:property value="%{fileName}" />
51 <tr height="1" bgcolor="#AAAAAA">
56 <form name="bring" id="bring" action="valid-import" method="post">
57 <s:hidden name="fileName" /> <s:hidden name="reference" /> <s:hidden
58 name="documentTitle" value="%{documentName}" /> <s:hidden
59 name="defaultDocumentType" value="%{documentType}" /> <s:hidden
60 name="defaultDocumentState" value="%{documentState}" /> <s:hidden
61 name="version" /> <s:hidden name="documentDate" />
62 <table cellpadding="0" cellspacing="0" border="0" class="text">
67 <td align="right"><s:text name="field.documentype" /> </td>
68 <td align="left"> <s:text name="field.documentitle" /></td>
71 <td><s:select theme="simple" name="documentType"
72 id="documentType" list="documentTypes" listKey="index"
73 listValue="%{getText('type.document.' + getName())}" /> </td>
74 <td><s:textfield theme="simple" id="documentName"
75 name="documentName" disabled="true" /></td>
77 <s:if test="defaultDocumentUses.size > 0">
79 <td align="right"><s:text name="label.uses" />:</td>
81 <s:iterator value="defaultDocumentUses">
83 <td align="right"><input type="checkbox" name="uses"
84 value="<s:property value="index"/>" checked></td>
85 <td><s:property value="title" /></td>
93 <td align="right"><s:submit theme="simple" name="cancel"
94 key="button.cancel" /> </td>
95 <td align="left"><s:submit theme="simple" name="save"
96 key="button.import" /> <s:select theme="simple" id="documentState"
97 name="documentState" list="documentStates" listKey="value"
98 listValue="%{getText(key)}" disabled="" /></td>