Rev 1406 | Rev 1408 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1405 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
1407 | jmachado | 2 | <%@ page import="pt.estgp.estgweb.domain.Teacher" %> |
1405 | jmachado | 3 | <%@ page import="pt.estgp.estgweb.domain.User" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
5 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
6 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
7 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
8 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
9 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
10 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
13 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
||
14 | <% |
||
15 | AbstractDao.getCurrentSession().beginTransaction(); |
||
16 | |||
17 | User u = DaoFactory.getUserDaoImpl().load(UserSession.getUser().getId()); |
||
18 | |||
19 | |||
20 | %> |
||
21 | |||
22 | <div class="col-md-4 col-sm-12 col-xs-12"> |
||
23 | <div class="panel panel-default"> |
||
24 | <div class="panel-heading">Preferências</div> |
||
25 | <div class="panel-body"> |
||
1407 | jmachado | 26 | <div class="alert alert-info">${UserSession.shortName} neste momento as informações que temos para <%=UserSession.getUser() instanceof Teacher?"si":"ti"%> são enviadas para os seguintes emails, se preferir<%=UserSession.getUser() instanceof Teacher?"":"es"%> receber noutro endereço <%=UserSession.getUser() instanceof Teacher?"diga-nos":"diz-nos"%> qual para que possamos informar sempre que haja novidades. Obrigado</div> |
1405 | jmachado | 27 | |
28 | <div class="panel panel-default"> |
||
1407 | jmachado | 29 | <div class="panel-heading">Emails por onde <%=UserSession.getUser() instanceof Teacher?"o":"te"%> contactamos:</div> |
1405 | jmachado | 30 | <div class="panel-body"> |
31 | |||
32 | <div class="list-group"> |
||
33 | <% |
||
34 | if(u.getEmail() != null && u.getEmail().trim().length() > 0) |
||
35 | { |
||
36 | %> |
||
37 | <div class="list-group-item"><%=u.getEmail()%></div> |
||
38 | <% |
||
39 | } |
||
40 | if(u.getOutEmail() != null && u.getOutEmail().trim().length() > 0) |
||
41 | { |
||
42 | %> |
||
43 | <div class="list-group-item"><%=u.getOutEmail()%></div> |
||
44 | <% |
||
45 | } |
||
46 | if(u.getPreferrefEmail() != null && u.getPreferrefEmail().trim().length() > 0) |
||
47 | { |
||
48 | %> |
||
1406 | jmachado | 49 | <div class="list-group-item"><%=u.getPreferrefEmail()%> <i class="badge">preferido</i></div> |
1405 | jmachado | 50 | <% |
51 | } |
||
52 | %> |
||
53 | </div> |
||
54 | </div> |
||
55 | </div> |
||
56 | |||
1406 | jmachado | 57 | <script> |
58 | $(document).ready( |
||
59 | function(){ |
||
60 | $("#preferidoBtn").on("click",function(){ |
||
61 | email = $("#preferido").val(); |
||
62 | if(email == "") |
||
63 | alert("Por favor coloque um endereço de email antes de confirmar"); |
||
64 | else |
||
65 | { |
||
66 | $.getJSON('<%=request.getContextPath()%>/user/home/panels/emailSetService.jsp',{"preferredEmail":email}, |
||
67 | function(data){ |
||
68 | if(data.result=="OK") |
||
69 | { |
||
70 | window.location = "<%=request.getContextPath()%>/user/homePae.do" |
||
71 | } |
||
72 | }); |
||
73 | } |
||
74 | }) |
||
75 | } |
||
76 | ); |
||
77 | </script> |
||
1405 | jmachado | 78 | |
79 | <div class="panel panel-default"> |
||
80 | <div class="panel-body"> |
||
1406 | jmachado | 81 | <div class="form-horizontal"> |
1405 | jmachado | 82 | <div class="form-group"> |
83 | <label class="control-label col-sm-4" for="preferido">Email Preferido:</label> |
||
84 | <div class="col-sm-8"> |
||
85 | <input id="preferido" class="form-control" type="text" name="preferredEmail"/> |
||
86 | </div> |
||
87 | </div> |
||
1406 | jmachado | 88 | <button id="preferidoBtn" type="button" class="btn btn-success">Modificar Preferido</button> |
89 | </div> |
||
1405 | jmachado | 90 | </div> |
91 | </div> |
||
92 | |||
93 | </div> |
||
94 | </div> |
||
95 | </div> |
||
96 | |||
97 | |||
98 | <% |
||
99 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
100 | %> |