Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1524 → Rev 1525

/branches/v3/impl/conf/WEB-INF/struts/struts-pae-eventos.xml
29,10 → 29,14
 
<!-- Start Pages -->
 
<!--PUBLIC-->
<action path="/eventSubscription" forward="page.pae.events.subscribe"/>
 
 
 
 
 
 
<action path="/user/startManageEventsClass" forward="page.pae.events.classes"/>
<action path="/user/startManageMyEvents" forward="page.pae.my.events"/>
 
/branches/v3/impl/conf/WEB-INF/struts/tiles-pae-eventos.xml
7,6 → 7,13
 
<tiles-definitions>
 
 
<!--PUBLIC-->
<definition name="page.pae.events.subscribe" extends="base.definition.pae.public">
<put name="body" value="/user/events/registoEventos.jsp"/>
</definition>
 
<!--SERVICES PAGES-->
<definition name="page.pae.events.classes" extends="page.pae.separators.home">
<put name="separator" value="1" type="string"/>
<put name="topnav" value="/user/events/topnavManageEventsClasses.jsp"/>
/branches/v3/impl/conf/WEB-INF/struts/struts-pae.xml
27,7 → 27,7
 
<!-- Start Pages -->
 
<action path="/WelcomePedagogicSurvey" forward="page.welcome.pedagogic.survey"/>
<action path="/WelcomePedagogicSurvey" forward="page.welcome.pae"/>
 
 
<!--Authentication-->
37,9 → 37,9
scope="request"
parameter="dispatch"
validate="false"
input="page.welcome.pedagogic.survey">
input="page.welcome.pae">
<forward name="success" path="page.pae.separators.home"/>
<forward name="logout" path="page.welcome.pedagogic.survey"/>
<forward name="logout" path="page.welcome.pae"/>
<forward name="firstTimeAuthenticate" path="page.pae.separators.home"/>
</action>
 
/branches/v3/impl/conf/WEB-INF/struts/tiles-pae.xml
7,14 → 7,22
 
<tiles-definitions>
 
<definition name="base.definition.pedagogicSurvey.public" path="/layout/layoutpedagogicsurveypublic.jsp">
 
<definition name="base.definition.pae.public" path="/layout/layoutpaepublic.jsp">
<put name="title" value="x"/>
<put name="header" value="/layout/header.jsp"/>
<put name="footer" value="/layout/footer.jsp" />
</definition>
 
<definition name="base.definition.pae.auth" path="/layout/layoutpaeauth.jsp">
<put name="title" value="x"/>
<put name="header" value="/layout/header.jsp"/>
<put name="footer" value="/layout/footer.jsp" />
</definition>
 
<definition name="page.welcome.pedagogic.survey" extends="base.definition.pedagogicSurvey.public">
 
 
<definition name="page.welcome.pae" extends="base.definition.pae.auth">
<put name="body" value="/auth/index.jsp" />
</definition>
 
/branches/v3/impl/conf/app.properties
924,6 → 924,11
siges.tipo.erasmus=20
 
 
##GOOGLE RECAPTCHA
google.recaptcha.secret.key=@google.recaptcha.secret.key@
google.recaptcha.address=https://www.google.com/recaptcha/api/siteverify
google.recaptcha.secret.param.name=secret
google.recaptcha.response.param.name=response
 
 
 
/branches/v3/impl/src/java/pt/estgp/estgweb/services/utils/UrlHashValidatorService.java
New file
0,0 → 1,22
package pt.estgp.estgweb.services.utils;
 
import jomm.utils.BytesUtils;
 
/**
* Created by jorgemachado on 10/10/16.
*/
public class UrlHashValidatorService {
 
private static final String PREFIX_TRASH = "#=%$%&(dsfde";
private static final String SUFFIX_TRASH = "vF64%dKZd_9d";
 
public static String getHashString(String data)
{
return BytesUtils.getMD5(PREFIX_TRASH + data + SUFFIX_TRASH);
}
 
public static boolean checkHashString(String data, String hash)
{
return hash.equals(getHashString(data));
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/utils/GoogleRecaptcha.java
New file
0,0 → 1,48
package pt.estgp.estgweb.web.utils;
 
import jomm.utils.StreamsUtils;
import org.apache.log4j.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import pt.estgp.estgweb.utils.ConfigProperties;
 
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
 
/**
* Created by jorgemachado on 10/10/16.
*/
public class GoogleRecaptcha
{
private static String secretCaptcha = ConfigProperties.getProperty("google.recaptcha.secret.key");
private static String address = ConfigProperties.getProperty("google.recaptcha.address");
private static String paramSecret = ConfigProperties.getProperty("google.recaptcha.secret.param.name");
private static String paramResponse = ConfigProperties.getProperty("google.recaptcha.response.param.name");
 
private static final Logger logger = Logger.getLogger(GoogleRecaptcha.class);
 
 
public static boolean validateCaptcha(String responseUser)
{
try {
URL url = new URL(address + "?" + paramSecret + "=" + secretCaptcha + "&" + paramResponse + "=" + responseUser);
InputStream stream = url.openStream();
String responseGoogle = StreamsUtils.readString(stream);
JSONObject response = new JSONObject(responseGoogle);
stream.close();
if(response.getString("success").equals("true"))
return true;
 
} catch (MalformedURLException e) {
logger.error(e,e);
} catch (IOException e) {
logger.error(e,e);
} catch (JSONException e) {
logger.error(e, e);
}
return false;
 
}
}
/branches/v3/impl/src/web/layout/layoutpedagogicsurveypublic.jsp
File deleted
/branches/v3/impl/src/web/layout/themes/ipp/header.jsp
1,5 → 1,3
<%@ page import="pt.estgp.estgweb.web.utils.ProxyUtils" %>
<%@ page import="pt.estgp.estgweb.web.filters.TopImageFilter" %>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
8,5 → 6,6
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<div id="header" class="clearfix">
<img class="logo" src="<%=request.getContextPath()%>/layout/themes/ipp/logo.png"/>
<h1> Centro de Sistemas de Informação do IPP </h1>
</div>
 
/branches/v3/impl/src/web/layout/layoutpaeauth.jsp
New file
0,0 → 1,54
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<html:html locale="true">
<head>
<title>Sistema de Planeamento Arquitetura de informação Empresarial PAE
<%--<bean:message key="site.title"/> - <tiles:getAsString name="title"/>--%></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<jsp:include page="/layout/scripts.jsp"/>
</head>
<body>
 
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<tiles:insert attribute="header"/>
</div>
</div>
<div class="row">
<div class="col-md-12">
 
<div class="container">
<div class="col-md-10" style="padding-left: 0">
<h1>Plataforma de Informação do IPP</h1>
</div>
</div>
<baco:isAuthenticated>
<div class="container">
<a class="btn btn-default" href="<%=request.getContextPath()%>/user/homePae.do">
Entrar <span class="glyphicon glyphicon-log-in"> </span>
na HOME <span class="glyphicon glyphicon-home"> </span>
</a>
(<bean:write name="UserSession" property="user.name"/> online)
 
</div>
</baco:isAuthenticated>
<baco:isNotAuthenticated>
<jsp:include page="/auth/index.jsp"/>
</baco:isNotAuthenticated>
 
</div>
</div>
</div>
</div>
<tiles:insert attribute="footer"/>
</body>
</html:html>
 
/branches/v3/impl/src/web/layout/layoutpaepublic.jsp
New file
0,0 → 1,38
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<html:html locale="true">
<head>
<title>Sistema de Planeamento Arquitetura de informação Empresarial PAE
<%--<bean:message key="site.title"/> - <tiles:getAsString name="title"/>--%></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<jsp:include page="/layout/scripts.jsp"/>
</head>
<body>
 
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<tiles:insert attribute="header"/>
</div>
</div>
<div class="row">
<div class="col-md-12">
 
<div class="container" style="padding-top: 10px">
<tiles:insert attribute="body"/>
</div>
</div>
</div>
</div>
</div>
<tiles:insert attribute="footer"/>
</body>
</html:html>
 
/branches/v3/impl/src/web/user/courseunits/courseCourseunitsStatistics.jsp
3,14 → 3,13
<%@ page import="org.hibernate.criterion.Order" %>
<%@ page import="org.hibernate.criterion.Projections" %>
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="pt.estgp.estgweb.domain.Course" %>
<%@ page import="pt.estgp.estgweb.domain.CourseUnit" %>
<%@ page import="static org.hibernate.criterion.Restrictions.eq" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="static org.hibernate.criterion.Restrictions.eq" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="static org.hibernate.criterion.Restrictions.eq" %>
<%@ page import="static org.hibernate.criterion.Restrictions.or" %>
<%@ page import="static org.hibernate.criterion.Restrictions.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/baco.tld" prefix="baco" %>
23,10 → 22,15
 
<%
String all = request.getParameter("all");
String importYear = request.getParameter("importYear");
AbstractDao.getCurrentSession().beginTransaction();
if(importYear == null)
importYear = UserSession.getNowConfiguration().getInterfaceImportYear();
AbstractDao.getCurrentSession().getTransaction().commit();
%>
<div class="panel panel-default">
<div class="panel-heading">
Estatisticas Unidades nos Cursos
Estatisticas Unidades nos Cursos (<%=importYear%>)
</div>
<div class="panel-body">
 
37,11 → 41,14
{
allCourses = true;
AbstractDao.getCurrentSession().beginTransaction();
 
 
Criteria c = AbstractDao.getCurrentSession().createCriteria(CourseUnit.class)
.setProjection(Projections.projectionList().add(Projections.groupProperty("c.validationRole"))
.add(Projections.property("c.id")).add(Projections.property("c.name")).add(Projections.property("c.code")))
.createAlias("course", "c")
.add(eq("importYear", UserSession.getNowConfiguration().getInterfaceImportYear()));
//.add(eq("importYear", importYear))
;
List<Object[]> validationRoles = c.list();
AbstractDao.getCurrentSession().getTransaction().commit();
comissionsRoles = new ArrayList<String>();
214,7 → 221,7
.add(Projections.property("c.name"))
.add(Projections.property("c.code")))
.createAlias("course", "c")
.add(eq("importYear", UserSession.getNowConfiguration().getInterfaceImportYear()))
.add(eq("importYear", importYear))
.add(eq("c.validationRole", roleCourse));
List<Object[]> coursesForRole = c.list();
 
241,7 → 248,7
c = AbstractDao.getCurrentSession().createCriteria(CourseUnit.class)
.setProjection(Projections.distinct(Projections.property("id")))
.createAlias("course", "c")
.add(eq("importYear", UserSession.getNowConfiguration().getInterfaceImportYear()))
.add(eq("importYear", importYear))
.add(eq("c.id", courseId))
;
c.addOrder(Order.asc("name"));
252,20 → 259,20
%>
<h2><bean:message key="user.role.${roleCourse}"/> </h2>
<div class="alert alert-info alert-small">
Não foram encontradas unidades curriculares no ano ${UserSession.nowConfiguration.interfaceImportYear}
Não foram encontradas unidades curriculares no ano <%=importYear%>
</div>
<%
}
else
{
//
// List<Student> students = DaoFactory.getStudentDaoImpl().loadFromCoursesWithValidationRoles(comissionsRoles,UserSession.getNowConfiguration().getInterfaceImportYear());
// List<Student> students = DaoFactory.getStudentDaoImpl().loadFromCoursesWithValidationRoles(comissionsRoles,importYear);
if(all == null)
{
%>
<h2><%=courseName%> (<%=courseCode%>)</h2>
<div class="alert alert-info alert-small">
Existem <%=courseUnits.size()%> unidades no ano ${UserSession.nowConfiguration.interfaceImportYear}
Existem <%=courseUnits.size()%> unidades no ano <%=importYear%>
</div>
 
<table class="tablesorter tablesorterfiltered">
/branches/v3/impl/src/web/user/home/teacher.jsp
167,9 → 167,12
</html:link>
</div>
<div class="list-group-item">
<html:link action="/user/startLoadCourseCourseUnitsStatistics">Consultar estatisticas das Unidades Curriculares</html:link>
<html:link action="/user/startLoadCourseCourseUnitsStatistics?importYear=${UserSession.nowConfiguration.interfaceImportYear}">Consultar estatisticas das Unidades Curriculares (${UserSession.nowConfiguration.interfaceImportYear})</html:link>
</div>
<div class="list-group-item">
<html:link action="/user/startLoadCourseCourseUnitsStatistics?importYear=${UserSession.nowConfiguration.previousInterfaceImportYear}">Consultar estatisticas das Unidades Curriculares (${UserSession.nowConfiguration.previousInterfaceImportYear})</html:link>
</div>
<div class="list-group-item">
<html:link action="/user/listStudentsCourseComission">
Consultar Alunos
</html:link>
217,8 → 220,8
 
 
 
<div class="panel panel-primary">
<div class="panel-heading">Tarefas Docente Relativas a Unidades (<%=activeYear%>)</div>
<div class="panel panel-info">
<div class="panel-heading"><span class="glyphicon glyphicon-education"> </span> Tarefas Docentes</div>
<div class="panel-body">
<%
if(programs != null && programs.size() > 0)
226,7 → 229,7
%>
 
<div class="list-group">
<div class="list-group-item active">Fichas Curriculares por preencher</div>
<div class="list-group-item list-group-item-heading"><span class="icon icon-file-pdf"></span> <label class="label label-info" style="font-size:1em">${UserSession.nowConfiguration.interfaceImportYear}</label> Fichas Curriculares por preencher </div>
<%
for(CourseUnit cu: programs)
{
243,8 → 246,8
{
%>
<div class="list-group">
<div class="list-group-item active">Relatórios de avaliação por preencher/entregar
<%
<div class="list-group-item list-group-item-warning"><span class="icon icon-clipboard"></span> <label class="label label-warning" style="font-size:1em"><%=activeYear%></label> Relatórios de avaliação por preencher/entregar de <%=activeYear%>
<%--<%
if(activeDegrees != null)
{
%>
263,7 → 266,7
<%
}
%>
 
--%>
</div>
 
<%
/branches/v3/impl/src/web/user/home/courseComission.jsp
5,7 → 5,7
<%@ page import="pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/>
<%
 
try{
29,20 → 29,16
{
%>
 
<div class="panel panel-primary">
<div class="panel-heading">Tarefas das Comissões de Curso (<%=activeYear%>)</div>
<div class="panel panel-default">
<div class="panel-heading"><span class="icon icon-library"></span> Tarefas das Comissões de Curso</div>
<div class="panel-body">
<p>Expanda os cursos e clique nas unidades para validar os relatórios de avaliação.</p>
<p>No final de cada relatório existe um botão de validação para os membros das comissões dos cursos respectivos.</p>
 
 
<%
if(result1.size()>0)
{
%>
 
<div class="list-group">
<div class="list-group-item active">Fichas curriculares por validar</div>
<div class="list-group-item list-group-item-heading"> <span class="icon icon-file-pdf"></span> <label class="label label-info" style="font-size:1em">${UserSession.nowConfiguration.interfaceImportYear}</label> Fichas curriculares por validar</div>
<%
for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result1)
{
63,7 → 59,7
%>
 
<div class="list-group">
<div class="list-group-item active">Fichas curriculares por preencher</div>
<div class="list-group-item list-group-item-heading"><span class="icon icon-file-pdf"></span> <label class="label label-info" style="font-size:1em">${UserSession.nowConfiguration.interfaceImportYear}</label> Fichas curriculares por preencher</div>
<%
for(CourseUnitDaoImpl.CourseMissingValidationProgram mis:result0)
{
85,28 → 81,31
%>
 
<div class="list-group">
<div class="list-group-item active">Relatórios de avaliação por validar
<%
String sep = "";
if(activeDegrees != null)
{
%>
(graus em processo de validação:
<%
for(String activeDegree: activeDegrees)
{
%>
<%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
<%
sep = ", ";
}
%>
)
<%
}
%>
</div>
<div class="list-group-item list-group-item-warning"><span class="icon icon-clipboard"></span> <label class="label label-warning" style="font-size:1em"><%=activeYear%></label> Relatórios de avaliação por validar
<%--
<%
String sep = "";
if(activeDegrees != null)
{
%>
 
(graus em processo de validação:
<%
for(String activeDegree: activeDegrees)
{
%>
<%=sep + MessageResources.getInstance(request).getMessage("course."+activeDegree)%>
<%
sep = ", ";
}
%>
)
<%
}
%>
--%>
</div>
 
<%
for(CourseUnitDaoImpl.CourseMissingValidationEvaluation mis:result2)
{
140,8 → 139,9
%>
 
<div class="list-group">
<div class="list-group-item active">Relatórios de avaliação ainda não preenchidos
<%
<div class="list-group-item list-group-item-warning"><span class="icon icon-clipboard"></span> <label class="label label-warning" style="font-size:1em"><%=activeYear%></label> Relatórios de avaliação ainda não preenchidos
 
<%-- <%
String sep = "";
if(activeDegrees != null)
{
160,6 → 160,7
<%
}
%>
--%>
</div>
 
<%
/branches/v3/impl/src/web/user/events/addEventFormacoes.jsp
1,8 → 1,9
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.*" %>
<%@ page import="pt.estgp.estgweb.domain.DomainObjectFactory" %>
<%@ page import="pt.estgp.estgweb.domain.EventClass" %>
<%@ page import="pt.estgp.estgweb.domain.EventFormacoes" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="pt.estgp.estgweb.web.utils.DatesUtils" %>
<%@ page import="pt.estgp.estgweb.web.form.events.MyEventFormacoesForm" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
49,7 → 50,15
%>
 
 
<script>
$(document).ready(function(){
$('input[type=checkbox]').bootstrapToggle({
on: 'Sim',
off: 'Não'
});
});
 
</script>
<div class="panel panel-default">
<div class="panel-heading">Criar uma Formação na classe <%=eventClass.getName()%></div>
<div class="panel-body">
232,7 → 241,10
<div class="form-group">
<label class="control-label col-sm-2">Ficheiro com Folheto promocional</label>
<div class="col-sm-10">
<html:file styleClass="form-control" property="flyerFile"/>
<label class="btn btn-default btn-file">
Adicionar Ficheiro <html:file styleClass="form-control" property="flyerFile" style="display: none;"/>
</label>
 
</div>
</div>
</div>
244,68 → 256,68
<div class="form-group">
<label class="control-label col-sm-2">Sexo</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.sexo"/>
<html:checkbox property="event.sexo"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Morada</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.morada"/>
<html:checkbox property="event.morada"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">País</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.pais"/>
<html:checkbox property="event.pais"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Data de Nascimento</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.dataNascimento"/>
<html:checkbox property="event.dataNascimento"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Número de Contribuinte Fiscal</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.nif"/>
<html:checkbox property="event.nif"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Número Cartão Cidadão</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.bi"/>
<html:checkbox property="event.bi"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Telefone 1</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.telefone1"/>
<html:checkbox property="event.telefone1"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Telefone 2</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.telefone2"/>
<html:checkbox property="event.telefone2"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Empresa</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.empresa"/>
<html:checkbox property="event.empresa"/>
</div>
</div>
 
<div class="form-group">
<label class="control-label col-sm-2">Escolaridade</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.escolaridade"/>
<html:checkbox property="event.escolaridade"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Profissão</label>
<div class="col-sm-10">
<html:checkbox styleClass="form-control" property="event.profissao"/>
<html:checkbox property="event.profissao"/>
</div>
</div>
 
/branches/v3/impl/src/web/user/events/getEventURL.jsp
New file
0,0 → 1,37
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.EventGeneric" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="jomm.utils.BytesUtils" %>
<%@ page import="pt.estgp.estgweb.services.utils.UrlHashValidatorService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<script src='https://www.google.com/recaptcha/api.js'></script>
<%
String eventId = request.getParameter("eventId");
 
String hash = UrlHashValidatorService.getHashString(eventId);
String url = "http://pae.ipportalegre.pt/eventSubscription.do?id=" + eventId + "&hash=" + hash;
%>
<p class="text-info">O seu URL de publicação é o seguinte:</p>
 
<pre>
<%=url%>
</pre>
 
<script>
function copyToClipboard()
{
//for IE ONLY!
clipboardData.setData('Text','<%=url%>');
}
</script>
<%--<button type="button" class="btn btn-info" onclick="copyToClipboard()">
<span class="glyphicon glyphicon-clone"> </span>Copiar para o clipboard
</button>--%>
 
/branches/v3/impl/src/web/user/events/myEvents.jsp
68,6 → 68,8
<th>Data Inicio</th>
<th>Data Abertura do Formulário</th>
<th>Rentabilidade %</th>
<th>URL Inscr.</th>
<th>Edição</th>
</tr>
</thead>
<tbody>
113,6 → 115,17
}
%>
</td>
<td>
<a class="btn btn-default" href="#" data-href="<%=request.getContextPath()%>/user/events/getEventURL.jsp?eventId=${event.id}" data-title="URL para inscrições no evento: ${event.title}" data-toggle="modal" data-target="#modalAjaxRequest">
<span class="glyphicon glyphicon-globe"></span>
</a>
</td>
<td>
<a class="btn btn-warning" href="<%=request.getContextPath()%>/user/startSubmitEventFormacoes.do?eventId=${event.id}">
<span class="glyphicon glyphicon-pencil"> Formações </span>
</a>
</td>
 
</tr>
<%
}
/branches/v3/impl/src/web/user/events/registoEventos.jsp
New file
0,0 → 1,65
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="pt.estgp.estgweb.domain.EventGeneric" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="jomm.utils.BytesUtils" %>
<%@ page import="pt.estgp.estgweb.services.utils.UrlHashValidatorService" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<script src='https://www.google.com/recaptcha/api.js'></script>
<%
String eventId = request.getParameter("id");
String hash = request.getParameter("hash");
 
 
if(eventId == null ||
eventId.trim().length() == 0 ||
hash == null ||
hash.trim().length() == 0 ||
!UrlHashValidatorService.checkHashString(eventId,hash))
{
response.sendError(404);
%>
<jsp:include page="/errors/404.jsp"/>
<%
return;
}
else
{
 
 
 
AbstractDao.getCurrentSession().beginTransaction();
 
EventGeneric event = DaoFactory.getEventGenericDaoImpl().load(Long.parseLong(eventId));
 
%>
<div class="panel panel-default">
<div class="panel-heading"><%=event.getTitle()%></div>
<div class="panel-body">
<p class="text-info">
<%=event.getDescription()%>
</p>
<p class="lead">
Por favor efetue o seu registo
</p>
<form class="col-sm-6" >
<input type="email" id="inputEmail" class="form-control input-lg" placeholder="Coloque aqui o seu email" required autofocus>
<br/>
<div class="g-recaptcha" data-sitekey="6Lez3ggUAAAAAL4kq9vCduJHaAMr7iOKpZMgTMVB"></div>
</br>
<button class="btn btn-lg btn-block btn-success">Continuar</button>
</form>
</div>
</div>
 
<%
 
AbstractDao.getCurrentSession().getTransaction().commit();
}
%>
/branches/v3/impl/build.properties
254,3 → 254,7
 
admin.email.1=jmachado@estgp.pt
admin.email.2=ci@estgp.pt
 
 
##GOOGLE RECAPTCHA
google.recaptcha.secret.key=DUMMY_PLEASE_SET_IN_LOCAL_PROPERTIES
/branches/v3/impl/build.xml
458,6 → 458,10
<replacefilter token="@hibernate.show.sql@" value="${hibernate.show.sql}"/>
</replace>-->
<replace file="${app.properties.build}/app.properties">
 
 
<replacefilter token="@google.recaptcha.secret.key@" value="${google.recaptcha.secret.key}"/>
 
<replacefilter token="@admin.email.1@" value="${admin.email.1}"/>
<replacefilter token="@admin.email.2@" value="${admin.email.2}"/>
<replacefilter token="@tmp.dir@" value="${tmp.dir}"/>