1<xsl:stylesheet
2    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3
4   <xsl:include href="footer.xsl"/>
5   <xsl:include href="headscripts.xsl"/>
6   <xsl:include href="headeradminproject.xsl"/>
7
8   <!-- Include local common files -->
9   <xsl:include href="local/footer.xsl"/>
10   <xsl:include href="local/headscripts.xsl"/>
11   <xsl:include href="local/headeradminproject.xsl"/>
12
13   <xsl:output method="xml" indent="yes"  doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
14   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
15
16    <xsl:template match="/">
17      <html>
18       <head>
19       <title><xsl:value-of select="cdash/title"/></title>
20        <meta name="robots" content="noindex,nofollow" />
21         <link rel="StyleSheet" type="text/css">
22         <xsl:attribute name="href"><xsl:value-of select="cdash/cssfile"/></xsl:attribute>
23         </link>
24         <xsl:comment><![CDATA[[if IE]>
25          <link rel="stylesheet" href="tabs_ie.css" type="text/css" media="projection, screen" />
26          <![endif]]]></xsl:comment>
27          <!-- Include project roles -->
28          <script src="javascript/jquery-1.6.2.js" type="text/javascript"></script>
29          <script src="javascript/cdashProjectRole.js" type="text/javascript"></script>
30          <script src="javascript/ui.tabs.js" type="text/javascript"></script>
31
32
33        <!-- Functions to confirm the email -->
34        <xsl:text disable-output-escaping="yes">
35              &lt;script type="text/javascript"&gt;
36              function confirmEmail() {
37                 if (window.confirm("Are you sure you want to send this email to all site maintainers?")){
38                    return true;
39                 }
40                 return false;
41              }
42              &lt;/script&gt;
43        </xsl:text>
44       </head>
45       <body bgcolor="#ffffff">
46
47<xsl:choose>
48<xsl:when test="/cdash/uselocaldirectory=1">
49  <xsl:call-template name="headeradminproject_local"/>
50</xsl:when>
51<xsl:otherwise>
52  <xsl:call-template name="headeradminproject"/>
53</xsl:otherwise>
54</xsl:choose>
55
56<br/>
57
58<xsl:if test="string-length(cdash/warning)>0">
59<xsl:value-of select="cdash/warning"/>
60</xsl:if>
61
62<div style="color: red;"><xsl:value-of select="cdash/error" /></div>
63<table  border="0">
64  <tr>
65   <form name="form1" method="post" action="">
66    <td width="15%"><div align="right"><strong>Project:</strong></div></td>
67    <td width="85%" ><select onchange="location = 'manageProjectRoles.php?projectid='+this.options[this.selectedIndex].value;" name="projectSelection">
68        <option>
69        <xsl:attribute name="value">0</xsl:attribute>
70        Choose...
71        </option>
72
73        <xsl:for-each select="cdash/availableproject">
74        <option>
75        <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
76        <xsl:if test="selected=1">
77        <xsl:attribute name="selected"></xsl:attribute>
78        </xsl:if>
79        <xsl:value-of select="name"/>
80        </option>
81        </xsl:for-each>
82        </select></td>
83    </form>
84  </tr>
85</table>
86
87<xsl:choose>
88 <xsl:when test="count(cdash/cvsuser)>0">
89    <div id="wizard">
90          <table width="800" border="0">
91             <!-- Show the cvsusers if imported to check that they are valid -->
92            <form  method="post">
93            <td valign="top" width="100"><div align="right">Import CVS Users:</div></td>
94            <td>
95            <table>
96            <tr style="background-color:#CCCCCC">
97            <td>Send</td>
98            <td>Email</td>
99            <td>CVS Login</td>
100            <td>First Name</td>
101            <td>Last Name</td>
102            </tr>
103            <xsl:for-each select="cdash/cvsuser">
104            <tr>
105            <td><input type="checkbox" value="1">
106            <xsl:attribute name="checked">checked</xsl:attribute>
107            <xsl:attribute name="name">cvsuser[<xsl:value-of select="id"/>]</xsl:attribute>
108            </input>
109            </td>
110            <td><xsl:value-of select="email"/>
111            <input type="hidden">
112            <xsl:attribute name="value"><xsl:value-of select="email"/></xsl:attribute>
113            <xsl:attribute name="name">email[<xsl:value-of select="id"/>]</xsl:attribute>
114            </input>
115            </td>
116            <td><xsl:value-of select="cvslogin"/>
117            <input type="hidden">
118            <xsl:attribute name="value"><xsl:value-of select="cvslogin"/></xsl:attribute>
119            <xsl:attribute name="name">cvslogin[<xsl:value-of select="id"/>]</xsl:attribute>
120            </input>
121            </td>
122            <td><xsl:value-of select="firstname"/>
123            <input type="hidden">
124            <xsl:attribute name="value"><xsl:value-of select="firstname"/></xsl:attribute>
125            <xsl:attribute name="name">firstname[<xsl:value-of select="id"/>]</xsl:attribute>
126            </input>
127            </td>
128            <td><xsl:value-of select="lastname"/>
129            <input type="hidden">
130            <xsl:attribute name="value"><xsl:value-of select="lastname"/></xsl:attribute>
131            <xsl:attribute name="name">lastname[<xsl:value-of select="id"/>]</xsl:attribute>
132            </input>
133            </td>
134            </tr>
135            </xsl:for-each>
136            <tr>
137            <td><input type="submit" name="registerUsers" value="Register Users and Send email"/></td>
138            </tr>
139            </table>
140            </td>
141            </form>
142          </table>
143      </div>
144    </xsl:when>
145    <xsl:otherwise>
146  <!-- If a project has
147  been selected -->
148  <xsl:if test="count(cdash/project)>0">
149   <div id="wizard">
150      <ul>
151          <li>
152            <a href="#fragment-1"><span>Current users</span></a></li>
153          <li>
154            <a href="#fragment-2"><span>Search for already registered users</span></a></li>
155          <li>
156            <a href="#fragment-3"><span>Register a new user</span></a></li>
157          <li>
158            <a href="#fragment-4"><span>Import users from CVS file </span></a></li>
159      </ul>
160    <div id="fragment-1" class="tab_content" >
161        <div class="tab_help"></div>
162
163          <table width="800"  border="0">
164            <tr>
165            <td><div align="right"></div></td>
166            <td>
167            <span style="color: #ff0000;">
168              <xsl:for-each select="cdash/baduser">
169              <xsl:choose>
170                <xsl:when test="emailtype=0">
171                * <b><xsl:value-of select="author"/></b> (<xsl:value-of select="email"/>) doesn't want to receive emails but has been submitting in the past month.
172                </xsl:when>
173                <xsl:otherwise>
174                * <b><xsl:value-of select="author"/></b> is not registered for this project but has been submitting in the past month.
175                </xsl:otherwise>
176              </xsl:choose>
177              <br/>
178              </xsl:for-each>
179              </span>
180            </td>
181            </tr>
182            <tr>
183             <td><div align="right"></div></td>
184             <td>
185             <table width="850">
186               <tr bgcolor="#CCCCCC">
187                <td><center><b>User</b></center></td>
188                <td><center><b>Email</b></center></td>
189                <td><center><b>Role</b></center></td>
190                <td><center><b>Repository Credentials<br/>(cred1;cred2;)</b></center></td>
191                <td><center><b>Notifications</b></center></td>
192                <td><center><b>Action</b></center></td>
193               </tr>
194
195               <xsl:for-each select="cdash/user">
196               <form method="post" action="">
197               <xsl:attribute name="form">formuser<xsl:value-of select="id"/></xsl:attribute>
198               <tr>
199                <xsl:attribute name="bgcolor"><xsl:value-of select="bgcolor"/></xsl:attribute>
200                <input name="userid" type="hidden">
201                <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
202                </input>
203                <td><xsl:value-of select="firstname"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="lastname"/></td>
204                <td><xsl:value-of select="email"/></td>
205                <td>
206                <select name="role">
207                 <option value="0"><xsl:if test="role=0"><xsl:attribute name="selected"></xsl:attribute></xsl:if>Normal User</option>
208                 <option value="1"><xsl:if test="role=1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>Site maintainer</option>
209                 <option value="2"><xsl:if test="role=2"><xsl:attribute name="selected"></xsl:attribute></xsl:if>Project Administrator</option>
210                </select>
211                </td>
212               <td>
213                 <input name="credentials" type="text">
214                  <xsl:attribute name="value"><xsl:for-each select="repositorycredential"><xsl:value-of select="."/>;</xsl:for-each></xsl:attribute>
215                 </input>
216                </td>
217                <td>
218                <select name="emailtype">
219                 <option value="0"><xsl:if test="emailtype=0"><xsl:attribute name="selected"></xsl:attribute></xsl:if>No email</option>
220                 <option value="1"><xsl:if test="emailtype=1"><xsl:attribute name="selected"></xsl:attribute></xsl:if>Email checkins</option>
221                 <option value="2"><xsl:if test="emailtype=2"><xsl:attribute name="selected"></xsl:attribute></xsl:if>Email nighlty</option>
222                 <option value="3"><xsl:if test="emailtype=3"><xsl:attribute name="selected"></xsl:attribute></xsl:if>All emails</option>
223               </select>
224                </td>
225                <td>
226                <input type="submit" name="updateuser" value="Update"/>
227                <input type="submit" name="removeuser" value="Remove"/>
228                </td>
229                </tr>
230                </form>
231                </xsl:for-each>
232             </table>
233             </td>
234             </tr>
235          </table>
236          <!-- Send email to site maintainer -->
237          <form name="emailsitemaintainers_form" method="post" action="">
238          <table width="100%"  border="0">
239            <tr>
240              <td  bgcolor="#DDDDDD"><strong>Send email to site maintainers</strong></td>
241            </tr>
242            <tr>
243
244            <td colspan="2"><textarea style="width:872px;" name="emailMaintainers"  rows="10"></textarea></td>
245            </tr>
246            <tr>
247            <td></td>
248            <td align="right"><input type="submit" onclick="return confirmEmail()" name="sendEmailToSiteMaintainers" value="Send email to all the site maintainers"/></td>
249            </tr>
250          </table>
251          </form>
252    </div>
253    <div id="fragment-2" class="tab_content" >
254        <div class="tab_help"></div>
255          <table width="800"  border="0">
256            <tr>
257              <td><div align="right"></div></td>
258              <td>
259              <xsl:choose>
260              <xsl:when test="/cdash/fullemail">
261                <i>type the full email address of the user to add</i>
262              </xsl:when>
263              <xsl:otherwise>
264                <i>start typing a name or email address (% to display all users)</i>
265              </xsl:otherwise>
266              </xsl:choose>
267              </td>
268            </tr>
269            <tr>
270              <td><div align="right">Search:</div></td>
271              <td><input name="search" type="text" id="search" size="40"/></td>
272            </tr>
273            <tr>
274              <td><div align="right"></div></td>
275              <td><div name="newuser" id="newuser"></div></td>
276              <input id="projectid" type="hidden">
277              <xsl:attribute name="value"><xsl:value-of select="cdash/project/id"/></xsl:attribute>
278              </input>
279            </tr>
280          </table>
281    </div>
282    <div id="fragment-3" class="tab_content" >
283        <div class="tab_help"></div>
284        <form  method="post">
285          <table width="800"  border="0">
286            <tr>
287                <td><div align="right">User Email:</div></td>
288            <td>
289            <input name="registeruseremail" type="text" id="registeruseremail" size="40"/>
290            </td>
291            </tr>
292            <tr>
293             <td><div align="right">First name:</div></td>
294            <td>
295            <input name="registeruserfirstname" type="text" id="registeruserfirstname" size="40"/>
296            </td>
297            </tr>
298            <tr>
299             <td><div align="right">Last name:</div></td>
300            <td>
301            <input name="registeruserlastname" type="text" id="registeruserlastname" size="40"/>
302            </td>
303            </tr>
304            <tr>
305             <td><div align="right">Repository credential:</div></td>
306            <td>
307            <input name="registeruserrepositorycredential" type="text" id="registeruserrepositorycredential" size="40"/>
308            * email address is automatically added as a credential
309            </td>
310            </tr>
311            <tr>
312            <td></td>
313            <td>
314            <input type="submit" name="registerUser" value="Register User"/>
315            </td>
316            </tr>
317          </table>
318          </form>
319    </div>
320    <div id="fragment-4" class="tab_content" >
321        <div class="tab_help"></div>
322          <table width="800"  border="0">
323            <tr>
324                <td><div align="right">CVS Users File:</div></td>
325
326            <td>
327            <form method="post" action="" enctype="multipart/form-data">
328            <input name="cvsUserFile" type="file"/><input type="submit" name="importUsers" value="Import"/>
329            </form>
330            </td>
331            </tr>
332          </table>
333    </div>
334  </div>
335</xsl:if> <!-- end if a project has been selected -->
336</xsl:otherwise>
337</xsl:choose>
338
339<!-- FOOTER -->
340<br/>
341
342<xsl:choose>
343<xsl:when test="/cdash/uselocaldirectory=1">
344  <xsl:call-template name="footer_local"/>
345</xsl:when>
346<xsl:otherwise>
347  <xsl:call-template name="footer"/>
348</xsl:otherwise>
349</xsl:choose>
350
351        </body>
352      </html>
353    </xsl:template>
354</xsl:stylesheet>
355