Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 264 → Rev 265

/impl/conf/language/MessageResourcesCourseUnits.properties
16,6 → 16,7
 
courseunit.program.description=Programa Curricular de {0}
 
courseunit.zero.units=Nenhuma Unidade Curricular
courseunit.objectives.todo=Peenchimento dos objectivos da unidade
courseunit.program.todo=Upload do programa da unidade
courseunit.question.todo=Dúvida
/impl/src/java/pt/estgp/estgweb/domain/StudentImpl.java
4,13 → 4,11
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;
 
import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.util.ArrayList;
import java.util.*;
 
import org.apache.log4j.Logger;
import jomm.utils.StringsUtils;
import com.lowagie.text.pdf.hyphenation.TernaryTree;
 
/**
* @author Jorge Machado
55,6 → 53,14
return STUDENT_ROLE;
}
 
public List<CourseUnit> getSubscribedUnitsViewS1()
{
return getUnitsSemestre("S1",getSubscribedUnitsView());
}
public List<CourseUnit> getSubscribedUnitsViewS2()
{
return getUnitsSemestre("S2",getSubscribedUnitsView());
}
public List<CourseUnit> getSubscribedUnitsView()
{
if(subscribedUnitsView == null)
84,6 → 90,14
return subscribedUnitsView;
}
 
public List<CourseUnit> getSubscribedUnitsCurrentYearViewS1()
{
return getUnitsSemestre("S1",getSubscribedUnitsCurrentYearView());
}
public List<CourseUnit> getSubscribedUnitsCurrentYearViewS2()
{
return getUnitsSemestre("S2",getSubscribedUnitsCurrentYearView());
}
public List<CourseUnit> getSubscribedUnitsCurrentYearView()
{
if(subscribedUnitsCurrentYearView == null)
113,6 → 127,14
return subscribedUnitsCurrentYearView;
}
 
public List<CourseUnit> getSubscribedUnitsOldYearsViewS1()
{
return getUnitsSemestre("S1",getSubscribedUnitsOldYearsView());
}
public List<CourseUnit> getSubscribedUnitsOldYearsViewS2()
{
return getUnitsSemestre("S2",getSubscribedUnitsOldYearsView());
}
public List<CourseUnit> getSubscribedUnitsOldYearsView()
{
if(subscribedUnitsOldYearsView == null)
143,6 → 165,7
}
 
 
 
public List<CourseUnitAnnouncementImpl> getCourseUnitAnnouncementsView()
{
if(courseUnitAnnouncementsView == null)
164,6 → 187,26
return courseUnitAnnouncementsView;
}
 
 
 
public static List<CourseUnit> getUnitsSemestre(String semestre, List<CourseUnit> s1)
{
if(s1 != null)
{
s1 = new ArrayList<CourseUnit>(s1);
Iterator iter = s1.iterator();
while (iter.hasNext())
{
CourseUnit courseUnit = (CourseUnit) iter.next();
if(courseUnit.getSemestre() == null || !courseUnit.getSemestre().equals(semestre))
iter.remove();
}
return s1;
}
return s1;
}
 
 
public boolean hasCourseUnit(CourseUnit courseUnit)
{
return hasCourseUnit(courseUnit.getId(),false);
/impl/src/web/user/home/student.jsp
18,35 → 18,37
<ul>
<li>
<p><bean:message key="courseunit.semestre"/> 1</p>
<ul>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearView">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsView">
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsView" type="pt.estgp.estgweb.domain.CourseUnit">
<logic:equal value="S1" name="unit" property="semestre">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.importYear})</html:link>
</li>
</logic:equal>
<logic:empty name="UserSession" property="user.subscribedUnitsCurrentYearViewS1">
<bean:message key="courseunit.zero.units"/>
</logic:empty>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewS1">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsCurrentYearViewS1">
<ul>
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsCurrentYearViewS1" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.importYear})</html:link>
</li>
</logic:iterate>
</logic:notEmpty>
</logic:present>
</ul>
</ul>
</logic:notEmpty>
</logic:present>
</li>
<li>
<p><bean:message key="courseunit.semestre"/> 2</p>
<ul>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearView">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsView">
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsView" type="pt.estgp.estgweb.domain.CourseUnit">
<logic:equal value="S2" name="unit" property="semestre">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.importYear})</html:link>
</li>
</logic:equal>
<logic:empty name="UserSession" property="user.subscribedUnitsCurrentYearViewS2">
<bean:message key="courseunit.zero.units"/>
</logic:empty>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewS2">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsCurrentYearViewS2">
<ul>
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsCurrentYearViewS2" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.importYear})</html:link>
</li>
</logic:iterate>
</logic:notEmpty>
</logic:present>
</ul>
</ul>
</logic:notEmpty>
</logic:present>
</li>
</ul>
<!--Can put year all other units in the future calling service user.subscribedUnitsOldYearsView-->