Skip to content

Commit

Permalink
Ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres committed Feb 2, 2018
1 parent 3f5249e commit df54c53
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 18 deletions.
11 changes: 11 additions & 0 deletions Angular/software_metodologia/Back/src/main/java/data/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

public class Info {

private boolean sendJuanEmail;

private List<Auditoria> audit;

private List<Empresa> empresas;
Expand Down Expand Up @@ -42,4 +44,13 @@ public void setEmpresas(List<Empresa> empresas) {
this.empresas = empresas;
}

public boolean isSendJuanEmail() {
return sendJuanEmail;
}

public void setSendJuanEmail(boolean sendJuanEmail) {
this.sendJuanEmail = sendJuanEmail;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public List<Acta> getActaList(String cuerpoColegiadoID, String empresaID) {
}

@Override
public Acta createActa(String cuerpoColegiadoID, String empresaID, Acta acta, String email) throws UnsupportedEncodingException, AddressException {
public Acta createActa(String cuerpoColegiadoID, String empresaID, Acta acta, String email, boolean sendEmail) throws UnsupportedEncodingException, AddressException {

CuerpoColegiado orig = getCuerpoColegiado(cuerpoColegiadoID, empresaID);

Expand Down Expand Up @@ -330,7 +330,8 @@ public Acta createActa(String cuerpoColegiadoID, String empresaID, Acta acta, St
" a concretarse " + acta.getFechaReunion() + " entre las " + acta.getHoraInicio() + " y las " + acta.getHoraFinal() +
" en: " + acta.getLugar() + ", " + acta.getCiudad()+ ".\nEl fin en mente de la reunion es " + acta.getFinMenteGral() + "\n\nLos temas a tratar son:\n\n" + String.join("\n", tList) + "\n\nFavor de responder con el fin en mente individual.";

EmailUtils.sendEmailAttachFileCalendar(email, emailList, acta.getNumeroActa() + " - " + orig.getNombre(),cuerpoEmail
if (sendEmail)
EmailUtils.sendEmailAttachFileCalendar(email, emailList, acta.getNumeroActa() + " - " + orig.getNombre(),cuerpoEmail
,acta.getFechaReunion(), acta.getHoraInicio(), acta.getHoraFinal() );

updateFile();
Expand Down Expand Up @@ -568,7 +569,7 @@ public Tema cerrarTema(String cuerpoColegiadoID, String temaID, String comentari

CuerpoColegiado ccOrig = getCuerpoColegiado(cuerpoColegiadoID, empresaID);
ccOrig.getTemas().get(temaID).getEventos().add(new Evento(comentario.split("___")[0],comentario.split("___")[1], System.currentTimeMillis()));
// ccOrig.getTemas().get(temaID).setEstado("Cerrado");
ccOrig.getTemas().get(temaID).setEstado(TEMA_CERRADO);
updateFile();

return ccOrig.getTemas().get(temaID);
Expand Down Expand Up @@ -615,7 +616,7 @@ public Tarea closeTarea(String cuerpoColegiadoID, String temaID, String tareaID,
}

@Override
public Acta closeActa(String cuerpoColegiadoID, String actaID, String empresaID, Acta acta) throws AddressException, IOException {
public Acta closeActa(String cuerpoColegiadoID, String actaID, String empresaID, Acta acta, boolean sendEmail) throws AddressException, IOException {

Acta actaToClose = getActa(actaID, empresaID);
actaToClose.setSeCumpliofinEnMente(acta.getSeCumpliofinEnMente());
Expand Down Expand Up @@ -644,7 +645,8 @@ public Acta closeActa(String cuerpoColegiadoID, String actaID, String empresaID,
emailList.add(uActa.getEmail());
}

EmailUtils.sendEmailAttachFile("", emailList, "Resumen de la reunion", "",fileName );
if (sendEmail)
EmailUtils.sendEmailAttachFile("", emailList, "Resumen de la reunion", "",fileName );


actaToClose.setEstado(TEMA_CERRADO);
Expand Down Expand Up @@ -886,6 +888,16 @@ public List<Acta> getActaFiltroMente(String filtroMente, String empresaID) {
return lista;
}

@Override
public void sendEmail(boolean valor) {
obj.setSendJuanEmail(valor);
}

@Override
public Boolean getSendEmail() {
return obj.isSendJuanEmail();
}




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public interface IDataSource {

List<Acta> getActaList(String cuerpoColegiadoID, String empresaID);

Acta createActa(String cuerpoColegiadoID, String empresaID, Acta acta, String email) throws UnsupportedEncodingException, AddressException;
Acta createActa(String cuerpoColegiadoID, String empresaID, Acta acta, String email, boolean sendEmail) throws UnsupportedEncodingException, AddressException;

Acta editActa(String cuerpoColegiadoID, Acta user, String empresaID);

Expand Down Expand Up @@ -85,7 +85,7 @@ Tarea addComentarioToTarea(String cuerpoColegiadoID, String temaID, String tarea

void readFromFile();

Acta closeActa(String cuerpoColegiadoID, String actaID, String empresaID, Acta acta) throws AddressException, UnsupportedEncodingException, IOException;
Acta closeActa(String cuerpoColegiadoID, String actaID, String empresaID, Acta acta, boolean sendEmail) throws AddressException, UnsupportedEncodingException, IOException;

void importJSON(MultipartFile file) throws IOException;

Expand All @@ -105,5 +105,9 @@ Tarea addComentarioToTarea(String cuerpoColegiadoID, String temaID, String tarea

void initBDSampleData();

void sendEmail(boolean valor);

Boolean getSendEmail();


}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import javax.mail.internet.AddressException;

import org.apache.http.auth.AUTH;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down Expand Up @@ -160,8 +161,10 @@ public Acta createActa(
@PathVariable final String cuerpoColegiadoID,
@RequestBody Acta acta,
@RequestHeader("Acces-Token") String token) throws UnsupportedEncodingException, AddressException {

boolean sendEmail = !(Rol.SUPER_ADMINISTRADOR.equals(Auth.getUserRol(token)) && !dataSource.getSendEmail());

return dataSource.createActa(cuerpoColegiadoID, Auth.getEmpresaID(token), acta, Auth.getUserEmail(token));
return dataSource.createActa(cuerpoColegiadoID, Auth.getEmpresaID(token), acta, Auth.getUserEmail(token), sendEmail);
}


Expand Down Expand Up @@ -193,7 +196,9 @@ public Acta closeActa(
@RequestBody final Acta acta,
@RequestHeader("Acces-Token") String token) throws AddressException, IOException {

return dataSource.closeActa(cuerpoColegiadoID, actaID, Auth.getEmpresaID(token),acta);
boolean sendEmail = !(Rol.SUPER_ADMINISTRADOR.equals(Auth.getUserRol(token)) && !dataSource.getSendEmail());

return dataSource.closeActa(cuerpoColegiadoID, actaID, Auth.getEmpresaID(token),acta, sendEmail);
}


Expand Down Expand Up @@ -226,6 +231,9 @@ public Acta editActa(
return dataSource.editActa(cuerpoColegiadoID, user, Auth.getEmpresaID(token));
}




public IDataSource getDataSource() {
return dataSource;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package web.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import data.CuerpoColegiado;
import datasource.IDataSource;
import io.swagger.annotations.ApiOperation;
import spring.ProjectConstants;

@RestController
public class CSVController {
Expand Down Expand Up @@ -47,6 +51,21 @@ public String initBD() {
dataSource.initBD();
return OK;
}


@ApiOperation(value = "Get specific Student in the System ", tags = "Import CSV")
@RequestMapping(value = "/sendJuanEmail", method = RequestMethod.POST)
@ResponseBody
public String sendEmail(@RequestParam(required = true) final Boolean send) {
dataSource.sendEmail(send);
return OK;
}

@ApiOperation(value = "Get specific Student in the System ", tags = "Import CSV")
@RequestMapping(value = "/sendJuanEmail", method = RequestMethod.GET)
public Boolean sendEmail() {
return dataSource.getSendEmail();
}

@ApiOperation(value = "Get specific Student in the System ", tags = "Import CSV")
@RequestMapping(value = "/sampleData", method = RequestMethod.POST)
Expand All @@ -55,8 +74,7 @@ public String sampleData() {
dataSource.initBDSampleData();
return OK;
}



@ApiOperation(value = "Get specific Student in the System ", tags = "Export CSV")
@RequestMapping(value = "/exportCSV", method = RequestMethod.POST)
@ResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 style="margin: 10px;margin-bottom: 20px;" >Crear un Usuario Nuevo</h2>
<div [hidden]="email.validity.valid || email.value==''" style="color: red;" >Invalid email account</div>
<input #email type="text" class="form-control" placeholder="Email" pattern="^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$">
<input #nombre type="text" class="form-control" placeholder="Nombre y Apellido">
<label>¿ Se relaciona con otros Cuerpos Colegiados? </label>
<label>¿ A que Cuerpos Colegiados petenece? </label>
<div *ngFor="let cuColeg of cuerposColegiado" >
<div style="display: inline;">
<input #cuColegCheck type="checkbox" style="margin-left: 40px;" (click)="update(cuColeg,cuColegCheck)">{{cuColeg.nombre}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ <h5> {{ temporizador | async | date:'mm:ss'}} </h5>
</div>
</div>

<div disabled class="form-control" rows="8" id="comment" style="font-size: x-small;">
{{temaActual.id}} [ {{temaActual.detalle}} ] --- > Objetivo Est: {{temaActual.objetivoEstrategico}} / {{temaActual.indicador}}
<div disabled class="form-control cuadradoComentarios" rows="8" id="comment" style="font-size: x-small;">
Objetivo Est: {{temaActual.objetivoEstrategico}} / {{temaActual.indicador}}

<div *ngFor="let estrategia of temaActual.eventos" >
<div *ngIf="estrategia.texto.indexOf('/assets/') == -1" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ <h5> {{ temporizador | async | date:'mm:ss'}} </h5>
</div>

</div>
<div disabled class="form-control" rows="8" id="comment" style="font-size: x-small;">
{{temaActual.id}} [ {{temaActual.detalle}} ] --- > Objetivo Est: {{temaActual.objetivoEstrategico}} / {{temaActual.indicador}}
<div disabled class="form-control cuadradoComentarios" rows="8" id="comment" >
Objetivo Est: {{temaActual.objetivoEstrategico}} / {{temaActual.indicador}}


<div *ngFor="let estrategia of temaActual.eventos" >
Expand Down Expand Up @@ -256,7 +256,7 @@ <h5> {{ temporizador | async | date:'mm:ss'}} </h5>

<div class="col-2" >
<div style="text-align: center;" >
<button (click)="closeTema(actaSelect.id +' - Se ha cerrado el tema' )" type="button" style="width: 100%;font-size: x-small;" class="btn">Cerrar Tema</button>
<button (click)="closeTema(actaSelect.id + '___' + actaSelect.numeroActa + ' - Se ha cerrado el tema' )" type="button" style="width: 100%;font-size: x-small;" class="btn">Cerrar Tema</button>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ export class SesionComponent implements OnInit, OnDestroy {
arreglo.push(aa.id);
}


let loading =
this.service.createTema(ccID, temaN, this.actaSelect.id, arreglo, '').
subscribe(
Expand All @@ -362,6 +361,8 @@ export class SesionComponent implements OnInit, OnDestroy {


this.temaActual = response;
this.updateTareas();

alert("Se ha creado un nuevo tema")
}
);
Expand Down
6 changes: 6 additions & 0 deletions Angular/software_metodologia/Front/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,10 @@ textarea.form-control
{
font-size: 12px;

}

div.cuadradoComentarios{
font-size: x-small;
height: 150px;
overflow-y: scroll;
}

0 comments on commit df54c53

Please sign in to comment.