Commit 456524f8 authored by didonet's avatar didonet

Added a page with an overall view of a student.

parent bbc2226a
......@@ -13,13 +13,13 @@ import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;
import br.ufpr.c3sl.sapos.models.scholar.Registration;
import br.ufpr.c3sl.sapos.models.scholar.SectionPos;
import br.ufpr.c3sl.sapos.models.scholar.StudentGrant;
import br.ufpr.c3sl.sapos.models.scholar.Transcript;
import br.ufpr.c3sl.sapos.models.scholar.TravelRequisition;
import br.ufpr.c3sl.sapos.models.scholar.enums.CommitteeKind;
import br.ufpr.c3sl.sapos.models.scholar.enums.RegistrationKind;
import br.ufpr.c3sl.sapos.models.scholar.enums.RegistrationStatus;
import br.ufpr.c3sl.sapos.models.scholar.enums.SituationTranscript;
@RooJavaBean
@RooToString
......@@ -39,6 +39,7 @@ public class Configuration {
public static String COURSE_INFO_FOOTER = "course.info.footer";
public static String VERIFY_TEACHING_PRACTICE = "verify.teaching.practice";
public static String TECHING_PRACTICE_COURSES = "teaching.practice.courses";
public static String ALLOWED_DUPLICATE_COURSE_CODE = "allowed.duplicate.course.codes";
public static String MONTHS_DEFENSE_DATE_EXPIRES_PHD = "months.defense.date.expires.phd";
public static String MONTHS_PHD = "months.phd";
......@@ -92,18 +93,22 @@ public class Configuration {
}
public static Object findActiveDuplicatedCodes(){
return entityManager().createNativeQuery("select " +
"a1.*, c1.code, e1.name " +
"from " +
"transcript a1, section_pos b1, course c1, registration d1, person e1 " +
"where " +
"a1.transcript_section = b1.id and b1.course = c1.id and a1.student = d1.id and d1.student = e1.id " +
"( a1.situation = '"+SituationTranscript.Aprovado+"' or a1.situation is null or a1.situation = '"+SituationTranscript.Nulo+"')"+
" and a1.transcript_section = b1.id and b1.course = c1.id and a1.student = d1.id and d1.student = e1.id " +
"and d1.reg_status='Ativa' and " +
"exists ( select e.name, c.code from transcript a, section_pos b, course c, registration d, person e " +
"where a.transcript_section = b.id and b.course = c.id and a.student = d.id and d.student = " +
"e.id and d.reg_status='Ativa' group by c.code, e.name having count(*) > 1 and" +
" c1.code=c.code and e1.name = e.name) " +
"order by e1.name, c1.code ",
"and c1.code not in ("+ "'"+
findConfigValueByName(Configuration.ALLOWED_DUPLICATE_COURSE_CODE).replaceAll(" ","").replaceAll(",","','")+"'"+") " +
" order by e1.name, c1.code ",
Transcript.class).getResultList();
}
......
......@@ -47,5 +47,10 @@ public class Committee {
"where a.student=b.id and b.student = c.id order by name", Committee.class).getResultList();
}
public static List<Committee> findCommitteesPerRegistration( Long id) {
return entityManager().createNativeQuery("select * from committee a, registration b, person c " +
"where a.student=b.id and b.student = c.id and b.id = "+id+" order by date", Committee.class).getResultList();
}
}
......@@ -603,9 +603,15 @@ public class Transcript {
public static boolean hasDuplicatedTranscript(long studentId, String courseCode) {
return (entityManager().createNativeQuery("select * from transcript a, section_pos b, course c " +
"where a.transcript_section = b.id and b.course = c.id and " +
"student = "+studentId+" and c.code like '"+courseCode.toUpperCase().trim()+"%'", Transcript.class).getResultList().size() > 0);
"( a.situation = '"+SituationTranscript.Aprovado+"' or a.situation is null or a.situation = '"+SituationTranscript.Nulo+"')"+
" andstudent = "+studentId+" and c.code like '"+courseCode.toUpperCase().trim()+"%'"+
"and c.code not in ("+ "'"+
Configuration.findConfigValueByName(Configuration.ALLOWED_DUPLICATE_COURSE_CODE).replaceAll(" ","").replaceAll(",","','")+"'"+") "
,
Transcript.class).getResultList().size() > 0);
}
......
......@@ -10,7 +10,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import br.ufpr.c3sl.sapos.models.customization.Configuration;
import br.ufpr.c3sl.sapos.models.scholar.Committee;
import br.ufpr.c3sl.sapos.models.scholar.Registration;
import br.ufpr.c3sl.sapos.models.scholar.StudentGrant;
import br.ufpr.c3sl.sapos.models.scholar.Transcript;
@RooWebScaffold(path = "registrations", formBackingObject = Registration.class)
@RequestMapping("/registrations")
......@@ -139,4 +143,27 @@ public class RegistrationController {
return "registrations/liststudentsbasicinfo";
}
@RequestMapping(value = "regoverviewchoice", method = RequestMethod.GET)
public String registrationOverviewChoice() {
return "registrations/regoverviewchoice";
}
@RequestMapping(value = "registrationOverview", method = RequestMethod.GET)
public String registrationOverview() {
return "registrations/registrationOverview";
}
@RequestMapping(value = "studentinfo", method = RequestMethod.GET)
public String registrationOverview(@RequestParam(value="id", required =true) String id, Model model) {
Registration reg = Registration.findRegistration(new Long(id));
model.addAttribute("registration", Registration.findRegistration(reg.getId()));
model.addAttribute("alltranscripts",Transcript.findTranscriptByRegInYearAndPeriodOrder(reg));
model.addAttribute("grants",StudentGrant.findGrantsPerRegistration(reg.getId()));
model.addAttribute("committees",Committee.findCommitteesPerRegistration(reg.getId()));
return "registrations/registrationoverview";
}
}
......@@ -3,6 +3,7 @@ global_menu_new=Create new {0}
global_menu_list=List all {0}
global_menu_list_status=List per status
global_menu_statement_disciplinas=List per course
global_menu_registration_overview=Registration overview
global_menu_statement_advisees=Advisees' statement
global_menu_statement_advisees_concluded=Concluded Advisees' statement
global_menu_statement_committees=Committees participation statement
......
......@@ -11,6 +11,7 @@ global_theme=Tema
global_theme_alt=alt
global_theme_standard=padro
global_menu_statement_disciplinas=Declarao disciplinas
global_menu_registration_overview=Viso geral do aluno
global_menu_transcript_section=Dirio de classe
global_menu_statement_advisees=Declarao de orientandos
global_menu_statement_advisees_concluded=Declarao de orientandos concluidos
......
......@@ -40,6 +40,7 @@
<menu:item id="i_registration_list" messageCode="global_menu_blank_proposal" url="/registrations/openproposaldate" z="user-managed"/>
<menu:item id="i_registration_list" messageCode="global_menu_entrants_data" url="/registrations/entrantsdata" z="user-managed"/>
<menu:item id="i_registration_list" messageCode="global_menu_concluded_by_period" url="/registrations/concludedbyperiod" z="user-managed"/>
<menu:item id="i_registration_list" messageCode="global_menu_registration_overview" url="/registrations/regoverviewchoice" z="user-managed"/>
</menu:category>
<menu:category id="c_transcript" z="a8v3h7EFS5CVeUqTWiTRDpYXXJg=">
<menu:item id="i_transcript_new" messageCode="global_menu_new" url="/transcripts?form" z="jWr28guoRI7FAdrnFd1qpcAYEGQ="/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<div xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:output omit-xml-declaration="yes"/>
<b>Dados gerais do aluno</b> <p/>
<b>Selecione um aluno</b>
<p></p>
<form name="registrationOverviewChoice" action="studentinfo" method="get">
<field:select disableFormBinding="true" field="id" id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_student"
itemValue="id" items="${registrations}" path="/registrations" z="user-managed"/>
<input type="submit" value="Enviar"/>
</form>
<form:dependency dependencies="${dependencies}" id="d_br_ufpr_c3sl_sapos_models_people_Student" render="${not empty dependencies}" z="gW+juyJp3mRm7nWlqYbCfkbtYVo="/>
</div>
......@@ -63,5 +63,13 @@
<definition extends="default" name="registrations/concludedbyperiod">
<put-attribute name="body" value="/WEB-INF/views/registrations/concludedbyperiod.jspx" />
</definition>
<definition extends="default" name="registrations/registrationoverview">
<put-attribute name="body" value="/WEB-INF/views/registrations/registrationoverview.jspx"/>
</definition>
<definition extends="default" name="registrations/regoverviewchoice">
<put-attribute name="body" value="/WEB-INF/views/registrations/regoverviewchoice.jspx"/>
</definition>
</tiles-definitions>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment