]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/study/editStudyProperties.jsp
Salome HOME
- Back-arrow is added when the user selects the new product on the new study screen
[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 <%@ taglib prefix="s" uri="/struts-tags"%>
10
11 <s:if test="actionType == null">
12         <s:set var="todo">display</s:set>
13 </s:if>
14 <s:else>
15         <s:set var="todo">
16                 <s:property value="actionType" />
17         </s:set>
18 </s:else>
19
20 <s:url id="edititle" namespace="/study" action="edit-title" />
21 <s:url id="edibutor" namespace="/study" action="edit-contributor" />
22 <s:url id="addcycle" namespace="/study" action="edit-cycle">
23   <s:param name="cycle" value="%{'default'}"/>
24 </s:url>
25 <s:url id="undo"     namespace="/study" action="prop-study" />
26 <script language="JavaScript">
27     function setType () {
28       var type   = edit.documentType.value;
29     }
30 </script>
31
32 <!-- Properties form
33      =============================================================================================================================
34   -->
35       <div id=article-box>
36         <div id=section>
37           <s:text name="title.prop.study" />
38         </div>
39         <div id=article-body class=text>
40
41           <s:form name="edit" action="valid-edit" method="post" validate="true" cssClass="text">
42
43             <tr height=10><td width=20></td></tr>
44             <tr>
45               <td width=16><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
46               <td width=24%><b><s:text name="field.studytitle"/></b></td>
47               <td width=23%></td>
48               <td width=23%></td>
49               <td width=23%></td>
50               <td width=24></td>
51             </tr>
52             <tr height=5><td></td></tr>
53             <tr height=26>
54             
55             <s:if test="actionType eq 'edititle'">
56               <td>
57                 <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
58               </td>
59               <td colspan=4>
60                 <s:textfield size="108" name="title" value="%{studyTitle}" theme="simple"/>
61               </td>
62               <td align=right>
63                 <s:submit type="button" name="saveTitle" value="" cssStyle="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent" theme="simple">
64                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
65                 </s:submit>
66               </td>
67               </s:if>
68               <s:else>
69
70                   <td>
71                 <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>
72               </td>
73               <td colspan=4><s:property value="studyTitle"/></td>
74               </s:else>
75               
76                 </tr>
77             <tr height=10><td width=20></td></tr>
78             <tr>
79               <td><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
80               <td><b><s:text name="label.members"/></b></td>
81             </tr>
82             <tr height=5><td></td></tr>    
83             
84             <s:if test="actionType eq 'edibutor'">   
85             <tr>
86               <td>
87                 <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
88               </td>
89               <td><s:text name="label.presents"/></td>
90               <td colspan=3><s:text name="label.absents"/></td>
91               <td align=right>
92                 <button type="submit" name="saveContributors" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
93                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
94                 </button>
95               </td>
96             </tr>
97             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
98 <%
99 //    Scriptlet implementation is required due to specific iteration
100       ValueStack             stack     = ActionContext.getContext().getValueStack();
101       Object                 stacktop  = stack.peek();
102       StudyPropertiesAction  controler = (StudyPropertiesAction)stacktop;
103
104       Iterator<User>         members   = controler.getContributors().iterator();
105       for (Iterator<User>    staff     = controler.getCandidates().iterator(); staff.hasNext(); ) {%>
106         <tr>
107         <%if (members.hasNext()) {
108             User  user = members.next();%>
109             <td><input type="checkbox" name="members" value="<%=String.valueOf(user.getIndex())%>" checked/></td>
110             <td>
111             <%=controler.getText(user.getDisplayName())%>
112             </td>
113           <%} else {%>
114             <td></td><td></td>
115           <%}
116           for (int j=0; j<3; j++) {
117           if (staff.hasNext()) {
118                   User user = staff.next();%>
119             <td><input type="checkbox" name="candidates" value="<%=String.valueOf(user.getIndex())%>" />&nbsp;
120            <%=controler.getText(user.getDisplayName())%>
121             </td>
122           <%} else {%>
123             <td></td>
124           <%}
125           }%>
126         </tr>
127       <%}
128       while (members.hasNext()) {
129         User  user = members.next();%>
130         <tr>
131           <td><input type="checkbox" name="members" value="<%=String.valueOf(user.getIndex())%>" checked/></td>
132           <td>
133            <%=controler.getText(user.getDisplayName())%>
134           </td>
135         </tr>
136       <%}%>
137       </s:if>
138           <s:else>
139           <tr>
140               <td></td>
141               <td><s:text name="label.contributor"/></td>
142               <td></td>
143               <td></td>
144               <td><s:text name="label.manager"/></td>
145             </tr>
146             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
147             <tr>
148               <td>
149                 <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>
150               </td>
151               <td colspan=3>
152                     <s:if test="contributors.size > 0">
153                       <s:iterator value="contributors" status="counter">
154                         <s:if test="#counter.last"><s:property value="getText(displayName)"/></s:if>
155                         <s:else><s:property value="getText(displayName)"/>,</s:else>
156                       </s:iterator>
157                     </s:if><s:else>
158                       <s:property value="%{'-'}"/>
159                     </s:else>
160               </td>
161               <td><s:property value="%{getText(author.displayName)}"/></td>
162             </tr>
163             </s:else>
164
165         <!-- Readers functionality -->
166             <tr height=10><td width=20></td></tr>
167             <tr>
168               <td><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
169               <td><b><s:text name="label.readers.section"/></b></td>
170             </tr>
171             <tr height=5><td></td></tr>
172             
173             <s:if test="actionType eq 'editReaders'">
174                   <tr>
175                       <td>
176                         <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
177                       </td>
178                       
179                       <td><s:text name="label.readers.present"/></td>
180                       <td colspan=3><s:text name="label.readers.absents"/></td>
181                       <td align=right>
182                         <button type="submit" name="saveReaders" value=""
183                             style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
184                           <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
185                         </button>
186                       </td>
187                   </tr>
188                   <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
189                   
190             
191               <tr>
192                 <td></td>
193                 <td valign="top">
194                   <table border="0" cellpadding="0" cellspacing="0">
195                   <s:iterator value="readers">
196                     <tr>
197                       <td>
198                         <s:checkbox name="readerIds" fieldValue="%{index}" theme="simple"  value="true" /> &nbsp;
199                           <s:property value="%{getText(displayName)}"/>
200                       </td>
201                     </tr>
202                   </s:iterator>
203                   </table>
204                 </td>
205                 
206                 <td colspan="3" valign="top">
207                   <table border="0" cellpadding="0" cellspacing="0" width="100%">
208                     <tr>
209                       <s:iterator value="candidates" status="status">
210                         <td>
211                           <s:checkbox name="readerIds" fieldValue="%{index}" theme="simple"/> &nbsp;
212                           <s:property value="%{getText(displayName)}"/>
213                         </td>
214                         <s:if test="%{(#status.index + 1) % 3 == 0}">
215                             </tr>
216                             <tr>
217                         </s:if>
218                       </s:iterator>
219                     </tr>
220                   </table>
221                 </td>
222                   
223               </tr>
224             </s:if>
225             <s:else>
226               <tr><td/><td><s:text name="label.readers"/></td></tr>
227               <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
228               <tr>
229                 <td>
230                   <s:if test="#todo == 'display'"> <s:a namespace="/study" action="init-edit-readers" >
231                       <img src="<s:url value="/skin/icon.ed.png"/>" border="none" 
232                             title="<s:text name="tooltip.edit.readers"/>"/>
233                   </s:a> </s:if>
234                 </td>
235                 <td colspan="4">
236                   <s:iterator value="readers" status="counter">
237                     <s:if test="#counter.last"><s:property value="%{getText(displayName)}"/></s:if>
238                     <s:else><s:property value="%{getText(displayName)}"/>,</s:else>
239                   </s:iterator>
240                 </td>
241               </tr>
242             </s:else>
243
244
245             <tr height=15><td width=20></td></tr>
246             <tr>
247               <td><img src="<s:url value="/skin/image.downarrow.png"/>" border="none"/></td>
248               <td><b><s:text name="label.approcycle"/></b></td>
249             </tr>
250             <tr height=5><td></td></tr>
251             <tr>
252               <td></td>
253               <td><s:text name="field.documentype"/></td>
254               <td><s:text name="label.PROMOTION"/></td>
255               <td><s:text name="label.REVIEW"/></td>
256               <td><s:text name="label.APPROVAL"/></td>
257             </tr>
258             <tr height=1 bgcolor=#AAAAAA><td colspan=6></td></tr>
259
260             <s:set var="edited" value="cycle"/>
261             <s:set var="height" value=""/>
262             <s:iterator value="validations" status="counter">
263             <s:url id="edicycle" namespace="/study" action="edit-cycle">
264               <s:param name="cycle" value="documentType"/>
265             </s:url>
266             <s:if test="#counter.last"><s:set var="height" value="24"/></s:if>
267             <tr height="<s:property value="#height"/>">
268               <td>
269                 <s:if test="#todo == 'display'">
270                   <s:if test="#counter.last">
271                     <s:if test="otherDocumentTypes.size > 0">
272                     <s:a href="%{#addcycle}">
273                       <img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.addvalidation"/>" />
274                     </s:a>
275                     </s:if>
276                   </s:if><s:else>
277                   <s:a href="%{#edicycle}">
278                     <img src="<s:url value="/skin/icon.ed.png"/>" border="none" title="<s:text name="tooltip.editvalidation"/>" />
279                   </s:a>
280                   </s:else>
281                 </s:if><s:elseif test="#todo == 'edicycle' && documentType == #edited">
282                   <s:a href="%{#undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="button.cancel"/>"/></s:a>
283                 </s:elseif>
284               </td>
285               <td>
286               <s:if test="#counter.last">
287                 <s:if test="#todo == 'edicycle' && documentType == #edited">
288                 <select name="documentType" onChange="setType()">
289                   <option value="0">&nbsp;<s:text name="menu.select"/></option>
290                   <s:iterator value="otherDocumentTypes">         
291                     <option value="<s:property value="index"/>"><s:text name="type.document.%{name}"/></option>
292                   </s:iterator>   
293                 </select>
294                 </s:if><s:else>
295                   <s:if test="validations.size > 0"><i><s:text name="label.other"/></i></s:if>
296                   <s:else><i><s:text name="label.all"/></i></s:else>
297                 </s:else>
298               </s:if><s:else>
299                 <s:if test="#todo == 'edicycle' && documentType == #edited">
300                   <input type="hidden" name="documentType" value="<s:property value="documentTypeIndex"/>"/>
301                 </s:if>
302                   <s:text name="type.document.%{documentType}"/>
303               </s:else>
304               </td>
305               <td>
306               <s:if test="#todo == 'edicycle' && documentType == #edited">
307                 <s:set var="selection" value="publisherIndex"/>
308                 <select name="publisher">
309                   <option value="0"><s:text name="label.bytheauthor"/></option>
310                   <s:if test="%{#selection != 0}"><option value="<s:property value="#selection"/>" selected><s:text name="label.me"/></option></s:if>
311                   <s:else><option value="<s:property value="author.index"/>"><s:text name="label.me"/></option></s:else>
312                 </select>
313               </s:if><s:else>
314                 <s:if test="publisherIndex > 0"><s:property value="publisherName"/></s:if>
315                 <s:else><i><s:property value="publisherName"/></i></s:else>
316               </s:else>
317               </td>
318               <td>
319               <s:if test="#todo == 'edicycle' && documentType == #edited">
320                 <s:set var="selection" value="reviewerIndex"/>
321                 <select name="reviewer">
322                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
323                   <s:iterator value="validationActors">         
324                     <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="getText(displayName)"/></option></s:if>
325                     <s:else><option value="<s:property value="index"/>"><s:property value="getText(displayName)"/></option></s:else>
326                   </s:iterator>   
327                 </select>
328               </s:if><s:else>
329                 <s:if test="reviewerIndex > 0"><s:property value="reviewerName"/></s:if>
330                 <s:else><font color="#A1A192"><i><s:property value="reviewerName"/></i></font></s:else>
331               </s:else>
332               </td>
333               <td>
334               <s:if test="#todo == 'edicycle' && documentType == #edited">
335                 <s:set var="selection" value="approverIndex"/>
336                 <select name="approver">
337                   <option value="0">-&nbsp;<s:text name="label.skipped"/>&nbsp;-</option>
338                   <s:iterator value="validationActors">         
339                     <s:if test="%{index == #selection}"><option value="<s:property value="index"/>" selected><s:property value="getText(displayName)"/></option></s:if>
340                     <s:else><option value="<s:property value="index"/>"><s:property value="getText(displayName)"/></option></s:else>
341                   </s:iterator>   
342                 </select>
343               </s:if><s:else>
344                 <s:if test="approverIndex > 0"><s:property value="approverName"/></s:if>
345                 <s:else><font color="#A1A192"><i><s:property value="approverName"/></i></font></s:else>
346               </s:else>
347               </td>
348               <td align=right>
349               <s:if test="#todo == 'edicycle' && documentType == #edited">
350                 <button type="submit" name="saveCycle" value="" style="width:24px; height:16px; border:0; cursor:pointer; cursor:hand; background:transparent">
351                   <img src="<s:url value="/skin/image.export.png"/>" title="<s:text name="button.save"/>"/>
352                 </button>
353               </s:if>
354               </td>
355             </tr>
356             </s:iterator>
357             <tr height=3><td></td></tr>
358           </s:form>
359         </div>
360       </div>