Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 135 → Rev 140

/impl/conf/language/MessageResources.properties
229,12 → 229,11
remove=Remover
yes=Sim
no=Não
edit=Editar
 
#Login
login.first.time.username=Username
login.first.time.name=Nome
login.first.time.targets=Permissões
login.first.time.targets=Papeis
login.first.time.bi=BI
login.first.time.address=Morada
login.first.time.zip=Código Postal
/impl/conf/WEB-INF/tlds/estgweb.tld
15,6 → 15,20
</attribute>
</tag>
<tag>
<name>canManage</name>
<tagclass>pt.estgp.estgweb.web.tags.CanManageTag</tagclass>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>property</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<name>isAuthenticated</name>
<tagclass>pt.estgp.estgweb.web.tags.IsAuthenticatedTag</tagclass>
</tag>
51,7 → 65,7
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<attribute>
<name>altKey</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
62,7 → 76,7
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<tag>
<name>ownerImageRole</name>
<tagclass>pt.estgp.estgweb.web.tags.OwnerImageRoleTag</tagclass>
<attribute>
70,7 → 84,7
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<attribute>
<name>property</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
78,17 → 92,17
 
</tag>
<!--<tag>-->
<!--<name>urlStat</name>-->
<!--<tagclass>pt.estgp.estgweb.web.tags.UrlStatTag</tagclass>-->
<!--<attribute>-->
<!--<name>url</name>-->
<!--<required>true</required>-->
<!--<rtexprvalue>true</rtexprvalue>-->
<!--</attribute>-->
<!--<attribute>-->
<!--<name>attributes</name>-->
<!--<required>false</required>-->
<!--<rtexprvalue>false</rtexprvalue>-->
<!--</attribute>-->
<!--<name>urlStat</name>-->
<!--<tagclass>pt.estgp.estgweb.web.tags.UrlStatTag</tagclass>-->
<!--<attribute>-->
<!--<name>url</name>-->
<!--<required>true</required>-->
<!--<rtexprvalue>true</rtexprvalue>-->
<!--</attribute>-->
<!--<attribute>-->
<!--<name>attributes</name>-->
<!--<required>false</required>-->
<!--<rtexprvalue>false</rtexprvalue>-->
<!--</attribute>-->
<!--</tag>-->
</taglib>
/impl/conf/berserk/sd.xml
165,6 → 165,7
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
</filterChains>
</service>
<service>
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadRoleTypeMaxAnnouncementsService.java
30,7 → 30,7
private static final Logger logger = Logger.getLogger(LoadRoleTypeMaxAnnouncementsService.class);
private static final int MAX_ANNOUNCEMENTS = ConfigProperties.getIntProperty("announcements.max.visible");
 
public List<AnnouncementView> run(String roles,String typeNews,String subTarget)
public List<AnnouncementView> run(String roles,String typeNews,String subTarget,UserSession sess)
{
List<String> targetRoles = new ArrayList<String>();
if (roles.contains(","))
45,7 → 45,11
{
targetRoles.add(roles);
}
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,typeNews,subTarget);
boolean internal = true;
if(sess.getUser() == null)
internal = false;
 
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,typeNews,subTarget,internal);
if(announcements == null)
return null;
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
/impl/src/java/pt/estgp/estgweb/services/announcements/AnnouncementsCommonServices.java
48,10 → 48,13
else
roles = ((UserImpl) userSession.getUser()).getRolesList();
 
searchResults.setTotalResults(DaoFactory.getAnnouncementDaoImpl().countAnnouncements(search, searchType, roles, null));
boolean internal = true;
if (userSession.getUser() == null)
internal = false;
searchResults.setTotalResults(DaoFactory.getAnnouncementDaoImpl().countAnnouncements(search, searchType, roles, null,internal));
if (searchResults.getTotalResults() > 0)
{
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().searchAnnouncements(search, searchType, maxResults, page, roles, null);
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().searchAnnouncements(search, searchType, maxResults, page, roles, null,internal);
if (announcements == null)
return searchResults;
for (Announcement a : announcements)
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadTargetMaxAnnouncementsService.java
27,7 → 27,10
List<String> targetRoles = null;
if(userSession.getUser() != null)
targetRoles = userSession.getUser().getTargetRolesList();
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,subTarget);
boolean internal = true;
if (userSession.getUser() == null)
internal = false;
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,subTarget,internal);
if(announcements == null)
return null;
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadTopFlashNewsIterateService.java
31,22 → 31,26
 
public AnnouncementView run(String subTarget, UserSession sess)
{
Integer iterator = (Integer) ((UserSessionImpl)sess).get(flashNewsIterator);
if(iterator == null)
Integer iterator = (Integer) ((UserSessionImpl) sess).get(flashNewsIterator);
if (iterator == null)
iterator = 0;
 
int size = DaoFactory.getAnnouncementDaoImpl().countAnnouncements(1,null,Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS,null);
if(size != 0)
boolean internal = true;
if (sess.getUser() == null)
internal = false;
int size = DaoFactory.getAnnouncementDaoImpl().countAnnouncements(1, null, Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS, null, internal);
if (size != 0)
{
iterator = iterator % size;
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(iterator, 1,null,Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS,subTarget);
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(iterator, 1, null, Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS, subTarget, internal);
iterator++;
((UserSessionImpl)sess).put(flashNewsIterator,iterator);
((UserSessionImpl) sess).put(flashNewsIterator, iterator);
 
if(announcements == null)
if (announcements == null)
return null;
logger.info("Loading announcement top flash iterator");
if(announcements.size() > 0)
if (announcements.size() > 0)
{
return new AnnouncementView(announcements.get(0));
}
59,12 → 63,13
//mudei a propriedade log.file build.properties para log.file=${data.dir}/estgweb.log assim ja nao da o erro do log
//adicionei as libs jsp-api.jar da pasta tomcat/common/lib para nao te falhar os imports nas TAGS aqui no Intellij
//adiciona sempre todos os jars da common aqui no Intellij faltava-te o activation.jar do jaxb e era preciso para o MimeTypeGuesser
public static void main(String[] args) throws Throwable {
public static void main(String[] args) throws Throwable
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] arguments = new Object[]{};
AnnouncementView announcementView = (AnnouncementView) sm.execute("testecookie", "LoadTopFlashNewsIterate",arguments,names);
System.out.println("-->"+announcementView.getTitle());
AnnouncementView announcementView = (AnnouncementView) sm.execute("testecookie", "LoadTopFlashNewsIterate", arguments, names);
System.out.println("-->" + announcementView.getTitle());
 
 
}
/impl/src/java/pt/estgp/estgweb/domain/UserImpl.java
19,33 → 19,38
private boolean newUser = false;
 
public UserImpl()
{}
{
}
 
public UserImpl(Date saveDate, boolean superuser, String name, String username, String password, String roles, String address, String zip, String country, String email, String outEmail, String phonenumber, String sex, String bi, Date birthDate, Set<Group> groups, Set<CourseUserAssociation> courses)
{
super(saveDate, superuser, name, username, password, roles, address, zip, country, email, outEmail, phonenumber, sex, bi, birthDate, groups, courses);
super(saveDate, superuser, name, username, password, roles, address, zip, country, email, outEmail, phonenumber, sex, bi, birthDate, groups, courses);
}
 
 
public boolean isNewUser() {
public boolean isNewUser()
{
return newUser;
}
 
public void setNewUser(boolean newUser) {
public void setNewUser(boolean newUser)
{
this.newUser = newUser;
}
}
 
/**
* check if user is in some group
*
* @param g to check
* @return true if belongs to group
*/
public boolean hasGroup(Group g)
{
if(getGroups() == null)
if (getGroups() == null)
return false;
for(Group group: getGroups())
for (Group group : getGroups())
{
if(group.getId() == g.getId())
if (group.getId() == g.getId())
return true;
}
return false;
53,23 → 58,22
 
public void addRole(String role)
{
setRoles(RoleManager.catRole(getRoles(),"student"));
setRoles(RoleManager.catRole(getRoles(), role));
}
 
public boolean hasRole(String r)
{
if(r == null || getRoles() == null || getRoles().length() == 0)
if (r == null || getRoles() == null || getRoles().length() == 0)
return false;
for(String role: RoleManager.getRolesFromSerial(getRoles()))
for (String role : RoleManager.getRolesFromSerial(getRoles()))
{
if(role.equals(r))
if (role.equals(r))
return true;
}
return false;
}
 
/**
*
* @return a list of role Strings
*/
public List<String> getOwnerRoles()
99,7 → 103,7
 
public boolean isAdmin()
{
return hasRole(Globals.ADMIN_ROLE);
return hasRole(Globals.ADMIN_ROLE);
}
 
public boolean isSuperUserOrAdmin()
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/AnnouncementDaoImpl.java
31,7 → 31,7
return (AnnouncementDaoImpl) myInstance;
}
 
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget) {
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget,boolean internal) {
if (roles == null) {
roles = new ArrayList<String>();
roles.add("all");
53,6 → 53,8
else {
coSubTargets = eq("subTargets", subTarget);
}
if(!internal)
criteria.add(eq("internal",false));
MyCalendar cNow = new MyCalendar();
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay());
Date now = calendarWithOutTime.getTime();
66,31 → 68,31
return criteria.list();
}
 
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget) {
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget);
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal) {
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget,internal);
}
 
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget);
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget,internal);
return criteria.setFirstResult(maxAnnouncements * startPage).list();
}
 
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget);
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget,internal);
return criteria.list().size();
}
 
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget) {
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget);
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget,internal);
}
 
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget) {
return createRolesTypeCriteria(roles, type, subTarget)
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
return createRolesTypeCriteria(roles, type, subTarget,internal)
.setFirstResult(page * maxAnnouncements)
.setMaxResults(maxAnnouncements);
}
 
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget) {
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget,boolean internal) {
if (roles == null) {
roles = new ArrayList<String>();
roles.add("all");
114,6 → 116,10
}
if (type != null)
criteria.add(eq("type", type));
 
if(!internal)
criteria.add(eq("internal",false));
MyCalendar cNow = new MyCalendar();
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay());
Date now = calendarWithOutTime.getTime();
147,18 → 153,18
AbstractDao.getCurrentSession().beginTransaction().commit();
}*/
 
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget) {
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget,boolean internal) {
 
Criterion c = createSearchQuery(query, searchTypeEnum);
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null);
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null,internal);
criteria.add(c);
return criteria.list();
}
 
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget) {
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget,boolean internal) {
 
Criterion c = createSearchQuery(query, searchTypeEnum);
Criteria criteria = createRolesTypeCriteria(roles, null, null);
Criteria criteria = createRolesTypeCriteria(roles, null, null,internal);
criteria.add(c);
return criteria.list().size();
}
/impl/src/java/pt/estgp/estgweb/web/controllers/profile/ProfileController.java
34,7 → 34,7
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class ProfileController extends ApplicationDispatchController {
public class ProfileController extends AddRolesController {
 
private static final Logger logger = Logger.getLogger(ProfileController.class);
 
81,6 → 81,7
throws Throwable, ServletException {
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request);
String id = request.getParameter("id");
long userToLoad;
90,14 → 91,13
else
userToLoad=userSession.getUser().getId();
 
ProfileForm profileForm = new ProfileForm();
 
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{userToLoad};
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request),"LoadUserById",args,names);
profileForm.setUserView(uV);
profileForm.setSelectedRoles(uV.getUserRoles());
request.setAttribute("ProfileForm",profileForm);
pF.setUserView(uV);
pF.setSelectedRoles(uV.getUserRoles());
return mapping.findForward("load");
}
catch(FilterChainFailedException e)
/impl/src/java/pt/estgp/estgweb/web/tags/IsNotAdminTag.java
21,7 → 21,8
public int doEndTag() throws JspException {
 
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession == null || userSession.getUser() == null || !(((UserImpl)userSession.getUser()).hasRole(Globals.ADMIN_ROLE) && !((UserImpl)userSession.getUser()).isSuperuser()))
 
if(userSession == null || userSession.getUser() == null)
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
35,6 → 36,20
throw new JspException(e);
}
}
else if(!(((UserImpl)userSession.getUser()).hasRole(Globals.ADMIN_ROLE)) && !((UserImpl)userSession.getUser()).isSuperuser())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
try
{
writer.write(toPage);
}
catch(Exception e)
{
logger.error(e,e);
throw new JspException(e);
}
}
 
// Continue processing this page
return EVAL_PAGE;
/impl/src/java/pt/estgp/estgweb/web/tags/CanManageTag.java
New file
0,0 → 1,78
package pt.estgp.estgweb.web.tags;
 
import org.apache.log4j.Logger;
import org.apache.struts.util.RequestUtils;
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.domain.IOwned;
import pt.estgp.estgweb.domain.IInternal;
import pt.estgp.estgweb.Globals;
 
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
 
public class CanManageTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(CanManageTag.class);
 
private String name;
 
private String property;
 
public String getName()
{
return name;
}
 
public void setName(String name)
{
this.name = name;
}
 
public String getProperty()
{
return property;
}
 
public void setProperty(String property)
{
this.property = property;
}
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
}
public int doEndTag() throws JspException
{
 
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
 
IOwned owned = (IOwned) RequestUtils.lookup(pageContext, name, property, null);
IInternal iInternal = (IInternal) owned;
if(userSession.getUser() == null && iInternal.isInternal())
{
//do nothing
}
else if(owned != null && userSession.getUser() != null && (owned.isOwnedBy(userSession.getUser()) || ((UserImpl) userSession.getUser()).isSuperUserOrAdmin()))
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
try
{
writer.write(toPage);
}
catch(Exception e)
{
logger.error(e,e);
throw new JspException(e);
}
}
 
// Continue processing this page
return EVAL_PAGE;
}
 
 
}
/impl/src/web/admin/profile/findUser.jsp
9,8 → 9,6
<jomm:messages/>
<html:form action="/profile">
<input type="hidden" name="dispatch" value="search">
<html:hidden property="userView.id"/>
<html:hidden property="userView.userRoles"/>
 
<table class="form">
<tr>
/impl/src/web/admin/profile/profile.jsp
1,25 → 1,26
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/estgweb.tld" prefix="estgweb" %>
 
 
<jomm:messages/>
<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/>
<%--<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/>--%>
<html:form action="/profile">
<input type="hidden" name="dispatch" value="editUser">
<html:hidden property="userView.id"/>
<html:hidden property="userView.userRoles"/>
<bean:message key="profile.edit"/>
 
<table class="form">
<estgweb:isNotAdmin>
<tr>
<th><bean:message key="login.first.time.username"/></th>
<th>
<bean:message key="login.first.time.username"/>
</th>
<td>
<html:text property="userView.username" maxlength="250" readonly="true" styleClass="readOnly"/>
</td>
27,30 → 28,40
</estgweb:isNotAdmin>
<estgweb:isAdmin>
<tr>
<th><bean:message key="login.first.time.username"/></th>
<th>
<bean:message key="login.first.time.username"/>
</th>
<td>
<html:text property="userView.username" maxlength="250"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.targets"/></th>
<th>
<bean:message key="login.first.time.targets"/>
</th>
<td>
<html:select property="targetRolesStr">
<logic:present name="ProfileForm" property="targetRoles">
<logic:iterate id="item" name="ProfileForm" property="targetRoles">
<jomm:option itemName="item" comparableObjectName="ProfileForm" comparableObjectProperty="targetRolesStr">
<jomm:option itemName="item" comparableObjectName="ProfileForm"
comparableObjectProperty="targetRolesStr">
<jomm:message patternMessage="user.role.{0}" name0="item"/>
</jomm:option>
</logic:iterate>
<input type="button" value="<bean:message key="add"/>" onclick="set(this.form,'addRole');this.form.submit();">
<input type="button" value="<bean:message key="add"/>"
onclick="set(this.form,'addRole');this.form.submit();">
</logic:present>
</html:select>
 
<logic:present name="ProfileForm" property="selectedRoles">
<logic:notEmpty name="ProfileForm" property="selectedRoles">
<ul>
<logic:iterate id="item" name="ProfileForm" property="selectedRoles">
<li><jomm:message patternMessage="user.role.{0}" name0="item"/><input type="button" value="<bean:message key="remove"/>" onclick="AnnouncementsForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();"></li>
<li>
<jomm:message patternMessage="user.role.{0}" name0="item"/>
<input type="button" value="<bean:message key="remove"/>"
onclick="AnnouncementsForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();">
</li>
</logic:iterate>
</ul>
</logic:notEmpty>
59,50 → 70,66
</tr>
</estgweb:isAdmin>
<tr>
<th><bean:message key="login.first.time.bi"/></th>
<th>
<bean:message key="login.first.time.bi"/>
</th>
<td>
<html:text property="userView.bi" maxlength="250" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.birthday.date"/></th>
<th>
<bean:message key="login.first.time.birthday.date"/>
</th>
<td>
<html:text property="birthDayDate" maxlength="100" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.name"/></th>
<th>
<bean:message key="login.first.time.name"/>
</th>
<td>
<html:text property="userView.name" maxlength="250" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.address"/></th>
<th>
<bean:message key="login.first.time.address"/>
</th>
<td>
<html:text property="userView.address" maxlength="250" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.zip"/></th>
<th>
<bean:message key="login.first.time.zip"/>
</th>
<td>
<html:text property="userView.zip" maxlength="8" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.country"/></th>
<th>
<bean:message key="login.first.time.country"/>
</th>
<td>
<html:text property="userView.country" maxlength="100" readonly="true" styleClass="readOnly"/>
</td>
</tr>
<tr>
<th><bean:message key="login.first.time.phone.number"/></th>
<th>
<bean:message key="login.first.time.phone.number"/>
</th>
<td>
<html:text property="userView.phonenumber" maxlength="250" styleClass="readOnly"/>
</td>
</tr>
<estgweb:isNotAdmin>
<tr>
<th><bean:message key="login.first.time.email.institucion"/></th>
<th>
<bean:message key="login.first.time.email.institucion"/>
</th>
<td>
<html:text property="userView.email" maxlength="250" readonly="true" styleClass="readOnly"/>
</td>
110,31 → 137,33
</estgweb:isNotAdmin>
<estgweb:isAdmin>
<tr>
<estgweb:isAdmin>
<th><bean:message key="login.first.time.email.institucion2"/></th>
</estgweb:isAdmin>
<estgweb:isNotAdmin>
<th><bean:message key="login.first.time.email.institucion"/></th>
</estgweb:isNotAdmin>
<th>
<bean:message key="login.first.time.email.institucion2"/>
</th>
<td>
<html:text property="userView.email" maxlength="250"/>
</td>
</tr>
</estgweb:isAdmin>
<tr>
<th><bean:message key="login.first.time.email.secundary"/></th>
<th>
<bean:message key="login.first.time.email.secundary"/>
</th>
<td>
<html:text property="userView.outEmail" maxlength="250"/>
</td>
</tr>
<estgweb:isNotAdmin>
<tr>
<th><bean:message key="profile.email.change"/></th>
<th>
<bean:message key="profile.email.change"/>
</th>
</tr>
</estgweb:isNotAdmin>
<tr class="buttons">
<td colspan="2">
<input type="button" onclick="set(this.form,'editUser');this.form.submit()" value="<bean:message key="confirm"/>"/>
<input type="button" onclick="set(this.form,'editUser');this.form.submit()"
value="<bean:message key="confirm"/>"/>
</td>
</tr>
</table>
/impl/src/web/public/announcements/loadAnnouncement.jsp
13,15 → 13,10
<html:link href="http://www.sapo.pt"></html:link>
<div class="seccao">
<h2>${Announcement.title}
<%
if (userSession.getUser() != null && (Announcement.isOwnedBy(userSession.getUser()) || ((UserImpl) userSession.getUser()).isSuperUserOrAdmin()))
{
%>
<estgweb:canManage name="Announcement">
<html:link action="/loadAnnouncement?id=${Announcement.id}&dispatch=edit"> <bean:message key="edit"/> </html:link>
<html:link action="/loadAnnouncement?id=${Announcement.id}&dispatch=delete">Apagar</html:link>
<%
}
%>
</estgweb:canManage>
</h2>
<%
AnnouncementStyleEnum styleEnum = Announcement.getStyleEnum();