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