Subversion Repositories bacoAlunos

Rev

Rev 1306 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
504 jmachado 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:curso="http://www.estgp.pt/xsd/planoestudos/1.0/">
3
 
4
        <xsl:template match="/">
5
        <html>
6
                <head>
7
 
8
                        <title></title>
9
                        <meta content="UTF-8" http-equiv="encoding"></meta>
10
                        <style type="text/css">
11
                                body *, .contentPortal, .contentPortal p, .contentPortal li, div
12
                                {
13
                                        font-family: "bitstream vera sans",Verdana,Arial,Helvetica,sans-serif;
14
                                        font-size: 11px;
15
                                }
16
                                .planoCurricular td,    .planoCurricular th
17
                                {
18
                                        font-family: "bitstream vera sans",Verdana,Arial,Helvetica,sans-serif;                         
19
                                }
20
                                .planoCurricular
21
                                {
22
                                        border:1px solid black;
23
 
24
                                }
25
                                .planoCurricular th
26
                                {
27
                                   font-weight:normal;
28
                                        border:1px solid black;
29
 
30
                                }
31
                                .planoCurricular td.unidade
32
                                {
33
                                                text-align:right;
34
                                }                              
35
                                td.unidade span
36
                                {
37
                                        width:100%;                            
38
                                }
39
                                .semestre
40
                                {
41
                                        background-color:#8ec73f;
42
                                }
43
                                .semestreHead
44
                                {
45
                                        background-color:#8ec73f;
46
                                }                              
47
                                .perfilNome, .perfilHead
48
                                {
49
                                        background-color:#D6D6D6
50
                                }
51
                                .ects
52
                                {
53
                                        background-color:#EBFCD6;
885 jmachado 54
                                }
55
                .ficha
56
                {
57
                    background-color:#EEEEEE;
58
                    text-alignment: center;
59
                }
504 jmachado 60
                        </style>
61
                </head>
62
                <body>
63
                        <xsl:call-template name="fragmentoCurso"/>
64
                </body>
65
                </html>
66
        </xsl:template>
67
        <xsl:template name="fragmentoCurso">
68
                <div class="seccao">
69
                        <table class="planoCurricular">
70
                                <xsl:for-each select="//curso:semestre">
71
                                        <tr>
72
                                                <th class="semestre">
73
                                                        <xsl:if test="./curso:perfil">
74
                                                                <xsl:attribute name="colspan"><xsl:value-of select="count(distinct-values(//curso:horasContacto/*/name())) + 3"/></xsl:attribute>
75
                                                        </xsl:if>
76
                                                        <xsl:choose>
77
                                                                <xsl:when test="@id = 'S1'">1º ano 1º semestre</xsl:when>
78
                                                                <xsl:when test="@id = 'S2'">1º ano 2º semestre</xsl:when>
79
                                                                <xsl:when test="@id = 'S3'">2º ano 1º semestre</xsl:when>
80
                                                                <xsl:when test="@id = 'S4'">2º ano 2º semestre</xsl:when>
81
                                                                <xsl:when test="@id = 'S5'">3º ano 1º semestre</xsl:when>
82
                                                                <xsl:when test="@id = 'S6'">3º ano 2º semestre</xsl:when>
83
                                                                <xsl:when test="@id = 'S7'">4º ano 1º semestre</xsl:when>
84
                                                                <xsl:when test="@id = 'S8'">4º ano 2º semestre</xsl:when>                                                                                                                                                                                            
85
                                                                <xsl:when test="@id = 'S9'">5º ano 1º semestre</xsl:when>
86
                                                                <xsl:when test="@id = 'S10'">5º ano 2º semestre</xsl:when>
87
                                                                <xsl:when test="@id = 'S11'">6º ano 1º semestre</xsl:when>
88
                                                                <xsl:when test="@id = 'S12'">6º ano 2º semestre</xsl:when>
89
                                                                <xsl:when test="@id = 'A1'">Anuais 1º Ano</xsl:when>
90
                                                                <xsl:when test="@id = 'A2'">Anuais 2º Ano</xsl:when>
91
                                                                <xsl:when test="@id = 'A3'">Anuais 3º Ano</xsl:when>
92
                                                                <xsl:when test="@id = 'A4'">Anuais 4º Ano</xsl:when>
93
                                                                <xsl:when test="@id = 'A5'">Anuais 5º Ano</xsl:when>
94
                                                                <xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>                                                            
95
                                                        </xsl:choose>
96
                                                </th>
97
                                                <xsl:if test="not(./curso:perfil)">
98
                                                        <th class="semestreHead">total</th>
99
                                                        <xsl:if test="//curso:T"><th class="semestreHead">T</th></xsl:if>
100
                                                        <xsl:if test="//curso:TP"><th class="semestreHead">TP</th></xsl:if>                    
101
                                                        <xsl:if test="//curso:P"><th class="semestreHead">P</th></xsl:if>                                                                      
102
                                                        <xsl:if test="//curso:PL"><th class="semestreHead">PL</th></xsl:if>                                                                    
103
                                                        <xsl:if test="//curso:PD"><th class="semestreHead">PD</th></xsl:if>                                                                    
104
                                                        <xsl:if test="//curso:OT"><th class="semestreHead">OT</th></xsl:if>                                                                    
105
                                                        <xsl:if test="//curso:E"><th class="semestreHead">E</th></xsl:if>                                                                      
106
                                                        <xsl:if test="//curso:S"><th class="semestreHead">S</th></xsl:if>                                                                                                                      
107
                                                        <xsl:if test="//curso:TC"><th class="semestreHead">TC</th></xsl:if>                                                                                                            
108
                                                        <xsl:if test="//curso:O"><th class="semestreHead">O</th></xsl:if>                                                                      
885 jmachado 109
                                                        <th class="semestreHead ectsHead">ECTS</th>
110
                            <th class="semestreHead ectsHead">Ficha</th>
111
 
504 jmachado 112
                                                </xsl:if>                                                                                                                                              
113
                                        </tr>
114
                                        <xsl:choose>
115
                                                <xsl:when test="./curso:perfil">
116
                                                        <xsl:apply-templates select="./curso:perfil" />
117
                                                </xsl:when>
118
                                                <xsl:otherwise>
119
                                                        <xsl:apply-templates select="./curso:unidade" />
120
                                                </xsl:otherwise>
121
                                        </xsl:choose>
122
                                </xsl:for-each>
123
                        </table>
124
                </div>
125
        </xsl:template>
126
        <xsl:template match="curso:perfil">
127
                <tr>
128
                        <th class="perfilNome">
883 jmachado 129
                <xsl:value-of select="@nome"/>
504 jmachado 130
                        </th>
131
                        <th class="perfilHead">total</th>
132
                        <xsl:if test="//curso:T"><th class="perfilHead">T</th></xsl:if>
133
                        <xsl:if test="//curso:TP"><th class="perfilHead">TP</th></xsl:if>                      
134
                        <xsl:if test="//curso:P"><th class="perfilHead">P</th></xsl:if>                                                                
135
                        <xsl:if test="//curso:PL"><th class="perfilHead">PL</th></xsl:if>                                                                      
136
                        <xsl:if test="//curso:PD"><th class="perfilHead">PD</th></xsl:if>                                                                      
137
                        <xsl:if test="//curso:OT"><th class="perfilHead">OT</th></xsl:if>                                                                      
138
                        <xsl:if test="//curso:E"><th class="perfilHead">E</th></xsl:if>                                                                
139
                        <xsl:if test="//curso:S"><th class="perfilHead">S</th></xsl:if>                                                                                                                
140
                        <xsl:if test="//curso:TC"><th class="perfilHead">TC</th></xsl:if>                                                                                                              
141
                        <xsl:if test="//curso:O"><th class="perfilHead">O</th></xsl:if>                                                                                                        
885 jmachado 142
                        <th class="perfilHead ectsHead">ECTS</th>
143
            <th class="semestreHead ectsHead">Ficha</th>
504 jmachado 144
                        <xsl:apply-templates select="./curso:unidade" mode="perfil"/>
145
                </tr>
146
        </xsl:template>
147
        <xsl:template match="curso:unidade" mode="perfil">
148
                <tr>
883 jmachado 149
                        <td  class="perfil unidadeNome">
150
                <span>
151
                    <xsl:choose>
152
                        <xsl:when test="@siges">
153
                            <a>
884 jmachado 154
                                <xsl:attribute name="href">startLoadCourseUnitSiges.do?unitCode=<xsl:value-of select="@siges"/>&amp;courseCode=<xsl:value-of select="$COURSE_SIGES_CODE"/>&amp;semestre=<xsl:value-of select="../../@id"/></xsl:attribute>
883 jmachado 155
                                <xsl:value-of select="./curso:nome"/>
156
                            </a>
157
                        </xsl:when>
158
                        <xsl:otherwise>
159
                            <xsl:value-of select="./curso:nome"/>
160
                        </xsl:otherwise>
161
                    </xsl:choose>
162
                </span>
163
            </td>
504 jmachado 164
                        <td  class="perfil unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                      
165
                        <xsl:if test="//curso:T"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:T"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:T"/></xsl:if></span></td></xsl:if>                 
166
                        <xsl:if test="//curso:TP"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:TP"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TP"/></xsl:if></span></td></xsl:if>                      
167
                        <xsl:if test="//curso:P"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:P"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:P"/></xsl:if></span></td></xsl:if>                 
168
                        <xsl:if test="//curso:PL"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:PL"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PL"/></xsl:if></span></td></xsl:if>                      
169
                        <xsl:if test="//curso:PD"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:PD"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PD"/></xsl:if></span></td></xsl:if>                      
170
                        <xsl:if test="//curso:OT"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:OT"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:OT"/></xsl:if></span></td></xsl:if>                      
171
                        <xsl:if test="//curso:E"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:E"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:E"/></xsl:if></span></td></xsl:if>                 
172
                        <xsl:if test="//curso:S"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:S"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:S"/></xsl:if></span></td></xsl:if>                 
173
                        <xsl:if test="//curso:TC"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:TC"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TC"/></xsl:if></span></td></xsl:if>                      
174
                        <xsl:if test="//curso:O"><td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:O"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:O"/></xsl:if></span></td></xsl:if>                 
175
                        <td  class="perfil unidade ects"><span><xsl:if test="./curso:ECTS"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:ECTS"/></xsl:if></span></td>
885 jmachado 176
 
177
 
178
            <td  class="perfil unidade ficha" align="center">
179
                <xsl:if test="@siges">
180
                    <a>
181
                        <xsl:attribute name="href">startLoadCourseUnitProgramSiges.do?unitCode=<xsl:value-of select="@siges"/>&amp;courseCode=<xsl:value-of select="$COURSE_SIGES_CODE"/>&amp;semestre=<xsl:value-of select="../../@id"/></xsl:attribute>
182
                        <img src="imgs/mime/pdf.gif"/>
183
                    </a>
184
                </xsl:if>
185
            </td>
504 jmachado 186
                </tr>
187
        </xsl:template>
188
        <xsl:template match="curso:unidade">
189
                <tr>
884 jmachado 190
                        <td  class="unidadeNome">
191
                <span>
192
                    <xsl:choose>
193
                        <xsl:when test="@siges">
194
                            <a>
195
                                <xsl:attribute name="href">startLoadCourseUnitSiges.do?unitCode=<xsl:value-of select="@siges"/>&amp;courseCode=<xsl:value-of select="$COURSE_SIGES_CODE"/>&amp;semestre=<xsl:value-of select="../@id"/></xsl:attribute>
196
                                <xsl:value-of select="./curso:nome"/>
197
                            </a>
198
                        </xsl:when>
199
                        <xsl:otherwise>
200
                            <xsl:value-of select="./curso:nome"/>
201
                        </xsl:otherwise>
202
                    </xsl:choose>
203
                </span>
204
            </td>
504 jmachado 205
                        <td  class="unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                     
206
                        <xsl:if test="//curso:T"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:T"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:T"/></xsl:if></span></td></xsl:if>
207
                        <xsl:if test="//curso:TP"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:TP"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TP"/></xsl:if></span></td></xsl:if>
208
                        <xsl:if test="//curso:P"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:P"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:P"/></xsl:if></span></td></xsl:if>
209
                        <xsl:if test="//curso:PL"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:PL"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PL"/></xsl:if></span></td></xsl:if>
210
                        <xsl:if test="//curso:PD"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:PD"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PD"/></xsl:if></span></td></xsl:if>
211
                        <xsl:if test="//curso:OT"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:OT"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:OT"/></xsl:if></span></td></xsl:if>
212
                        <xsl:if test="//curso:E"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:E"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:E"/></xsl:if></span></td></xsl:if>
213
                        <xsl:if test="//curso:S"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:S"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:S"/></xsl:if></span></td></xsl:if>
214
                        <xsl:if test="//curso:TC"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:TC"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TC"/></xsl:if></span></td></xsl:if>
215
                        <xsl:if test="//curso:O"><td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:O"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:O"/></xsl:if></span></td></xsl:if>
885 jmachado 216
                        <td  class="unidade ects"><span><xsl:if test="./curso:ECTS"><xsl:value-of select="./curso:ECTS"/></xsl:if></span></td>
217
            <td  class="unidade ficha" align="center">
218
                <xsl:if test="@siges">
219
                    <a>
220
                        <xsl:attribute name="href">startLoadCourseUnitProgramSiges.do?unitCode=<xsl:value-of select="@siges"/>&amp;courseCode=<xsl:value-of select="$COURSE_SIGES_CODE"/>&amp;semestre=<xsl:value-of select="../@id"/></xsl:attribute>
221
                        <img src="imgs/mime/pdf.gif"/>
222
                    </a>
223
                </xsl:if>
224
            </td>
504 jmachado 225
                </tr>
226
        </xsl:template>
227
</xsl:stylesheet>