Rev 1408 | 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 | |||
1408 | jmachado | 22 | |
1405 | jmachado | 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"> |
||
1585 | jmachado | 81 | <div class="form-vertical"> |
1405 | jmachado | 82 | <div class="form-group"> |
1585 | jmachado | 83 | <label class="control-label col-md-12" for="preferido">Email Preferido:</label> |
84 | <div class="col-md-12"> |
||
1405 | jmachado | 85 | <input id="preferido" class="form-control" type="text" name="preferredEmail"/> |
86 | </div> |
||
87 | </div> |
||
1585 | jmachado | 88 | <div class="form-group"> |
89 | <label class="control-label col-md-12"></label> |
||
90 | <div class="col-md-12"> |
||
91 | <button id="preferidoBtn" type="button" class="btn btn-success">Modificar Preferido</button> |
||
92 | </div> |
||
93 | </div> |
||
94 | |||
1406 | jmachado | 95 | </div> |
1405 | jmachado | 96 | </div> |
97 | </div> |
||
98 | |||
1585 | jmachado | 99 | <div class="panel panel-default"> |
100 | <div class="panel-body"> |
||
101 | <div class="form-vertical"> |
||
102 | <div class="form-group"> |
||
103 | <label class="control-label col-md-12" for="preferido">Alterar a minha password:</label> |
||
104 | <div class="col-md-12"> |
||
105 | <html:link styleClass="btn btn-warning" action="/user/ChangePassword">Iniciar Alteração</html:link> |
||
106 | </div> |
||
107 | </div> |
||
108 | </div> |
||
109 | </div> |
||
110 | </div> |
||
111 | |||
1405 | jmachado | 112 | </div> |
113 | </div> |
||
114 | |||
115 | |||
116 | <% |
||
117 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
118 | %> |