Subversion Repositories bacoAlunos

Rev

Rev 1771 | Rev 1773 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1771 Rev 1772
1
<%@ page import="jomm.dao.impl.AbstractDao" %>
1
<%@ page import="jomm.dao.impl.AbstractDao" %>
2
<%@ page import="pt.estgp.estgweb.domain.Course" %>
2
<%@ page import="pt.estgp.estgweb.domain.Course" %>
3
<%@ page import="pt.estgp.estgweb.domain.CourseStudiesPlan" %>
3
<%@ page import="pt.estgp.estgweb.domain.CourseStudiesPlan" %>
4
<%@ page import="pt.estgp.estgweb.domain.CourseStudiesPlanImpl" %>
4
<%@ page import="pt.estgp.estgweb.domain.CourseStudiesPlanImpl" %>
5
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
5
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
6
<%@ page import="pt.estgp.estgweb.services.courses.CoursesService" %>
6
<%@ page import="pt.estgp.estgweb.services.courses.CoursesService" %>
7
<%@ page import="pt.estgp.estgweb.services.courses.xsd.Curso" %>
7
<%@ page import="pt.estgp.estgweb.services.courses.xsd.Curso" %>
8
<%@ page import="pt.estgp.estgweb.services.courses.xsd.CursoImpl" %>
8
<%@ page import="pt.estgp.estgweb.services.courses.xsd.CursoImpl" %>
9
<%@ page import="pt.estgp.estgweb.web.form.courses.CourseStudiesPlansAdminForm" %>
9
<%@ page import="pt.estgp.estgweb.web.form.courses.CourseStudiesPlansAdminForm" %>
10
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
10
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
11
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
11
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
12
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
12
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
13
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
13
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
14
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
14
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
15
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
15
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
16
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
16
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
17
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm"%>
17
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm"%>
18
<%
18
<%
19
 
19
 
20
 
20
 
21
    //TODO NOVO JSON
21
    //TODO NOVO JSON
22
    //O SALVAR TEM DE SER UMA FuncTION E DEIXAR DE SER UM SUBMIT PARA PODERMOS TRASNFERIR O JSON
22
    //O SALVAR TEM DE SER UMA FuncTION E DEIXAR DE SER UM SUBMIT PARA PODERMOS TRASNFERIR O JSON
23
    //PARA UMA VAR DE TEXTO
23
    //PARA UMA VAR DE TEXTO
24
 
24
 
25
    //todo temos de ter aqui o id do curso para o carregar aqui mesmo
25
    //todo temos de ter aqui o id do curso para o carregar aqui mesmo
26
 
26
 
27
    //se queremos barras de navegação então temos de ter ser acedidos de um
27
    //se queremos barras de navegação então temos de ter ser acedidos de um
28
    //controlador que carregue o necerrário à barra ou então assumimos que
28
    //controlador que carregue o necerrário à barra ou então assumimos que
29
    //o curso id esta sempre disponivel nas barras possiveis de chamar
29
    //o curso id esta sempre disponivel nas barras possiveis de chamar
30
 
30
 
31
    AbstractDao.getCurrentSession().beginTransaction();
31
    AbstractDao.getCurrentSession().beginTransaction();
32
 
32
 
33
    CourseStudiesPlanImpl planoEdicao;
33
    CourseStudiesPlanImpl planoEdicao;
34
    boolean ultimaVersao = true;
34
    boolean ultimaVersao = true;
35
    Long courseId;
35
    Long courseId;
36
    Long studyPlanId;
36
    Long studyPlanId;
37
    String versaoPlano = "Não Encontrada";
37
    String versaoPlano = "Não Encontrada";
38
    Course course;
38
    Course course;
39
    if(request.getAttribute("CourseStudiesPlansAdminForm") != null)
39
    if(request.getAttribute("CourseStudiesPlansAdminForm") != null)
40
    {
40
    {
41
        CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) request.getAttribute("CourseStudiesPlansAdminForm");
41
        CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) request.getAttribute("CourseStudiesPlansAdminForm");
42
        courseId = frm.getCourseId();
42
        courseId = frm.getCourseId();
43
        studyPlanId = frm.getCourseStudiesPlan().getId();
43
        studyPlanId = frm.getCourseStudiesPlan().getId();
44
        ultimaVersao = frm.isVersaoVigor();
44
        ultimaVersao = frm.isVersaoVigor();
45
        course = DaoFactory.getCourseDaoImpl().load(courseId);
45
        course = DaoFactory.getCourseDaoImpl().load(courseId);
46
        planoEdicao = frm.getCourseStudiesPlan();
46
        planoEdicao = frm.getCourseStudiesPlan();
47
    }
47
    }
48
    else
48
    else
49
    {
49
    {
50
        courseId = Long.parseLong(request.getParameter("courseId"));
50
        courseId = Long.parseLong(request.getParameter("courseId"));
51
        studyPlanId = Long.parseLong(request.getParameter("studyPlanId"));
51
        studyPlanId = Long.parseLong(request.getParameter("studyPlanId"));
52
        request.setAttribute("courseId",courseId);
52
        request.setAttribute("courseId",courseId);
53
        request.setAttribute("studyPlanId",studyPlanId);
53
        request.setAttribute("studyPlanId",studyPlanId);
54
 
54
 
55
 
55
 
56
        course = DaoFactory.getCourseDaoImpl().load(courseId);
56
        course = DaoFactory.getCourseDaoImpl().load(courseId);
57
        planoEdicao = null;
57
        planoEdicao = null;
58
        for(CourseStudiesPlan plan:course.getStudiesPlans())
58
        for(CourseStudiesPlan plan:course.getStudiesPlans())
59
        {
59
        {
60
            if(plan.getId() == studyPlanId)
60
            if(plan.getId() == studyPlanId)
61
            {
61
            {
62
                versaoPlano = plan.getVersion() + "";
62
                versaoPlano = plan.getVersion() + "";
63
                planoEdicao = (CourseStudiesPlanImpl) DaoFactory.getCourseStudiesPlanDaoImpl().narrow(plan);
63
                planoEdicao = (CourseStudiesPlanImpl) DaoFactory.getCourseStudiesPlanDaoImpl().narrow(plan);
64
                break;
64
                break;
65
            }
65
            }
66
            ultimaVersao = false;
66
            ultimaVersao = false;
67
        }
67
        }
68
        //provavelmente era mais facil ter um Form Nested com toda a informação, ou então faz-se isso numa pagina propria para editar o plano em questão
68
        //provavelmente era mais facil ter um Form Nested com toda a informação, ou então faz-se isso numa pagina propria para editar o plano em questão
69
    }
69
    }
70
    request.setAttribute("courseId",courseId);
70
    request.setAttribute("courseId",courseId);
71
    request.setAttribute("studyPlanId",studyPlanId);
71
    request.setAttribute("studyPlanId",studyPlanId);
72
    request.setAttribute("course",course);
72
    request.setAttribute("course",course);
73
    request.setAttribute("courseSigesCode",course.getCode());
73
    request.setAttribute("courseSigesCode",course.getCode());
74
 
74
 
75
 
75
 
76
 
76
 
77
 
77
 
78
 
78
 
79
 
79
 
80
    /*
80
    /*
81
    if(planoEdicao != null)
81
    if(planoEdicao != null)
82
    {
82
    {
83
 
83
 
84
 
84
 
85
    }
85
    }
86
    */
86
    */
87
 
87
 
88
%>
88
%>
89
    <div class="panel panel-default" id="planoApp" ng-app="planoApp" ng-controller="planoController">
89
    <div class="panel panel-default" id="planoApp" ng-app="planoApp" ng-controller="planoController">
90
        <div class="panel-heading">
90
        <div class="panel-heading">
91
            Edição do plano de estudos. Versão <%=versaoPlano%> <%=ultimaVersao? "(<u>é a versão em vigor</u>)":""%> do curso de <%=course.getName()%> (<%=course.getCode()%>)
91
            Edição do plano de estudos. Versão <%=versaoPlano%> <%=ultimaVersao? "(<u>é a versão em vigor</u>)":""%> do curso de <%=course.getName()%> (<%=course.getCode()%>)
92
        </div>
92
        </div>
93
        <div class="panel-body">
93
        <div class="panel-body">
94
 
94
 
95
            <html:errors/>
95
            <html:errors/>
96
            <jomm:messages/>
96
            <jomm:messages/>
97
 
97
 
98
 
98
 
99
 
99
 
100
            <div class="panel panel-default">
100
            <div class="panel panel-default">
101
                <div class="panel-heading">Dados do Curso</div>
101
                <div class="panel-heading">Dados do Curso</div>
102
                <div class="panel-body">
102
                <div class="panel-body">
103
 
103
 
104
                    <div class="col-sm-12">Código do Curso <label class="text-info">${course.code}</label></div>
104
                    <div class="col-sm-12">Código do Curso <label class="text-info">${course.code}</label></div>
105
                    <div class="col-sm-12">
105
                    <div class="col-sm-12">
106
                        <table class="tablesorter-blue">
106
                        <table class="tablesorter-blue">
107
                            <thead>
107
                            <thead>
108
                                <tr>
108
                                <tr>
109
                                    <th>Língua</th>
109
                                    <th>Língua</th>
110
                                    <th>Nome do Curso</th>
110
                                    <th>Nome do Curso</th>
111
                                    <th>Departamento</th>
111
                                    <th>Departamento</th>
112
                                </tr>
112
                                </tr>
113
                            </thead>
113
                            </thead>
114
                            <tbody>
114
                            <tbody>
115
                                <tr>
115
                                <tr>
116
                                    <td>PT</td>
116
                                    <td>PT</td>
117
                                    <td>${course.name}</td>
117
                                    <td>${course.name}</td>
118
                                    <td>
118
                                    <td>
119
                                    <%if(course.getDepartment() != null){%>${course.department.name}<%}%>
119
                                    <%if(course.getDepartment() != null){%>${course.department.name}<%}%>
120
                                    </td>
120
                                    </td>
121
                                </tr>
121
                                </tr>
122
                                <tr>
122
                                <tr>
123
                                    <td>EN</td>
123
                                    <td>EN</td>
124
                                    <td>${course.nameEn}</td>
124
                                    <td>${course.nameEn}</td>
125
                                    <td>
125
                                    <td>
126
                                        <%if(course.getDepartment() != null){%>${course.department.nameEn}<%}%>
126
                                        <%if(course.getDepartment() != null){%>${course.department.nameEn}<%}%>
127
 
127
 
128
                                    </td>
128
                                    </td>
129
                                </tr>
129
                                </tr>
130
                                <tr>
130
                                <tr>
131
                                    <td>ES</td>
131
                                    <td>ES</td>
132
                                    <td>${course.nameEs}</td>
132
                                    <td>${course.nameEs}</td>
133
                                    <td>
133
                                    <td>
134
                                        <%if(course.getDepartment() != null){%>${course.department.nameEs}<%}%>
134
                                        <%if(course.getDepartment() != null){%>${course.department.nameEs}<%}%>
135
                                    </td>
135
                                    </td>
136
                                </tr>
136
                                </tr>
137
                                <tr>
137
                                <tr>
138
                                    <td>FR</td>
138
                                    <td>FR</td>
139
                                    <td>${course.nameFr}</td>
139
                                    <td>${course.nameFr}</td>
140
                                    <td>
140
                                    <td>
141
                                        <%if(course.getDepartment() != null){%>${course.department.nameFr}<%}%>
141
                                        <%if(course.getDepartment() != null){%>${course.department.nameFr}<%}%>
142
                                    </td>
142
                                    </td>
143
                                </tr>
143
                                </tr>
144
                            </tbody>
144
                            </tbody>
145
                        </table>
145
                        </table>
146
                   </div>
146
                   </div>
147
 
147
 
148
                </div>
148
                </div>
149
            </div>
149
            </div>
150
            <html:form action="/user/courseControllerStudiesPlan" styleId="CourseStudiesPlansAdminForm" styleClass="form-horizontal"  enctype="multipart/form-data">
150
            <html:form action="/user/courseControllerStudiesPlan" styleId="CourseStudiesPlansAdminForm" styleClass="form-horizontal"  enctype="multipart/form-data">
151
 
151
 
152
                <div class="panel panel-warning">
152
                <div class="panel panel-warning">
153
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Clonagem a partir de outro plano de Estudos</div>
153
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Clonagem a partir de outro plano de Estudos</div>
154
                    <div class="panel-body">
154
                    <div class="panel-body">
155
 
155
 
156
                            <div class="form-group">
156
                            <div class="form-group">
157
                                <label class="control-label col-sm-2">Versão Fonte para Clonagem</label>
157
                                <label class="control-label col-sm-2">Versão Fonte para Clonagem</label>
158
                                <div class="col-sm-10">
158
                                <div class="col-sm-10">
159
                                    <html:select styleClass="form-control" property="sourcePlanId">
159
                                    <html:select styleClass="form-control" property="sourcePlanId">
160
                                        <html:option value="">Nenhuma</html:option>
160
                                        <html:option value="">Nenhuma</html:option>
161
                                    <%
161
                                    <%
162
                                        for(CourseStudiesPlan plan:course.getStudiesPlans())
162
                                        for(CourseStudiesPlan plan:course.getStudiesPlans())
163
                                        {
163
                                        {
164
                                            if(plan.getId() != studyPlanId)
164
                                            if(plan.getId() != studyPlanId)
165
                                            {
165
                                            {
166
                                                request.setAttribute("nowPlanId",plan.getId());
166
                                                request.setAttribute("nowPlanId",plan.getId());
167
                                        %>
167
                                        %>
168
                                            <html:option value="${nowPlanId}">Versão <%=plan.getVersion()%></html:option>
168
                                            <html:option value="${nowPlanId}">Versão <%=plan.getVersion()%></html:option>
169
                                        <%
169
                                        <%
170
                                            }
170
                                            }
171
 
171
 
172
                                        }
172
                                        }
173
                                    %>
173
                                    %>
174
                                    </html:select>
174
                                    </html:select>
175
                                </div>
175
                                </div>
176
                            </div>
176
                            </div>
177
                            <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="set($('#CourseStudiesPlansAdminForm').get(0),'clonarPlano');$('#CourseStudiesPlansAdminForm').get(0).submit();">
177
                            <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="set($('#CourseStudiesPlansAdminForm').get(0),'clonarPlano');$('#CourseStudiesPlansAdminForm').get(0).submit();">
178
                                Clonar para a fonte escolhida
178
                                Clonar para a fonte escolhida
179
                            </button>
179
                            </button>
180
 
180
 
181
 
181
 
182
 
182
 
183
                    </div>
183
                    </div>
184
                </div>
184
                </div>
185
 
185
 
186
                <script>
186
                <script>
187
                    function createFichasUrls()
187
                    function createFichasUrls()
188
                    {
188
                    {
189
                        $("[data-unit-ficha-url-target-id]").each(
189
                        $("[data-unit-ficha-url-target-id]").each(
190
                                function()
190
                                function()
191
                                {
191
                                {
192
                                    var targetId = $(this).attr("data-unit-ficha-url-target-id");
192
                                    var targetId = $(this).attr("data-unit-ficha-url-target-id");
193
                                    var sigesUnit = $(this).attr("data-unit-siges-code");
193
                                    var sigesUnit = $(this).attr("data-unit-siges-code");
194
                                    var sigesCourse = $(this).attr("data-course-siges-code");
194
                                    var sigesCourse = $(this).attr("data-course-siges-code");
195
                                    var unitSemestre = $(this).attr("data-unit-semestre");
195
                                    var unitSemestre = $(this).attr("data-unit-semestre");
196
                                    var sigesUrlInput = $("#" + targetId);
196
                                    var sigesUrlInput = $("#" + targetId);
197
                                    var urlPattern = $("#urlPadraoFicha").val();
197
                                    var urlPattern = $("#urlPadraoFicha").val();
198
                                    var targetsType = $("#urlPadraoFichaAlvo option:selected").val();
198
                                    var targetsType = $("#urlPadraoFichaAlvo option:selected").val();
199
                                    if(targetsType == "all" || sigesUrlInput.val() == "")
199
                                    if(targetsType == "all" || sigesUrlInput.val() == "")
200
                                    {
200
                                    {
201
                                        urlPattern = urlPattern.replace("{SIGES_CURSO}",'${courseSigesCode}');
201
                                        urlPattern = urlPattern.replace("{SIGES_CURSO}",'${courseSigesCode}');
202
                                        urlPattern = urlPattern.replace("{SIGES_UNIT}",sigesUnit);
202
                                        urlPattern = urlPattern.replace("{SIGES_UNIT}",sigesUnit);
203
                                        urlPattern = urlPattern.replace("{UNIT_SEMESTRE}",unitSemestre);
203
                                        urlPattern = urlPattern.replace("{UNIT_SEMESTRE}",unitSemestre);
204
 
204
 
205
                                        $("#" + targetId).val(urlPattern);
205
                                        $("#" + targetId).val(urlPattern);
206
                                    }
206
                                    }
207
                                }
207
                                }
208
                        );
208
                        );
209
                        alert("URLS gerados com Sucesso, Necessita de SALVAR o Plano.");
209
                        alert("URLS gerados com Sucesso, Necessita de SALVAR o Plano.");
210
                    }
210
                    }
211
                </script>
211
                </script>
212
 
212
 
213
                <div class="panel panel-warning">
213
                <div class="panel panel-warning">
214
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Ferramenta Auxiliar de Auto-Preenchimento de URL's de Fichas</div>
214
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Ferramenta Auxiliar de Auto-Preenchimento de URL's de Fichas</div>
215
                    <div class="panel-body">
215
                    <div class="panel-body">
216
 
216
 
217
                        <div class="form-group">
217
                        <div class="form-group">
218
                            <label class="control-label col-sm-2">URL Padrão</label>
218
                            <label class="control-label col-sm-2">URL Padrão</label>
219
                            <div class="col-sm-10">
219
                            <div class="col-sm-10">
220
                                <p>exemplo para a ESTG: http://www.estgp.pt/startLoadCourseUnitProgramSiges.do?unitCode={SIGES_UNIT}&courseCode={SIGES_CURSO}&semestre={UNIT_SEMESTRE}</p>
220
                                <p>exemplo para a ESTG: http://www.estgp.pt/startLoadCourseUnitProgramSiges.do?unitCode={SIGES_UNIT}&courseCode={SIGES_CURSO}&semestre={UNIT_SEMESTRE}</p>
221
                                <p>Nenhum dos campos é obrigatório, o sistema substitui se existir no padrão, Na estg o Semestre é obrigatório para diferenciar unidades que são lecionadas em ambos os semestres</p>
221
                                <p>Nenhum dos campos é obrigatório, o sistema substitui se existir no padrão, Na estg o Semestre é obrigatório para diferenciar unidades que são lecionadas em ambos os semestres</p>
222
                                <p>O semestre presente neste sistema e que vai ser preenchido vai de S1 a S6 e de T1 a T8 ou A, portanto se o semestre for usado à que ter isto em atenção</p>
222
                                <p>O semestre presente neste sistema e que vai ser preenchido vai de S1 a S6 e de T1 a T8 ou A, portanto se o semestre for usado à que ter isto em atenção</p>
223
                                <input type="text" class="form-control" id="urlPadraoFicha" placeholder="http://exemplo.com/exemplo/{SIGES_CURSO}/{UNIT_SEMESTRE}/{SIGES_UNIT}.pdf">
223
                                <input type="text" class="form-control" id="urlPadraoFicha" placeholder="http://exemplo.com/exemplo/{SIGES_CURSO}/{UNIT_SEMESTRE}/{SIGES_UNIT}.pdf">
224
                            </div>
224
                            </div>
225
                        </div>
225
                        </div>
226
                        <div class="form-group">
226
                        <div class="form-group">
227
                            <label class="control-label col-sm-2">Alvos</label>
227
                            <label class="control-label col-sm-2">Alvos</label>
228
                            <div class="col-sm-10">
228
                            <div class="col-sm-10">
229
                                <select id="urlPadraoFichaAlvo">
229
                                <select id="urlPadraoFichaAlvo">
230
                                    <option value="all">Todos</option>
230
                                    <option value="all">Todos</option>
231
                                    <option value="onlyEmpty">Apenas Vazios</option>
231
                                    <option value="onlyEmpty">Apenas Vazios</option>
232
                                </select>
232
                                </select>
233
                            </div>
233
                            </div>
234
                        </div>
234
                        </div>
235
                        <button class="btn btn-warning" type="button" data-toggle="modal" onclick="createFichasUrls()">
235
                        <button class="btn btn-warning" type="button" data-toggle="modal" onclick="createFichasUrls()">
236
                            Gerar URL's de Fichas
236
                            Gerar URL's de Fichas
237
                        </button>
237
                        </button>
238
 
238
 
239
 
239
 
240
 
240
 
241
                    </div>
241
                    </div>
242
                </div>
242
                </div>
243
 
243
 
244
                <%
244
                <%
245
                    CourseStudiesPlansAdminForm courseStudiesPlansAdminForm = (CourseStudiesPlansAdminForm) request.getAttribute("CourseStudiesPlansAdminForm");
245
                    CourseStudiesPlansAdminForm courseStudiesPlansAdminForm = (CourseStudiesPlansAdminForm) request.getAttribute("CourseStudiesPlansAdminForm");
246
                    //Isto corre sempre que se entra no Editor a primeira vez e não apenas quando é um plano novo
246
                    //Isto corre sempre que se entra no Editor a primeira vez e não apenas quando é um plano novo
247
                    //Form ainda não iniciado vai iniciar é a primeira vez
247
                    //Form ainda não iniciado vai iniciar é a primeira vez
248
                    if(courseStudiesPlansAdminForm.getCourseStudiesPlan().getId() <= 0)
248
                    if(courseStudiesPlansAdminForm.getCourseStudiesPlan().getId() <= 0)
249
                    {
249
                    {
250
                        courseStudiesPlansAdminForm.setCourseStudiesPlan(planoEdicao);
250
                        courseStudiesPlansAdminForm.setCourseStudiesPlan(planoEdicao);
251
                        courseStudiesPlansAdminForm.setCourseId(courseId);
251
                        courseStudiesPlansAdminForm.setCourseId(courseId);
252
                        courseStudiesPlansAdminForm.setVersaoVigor(ultimaVersao);
252
                        courseStudiesPlansAdminForm.setVersaoVigor(ultimaVersao);
253
                        Curso cPlanoDoXml2Json = new CoursesService().loadCursoPlanoFromXml(planoEdicao.getXml());
253
                        Curso cPlanoDoXml2Json = new CoursesService().loadCursoPlanoFromXml(planoEdicao.getXml());
254
                        if(cPlanoDoXml2Json == null)
254
                        if(cPlanoDoXml2Json == null)
255
                            courseStudiesPlansAdminForm.setPlanoEstudos(new CursoImpl());
255
                            courseStudiesPlansAdminForm.setPlanoEstudos(new CursoImpl());
256
                        else
256
                        else
257
                            courseStudiesPlansAdminForm.setPlanoEstudos(new CoursesService().loadCursoPlanoFromXml(planoEdicao.getXml()));
257
                            courseStudiesPlansAdminForm.setPlanoEstudos(new CoursesService().loadCursoPlanoFromXml(planoEdicao.getXml()));
258
                    }
258
                    }
259
                    //LINHA NOVA PARA JSON DE INTERFACE
259
                    //LINHA NOVA PARA JSON DE INTERFACE
260
                    courseStudiesPlansAdminForm.setPlanoEstudosJsonInterface(CursoImpl.toJson(courseStudiesPlansAdminForm.getPlanoEstudos()));
260
                    courseStudiesPlansAdminForm.setPlanoEstudosJsonInterface(CursoImpl.toJson(courseStudiesPlansAdminForm.getPlanoEstudos()));
261
                %>
261
                %>
262
                <logic:notEmpty name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog">
262
                <logic:notEmpty name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog">
263
                    <div class="panel panel-warning">
263
                    <div class="panel panel-warning">
264
                        <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> LOG DA ULTIMA IMPORTAÇÃO</div>
264
                        <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> LOG DA ULTIMA IMPORTAÇÃO</div>
265
                        <div class="panel-body">
265
                        <div class="panel-body">
266
                            <pre>
266
                            <pre>
267
                                <html:hidden name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog"/>
267
                                <html:hidden name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog"/>
268
                                <bean:write name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog"/>
268
                                <bean:write name="CourseStudiesPlansAdminForm" property="courseStudiesPlan.importLog"/>
269
 
269
 
270
                            </pre>
270
                            </pre>
271
                        </div>
271
                        </div>
272
                    </div>
272
                    </div>
273
                </logic:notEmpty>
273
                </logic:notEmpty>
274
                <div class="panel panel-warning">
274
                <div class="panel panel-warning">
275
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Importar Ficheiro do SIGES em formato TXT: <a href="<%=request.getContextPath()%>/user/courses/9500-Enfermagem.TXT">VEJA UM EXEMPLO DE ENFERMAGEM</a></div>
275
                    <div class="panel-heading"><span class="glyphicon glyphicon-wrench"></span> Importar Ficheiro do SIGES em formato TXT: <a href="<%=request.getContextPath()%>/user/courses/9500-Enfermagem.TXT">VEJA UM EXEMPLO DE ENFERMAGEM</a></div>
276
                    <div class="panel-body">
276
                    <div class="panel-body">
277
                        <div class="col-md-6">
277
                        <div class="col-md-6">
278
                            <div class="panel panel-default">
278
                            <div class="panel panel-default">
279
                                <div class="panel-body">
279
                                <div class="panel-body">
280
                                    <div class="form-group">
280
                                    <div class="form-group">
281
                                        <label class="control-label col-sm-2">Escolher Ficheiro Exportado do Siges</label>
281
                                        <label class="control-label col-sm-2">Escolher Ficheiro Exportado do Siges</label>
282
                                        <div class="col-sm-10">
282
                                        <div class="col-sm-10">
283
                                            <html:file styleClass="form-control" property="formFileImport"/>
283
                                            <html:file styleClass="form-control" property="formFileImport"/>
284
                                        </div>
284
                                        </div>
285
                                    </div>
285
                                    </div>
286
                                    <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="angular.element($('#planoApp')).scope().fundirPlano();">
286
                                    <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="angular.element($('#planoApp')).scope().fundirPlano();">
287
                                        Importar o ficheiro sobrepondo esta versão do plano
287
                                        Importar o ficheiro sobrepondo esta versão do plano
288
                                    </button>
288
                                    </button>
289
                                </div>
289
                                </div>
290
                            </div>
290
                            </div>
291
                        </div>
291
                        </div>
292
                        <div class="col-md-6">
292
                        <div class="col-md-6">
293
                            <div class="panel panel-default">
293
                            <div class="panel panel-default">
294
                                <div class="panel-body">
294
                                <div class="panel-body">
295
                                    <div class="form-group">
295
                                    <div class="form-group">
296
                                        <label class="control-label col-sm-2">Escolher Ficheiro Exportado do Siges Com Ramos</label>
296
                                        <label class="control-label col-sm-2">Escolher Ficheiro Exportado do Siges Com Ramos</label>
297
                                        <div class="col-sm-10">
297
                                        <div class="col-sm-10">
298
                                            <html:file styleClass="form-control" property="formFileImport2"/>
298
                                            <html:file styleClass="form-control" property="formFileImport2"/>
299
                                        </div>
299
                                        </div>
300
                                    </div>
300
                                    </div>
301
                                    <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="angular.element($('#planoApp')).scope().fundirPlano();">
301
                                    <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai sobrepor os dados do plano de estudos atual com os dados da versão escolhida!! Tem a certeza que deseja prosseguir?" data-script="angular.element($('#planoApp')).scope().fundirPlano();">
302
                                        FUNDIR o ficheiro com esta versão do plano
302
                                        FUNDIR o ficheiro com esta versão do plano
303
                                    </button>
303
                                    </button>
304
                                </div>
304
                                </div>
305
                            </div>
305
                            </div>
306
                        </div>
306
                        </div>
307
 
307
 
308
 
308
 
309
                    </div>
309
                    </div>
310
                </div>
310
                </div>
311
 
311
 
312
 
312
 
313
                <div class="panel panel-default">
313
                <div class="panel panel-default">
314
                    <div class="panel-heading">Plano de Estudos</div>
314
                    <div class="panel-heading">Plano de Estudos</div>
315
                    <div class="panel-body">
315
                    <div class="panel-body">
316
 
316
 
317
 
317
 
318
                                <input type="hidden" name="dispatch" value="savePlano"/>
318
                                <input type="hidden" name="dispatch" value="savePlano"/>
319
                                <html:hidden property="courseId"/>
319
                                <html:hidden property="courseId"/>
320
                                <html:hidden property="versaoVigor"/>
320
                                <html:hidden property="versaoVigor"/>
321
                                <html:hidden property="courseStudiesPlan.id"/>
321
                                <html:hidden property="courseStudiesPlan.id"/>
322
                                <html:hidden styleId="semestreId" property="semestreId"/>
322
                                <html:hidden styleId="semestreId" property="semestreId"/>
323
                                <html:hidden styleId="perfilId" property="perfilId"/>
323
                                <html:hidden styleId="perfilId" property="perfilId"/>
324
                                <html:hidden styleId="planoEstudosJsonInterface" property="planoEstudosJsonInterface"/>
324
                                <html:hidden styleId="planoEstudosJsonInterface" property="planoEstudosJsonInterface"/>
325
 
325
 
326
                                <div class="form-group">
326
                                <div class="form-group">
327
                                    <label class="control-label col-sm-2">Versão</label>
327
                                    <label class="control-label col-sm-2">Versão</label>
328
                                    <div class="col-sm-10">
328
                                    <div class="col-sm-10">
329
                                        <html:text styleClass="form-control" property="courseStudiesPlan.version" size="3"/>
329
                                        <html:text styleClass="form-control" property="courseStudiesPlan.version" size="3"/>
330
                                    </div>
330
                                    </div>
331
                                </div>
331
                                </div>
332
                                <div class="form-group">
332
                                <div class="form-group">
333
                                    <label class="control-label col-sm-2">Descrição</label>
333
                                    <label class="control-label col-sm-2">Descrição</label>
334
                                    <div class="col-sm-10">
334
                                    <div class="col-sm-10">
335
                                        <html:text styleClass="form-control" property="courseStudiesPlan.versionDescription"/>
335
                                        <html:text styleClass="form-control" property="courseStudiesPlan.versionDescription"/>
336
                                    </div>
336
                                    </div>
337
                                </div>
337
                                </div>
338
 
338
 
339
 
339
 
340
 
340
 
341
 
341
 
342
 
342
 
343
 
343
 
344
 
344
 
345
                                    <div>
345
                                    <div>
346
                                        <script>
346
                                        <script>
347
                                            var planoApp = angular.module('planoApp', ['ui.tree']);
347
                                            var planoApp = angular.module('planoApp', ['ui.tree']);
348
                                            GLOBAL_BacoAngularAppDependencies.push('planoApp');
348
                                            GLOBAL_BacoAngularAppDependencies.push('planoApp');
349
                                            planoApp.controller('planoController',  function ($scope) {
349
                                            planoApp.controller('planoController',  function ($scope) {
350
                                                $scope.treeOptions = {
350
                                                $scope.treeOptions = {
351
                                                    accept: function(sourceNodeScope, destNodesScope, destIndex) {
351
                                                    accept: function(sourceNodeScope, destNodesScope, destIndex) {
352
 
352
 
353
                                                        //if(destNodesScope)
353
                                                        //if(destNodesScope)
354
                                                        //console.log(destNodesScope);
354
                                                        //console.log(destNodesScope);
355
                                                        //console.log(sourceNodeScope);
355
                                                        //console.log(sourceNodeScope);
356
                                                        //console.log(destIndex);
356
                                                        //console.log(destIndex);
357
                                                        //console.log(destNodesScope.$parent.$modelValue.title);
357
                                                        //console.log(destNodesScope.$parent.$modelValue.title);
358
                                                        //console.log(destNodesScope.$modelValue[0].type);
358
                                                        //console.log(destNodesScope.$modelValue[0].type);
359
                                                        if(sourceNodeScope.$modelValue.type == destNodesScope.$modelValue[0].type)
359
                                                        if(sourceNodeScope.$modelValue.type == destNodesScope.$modelValue[0].type)
360
                                                            return true;
360
                                                            return true;
361
                                                        return false;
361
                                                        return false;
362
                                                    },
362
                                                    },
363
                                                    dropped: function(e) {
363
                                                    dropped: function(e) {
364
                                                        //console.log (e.source.nodeScope.$modelValue);
364
                                                        //console.log (e.source.nodeScope.$modelValue);
365
                                                        //alert ("Largado o nó com nome: " + e.source.nodeScope.$modelValue.name + " sobre " + e.dest.nodesScope.$parent.$modelValue.name);
365
                                                        //alert ("Largado o nó com nome: " + e.source.nodeScope.$modelValue.name + " sobre " + e.dest.nodesScope.$parent.$modelValue.name);
366
                                                    }
366
                                                    }
367
                                                };
367
                                                };
368
                                                $scope.json = <%=courseStudiesPlansAdminForm.getPlanoEstudosJsonInterface()%>
368
                                                $scope.json = <%=courseStudiesPlansAdminForm.getPlanoEstudosJsonInterface()%>
369
 
369
 
370
                                                $scope.confView =
370
                                                $scope.confView =
371
                                                {
371
                                                {
372
                                                    "SIGES" : true ,
372
                                                    "SIGES" : true ,
373
                                                    "Nome" : true ,
373
                                                    "Nome" : true ,
374
                                                    "ECTS" : true,
374
                                                    "ECTS" : true,
375
                                                    "Total" : true ,
375
                                                    "Total" : true ,
376
                                                    "T" : true ,
376
                                                    "T" : true ,
377
                                                    "TP" : true ,
377
                                                    "TP" : true ,
378
                                                    "P" : true ,
378
                                                    "P" : true ,
379
                                                    "PL" : true ,
379
                                                    "PL" : true ,
380
                                                    "PD" : true ,
380
                                                    "PD" : true ,
381
                                                    "OT" : true ,
381
                                                    "OT" : true ,
382
                                                    "E" : true ,
382
                                                    "E" : true ,
383
                                                    "S" : true ,
383
                                                    "S" : true ,
384
                                                    "TC" : true ,
384
                                                    "TC" : true ,
385
                                                    "O" : true ,
385
                                                    "O" : true ,
386
                                                    "URL_UNIDADE" : true ,
386
                                                    "URL_UNIDADE" : true ,
387
                                                    "FICHA_URL" : true
387
                                                    "FICHA_URL" : true
388
                                                }
388
                                                }
389
 
389
 
390
                                                $scope.submeterForm = function()
390
                                                $scope.submeterForm = function()
391
                                                {
391
                                                {
392
                                                    $("#planoEstudosJsonInterface").val(
392
                                                    $("#planoEstudosJsonInterface").val(
393
                                                            JSON.stringify($scope.json)
393
                                                            JSON.stringify($scope.json)
394
                                                    );
394
                                                    );
395
                                                    $("#CourseStudiesPlansAdminForm").submit();
395
                                                    $("#CourseStudiesPlansAdminForm").submit();
396
                                                }
396
                                                }
397
 
397
 
398
                                                $scope.fundirPlano = function()
398
                                                $scope.fundirPlano = function()
399
                                                {
399
                                                {
400
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"mergePlano");
400
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"mergePlano");
401
                                                    $scope.submeterForm();
401
                                                    $scope.submeterForm();
402
                                                }
402
                                                }
403
 
403
 
404
                                                $scope.importarPlano = function()
404
                                                $scope.importarPlano = function()
405
                                                {
405
                                                {
406
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"importarPlano");
406
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"importarPlano");
407
                                                    $scope.submeterForm();
407
                                                    $scope.submeterForm();
408
                                                }
408
                                                }
409
                                                $scope.salvar = function()
409
                                                $scope.salvar = function()
410
                                                {
410
                                                {
411
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"savePlano");
411
                                                    set($("#CourseStudiesPlansAdminForm").get(0),"savePlano");
412
                                                    $scope.submeterForm();
412
                                                    $scope.submeterForm();
413
                                                }
413
                                                }
414
 
414
 
415
                                                $scope.removeSemestre = function($index)
415
                                                $scope.removeSemestre = function($index)
416
                                                {
416
                                                {
417
                                                    if(confirm("Tem a certeza que deseja remover o Semestre " + $scope.json.semestre[$index].id + "?"))
417
                                                    if(confirm("Tem a certeza que deseja remover o Semestre " + $scope.json.semestre[$index].id + "?"))
418
                                                        $scope.json.semestre.splice($index,1);
418
                                                        $scope.json.semestre.splice($index,1);
419
                                                }
419
                                                }
420
                                                $scope.removePerfil = function(semestre,$index)
420
                                                $scope.removePerfil = function(semestre,$index)
421
                                                {
421
                                                {
422
                                                    if(confirm("Tem a certeza que deseja remover o Perfil " + semestre.perfil[$index].nome + "?"))
422
                                                    if(confirm("Tem a certeza que deseja remover o Perfil " + semestre.perfil[$index].nome + "?"))
423
                                                        semestre.perfil.splice($index,1);
423
                                                        semestre.perfil.splice($index,1);
424
                                                }
424
                                                }
425
                                                $scope.removeUnidade = function(semestreOuperfil,$index)
425
                                                $scope.removeUnidade = function(semestreOuperfil,$index)
426
                                                {
426
                                                {
427
                                                    if(confirm("Tem a certeza que deseja remover a Unidade " + semestreOuperfil.unidade[$index].nome + "?"))
427
                                                    if(confirm("Tem a certeza que deseja remover a Unidade " + semestreOuperfil.unidade[$index].nome + "?"))
428
                                                    semestreOuperfil.unidade.splice($index,1);
428
                                                    semestreOuperfil.unidade.splice($index,1);
429
                                                }
429
                                                }
430
                                                $scope.addSemestre = function()
430
                                                $scope.addSemestre = function()
431
                                                {
431
                                                {
432
                                                    $scope.json.semestre.push(
432
                                                    $scope.json.semestre.push(
433
                                                            {
433
                                                            {
434
                                                                "id": "S1",
434
                                                                "id": "S1",
435
                                                                "notas": null,
435
                                                                "notas": null,
436
                                                                "perfil": [],
436
                                                                "perfil": [],
437
                                                                "semestreDesc": "Semestre 1",
437
                                                                "semestreDesc": "Semestre 1",
438
                                                                "semestreDescEn": "Semester 1",
438
                                                                "semestreDescEn": "Semester 1",
439
                                                                "semestreDescEs": "Semestre 1",
439
                                                                "semestreDescEs": "Semestre 1",
440
                                                                "semestreDescFr": "Semestre 1",
440
                                                                "semestreDescFr": "Semestre 1",
441
                                                                "semestreId": null,
441
                                                                "semestreId": null,
442
                                                                "unidade": [],
442
                                                                "unidade": [],
443
                                                                "type" : "semestre"
443
                                                                "type" : "semestre"
444
                                                            }
444
                                                            }
445
                                                    );
445
                                                    );
446
                                                }
446
                                                }
447
 
447
 
448
                                                $scope.addPerfil = function(semestre)
448
                                                $scope.addPerfil = function(semestre)
449
                                                {
449
                                                {
450
                                                    semestre.perfil.push(
450
                                                    semestre.perfil.push(
451
                                                            {
451
                                                            {
452
                                                                "nome": "",
452
                                                                "nome": "",
453
                                                                "perfilId": null,
453
                                                                "perfilId": null,
454
                                                                "unidade" : [],
454
                                                                "unidade" : [],
455
                                                                "type" : "perfil"
455
                                                                "type" : "perfil"
456
                                                            }
456
                                                            }
457
                                                    );
457
                                                    );
458
                                                }
458
                                                }
459
 
459
 
460
                                                $scope.addUnidade = function(semestreOuPerfil)
460
                                                $scope.addUnidade = function(semestreOuPerfil)
461
                                                {
461
                                                {
462
                                                    semestreOuPerfil.unidade.push(
462
                                                    semestreOuPerfil.unidade.push(
463
                                                            {
463
                                                            {
464
                                                                "dep": "",
464
                                                                "dep": "",
465
                                                                "ects": "",
465
                                                                "ects": "",
466
                                                                "nome": "",
466
                                                                "nome": "",
467
                                                                "nomeEn": null,
467
                                                                "nomeEn": null,
468
                                                                "nomeEs": null,
468
                                                                "nomeEs": null,
469
                                                                "nomeFr": null,
469
                                                                "nomeFr": null,
470
                                                                "obs": "",
470
                                                                "obs": "",
471
                                                                "removed": null,
471
                                                                "removed": null,
472
                                                                "siges": null,
472
                                                                "siges": null,
473
                                                                "totalHoras": 0,
473
                                                                "totalHoras": 0,
474
                                                                "urlFichaCurricular": "",
474
                                                                "urlFichaCurricular": "",
475
                                                                "urlUnidadeCurricular": "",
475
                                                                "urlUnidadeCurricular": "",
476
                                                                "type": "unidade"
476
                                                                "type": "unidade"
477
                                                            }
477
                                                            }
478
                                                    );
478
                                                    );
479
                                                }
479
                                                }
480
                                            });
480
                                            });
481
 
481
 
482
 
482
 
483
                                        </script>
483
                                        </script>
484
                                        <div class="panel panel-info">
484
                                        <div class="panel panel-info">
485
                                            <div class="panel-heading">Configuração de Visualização</div>
485
                                            <div class="panel-heading">Configuração de Visualização</div>
486
                                            <div class="panel-body">
486
                                            <div class="panel-body">
487
                                                <table class="table">
487
                                                <table class="table">
488
                                                    <thead>
488
                                                    <thead>
489
                                                        <tr>
489
                                                        <tr>
490
                                                            <th>SIGES</th>
490
                                                            <th>SIGES</th>
491
                                                            <th>Nome</th>
491
                                                            <th>Nome</th>
492
                                                            <th>ECTS</th>
492
                                                            <th>ECTS</th>
493
                                                            <th>Total</th>
493
                                                            <th>Total</th>
494
                                                            <th>T</th>
494
                                                            <th>T</th>
495
                                                            <th>TP</th>
495
                                                            <th>TP</th>
496
                                                            <th>P</th>
496
                                                            <th>P</th>
497
                                                            <th>PL</th>
497
                                                            <th>PL</th>
498
                                                            <th>PD</th>
498
                                                            <th>PD</th>
499
                                                            <th>OT</th>
499
                                                            <th>OT</th>
500
                                                            <th>E</th>
500
                                                            <th>E</th>
501
                                                            <th>S</th>
501
                                                            <th>S</th>
502
                                                            <th>TC</th>
502
                                                            <th>TC</th>
503
                                                            <th>O</th>
503
                                                            <th>O</th>
504
 
504
 
505
                                                            <th>URL UNIDADE</th>
505
                                                            <th>URL UNIDADE</th>
506
                                                            <th>FICHA URL</th>
506
                                                            <th>FICHA URL</th>
507
                                                        </tr>
507
                                                        </tr>
508
                                                    </thead>
508
                                                    </thead>
509
                                                    <tbody>
509
                                                    <tbody>
510
                                                    <tr>
510
                                                    <tr>
511
                                                        <td><input type="checkbox" ng-model="confView.SIGES"></td>
511
                                                        <td><input type="checkbox" ng-model="confView.SIGES"></td>
512
                                                        <td><input type="checkbox" ng-model="confView.Nome"></td>
512
                                                        <td><input type="checkbox" ng-model="confView.Nome"></td>
513
                                                        <td><input type="checkbox" ng-model="confView.ECTS"></td>
513
                                                        <td><input type="checkbox" ng-model="confView.ECTS"></td>
514
                                                        <td><input type="checkbox" ng-model="confView.Total"></td>
514
                                                        <td><input type="checkbox" ng-model="confView.Total"></td>
515
                                                        <td><input type="checkbox" ng-model="confView.T"></td>
515
                                                        <td><input type="checkbox" ng-model="confView.T"></td>
516
                                                        <td><input type="checkbox" ng-model="confView.TP"></td>
516
                                                        <td><input type="checkbox" ng-model="confView.TP"></td>
517
                                                        <td><input type="checkbox" ng-model="confView.P"></td>
517
                                                        <td><input type="checkbox" ng-model="confView.P"></td>
518
                                                        <td><input type="checkbox" ng-model="confView.PL"></td>
518
                                                        <td><input type="checkbox" ng-model="confView.PL"></td>
519
                                                        <td><input type="checkbox" ng-model="confView.PD"></td>
519
                                                        <td><input type="checkbox" ng-model="confView.PD"></td>
520
                                                        <td><input type="checkbox" ng-model="confView.OT"></td>
520
                                                        <td><input type="checkbox" ng-model="confView.OT"></td>
521
                                                        <td><input type="checkbox" ng-model="confView.E"></td>
521
                                                        <td><input type="checkbox" ng-model="confView.E"></td>
522
                                                        <td><input type="checkbox" ng-model="confView.S"></td>
522
                                                        <td><input type="checkbox" ng-model="confView.S"></td>
523
                                                        <td><input type="checkbox" ng-model="confView.TC"></td>
523
                                                        <td><input type="checkbox" ng-model="confView.TC"></td>
524
                                                        <td><input type="checkbox" ng-model="confView.O"></td>
524
                                                        <td><input type="checkbox" ng-model="confView.O"></td>
525
                                                        <td><input type="checkbox" ng-model="confView.URL_UNIDADE"></td>
525
                                                        <td><input type="checkbox" ng-model="confView.URL_UNIDADE"></td>
526
                                                        <td><input type="checkbox" ng-model="confView.FICHA_URL"></td>
526
                                                        <td><input type="checkbox" ng-model="confView.FICHA_URL"></td>
527
                                                    </tr>
527
                                                    </tr>
528
                                                    </tbody>
528
                                                    </tbody>
529
                                                </table>
529
                                                </table>
530
                                            </div>
530
                                            </div>
531
                                        </div>
531
                                        </div>
532
 
532
 
533
                                        <div class="panel panel-default">
533
                                        <div class="panel panel-default">
534
                                            <div class="panel-heading">
534
                                            <div class="panel-heading">
535
                                                Informação obtida do Siges (Auxiliar)
535
                                                Informação obtida do Siges (Auxiliar)
536
                                            </div>
536
                                            </div>
537
                                            <div class="panel-body">
537
                                            <div class="panel-body">
538
                                                <div class="form-group">
538
                                                <div class="form-group">
539
                                                    <label class="control-label col-sm-2">Ano do Plano no Siges</label>
539
                                                    <label class="control-label col-sm-2">Ano do Plano no Siges</label>
540
                                                    <div class="col-sm-10">
540
                                                    <div class="col-sm-10">
541
                                                        <input type="text" class="form-control" ng-model="json.anoPlanoSiges"/>
541
                                                        <input type="text" class="form-control" ng-model="json.anoPlanoSiges"/>
542
                                                    </div>
542
                                                    </div>
543
                                                </div>
543
                                                </div>
544
                                                <div class="form-group">
544
                                                <div class="form-group">
545
                                                    <label class="control-label col-sm-2">Código do Plano no Siges</label>
545
                                                    <label class="control-label col-sm-2">Código do Plano no Siges</label>
546
                                                    <div class="col-sm-10">
546
                                                    <div class="col-sm-10">
547
                                                        <input type="text" class="form-control" ng-model="json.codigoPlanoSiges"/>
547
                                                        <input type="text" class="form-control" ng-model="json.codigoPlanoSiges"/>
548
                                                    </div>
548
                                                    </div>
549
                                                </div>
549
                                                </div>
550
                                                <div class="form-group">
550
                                                <div class="form-group">
551
                                                    <label class="control-label col-sm-2">Linha Descritiva do Plano no Siges</label>
551
                                                    <label class="control-label col-sm-2">Linha Descritiva do Plano no Siges</label>
552
                                                    <div class="col-sm-10">
552
                                                    <div class="col-sm-10">
553
                                                        <input type="text" class="form-control" ng-model="json.descPlanoSiges"/>
553
                                                        <input type="text" class="form-control" ng-model="json.descPlanoSiges"/>
554
                                                    </div>
554
                                                    </div>
555
                                                </div>
555
                                                </div>
556
                                            </div>
556
                                            </div>
557
                                        </div>
557
                                        </div>
558
 
558
 
559
                                        <div class="panel panel-default">
559
                                        <div class="panel panel-default">
560
                                            <div class="panel-heading">
560
                                            <div class="panel-heading">
561
                                                Semestres
561
                                                Semestres
562
                                                <button style="margin-left: 4px"  type="button" class="btn btn-success pull-right" ng-click="addSemestre()">
562
                                                <button style="margin-left: 4px"  type="button" class="btn btn-success pull-right" ng-click="addSemestre()">
563
                                                    <span class="glyphicon glyphicon-plus"> </span> Semestre
563
                                                    <span class="glyphicon glyphicon-plus"> </span> Semestre
564
                                                </button>
564
                                                </button>
565
                                            </div>
565
                                            </div>
566
                                            <div class="panel-body">
566
                                            <div class="panel-body">
567
                                                <div ui-tree="treeOptions" id="page-content-root">
567
                                                <div ui-tree="treeOptions" id="page-content-root">
568
                                                    <div ui-tree-nodes ng-model="json.semestre">
568
                                                    <div ui-tree-nodes ng-model="json.semestre">
569
                                                        <div class="panel panel-primary" ng-repeat="s in json.semestre" ui-tree-node ng-include="'semestre_renderer.html'" ng-init="s.type='semestre'">
569
                                                        <div class="panel panel-primary" ng-repeat="s in json.semestre" ui-tree-node ng-include="'semestre_renderer.html'" ng-init="s.type='semestre'">
570
                                                    </div>
570
                                                    </div>
571
                                                </div>
571
                                                </div>
572
                                            </div>
572
                                            </div>
573
                                        </div>
573
                                        </div>
574
 
574
 
575
                                        <script type="text/ng-template" id="semestre_renderer.html">
575
                                        <script type="text/ng-template" id="semestre_renderer.html">
576
                                            <div class="panel-heading">
576
                                            <div class="panel-heading">
577
                                                <div class="form-group">
577
                                                <div class="form-group">
578
 
578
 
579
                                                    <div class="col-sm-1">
579
                                                    <div class="col-sm-1">
580
                                                        <button type="button" class="btn btn-danger" ng-click="removeSemestre($index)">
580
                                                        <button type="button" class="btn btn-danger" ng-click="removeSemestre($index)">
581
                                                            <span class="glyphicon glyphicon-remove"> </span>
581
                                                            <span class="glyphicon glyphicon-remove"> </span>
582
                                                        </button>
582
                                                        </button>
583
                                                    </div>
583
                                                    </div>
584
                                                    <div class="col-sm-4" ui-tree-handle>
584
                                                    <div class="col-sm-4" ui-tree-handle>
585
                                                        <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical"></i></span>
585
                                                        <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical"></i></span>
586
                                                        Duração
586
                                                        Duração
587
                                                    </div>
587
                                                    </div>
588
                                                    <div class="col-sm-3">
588
                                                    <div class="col-sm-3">
589
                                                        <select class="form-control chosenOff" ng-model="s.id">
589
                                                        <select class="form-control chosenOff" ng-model="s.id">
590
                                                            <option value="S1">Semestre 1</option>
590
                                                            <option value="S1">Semestre 1</option>
591
                                                            <option value="S2">Semestre 2</option>
591
                                                            <option value="S2">Semestre 2</option>
592
                                                            <option value="S3">Semestre 3</option>
592
                                                            <option value="S3">Semestre 3</option>
593
                                                            <option value="S4">Semestre 4</option>
593
                                                            <option value="S4">Semestre 4</option>
594
                                                            <option value="S5">Semestre 5</option>
594
                                                            <option value="S5">Semestre 5</option>
595
                                                            <option value="S6">Semestre 6</option>
595
                                                            <option value="S6">Semestre 6</option>
596
                                                            <option value="S7">Semestre 7</option>
596
                                                            <option value="S7">Semestre 7</option>
597
                                                            <option value="S8">Semestre 8</option>
597
                                                            <option value="S8">Semestre 8</option>
598
                                                            <option value="A1">Anual 1</option>
598
                                                            <option value="A1">Anual 1</option>
599
                                                            <option value="A2">Anual 2</option>
599
                                                            <option value="A2">Anual 2</option>
600
                                                            <option value="A3">Anual 3</option>
600
                                                            <option value="A3">Anual 3</option>
601
                                                            <option value="A4">Anual 4</option>
601
                                                            <option value="A4">Anual 4</option>
602
                                                            <option value="T1">Trimestre 1</option>
602
                                                            <option value="T1">Trimestre 1</option>
603
                                                            <option value="T2">Trimestre 2</option>
603
                                                            <option value="T2">Trimestre 2</option>
604
                                                            <option value="T3">Trimestre 3</option>
604
                                                            <option value="T3">Trimestre 3</option>
605
                                                            <option value="T4">Trimestre 4</option>
605
                                                            <option value="T4">Trimestre 4</option>
606
                                                            <option value="T5">Trimestre 5</option>
606
                                                            <option value="T5">Trimestre 5</option>
607
                                                            <option value="T6">Trimestre 6</option>
607
                                                            <option value="T6">Trimestre 6</option>
608
                                                            <option value="T7">Trimestre 7</option>
608
                                                            <option value="T7">Trimestre 7</option>
609
                                                            <option value="T8">Trimestre 8</option>
609
                                                            <option value="T8">Trimestre 8</option>
610
                                                            <option value="OP">Opcionais</option>
610
                                                            <option value="OP">Opcionais</option>
611
                                                        </select>
611
                                                        </select>
612
                                                        <div ng-show="s.id == 'OP'">
612
                                                        <div ng-show="s.id == 'OP'">
613
                                                            Descrição (PT) <input type="text" ng-model="s.semestreDesc" class="form-control"/>
613
                                                            Descrição (PT) <input type="text" ng-model="s.semestreDesc" class="form-control"/>
614
                                                            Descrição (EN) <input type="text" ng-model="s.semestreDescEn" class="form-control"/>
614
                                                            Descrição (EN) <input type="text" ng-model="s.semestreDescEn" class="form-control"/>
615
                                                            Descrição (ES) <input type="text" ng-model="s.semestreDescEs" class="form-control"/>
615
                                                            Descrição (ES) <input type="text" ng-model="s.semestreDescEs" class="form-control"/>
616
                                                            Descrição (FR) <input type="text" ng-model="s.semestreDescFr" class="form-control"/>
616
                                                            Descrição (FR) <input type="text" ng-model="s.semestreDescFr" class="form-control"/>
617
                                                        </div>
617
                                                        </div>
618
                                                    </div>
618
                                                    </div>
619
                                                    <div class="col-sm-4">
619
                                                    <div class="col-sm-4">
620
 
620
 
621
                                                        <button style="margin-left: 4px"  type="button" class="btn btn-success pull-right" ng-click="addUnidade(s)">
621
                                                        <button style="margin-left: 4px"  type="button" class="btn btn-success pull-right" ng-click="addUnidade(s)">
622
                                                            <span class="glyphicon glyphicon-plus"> </span> Unidade
622
                                                            <span class="glyphicon glyphicon-plus"> </span> Unidade
623
                                                        </button>
623
                                                        </button>
624
 
624
 
625
                                                        <button style="margin-left: 4px" type="button" class="btn btn-success pull-right" ng-click="addPerfil(s)">
625
                                                        <button style="margin-left: 4px" type="button" class="btn btn-success pull-right" ng-click="addPerfil(s)">
626
                                                            <span class="glyphicon glyphicon-plus"> </span> Perfil
626
                                                            <span class="glyphicon glyphicon-plus"> </span> Perfil
627
                                                        </button>
627
                                                        </button>
628
                                                    </div>
628
                                                    </div>
629
                                                </div>
629
                                                </div>
630
                                            </div>
630
                                            </div>
631
                                            <div class="panel-body">
631
                                            <div class="panel-body">
632
                                                <div class="form-group">
632
                                                <div class="form-group">
633
 
633
 
634
                                                    <div class="col-sm-2">
634
                                                    <div class="col-sm-2">
635
                                                        Notas do Semestre (Pode ser utilizado para mostrar Optativas)
635
                                                        Notas do Semestre (Pode ser utilizado para mostrar Optativas)
636
                                                    </div>
636
                                                    </div>
637
                                                    <div class="col-sm-10">
637
                                                    <div class="col-sm-10">
638
                                                        <textarea ng-model="s.notas" rows="5" class="form-control"></textarea>
638
                                                        <textarea ng-model="s.notas" rows="5" class="form-control"></textarea>
639
                                                    </div>
639
                                                    </div>
640
                                                </div>
640
                                                </div>
641
 
641
 
642
                                                <button class="btn btn-default" data-toggle="collapse" type="button" data-target=".langs">Ver Campos Multingua</button>
642
                                                <button class="btn btn-default" data-toggle="collapse" type="button" data-target=".langs">Ver Campos Multingua</button>
643
                                                <div ui-tree-nodes="" ng-model="s.perfil" ng-show="s.perfil.length > 0">
643
                                                <div ui-tree-nodes="" ng-model="s.perfil" ng-show="s.perfil.length > 0">
644
                                                    <div class="panel panel-info" ng-repeat="p in s.perfil" ui-tree-node ng-include="'perfil_renderer.html'" ng-init="p.type='perfil';parent=s">
644
                                                    <div class="panel panel-info" ng-repeat="p in s.perfil" ui-tree-node ng-include="'perfil_renderer.html'" ng-init="p.type='perfil';parent=s">
645
                                                    </div>
645
                                                    </div>
646
                                                </div>
646
                                                </div>
647
                                                <div ng-show="s.unidade.length > 0" class="table-responsive">
647
                                                <div ng-show="s.unidade.length > 0" class="table-responsive">
648
                                                    <table class="table clearfix">
648
                                                    <table class="table clearfix">
649
                                                        <thead>
649
                                                        <thead>
650
                                                        <tr>
650
                                                        <tr>
651
                                                            <td></td>
651
                                                            <td></td>
652
                                                            <td></td>
652
                                                            <td></td>
653
                                                            <th ng-show="confView.SIGES">SIGES</th>
653
                                                            <th ng-show="confView.SIGES">SIGES</th>
654
                                                            <th ng-show="confView.Nome">Nome</th>
654
                                                            <th ng-show="confView.Nome">Nome</th>
655
                                                            <th ng-show="confView.ECTS">ECTS</th>
655
                                                            <th ng-show="confView.ECTS">ECTS</th>
656
                                                            <th ng-show="confView.Total">Total</th>
656
                                                            <th ng-show="confView.Total">Total</th>
657
                                                            <th ng-show="confView.T">T</th>
657
                                                            <th ng-show="confView.T">T</th>
658
                                                            <th ng-show="confView.TP">TP</th>
658
                                                            <th ng-show="confView.TP">TP</th>
659
                                                            <th ng-show="confView.P">P</th>
659
                                                            <th ng-show="confView.P">P</th>
660
                                                            <th ng-show="confView.PL">PL</th>
660
                                                            <th ng-show="confView.PL">PL</th>
661
                                                            <th ng-show="confView.PD">PD</th>
661
                                                            <th ng-show="confView.PD">PD</th>
662
                                                            <th ng-show="confView.OT">OT</th>
662
                                                            <th ng-show="confView.OT">OT</th>
663
                                                            <th ng-show="confView.E">E</th>
663
                                                            <th ng-show="confView.E">E</th>
664
                                                            <th ng-show="confView.S">S</th>
664
                                                            <th ng-show="confView.S">S</th>
665
                                                            <th ng-show="confView.TC">TC</th>
665
                                                            <th ng-show="confView.TC">TC</th>
666
                                                            <th ng-show="confView.O">O</th>
666
                                                            <th ng-show="confView.O">O</th>
667
                                                            <th ng-show="confView.URL_UNIDADE">URL UNIDADE</th>
667
                                                            <th ng-show="confView.URL_UNIDADE">URL UNIDADE</th>
668
                                                            <th ng-show="confView.FICHA_URL">FICHA URL</th>
668
                                                            <th ng-show="confView.FICHA_URL">FICHA URL</th>
669
                                                        </tr>
669
                                                        </tr>
670
                                                    </thead>
670
                                                    </thead>
671
                                                    <tbody ui-tree-nodes="" ng-model="s.unidade">
671
                                                    <tbody ui-tree-nodes="" ng-model="s.unidade">
672
 
672
 
673
                                                        <!-- UNIDADE TEMPLATE START-->
673
                                                        <!-- UNIDADE TEMPLATE START-->
674
                                                        <tr ng-repeat="u in s.unidade" ui-tree-node ng-include="'unidade_renderer.html'" ng-init="u.type='unidade';parent=s">
674
                                                        <tr ng-repeat="u in s.unidade" ui-tree-node ng-include="'unidade_renderer.html'" ng-init="u.type='unidade';parent=s">
675
                                                        </tr>
675
                                                        </tr>
676
                                                        <!--UNIDADE TEMPLATE END-->
676
                                                        <!--UNIDADE TEMPLATE END-->
677
 
677
 
678
                                                    </tbody>
678
                                                    </tbody>
679
                                                </table>
679
                                                </table>
680
                                                </div>
680
                                                </div>
681
                                            </div>
681
                                            </div>
682
                                        </script>
682
                                        </script>
683
                                        <!-- PERFIL TEMPLATE START -->
683
                                        <!-- PERFIL TEMPLATE START -->
684
                                        <script type="text/ng-template" id="perfil_renderer.html">
684
                                        <script type="text/ng-template" id="perfil_renderer.html">
685
 
685
 
686
                                            <div class="panel-heading">
686
                                            <div class="panel-heading">
687
 
687
 
688
                                                <div class="form-group">
688
                                                <div class="form-group">
689
                                                    <div class="col-sm-1">
689
                                                    <div class="col-sm-1">
690
                                                        <button type="button" class="btn btn-danger" ng-click="removePerfil(parent,$index)">
690
                                                        <button type="button" class="btn btn-danger" ng-click="removePerfil(parent,$index)">
691
                                                            <span class="glyphicon glyphicon-remove"> </span>
691
                                                            <span class="glyphicon glyphicon-remove"> </span>
692
                                                        </button>
692
                                                        </button>
693
                                                    </div>
693
                                                    </div>
694
                                                    <div class="col-sm-3" ui-tree-handle>
694
                                                    <div class="col-sm-3" ui-tree-handle>
695
                                                        <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical"></i></span> Perfil
695
                                                        <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical"></i></span> Perfil
696
                                                    </div>
696
                                                    </div>
697
                                                    <div class="col-sm-5">
697
                                                    <div class="col-sm-5">
698
                                                        <input type="text" class="form-control" ng-model="p.nome">
698
                                                        <input type="text" class="form-control" ng-model="p.nome">
699
                                                    </div>
699
                                                    </div>
700
                                                    <div  class="col-sm-3">
700
                                                    <div  class="col-sm-3">
701
                                                        <button type="button" class="btn btn-success pull-right" ng-click="addUnidade(p)">
701
                                                        <button type="button" class="btn btn-success pull-right" ng-click="addUnidade(p)">
702
                                                            <span class="glyphicon glyphicon-plus"> </span>  Unidade
702
                                                            <span class="glyphicon glyphicon-plus"> </span>  Unidade
703
                                                        </button>
703
                                                        </button>
704
                                                    </div>
704
                                                    </div>
705
                                                </div>
705
                                                </div>
706
                                            </div>
706
                                            </div>
707
                                            <div class="panel-body clearfix table-responsive">
707
                                            <div class="panel-body clearfix table-responsive">
708
                                                <table class="table">
708
                                                <table class="table">
709
                                                    <thead>
709
                                                    <thead>
710
                                                    <tr>
710
                                                    <tr>
711
                                                        <td></td>
711
                                                        <td></td>
712
                                                        <td></td>
712
                                                        <td></td>
713
                                                        <th ng-show="confView.SIGES">SIGES</th>
713
                                                        <th ng-show="confView.SIGES">SIGES</th>
714
                                                        <th ng-show="confView.Nome">Nome</th>
714
                                                        <th ng-show="confView.Nome">Nome</th>
715
                                                        <th ng-show="confView.ECTS">ECTS</th>
715
                                                        <th ng-show="confView.ECTS">ECTS</th>
716
                                                        <th ng-show="confView.Total">Total</th>
716
                                                        <th ng-show="confView.Total">Total</th>
717
                                                        <th ng-show="confView.T">T</th>
717
                                                        <th ng-show="confView.T">T</th>
718
                                                        <th ng-show="confView.TP">TP</th>
718
                                                        <th ng-show="confView.TP">TP</th>
719
                                                        <th ng-show="confView.P">P</th>
719
                                                        <th ng-show="confView.P">P</th>
720
                                                        <th ng-show="confView.PL">PL</th>
720
                                                        <th ng-show="confView.PL">PL</th>
721
                                                        <th ng-show="confView.PD">PD</th>
721
                                                        <th ng-show="confView.PD">PD</th>
722
                                                        <th ng-show="confView.OT">OT</th>
722
                                                        <th ng-show="confView.OT">OT</th>
723
                                                        <th ng-show="confView.E">E</th>
723
                                                        <th ng-show="confView.E">E</th>
724
                                                        <th ng-show="confView.S">S</th>
724
                                                        <th ng-show="confView.S">S</th>
725
                                                        <th ng-show="confView.TC">TC</th>
725
                                                        <th ng-show="confView.TC">TC</th>
726
                                                        <th ng-show="confView.O">O</th>
726
                                                        <th ng-show="confView.O">O</th>
727
                                                        <th ng-show="confView.URL_UNIDADE">URL UNIDADE</th>
727
                                                        <th ng-show="confView.URL_UNIDADE">URL UNIDADE</th>
728
                                                        <th ng-show="confView.FICHA_URL">FICHA URL</th>
728
                                                        <th ng-show="confView.FICHA_URL">FICHA URL</th>
729
                                                    </tr>
729
                                                    </tr>
730
                                                    </thead>
730
                                                    </thead>
731
                                                    <tbody ui-tree-nodes="" ng-model="p.unidade">
731
                                                    <tbody ui-tree-nodes="" ng-model="p.unidade">
732
                                                        <!-- UNIDADE TEMPLATE START-->
732
                                                        <!-- UNIDADE TEMPLATE START-->
733
                                                        <tr ng-repeat="u in p.unidade" ui-tree-node ng-include="'unidade_renderer.html'" ng-init="u.type='unidade';parent=p">
733
                                                        <tr ng-repeat="u in p.unidade" ui-tree-node ng-include="'unidade_renderer.html'" ng-init="u.type='unidade';parent=p">
734
                                                        </tr>
734
                                                        </tr>
735
                                                        <!--UNIDADE TEMPLATE END-->
735
                                                        <!--UNIDADE TEMPLATE END-->
736
 
736
 
737
                                                    </tbody>
737
                                                    </tbody>
738
                                                </table>
738
                                                </table>
739
                                            </div>
739
                                            </div>
740
                                        </script>
740
                                        </script>
741
 
741
 
742
                                        <script type="text/ng-template" id="unidade_renderer.html">
742
                                        <script type="text/ng-template" id="unidade_renderer.html">
743
                                            <td class="text-nowrap">
743
                                            <td class="text-nowrap">
744
                                                <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical" ui-tree-handle></i></span>
744
                                                <span class="btn btn-info"><i class="glyphicon glyphicon-resize-vertical" ui-tree-handle></i></span>
745
                                            </td>
745
                                            </td>
746
                                            <td>
746
                                            <td>
747
                                                <button type="button" class="btn btn-danger" ng-click="removeUnidade(parent,$index)">
747
                                                <button type="button" class="btn btn-danger" ng-click="removeUnidade(parent,$index)">
748
                                                    <span class="glyphicon glyphicon-remove"> </span>
748
                                                    <span class="glyphicon glyphicon-remove"> </span>
749
                                                </button>
749
                                                </button>
750
                                            </td>
750
                                            </td>
751
                                            <td ng-show="confView.SIGES">
751
                                            <td ng-show="confView.SIGES">
752
                                                <%--
752
                                                <%--
753
 
753
 
754
                                                FOCUS FIND UNIT
754
                                                FOCUS FIND UNIT
755
                                                <script>
755
                                                <script>
756
 
756
 
757
                                                    $(document).ready(
757
                                                    $(document).ready(
758
                                                            function()
758
                                                            function()
759
                                                            {
759
                                                            {
760
                                                                $("#siges${dummyIndexIdUnidades}").focusout(
760
                                                                $("#siges${dummyIndexIdUnidades}").focusout(
761
                                                                        function(){
761
                                                                        function(){
762
                                                                            var code = $("#siges${dummyIndexIdUnidades}").val();
762
                                                                            var code = $("#siges${dummyIndexIdUnidades}").val();
763
                                                                            $.getJSON("<%=request.getContextPath()%>/user/courses/courseApiJson.jsp",
763
                                                                            $.getJSON("<%=request.getContextPath()%>/user/courses/courseApiJson.jsp",
764
                                                                                    { service:"findCourseUnit",
764
                                                                                    { service:"findCourseUnit",
765
                                                                                        siges: code,
765
                                                                                        siges: code,
766
                                                                                        courseSigesCode: "${course.code}"
766
                                                                                        courseSigesCode: "${course.code}"
767
                                                                                    },
767
                                                                                    },
768
                                                                                    function(data)
768
                                                                                    function(data)
769
                                                                                    {
769
                                                                                    {
770
                                                                                        if(data.response == "ok")
770
                                                                                        if(data.response == "ok")
771
                                                                                        {
771
                                                                                        {
772
                                                                                            $("#nome${dummyIndexIdUnidades}").val(data.courseUnitName);
772
                                                                                            $("#nome${dummyIndexIdUnidades}").val(data.courseUnitName);
773
                                                                                            $("#sigesResponse${dummyIndexIdUnidades}").html("");
773
                                                                                            $("#sigesResponse${dummyIndexIdUnidades}").html("");
774
                                                                                        }
774
                                                                                        }
775
                                                                                        else
775
                                                                                        else
776
                                                                                        {
776
                                                                                        {
777
                                                                                            $("#sigesResponse${dummyIndexIdUnidades}").html("Não encontrado");
777
                                                                                            $("#sigesResponse${dummyIndexIdUnidades}").html("Não encontrado");
778
                                                                                        }
778
                                                                                        }
779
                                                                                    }
779
                                                                                    }
780
                                                                            );
780
                                                                            );
781
                                                                        }
781
                                                                        }
782
                                                                );
782
                                                                );
783
                                                            }
783
                                                            }
784
                                                    );
784
                                                    );
785
                                                </script>--%>
785
                                                </script>--%>
786
 
786
 
787
                                                <input type="text" ng-model="u.siges" style="width: 60px"/>
787
                                                <input type="text" ng-model="u.siges" style="width: 60px"/>
788
                                                <%--<div id="sigesResponse${dummyIndexIdUnidades}"></div>--%>
788
                                                <%--<div id="sigesResponse${dummyIndexIdUnidades}"></div>--%>
789
                                            </td>
789
                                            </td>
790
                                            <td ng-show="confView.Nome">
790
                                            <td ng-show="confView.Nome">
791
                                                <div>
791
                                                <div>
792
                                                    <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nome"/></div>
792
                                                    <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nome"/></div>
793
 
793
 
794
                                                    <div class="langs collapse" >
794
                                                    <div class="langs collapse" >
795
                                                        <div class="col-sm-1">(EN)</div>
795
                                                        <div class="col-sm-1">(EN)</div>
796
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeEn"/></div>
796
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeEn"/></div>
797
                                                        <div class="col-sm-1">(ES)</div>
797
                                                        <div class="col-sm-1">(ES)</div>
798
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeEs"/></div>
798
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeEs"/></div>
799
                                                        <div class="col-sm-1">(FR)</div>
799
                                                        <div class="col-sm-1">(FR)</div>
800
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeFr"/></div>
800
                                                        <div class="col-sm-11"><input type="text"  style="width:200px" ng-model="u.nomeFr"/></div>
801
                                                    </div>
801
                                                    </div>
802
                                                </div>
802
                                                </div>
803
 
803
 
804
                                            </td>
804
                                            </td>
805
                                            <td ng-show="confView.ECTS"><input type="text" style="width: 40px" ng-model="u.eCTS"/></td>
805
                                            <td ng-show="confView.ECTS"><input type="text" style="width: 40px" ng-model="u.eCTS"/></td>
806
                                            <td ng-show="confView.Total"><input type="text" style="width: 40px" ng-model="u.totalHoras"></td>
806
                                            <td ng-show="confView.Total"><input type="text" style="width: 40px" ng-model="u.totalHoras"></td>
807
 
807
 
808
                                            <td ng-show="confView.T"><input type="text" style="width: 40px" ng-model="u.horasContacto.t"/></td>
808
                                            <td ng-show="confView.T"><input type="text" style="width: 40px" ng-model="u.horasContacto.t"/></td>
809
                                            <td ng-show="confView.TP"><input type="text" style="width: 40px" ng-model="u.horasContacto.TP"/></td>
809
                                            <td ng-show="confView.TP"><input type="text" style="width: 40px" ng-model="u.horasContacto.tP"/></td>
810
                                            <td ng-show="confView.P"><input type="text" style="width: 40px" ng-model="u.horasContacto.p"/></td>
810
                                            <td ng-show="confView.P"><input type="text" style="width: 40px" ng-model="u.horasContacto.p"/></td>
811
                                            <td ng-show="confView.PL"><input type="text" style="width: 40px" ng-model="u.horasContacto.PL"/></td>
811
                                            <td ng-show="confView.PL"><input type="text" style="width: 40px" ng-model="u.horasContacto.pL"/></td>
812
                                            <td ng-show="confView.PD"><input type="text" style="width: 40px" ng-model="u.horasContacto.PD"/></td>
812
                                            <td ng-show="confView.PD"><input type="text" style="width: 40px" ng-model="u.horasContacto.pD"/></td>
813
                                            <td ng-show="confView.OT"><input type="text" style="width: 40px" ng-model="u.horasContacto.OT"/></td>
813
                                            <td ng-show="confView.OT"><input type="text" style="width: 40px" ng-model="u.horasContacto.oT"/></td>
814
                                            <td ng-show="confView.E"><input type="text" style="width: 40px" ng-model="u.horasContacto.e"/></td>
814
                                            <td ng-show="confView.E"><input type="text" style="width: 40px" ng-model="u.horasContacto.e"/></td>
815
                                            <td ng-show="confView.S"><input type="text" style="width: 40px" ng-model="u.horasContacto.s"/></td>
815
                                            <td ng-show="confView.S"><input type="text" style="width: 40px" ng-model="u.horasContacto.s"/></td>
816
                                            <td ng-show="confView.TC"><input type="text" style="width: 40px" ng-model="u.horasContacto.TC"/></td>
816
                                            <td ng-show="confView.TC"><input type="text" style="width: 40px" ng-model="u.horasContacto.tC"/></td>
817
                                            <td ng-show="confView.O"><input type="text" style="width: 40px" ng-model="u.horasContacto.o"/></td>
817
                                            <td ng-show="confView.O"><input type="text" style="width: 40px" ng-model="u.horasContacto.o"/></td>
818
                                            <td ng-show="confView.URL_UNIDADE"><input type="text" ng-model="u.urlUnidadeCurricular" style="width:600px"/></td>
818
                                            <td ng-show="confView.URL_UNIDADE"><input type="text" ng-model="u.urlUnidadeCurricular" style="width:600px"/></td>
819
                                            <td ng-show="confView.FICHA_URL" data-unit-semestre="{{s.id}}" data-course-siges-code="${courseSigesCode}" data-unit-siges-code="{{u.siges}}" data-unit-ficha-url-target-id="urlFichaCurricular{{s.id}}_{{u.siges}}" data-unit-site-url-target-id="urlUnidadeCurricular{{s.id}}_{{u.siges}}">
819
                                            <td ng-show="confView.FICHA_URL" data-unit-semestre="{{s.id}}" data-course-siges-code="${courseSigesCode}" data-unit-siges-code="{{u.siges}}" data-unit-ficha-url-target-id="urlFichaCurricular{{s.id}}_{{u.siges}}" data-unit-site-url-target-id="urlUnidadeCurricular{{s.id}}_{{u.siges}}">
820
                                                <input type="text" id="urlFichaCurricular{{s.id}}_{{u.siges}}"  ng-model="u.urlFichaCurricular" style="width:600px"/>
820
                                                <input type="text" id="urlFichaCurricular{{s.id}}_{{u.siges}}"  ng-model="u.urlFichaCurricular" style="width:600px"/>
821
                                            </td>
821
                                            </td>
822
                                        </script>
822
                                        </script>
823
 
823
 
824
                                       <%-- <pre class="code">
824
                                        <pre class="code">
825
                                            {{json | json}}
825
                                            {{json | json}}
826
                                        </pre>--%>
826
                                        </pre>
827
                                        <a type="button" class="btn btn-danger" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=${courseId}">Cancelar</a>
827
                                        <a type="button" class="btn btn-danger" href="<%=request.getContextPath()%>/user/adminStudyPlans.do?courseId=${courseId}">Cancelar</a>
828
                                        <button type="button" class="btn btn-success" ng-click="salvar()">Salvar</button>
828
                                        <button type="button" class="btn btn-success" ng-click="salvar()">Salvar</button>
829
                                    </div>
829
                                    </div>
830
 
830
 
831
 
831
 
832
 
832
 
833
 
833
 
834
 
834
 
835
                    </div>
835
                    </div>
836
                </div>
836
                </div>
837
            </html:form>
837
            </html:form>
838
        </div>
838
        </div>
839
    </div>
839
    </div>
840
 
840
 
841
<%
841
<%
842
 
842
 
843
    AbstractDao.getCurrentSession().getTransaction().commit();
843
    AbstractDao.getCurrentSession().getTransaction().commit();
844
%>
844
%>