]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/study/importDocument.jsp
Salome HOME
Fix for mantis #0022093: To exclude the "In-Draft" state from drop-down list during...
[tools/siman.git] / Workspace / Siman / WebContent / study / importDocument.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2         pageEncoding="ISO-8859-1"%>
3 <%@ taglib prefix="s" uri="/struts-tags"%>
4
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 />;
10 </s:iterator>
11
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);
18     </s:if>
19     $("#bring #documentType").change(function () {
20         // Hide or show inDraft according to the selected document type
21                 if (hasReview[document.bring.documentType.selectedIndex]) {
22                   // Show inDraft
23                   $("#bring #documentState option[value='inDRAFT']").show();
24                 } else {
25                   // Deselect inDraft if it is selected
26                   if (document.bring.documentState.value == 'inDRAFT') {
27                       document.bring.documentState.selectedIndex = 0;
28                   }
29                   // Hide inDraft
30                   $("#bring #documentState option[value='inDRAFT']").hide();
31                 }
32         }).change();
33 });
34 </script>
35
36 <!-- Import dialog
37      ===========================================================================
38   -->
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"
43         class="text">
44         <tr height="25" valign="middle">
45                 <td><s:text name="message.upload">
46                         <s:param>
47                                 <s:property value="%{fileName}" />
48                         </s:param>
49                 </s:text></td>
50         </tr>
51         <tr height="1" bgcolor="#AAAAAA">
52                 <td></td>
53         </tr>
54 </table>
55
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">
63         <tr height="15">
64                 <td></td>
65         </tr>
66         <tr>
67                 <td align="right"><s:text name="field.documentype" />&nbsp;&nbsp;</td>
68                 <td align="left">&nbsp;<s:text name="field.documentitle" /></td>
69         </tr>
70         <tr>
71                 <td><s:select theme="simple" name="documentType"
72                         id="documentType" list="documentTypes" listKey="index"
73                         listValue="%{getText('type.document.' + getName())}" /> &nbsp;</td>
74                 <td><s:textfield theme="simple" id="documentName"
75                         name="documentName" disabled="true" /></td>
76         </tr>
77         <s:if test="defaultDocumentUses.size > 0">
78                 <tr>
79                         <td align="right"><s:text name="label.uses" />:</td>
80                 </tr>
81                 <s:iterator value="defaultDocumentUses">
82                         <tr>
83                                 <td align="right"><input type="checkbox" name="uses"
84                                         value="<s:property value="index"/>" checked></td>
85                                 <td><s:property value="title" /></td>
86                         </tr>
87                 </s:iterator>
88         </s:if>
89         <tr height="10">
90                 <td></td>
91         </tr>
92         <tr>
93                 <td align="right"><s:submit theme="simple" name="cancel"
94                         key="button.cancel" />&nbsp;</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>
99         </tr>
100 </table>
101 </form>
102 </div>
103 </div>