]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/study/editStudyProperties.jsp
Salome HOME
Menus are improved
[tools/siman.git] / Workspace / Siman / WebContent / study / editStudyProperties.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@ page import="java.util.Iterator"%>
5 <%@ page import="com.opensymphony.xwork2.util.ValueStack"%>
6 <%@ page import="com.opensymphony.xwork2.ActionContext"%>
7 <%@ page import="org.splat.simer.StudyPropertiesAction"%>
8 <%@ page import="org.splat.dal.bo.kernel.User"%>
9 <%@
10     taglib prefix="s" uri="/struts-tags"
11 %>
12 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
13
14 <%  String              action = request.getParameter("action");   
15     if (action == null) action = "display";
16 %>
17 <s:set var="todo"><%=action%></s:set>
18 <s:url id="edititle" namespace="/study" action="edit-title" />
19 <s:url id="edibutor" namespace="/study" action="edit-contributor" />
20 <s:url id="addcycle" namespace="/study" action="edit-cycle">
21   <s:param name="cycle" value="%{'default'}"/>
22 </s:url>
23 <s:url id="undo"     namespace="/study" action="prop-study" />
24 <html>
25
26   <head>
27     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
28     <title><s:text name="name.module"/></title>
29     <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
30     <script language="JavaScript">
31
32     function setType () {
33 //  -------------------
34       var type   = edit.documentType.value;
35 //    if (type == "0") edit.saveCycle.disabled = true;
36 //    else             edit.saveCycle.disabled = false;
37     }
38     </script>
39   </head>
40
41   <body>
42 <!-- Menu-bar
43      =============================================================================================================================
44   -->
45     <jsp:include page="/jsp/menubar.jsp" />
46
47 <!-- Title-bar
48      =============================================================================================================================
49   -->
50     <jsp:include page="/jsp/titlebar.jsp">
51       <jsp:param name="entity"  value="study" />
52       <jsp:param name="disable" value="true" />
53     </jsp:include>
54
55 <!-- Left pane
56      =============================================================================================================================
57   -->
58     <div id=left-pane>
59       <jsp:include page="/jsp/toolbar.jsp">
60         <jsp:param name="tools" value="back" />
61       </jsp:include>
62       <div id=top-spacer></div>
63       <jsp:include page="/jsp/menuitem.jsp">
64         <jsp:param name="menu" value="open" />
65       </jsp:include>
66       <jsp:include page="/jsp/studyProperties.jsp" />
67     </div>
68
69 <!-- Properties form
70      =============================================================================================================================
71   -->
72     <div id=main-pane>
73       <div id=article-box>
74         <div id=section>
75           <s:text name="title.prop.study" />
76         </div>
77         <div id=article-body class=text>
78
79           <form name="edit" action="valid-edit" method="post">
80           <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
81
82             <tr height=10><td width=20></td></tr>
83             <tr>
84               <td width=16><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
85               <td width=24%><b><s:text name="field.studytitle"/></b></td>
86               <td width=23%></td>
87               <td width=23%></td>
88               <td width=23%></td>
89               <td width=24></td>
90             </tr>
91             <tr height=5><td></td></tr>
92             <tr height=26>
93 <%  if (action.equals("edititle")) {
94 %>
95               <td>
96                 <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
97               </td>
98               <td colspan=4>
99                 <input type=text size="108" name=title value="<s:property value="studyTitle"/>">
100               </td>
101               <td align=right>
102                 <button type="submit" name="saveTitle" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
103                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
104                 </button>
105               </td>
106 <%  } else {
107 %>            <td>
108                 <s:if test="#todo == 'display'"><s:a href="%{#edititle}"><img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.edit.title"/>"/></s:a></s:if>
109               </td>
110               <td colspan=4><s:property value="studyTitle"/></td>
111 <%  }
112 %>          </tr>
113             <tr height=10><td width=20></td></tr>
114             <tr>
115               <td><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
116               <td><b><s:text name="label.members"/></b></td>
117             </tr>
118             <tr height=5><td></td></tr>       
119 <%  if (action.equals("edibutor")) {
120 %>
121             <tr>
122               <td>
123                 <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
124               </td>
125               <td><s:text name="label.presents"/></td>
126               <td colspan=3><s:text name="label.absents"/></td>
127               <td align=right>
128                 <button type="submit" name="saveContributors" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
129                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
130                 </button>
131               </td>
132             </tr>
133             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
134 <%
135 //    Scriptlet implementation is required due to specific iteration
136       ValueStack             stack     = ActionContext.getContext().getValueStack();
137       Object                 stacktop  = stack.peek();
138       StudyPropertiesAction  controler = (StudyPropertiesAction)stacktop;
139
140       Iterator<User>         members   = controler.getContributors().iterator();
141       for (Iterator<User>    staff     = controler.getCandidates().iterator(); staff.hasNext(); ) {
142         out.print("<tr>");
143           if (members.hasNext()) {
144             User  user = members.next();
145             out.print("<td><input type=checkbox name=\"members\" value=\"" + String.valueOf(String.valueOf(user.getIndex())) + "\" checked/></td>");
146             out.print("<td>");
147               out.print(user.toString());
148             out.print("</td>");
149           } else {
150             out.print("<td></td><td></td>");
151           }
152           for (int j=0; j<3; j++) {
153           if (staff.hasNext()) {
154                   User user = staff.next();
155             out.print("<td><input type=checkbox name=\"candidates\" value=\"" + String.valueOf(user.getIndex()) + "\" />&nbsp;");
156               out.print(user.toString());
157             out.print("</td>");
158           } else {
159             out.print("<td></td>");
160           }
161           }
162         out.print("</tr>");
163       }
164       while (members.hasNext()) {
165         User  user = members.next();
166         out.print("<tr>");
167           out.print("<td><input type=checkbox name=\"members\" value=\"" + String.valueOf(user.getIndex()) + "\" checked/></td>");
168           out.print("<td>");
169             out.print(user.toString());
170           out.print("</td>");
171         out.print("</tr>");
172       }
173     } else {
174 %>          <tr>
175               <td></td>
176               <td><s:text name="label.contributor"/></td>
177               <td></td>
178               <td></td>
179               <td><s:text name="label.manager"/></td>
180             </tr>
181             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
182             <tr>
183               <td>
184                 <s:if test="#todo == 'display'"><s:a href="%{#edibutor}"><img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.edit.members"/>"/></s:a></s:if>
185               </td>
186               <td colspan=3>
187                     <s:if test="contributors.size > 0">
188                       <s:iterator value="contributors" status="counter">
189                         <s:if test="#counter.last"><s:property value="toString()"/></s:if>
190                         <s:else><s:property value="toString()"/>,</s:else>
191                       </s:iterator>
192                     </s:if><s:else>
193                       <s:property value="%{'-'}"/>
194                     </s:else>
195               </td>
196               <td><s:property value="%{author.toString()}"/></td>
197             </tr>
198 <%  }
199 %>          <tr height=15><td width=20></td></tr>
200             <tr>
201               <td><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
202               <td><b><s:text name="label.approcycle"/></b></td>
203             </tr>
204             <tr height=5><td></td></tr>
205             <tr>
206               <td></td>
207               <td><s:text name="field.documentype"/></td>
208               <td><s:text name="label.PROMOTION"/></td>
209               <td><s:text name="label.REVIEW"/></td>
210               <td><s:text name="label.APPROVAL"/></td>
211             </tr>
212             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
213
214             <s:set var="edited" value="cycle"/>
215             <s:set var="height" value=""/>
216             <s:iterator value="validations" status="counter">
217             <s:url id="edicycle" namespace="/study" action="edit-cycle">
218               <s:param name="cycle" value="documentType"/>
219             </s:url>
220             <s:if test="#counter.last"><s:set var="height" value="24"/></s:if>
221             <tr height="<s:property value="#height"/>">
222               <td>
223                 <s:if test="#todo == 'display'">
224                   <s:if test="#counter.last">
225                     <s:if test="otherDocumentTypes.size > 0">
226                     <s:a href="%{#addcycle}">
227                       <img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.addvalidation"/>" />
228                     </s:a>
229                     </s:if>
230                   </s:if><s:else>
231                   <s:a href="%{#edicycle}">
232                     <img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.editvalidation"/>" />
233                   </s:a>
234                   </s:else>
235                 </s:if><s:elseif test="#todo == 'edicycle' && documentType == #edited">
236                   <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
237                 </s:elseif>
238               </td>
239               <td>
240               <s:if test="#counter.last">
241                 <s:if test="#todo == 'edicycle' && documentType == #edited">
242                 <select name="documentType" onChange="setType()">
243                   <option value="0">&nbsp;<s:text name="menu.select"/></option>
244                   <s:iterator value="otherDocumentTypes">         
245                     <option value="<s:property value="index"/>"><s:text name="type.document.%{name}"/></option>
246                   </s:iterator>   
247                 </select>
248                 </s:if><s:else>
249                   <s:if test="validations.size > 0"><i><s:text name="label.other"/></i></s:if>
250                   <s:else><i><s:text name="label.all"/></i></s:else>
251                 </s:else>
252               </s:if><s:else>
253                 <s:if test="#todo == 'edicycle' && documentType == #edited">
254                   <input type="hidden" name="documentType" value="<s:property value="documentTypeIndex"/>"/>
255                 </s:if>
256                   <s:text name="type.document.%{documentType}"/>
257               </s:else>
258               </td>
259               <td>
260               <s:if test="#todo == 'edicycle' && documentType == #edited">
261                 <s:set var="selection" value="publisherIndex"/>
262                 <select name="publisher">
263                   <option value="0"><s:text name="label.bytheauthor"/></option>
264                   <s:if test="%{#selection != 0}"><option value="<s:property value="#selection"/>" selected><s:text name="label.me"/></option></s:if>
265                   <s:else><option value="<s:property value="author.index"/>"><s:text name="label.me"/></option></s:else>
266                 </select>
267               </s:if><s:else>
268                 <s:if test="publisherIndex > 0"><s:property value="publisherName"/></s:if>
269                 <s:else><i><s:property value="publisherName"/></i></s:else>
270               </s:else>
271               </td>
272               <td>
273               <s:if test="#todo == 'edicycle' && documentType == #edited">
274                 <s:set var="selection" value="reviewerIndex"/>
275                 <select name="reviewer">
276                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
277                   <s:iterator value="validationActors">         
278                     <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="toString()"/></option></s:if>
279                     <s:else><option value="<s:property value="index"/>"><s:property value="toString()"/></option></s:else>
280                   </s:iterator>   
281                 </select>
282               </s:if><s:else>
283                 <s:if test="reviewerIndex > 0"><s:property value="reviewerName"/></s:if>
284                 <s:else><font color="#A1A192"><i><s:property value="reviewerName"/></i></font></s:else>
285               </s:else>
286               </td>
287               <td>
288               <s:if test="#todo == 'edicycle' && documentType == #edited">
289                 <s:set var="selection" value="approverIndex"/>
290                 <select name="approver">
291                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
292                   <s:iterator value="validationActors">         
293                     <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="toString()"/></option></s:if>
294                     <s:else><option value="<s:property value="index"/>"><s:property value="toString()"/></option></s:else>
295                   </s:iterator>   
296                 </select>
297               </s:if><s:else>
298                 <s:if test="approverIndex > 0"><s:property value="approverName"/></s:if>
299                 <s:else><font color="#A1A192"><i><s:property value="approverName"/></i></font></s:else>
300               </s:else>
301               </td>
302               <td align=right>
303               <s:if test="#todo == 'edicycle' && documentType == #edited">
304                 <button type="submit" name="saveCycle" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
305                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
306                 </button>
307               </s:if>
308               </td>
309             </tr>
310             </s:iterator>
311             <tr height=3><td></td></tr>
312             </table>
313           </form>
314         </div>
315       </div>
316     </div>
317
318   </body>
319 </html>