Commit fa4294de authored by Fabiano Sluzarski's avatar Fabiano Sluzarski

Fixed concept alert and others, added travel requisition alert, near end

grant alert and profession on travel requisition.
parent d6e261d1
......@@ -12,6 +12,7 @@ import org.springframework.roo.addon.tostring.RooToString;
import br.ufpr.c3sl.sapos.models.scholar.Registration;
import br.ufpr.c3sl.sapos.models.scholar.StudentGrant;
import br.ufpr.c3sl.sapos.models.scholar.Transcript;
import br.ufpr.c3sl.sapos.models.scholar.TravelRequisition;
@RooJavaBean
@RooToString
......@@ -68,7 +69,7 @@ public class Configuration {
}
//- avisar que notas do semestre anterior nao foram preenchidas
public static Object findLastPeriodBlankGrades(){
public static Object findLastPeriodBlankConcepts(){
int year, month, period = 0;
Calendar c = Calendar.getInstance();
year = c.get(Calendar.YEAR);
......@@ -81,9 +82,34 @@ public class Configuration {
period = 1;
return entityManager().createNativeQuery(
"select * from transcript t, section_pos s, registration r, person p where t.grade IS NULL " +
"select * from transcript t, section_pos s, registration r, person p where (t.concept IS NULL or t.concept = 'Nulo') " +
"and t.transcript_section = s.id and s.section_year = "+year+" and s.period = "+period+
" and t.student = r.id and r.student = p.id order by p.name", Transcript.class).getResultList();
}
//- alerta para requisicoes de viagem
public static Object findAllOpenTravelRequisitions(){
return entityManager().createNativeQuery(
"select * from travel_requisition where request_status = 'Aberta'", TravelRequisition.class).getResultList();
}
//- mostrar perto da data final de bolsa
public static Object findNearEndGrants(){
Integer phd, master, expiring;
phd = new Integer(Configuration.findConfigValueByName("months.phd.scholarship.duration"));
master = new Integer(Configuration.findConfigValueByName("months.master.scholarship.duration"));
expiring = new Integer(Configuration.findConfigValueByName("days.to.grant.expiration"));
phd = phd * 30; //em dias
master = master * 30; //em dias
return entityManager().createNativeQuery("select * from student_grant sg, registration r, person p" +
" where sg.registration = r.id and r.student = p.id and sg.end_date IS NULL and" +
" ((r.reg_kind = 'Mestrado' and (CURRENT_DATE - (sg.start_date + integer '"+master.toString()+"')) <= '"+expiring.toString()+"') OR" +
" (r.reg_kind = 'Doutorado' and (CURRENT_DATE - (sg.start_date + integer '"+phd.toString()+"')) <= '"+expiring.toString()+"'))" +
" order by p.name", StudentGrant.class).getResultList();
/*"select * from student_grant sg where (CURRENT_DATE - (sg.start_date + integer '"+master+"')) <= '"+expiring+"'"*/
}
}
\ No newline at end of file
......@@ -36,14 +36,15 @@ import com.itextpdf.text.Phrase;
@RooJavaBean
@RooToString
@RooEntity
public class TravelRequisition { //base: Research Field
public class TravelRequisition {
//TODO ??????
@ManyToOne
private Person person;
@Enumerated(EnumType.STRING)
private RequesterKind requesterKind;
private RequesterKind requesterKind;
private String profession;
private String justification;
......@@ -112,14 +113,7 @@ public class TravelRequisition { //base: Research Field
p = new Paragraph("Nome: "+person.getName(), ReportUtil.getNormalTextFont());
document.add(p);
p = new Paragraph();
phr = new Phrase("Cargo/Profissão: ", ReportUtil.getNormalTextFont());
p.add(phr);
if (person.getUserKind() == UserKind.Aluno)
phr = new Phrase("Aluno", ReportUtil.getNormalTextFont());
else if (person.getUserKind() == UserKind.Professor)
phr = new Phrase("Professor", ReportUtil.getNormalTextFont());
else
phr = new Phrase("Funcionário", ReportUtil.getNormalTextFont());
phr = new Phrase("Cargo/Profissão: "+tr.profession, ReportUtil.getNormalTextFont());
p.add(phr);
phr = new Phrase(" Data de nascimento: "+person.getDateOfBirth(), ReportUtil.getNormalTextFont());
p.add(phr);
......
......@@ -13,7 +13,6 @@ import br.ufpr.c3sl.sapos.models.scholar.enums.TripKind;
privileged aspect TravelRequisition_Roo_JavaBean {
// TODO
public Person TravelRequisition.getPerson() {
return this.person;
}
......@@ -29,6 +28,14 @@ privileged aspect TravelRequisition_Roo_JavaBean {
public void TravelRequisition.setRequesterKind(RequesterKind requesterKind) {
this.requesterKind = requesterKind;
}
public String TravelRequisition.getProfession() {
return this.profession;
}
public void TravelRequisition.setProfession(String profession) {
this.profession = profession;
}
public String TravelRequisition.getJustification() {
return this.justification;
......
......@@ -9,7 +9,6 @@ privileged aspect TravelRequisition_Roo_ToString {
public String TravelRequisition.toString() {
StringBuilder sb = new StringBuilder();
// TODO ?????
sb.append("Conference: ").append(getConference()).append(", ");
sb.append("DayNumber: ").append(getDayNumber()).append(", ");
sb.append("Destinations: ").append(getDestinations()).append(", ");
......@@ -18,6 +17,7 @@ privileged aspect TravelRequisition_Roo_ToString {
sb.append("Observations: ").append(getObservations()).append(", ");
sb.append("Person: ").append(getPerson()).append(", ");
sb.append("Place: ").append(getPlace()).append(", ");
sb.append("Profession: ").append(getProfession()).append(", ");
sb.append("RequesterKind: ").append(getRequesterKind()).append(", ");
sb.append("RequestStatus: ").append(getRequestStatus()).append(", ");
sb.append("StartDate: ").append(getStartDate()).append(", ");
......
......@@ -36,8 +36,9 @@ public class ConfigurationController {
model.addAttribute("irregularGrants", Configuration.findActiveStudentIrregularGrants());
model.addAttribute("irregularRegistrations", Configuration.findIrregularRegistration());
model.addAttribute("expiredDefense", Configuration.findLongTimeDefenseRegistration());
model.addAttribute("endGrant", "");
model.addAttribute("gradeEmpty", Configuration.findLastPeriodBlankGrades());
model.addAttribute("endGrant", Configuration.findNearEndGrants());
model.addAttribute("gradeEmpty", Configuration.findLastPeriodBlankConcepts());
model.addAttribute("travelrequisition", Configuration.findAllOpenTravelRequisitions());
return "configurations/alert";
}
......@@ -102,10 +103,10 @@ public class ConfigurationController {
@Autowired
private transient MailSender mailTemplate;
public void sendMessage(String mailFrom, String subject, String mailTo, String message) {
//USAGE: sendMessage("spring.roo.playground@gmail.com", "[sapos] Teste Email", "arke.fabiano@gmail.com", "Sucesso!!!");
public void sendMessage(/*String mailFrom,*/ String subject, String mailTo, String message) {
//USAGE: sendMessage("[sapos] Teste Email", "exemplo@gmail.com", "Sucesso!!!");
org.springframework.mail.SimpleMailMessage simpleMailMessage = new org.springframework.mail.SimpleMailMessage();
simpleMailMessage.setFrom(mailFrom);
simpleMailMessage.setFrom(Configuration.findConfigValueByName("course.email"));
simpleMailMessage.setSubject(subject);
simpleMailMessage.setTo(mailTo);
simpleMailMessage.setText(message);
......
......@@ -98,7 +98,6 @@ privileged aspect TravelRequisitionController_Roo_Controller {
return "redirect:/travelrequisitions";
}
//TODO ??
@ModelAttribute("people")
public java.util.Collection<Person> TravelRequisitionController.populatePeople() {
return Person.findAllPeople();
......
......@@ -85,7 +85,7 @@ label_br_ufpr_c3sl_sapos_models_people_person_street=Street
label_br_ufpr_c3sl_sapos_models_people_person_titles=Titles
label_br_ufpr_c3sl_sapos_models_people_person_version=Version
label_br_ufpr_c3sl_sapos_models_people_person_zipcode=Zip Code
label_br_ufpr_c3sl_sapos_models_people_person_username=User Name
label_br_ufpr_c3sl_sapos_models_people_person_username=Login
label_br_ufpr_c3sl_sapos_models_people_person_password=Password
label_br_ufpr_c3sl_sapos_models_people_person_userkind=User Kind
label_br_ufpr_c3sl_sapos_models_people_person_oldpass=Old Password
......@@ -317,6 +317,7 @@ label_br_ufpr_c3sl_sapos_models_scholar_researchfield_version=Version
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition=Travel Requisition
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_id=Id
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_person=Person
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_profession=Profession
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_requesterkind=Requester Kind
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_justification=Justification
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_conference=Conference
......
......@@ -76,7 +76,7 @@ label_br_ufpr_c3sl_sapos_models_people_person_street=Rua
label_br_ufpr_c3sl_sapos_models_people_person_titles=Ttulos
label_br_ufpr_c3sl_sapos_models_people_person_version=Version
label_br_ufpr_c3sl_sapos_models_people_person_zipcode=C.E.P.
label_br_ufpr_c3sl_sapos_models_people_person_username=Nome do Usurio
label_br_ufpr_c3sl_sapos_models_people_person_username=Login
label_br_ufpr_c3sl_sapos_models_people_person_password=Senha
label_br_ufpr_c3sl_sapos_models_people_person_userkind=Tipo de Usurio
label_br_ufpr_c3sl_sapos_models_people_person_oldpass=Senha Antiga
......@@ -310,6 +310,7 @@ label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition=Requisi
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_id=Id
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_person=Pessoa
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_requesterkind=Beneficirio
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_profession=Profisso
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_justification=Justificativa
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_conference=Conferncia
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_place=Local
......
......@@ -13,7 +13,7 @@
</c:if>
<li id="${fn:escapeXml(id)}">
<script type="text/javascript">dojo.require('dijit.TitlePane');</script>
<!-- <script type="text/javascript">dojo.require('dijit.TitlePane');</script>
<div id="_title_${id}_id">
<script type="text/javascript">Spring.addDecoration(
new Spring.ElementDecoration({elementId : '_title_${id}_id', widgetType : 'dijit.TitlePane', widgetAttrs :
......@@ -21,13 +21,13 @@
<ul>
<jsp:doBody />
</ul>
</div>
<!-- <h2>
</div> -->
<h2>
<c:out value="${label}" />
</h2>
<ul>
<jsp:doBody />
</ul> -->
</ul>
</li>
</c:if>
......
......@@ -3,11 +3,33 @@
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:output omit-xml-declaration="yes"/>
<b>Alunos ativos nos programas</b>
<page:show id="ps_br_ufpr_c3sl_sapos_models_customization_Configuration" object="${configurations}" path="/configurations" emptyLabels="true" create="false" delete="false" update="false" list="false" z="user-managed">
<field:display field="value" id="s_br_ufpr_c3sl_sapos_models_customization_Configuration_master" object="${activeMaster}" z="user-managed"/>
<field:display field="value" id="s_br_ufpr_c3sl_sapos_models_customization_Configuration_phd" object="${activePhd}" z="user-managed"/>
</page:show>
<b>Requisições de viagem em aberto</b>
<page:list id="pl_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition" items="${travelrequisition}" emptyLabels="true" z="user-managed">
<table:table data="${travelrequisition}" id="l_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition" path="/travelrequisitions" create="false" z="user-managed">
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_person" navigation="true" property="person" z="user-managed"/>
<table:column property="requesterKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requesterKind" z="user-managed"/>
<table:column property="profession" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_profession" z="user-managed"/>
<table:column property="conference" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_conference" z="user-managed"/>
<table:column property="place" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_place" z="user-managed"/>
<table:column property="destinations" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_destinations" z="user-managed"/>
<table:column property="justification" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_justification" z="user-managed"/>
<table:column property="tripKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_tripKind" z="user-managed"/>
<table:column property="dayNumber" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_dayNumber" z="user-managed"/>
<table:column property="tripStartDate" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_tripStartDate" z="user-managed"/>
<table:column property="tripEndDate" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_tripEndDate" z="user-managed"/>
<table:column property="startDate" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_startDate" z="user-managed"/>
<table:column property="endDate" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_endDate" z="user-managed"/>
<table:column property="ticketKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_ticketKind" z="user-managed"/>
<table:column property="ticketValue" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_ticketValue" z="user-managed"/>
<table:column property="totalValue" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_totalValue" z="user-managed"/>
<table:column property="requestStatus" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requestStatus" z="user-managed"/>
<table:column property="observations" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_observations" z="user-managed"/>
</table:table>
</page:list>
<br/><br/>
<b>Aluno reprovado com bolsa</b>
......@@ -53,7 +75,7 @@
</page:list>
<br/><br/>
<b>- mostrar perto da data final de bolsa</b>
<b>Bolsas próximas a data de termino</b>
<page:list id="pl_br_ufpr_c3sl_sapos_models_people_Staff" items="${endGrant}" emptyLabels="true" z="user-managed">
<table:table data="${endGrant}" id="l_br_ufpr_c3sl_sapos_models_scholar_StudentGrant" path="/studentgrants" create="false" z="user-managed">
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_name" property="registration.student.name" z="user-managed" navigation="true"/>
......@@ -66,7 +88,7 @@
</page:list>
<br/><br/>
<b>Avaliações do semestre anterior com notas não preenchidas</b>
<b>Avaliações do semestre anterior com conceitos não preenchidos</b>
<page:list id="pl_br_ufpr_c3sl_sapos_models_scholar_Transcript" items="${gradeEmpty}" emptyLabels="true" z="XkBEOi8+LWqvFKK06b3mq90KI1U=">
<table:table data="${gradeEmpty}" id="l_br_ufpr_c3sl_sapos_models_scholar_Transcript" path="/transcripts" create="false" z="57/qLH4Y2mwQJG9RQk+tGXo2kpw=">
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_student" navigation="true" property="student.student.name" z="user-managed"/>
......@@ -79,5 +101,12 @@
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_Transcript_situation" property="situation" z="iq+rXnC/oF96+jdqVt0v2XQMzZw=" nullvalue="Nulo"/>
</table:table>
</page:list>
<br/><br/>
<b>Alunos ativos nos programas</b>
<page:show id="ps_br_ufpr_c3sl_sapos_models_customization_Configuration" object="${configurations}" path="/configurations" emptyLabels="true" create="false" delete="false" update="false" list="false" z="user-managed">
<field:display field="value" id="s_br_ufpr_c3sl_sapos_models_customization_Configuration_master" object="${activeMaster}" z="user-managed"/>
<field:display field="value" id="s_br_ufpr_c3sl_sapos_models_customization_Configuration_phd" object="${activePhd}" z="user-managed"/>
</page:show>
</div>
......@@ -3,9 +3,9 @@
<jsp:output omit-xml-declaration="yes"/>
<page:list id="pl_br_ufpr_c3sl_sapos_models_people_Student" items="${registrations}" z="x61ty86TOZ+JTCqaf5YvH3Kj2sA=">
<table:table data="${registrations}" id="l_br_ufpr_c3sl_sapos_models_scholar_Registration" path="/registrations" z="izP/twCuZG4G9mcJpiGRcM1CmLU=">
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_userName" property="student.userName" z="user-managed" navigation="true"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_name" property="student.name" z="user-managed" navigation="true"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_cpf" property="student.cpf" z="user-managed" navigation="true"/>
<table:column id="c_br_ufpr_c3sl_sapos_models_people_Person_userName" property="student.userName" z="user-managed" navigation="true"/>
</table:table>
</page:list>
</div>
......@@ -7,6 +7,7 @@
<p/>
<field:select disableFormBinding="true" field="person" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_person" itemValue="id" items="${people}" path="/people" z="user-managed"/>
<field:select field="requesterKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requesterKind" items="${requesterkinds}" path="requesterkinds" z="user-managed"/>
<field:input field="profession" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_profession" z="user-managed"/>
<hr/>
<b>Sobre a viagem</b>
......
......@@ -6,6 +6,7 @@
<table:table data="${travelrequisitions}" id="l_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition" path="/travelrequisitions" generatepdf="true" pathpdf="/travelrequisitions/travelrequisitionpdf?id=" z="user-managed">
<table:column id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_person" navigation="true" property="person" z="user-managed"/>
<table:column property="requesterKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requesterKind" z="user-managed"/>
<table:column property="profession" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_profession" z="user-managed"/>
<table:column property="conference" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_conference" z="user-managed"/>
<table:column property="place" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_place" z="user-managed"/>
......
......@@ -7,6 +7,7 @@
<p/>
<field:display field="person" id="s_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_person" object="${travelrequisition}" z="user-managed"/>
<field:display field="requesterKind" id="s_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requesterKind" object="${travelrequisition}" z="user-managed"/>
<field:display field="profession" id="s_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_profession" object="${travelrequisition}" z="user-managed"/>
<br/>
<hr/>
......
......@@ -7,6 +7,7 @@
<p/>
<field:select disableFormBinding="true" field="person" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_person" itemValue="id" items="${people}" path="/people" z="user-managed"/>
<field:select field="requesterKind" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_requesterKind" items="${requesterkinds}" path="requesterkinds" z="user-managed"/>
<field:input field="profession" id="c_br_ufpr_c3sl_sapos_models_scholar_TravelRequisition_profession" z="user-managed"/>
<hr/>
<b>Sobre a viagem</b>
......
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