Commit ef7fecf2 authored by didonet's avatar didonet
Browse files

Added attributes to the travel requisition class.

Changed the type of the "program" attribute at SectionPos and Course
parent c15b69e2
......@@ -98,7 +98,7 @@ public class Configuration {
//- alerta para requisicoes de viagem
public static Object findAllOpenTravelRequisitions(){
return entityManager().createNativeQuery(
"select * from travel_requisition where request_status = 'Aberta'", TravelRequisition.class).getResultList();
"select * from travel_requisition where request_status = 'Aberta' OR request_status = 'Confirmada'", TravelRequisition.class).getResultList();
}
//- mostrar perto da data final de bolsa
......
......@@ -4,6 +4,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.entity.RooEntity;
......@@ -25,6 +26,7 @@ public class Course {
private Integer workload;
@Column(columnDefinition="text")
private String program;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "course")
......
......@@ -40,16 +40,22 @@ public class Recommendation {
* Relacionamento com colegas e professores:
* Capacidade de expressão oral:
* Capacidade de expressão escrita: */
@Column(columnDefinition="text")
private String interest;
@Column(columnDefinition="text")
private String persistence;
@Column(columnDefinition="text")
private String intelectualCapability;
@Column(columnDefinition="text")
private String relationshipCoWorkers;
@Column(columnDefinition="text")
private String vocalExpression;
@Column(columnDefinition="text")
private String writingExpression;
/* 5) Descreva o potencial e a habilidade do candidato para uma carreira científica (uma descrição de pontos positivos e negativos é mais útil que comentários genéricos). */
......
......@@ -4,6 +4,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
......@@ -33,6 +34,7 @@ public class SectionPos {
@ManyToOne
private Course course;
@Column(columnDefinition="text")
private String program;
@ManyToOne
......
......@@ -144,7 +144,7 @@ public class Subscription {
Outros: Qual? lê ( ) entende ( ) fala ( ) escreve ( )*/
//10) Quais são suas motivações para fazer o Mestrado/Doutorado em Informática?
@Column(columnDefinition="alter table Subscription change motivations motivations text")
@Column(columnDefinition="text")
private String motivations;
//11) Recomendação:
......
......@@ -77,9 +77,14 @@ public class TravelRequisition {
private String destinations;
private String tripStartDate;
//valor só da passagem
@Temporal(TemporalType.DATE)
@DateTimeFormat(style = "S-")
private Date ticketStartDate;
private String tripEndDate;
@Temporal(TemporalType.DATE)
@DateTimeFormat(style = "S-")
private Date ticketEndDate;
private String ticketValue;
......@@ -90,6 +95,8 @@ public class TravelRequisition {
private String observations;
private String ticketPurchasePrice;
public static Object findTravelRequisitions(String requestStatus, String year) {
String sql = "";
if (!requestStatus.isEmpty())
......@@ -158,7 +165,7 @@ public class TravelRequisition {
phr = new Phrase("Unidade: ", ReportUtil.getNormalTextFont());
p.add(phr);
Professor prof = Professor.findProfessor(person.getId());
if (prof != null) {
if (prof != null && prof.getSiape() != null) {
phr = new Phrase(" Matrícula SIAPE: "+prof.getSiape(), ReportUtil.getNormalTextFont());
p.add(phr);
}
......@@ -274,7 +281,7 @@ public class TravelRequisition {
document.add(p);
p = new Paragraph("( ) Pagar diárias no Caravelle Licitado ( ) Apenas efetuar reserva no Hotel Licitado", ReportUtil.getNormalTextFont());
document.add(p);
p = new Paragraph("Valor das diárias (preenchido pela PRPPG) ", ReportUtil.getNormalTextFont());
p = new Paragraph("Valor das diárias (preenchido pela PRPPG): ", ReportUtil.getNormalTextFont());
document.add(p);
//3 – DIÁRIAS (Em caso de opção pelo pagamento do Hotel licitado NÃO será pago diárias na conta do beneficiário)
......@@ -290,9 +297,9 @@ public class TravelRequisition {
document.add(p);
p = new Paragraph("TRECHO: "+tr.destinations, ReportUtil.getNormalTextFont());
document.add(p);
p = new Paragraph("SAÍDA: "+tr.tripStartDate, ReportUtil.getNormalTextFont());
p = new Paragraph("SAÍDA: "+tr.ticketStartDate, ReportUtil.getNormalTextFont());
document.add(p);
p = new Paragraph("RETORNO: "+tr.tripEndDate, ReportUtil.getNormalTextFont());
p = new Paragraph("RETORNO: "+tr.ticketEndDate, ReportUtil.getNormalTextFont());
document.add(p);
p = new Paragraph();
......@@ -300,7 +307,7 @@ public class TravelRequisition {
p.add(phr);
if (tr.ticketValue != null) {
phr = new Phrase(tr.ticketValue, ReportUtil.getNormalTextFont());
phr = new Phrase(tr.ticketValue.toString(), ReportUtil.getNormalTextFont());
p.add(phr);
}
......
......@@ -33,6 +33,14 @@ privileged aspect TravelRequisition_Roo_JavaBean {
return this.profession;
}
public String TravelRequisition.getTicketPurchasePrice (){
return this.ticketPurchasePrice;
}
public void TravelRequisition.setTicketPurchasePrice(String ticketPurchasePrice){
this.ticketPurchasePrice = ticketPurchasePrice;
}
public void TravelRequisition.setProfession(String profession) {
this.profession = profession;
}
......@@ -125,20 +133,20 @@ privileged aspect TravelRequisition_Roo_JavaBean {
this.destinations = destinations;
}
public String TravelRequisition.getTripStartDate() {
return this.tripStartDate;
public Date TravelRequisition.getTicketStartDate() {
return this.ticketStartDate;
}
public void TravelRequisition.setTripStartDate(String tripStartDate) {
this.tripStartDate = tripStartDate;
public void TravelRequisition.setTicketStartDate(Date ticketStartDate) {
this.ticketStartDate = ticketStartDate;
}
public String TravelRequisition.getTripEndDate() {
return this.tripEndDate;
public Date TravelRequisition.getTicketEndDate() {
return this.ticketEndDate;
}
public void TravelRequisition.setTripEndDate(String tripEndDate) {
this.tripEndDate = tripEndDate;
public void TravelRequisition.setTicketEndDate(Date ticketEndDate) {
this.ticketEndDate = ticketEndDate;
}
public String TravelRequisition.getTicketValue() {
......
......@@ -25,9 +25,9 @@ privileged aspect TravelRequisition_Roo_ToString {
sb.append("TicketKind: ").append(getTicketKind()).append(", ");
sb.append("TicketValue: ").append(getTicketValue()).append(", ");
sb.append("TotalValue: ").append(getTotalValue()).append(", ");
sb.append("TripEndDate: ").append(getTripEndDate()).append(", ");
sb.append("TicketEndDate: ").append(getTicketEndDate()).append(", ");
sb.append("TripKind: ").append(getTripKind()).append(", ");
sb.append("TripStartDate: ").append(getTripStartDate());
sb.append("TicketStartDate: ").append(getTicketStartDate());
return sb.toString();
}
......
......@@ -2,5 +2,5 @@ package br.ufpr.c3sl.sapos.models.scholar.enums;
public enum RequestStatus {
Aberta, Negada, Confirmada, Anulada;
Aberta, Negada, Confirmada, Concluida, Cancelada;
}
......@@ -56,8 +56,8 @@ public class TravelRequisitionController {
Person p = travelRequisition.getPerson();
String message = new String();
message = "A requisição de viagem de "+p.getName();
if (travelRequisition.getRequestStatus() == RequestStatus.Anulada)
message += " foi ANULADA.";
if (travelRequisition.getRequestStatus() == RequestStatus.Cancelada)
message += " foi CANCELADA.";
else if (travelRequisition.getRequestStatus() == RequestStatus.Negada)
message += " foi NEGADA.";
else if (travelRequisition.getRequestStatus() == RequestStatus.Confirmada)
......
......@@ -42,6 +42,14 @@ privileged aspect TravelRequisitionController_Roo_Controller {
// return "redirect:/travelrequisitions/" + encodeUrlPathSegment(travelRequisition.getId().toString(), httpServletRequest);
// }
void TravelRequisitionController.addDateTimeFormatPatterns(Model uiModel) {
uiModel.addAttribute("travelrequisition_ticketstartdate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
uiModel.addAttribute("travelrequisition_ticketenddate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
uiModel.addAttribute("travelrequisition_startdate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
uiModel.addAttribute("travelrequisition_enddate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
}
@RequestMapping(params = "form", method = RequestMethod.GET)
public String TravelRequisitionController.createForm(Model uiModel) {
uiModel.addAttribute("travelRequisition", new TravelRequisition());
......@@ -127,11 +135,6 @@ privileged aspect TravelRequisitionController_Roo_Controller {
return Arrays.asList(RequestStatus.class.getEnumConstants());
}
void TravelRequisitionController.addDateTimeFormatPatterns(Model uiModel) {
uiModel.addAttribute("travelrequisition_startdate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
uiModel.addAttribute("travelrequisition_enddate_date_format", DateTimeFormat.patternForStyle("S-", LocaleContextHolder.getLocale()));
}
String TravelRequisitionController.encodeUrlPathSegment(String pathSegment, HttpServletRequest httpServletRequest) {
String enc = httpServletRequest.getCharacterEncoding();
if (enc == null) {
......
......@@ -420,14 +420,15 @@ label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_daynumber=Number of da
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_totalvalue=Total Value
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketkind=Ticket Kind
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_destinations=Destinations
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_tripstartdate=Trip Start Date
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_tripenddate=Trip End Date
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketvalue=Ticket Value
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketstartdate=Trip Start Date
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketenddate=Trip End Date
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketvalue=Estimated Ticket Value
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_registrationvalue=Registration Value
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_requeststatus=Request Status
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_observations=Observations
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_plural=Travel Requisitions
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_version=Version
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketpurchaseprice=Ticket Purchase Price
label_br_ufpr_c3sl_sapos_models_scholar_sectionpos=Section Pos
label_br_ufpr_c3sl_sapos_models_scholar_sectionpos_classroom=Class Room
......
......@@ -405,20 +405,21 @@ label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_justification=Justific
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_conference=Conferncia
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_place=Local
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_tripkind=Deslocamento
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_startdate=De
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_enddate=At
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_startdate=Data inicial da viagem
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_enddate=Data final
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_daynumber=Nmero de Dirias
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_totalvalue=Valor Total
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketkind=Bilhete de Passagem
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_destinations=Trecho
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_tripstartdate=Sada
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_tripenddate=Retorno
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketvalue=Valor da Passagem
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketstartdate=Sada (passagem)
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketenddate=Retorno (passagem)
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketvalue=Valor da Passagem Orado
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_registrationvalue=Valor da Inscrio
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_requeststatus=Status da Requisio
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_observations=Observaes
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_plural=Requisies de Viagem
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_version=Version
label_br_ufpr_c3sl_sapos_models_scholar_travelrequisition_ticketpurchaseprice=Preo de compra da passagem
label_br_ufpr_c3sl_sapos_models_scholar_sectionpos=Turma
label_br_ufpr_c3sl_sapos_models_scholar_sectionpos_classroom=Sala da Aula
......
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