Commit a156b740 authored by S-Nathalia's avatar S-Nathalia
Browse files

merge

parents a3c69756 1b13e4ac
......@@ -134,4 +134,10 @@ class AvaliacaoRelatorioController extends Controller
return redirect()->back();
}
public function removerAvaliador($id){
$avaliacao = AvaliacaoRelatorio::find($id);
$avaliacao->delete();
return redirect()->back();
}
}
......@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\AvaliacaoRelatorio;
use Illuminate\Http\Request;
use Auth;
use Illuminate\Support\Facades\Log;
......@@ -44,7 +45,8 @@ class HomeController extends Controller
return view('proponente.index');
}
else if (Auth::user()->avaliadors != null) {
return view('avaliador.index');
$flagAvalRelatorio = count(AvaliacaoRelatorio::where('user_id',Auth::user()->id )->get());
return view('avaliador.index', compact('flagAvalRelatorio'));
}
else if (Auth::user()->participantes != null) {
return view('participante.index');
......
......@@ -6,7 +6,6 @@ use App\Arquivo;
use App\Evento;
use App\Participante;
use App\Trabalho;
use App\User;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
......@@ -36,14 +35,6 @@ class UpdateTrabalho extends FormRequest
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
$usuario = User::where('email', $this->email[$value])->first();
// if(isset($usuario)){
// $participante = Participante::where('user_id', $usuario->id)->where('trabalho_id', $projeto->id)->first();
// $arquivo = Arquivo::where('trabalhoId', $projeto->id)->where('participanteId', $participante->id)->first();
// }
//user
$rules['name.'.$value] = ['required', 'string'];
$rules['email.'.$value] = ['required', 'string'];
......@@ -69,14 +60,8 @@ class UpdateTrabalho extends FormRequest
$rules['media_do_curso.' . $value] = ['required', 'string'];
}
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if(isset($usuario)){
$participante = Participante::where('user_id', $usuario->id)->where('trabalho_id', $projeto->id)->first();
$arquivo = Arquivo::where('trabalhoId', $projeto->id)->where('participanteId', $participante->id)->first();
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($arquivo == null), 'mimes:pdf'];
}else {
$rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf'];
}
}
}
......
......@@ -574,7 +574,7 @@
<!-- Modal -->
<div class="modal fade" id="avaliacaoModalCenter" data-bs-backdrop="static"
data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel"
aria-hidden="true" style="overflow-y: hidden">
aria-hidden="true" style="overflow-y: auto">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
<div class="modal-content modal-submeta modal-xl">
<div class="modal-header modal-header-submeta">
......@@ -624,6 +624,9 @@
para a(s) avaliacões de relatorio final</label>
@endif
</div>
<div class="col-md-3 offset-md-3" style="display:flex; align-items: end; max-width: 250px;">
<input type="text" class="form-control form-control-edit" placeholder="Nome do avaliador" onkeyup="buscarAvalRelatorio(this)"> <img src="{{asset('img/icons/logo_lupa.png')}}" alt="">
</div>
</div>
@foreach($trabalho->participantes as $participante)
<div class="col-md-6">
......@@ -631,7 +634,7 @@
</div>
@php
$avaliacoesId = \App\AvaliacaoRelatorio::where("arquivo_id",$participante->planoTrabalho->id)->where("tipo",$tipoTemp)->pluck('user_id');
$avalProjeto = \App\User::whereNotIn('id', $avaliacoesId)->where('tipo','avaliador')->get();
$avalProjeto = \App\User::whereNotIn('id', $avaliacoesId)->where('tipo','avaliador')->orderBy('name')->get();
@endphp
<select name="avaliadores_{{$participante->planoTrabalho->id}}_id[]" multiple
......@@ -681,11 +684,38 @@
</div>
<div class="col-sm-3">
<h5>{{\App\User::find($aval->user_id)->name}}</h5>
<h9><a href="" data-toggle="modal"
<h6><a href="" data-toggle="modal"
data-target="#modalVizuRelatParcial{{$aval->id}}" class="button">
@if($aval->nota == null) <b style="color: red">Pendente</b> </a>@else Avaliação</a> @endif</h9>
@if($aval->nota == null) Pendente </a>@else Avaliação</a> @endif</h6>
@if($aval->nota == null)
<h6><a href="" data-toggle="modal"
data-target="#removerAvaliadorReltorioParcial{{$aval->id}}" class="button"><b style="color: red">Remover</b></a></h6>
@endif
</div>
<!-- Modal Remover -->
<div class="modal fade" id="removerAvaliadorReltorioParcial{{ $aval->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Remover Avaliador Do Relatório Parcial</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Você tem certeza que deseja remover o avaliador: {{ $aval->user->name }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
<a type="button" class="btn btn-danger" href="{{route('avaliacaoRelatorio.remover.avaliador',$aval->id)}}">Remover</a>
</div>
</div>
</div>
</div>
<!-- Modal visualizar informações participante -->
<div class="modal fade" id="modalVizuRelatParcial{{$aval->id}}" tabindex="-1"
role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
......@@ -724,9 +754,35 @@
</div>
<div class="col-sm-3">
<h5>{{\App\User::find($aval->user_id)->name}}</h5>
<h9><a href="" data-toggle="modal"
<h6><a href="" data-toggle="modal"
data-target="#modalVizuRelatFinal{{$aval->id}}" class="button">
@if($aval->nota == null) <b style="color: red">Pendente</b> </a>@else Avaliação</a> @endif</h9>
@if($aval->nota == null) Pendente </a>@else Avaliação</a> @endif</h6>
@if($aval->nota == null)
<h6><a href="" data-toggle="modal"
data-target="#removerAvaliadorReltorioFinal{{$aval->id}}" class="button"><b style="color: red">Remover</b></a></h6>
@endif
</div>
<!-- Modal Remover -->
<div class="modal fade" id="removerAvaliadorReltorioFinal{{ $aval->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Remover Avaliador Do Relatório Final</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Você tem certeza que deseja remover o avaliador: {{ $aval->user->name }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
<a type="button" class="btn btn-danger" href="{{route('avaliacaoRelatorio.remover.avaliador',$aval->id)}}">Remover</a>
</div>
</div>
</div>
</div>
<!-- Modal visualizar informações participante -->
......@@ -1970,12 +2026,13 @@
<script>
//let seletor = document.getElementsByClassName('aval1')
//console.log(seletor[0].children[0].text)
//console.log(seletor[0].children[0].text)=
function buscar(input) {
let seletor1 = document.getElementById('exampleFormControlSelect2').children;
let seletor2 = document.getElementById('exampleFormControlSelect3').children;
for(let i = 0; i < seletor1.length; i++){
let nomeAval1 = seletor1[i].textContent
......@@ -2001,5 +2058,24 @@
}
}
function buscarAvalRelatorio(input) {
let seletorAvalRelatorio = document.querySelectorAll('#avaliacaoSelect');
for(let i = 0; i < seletorAvalRelatorio.length; i++){
for(let j = 0; j < seletorAvalRelatorio[i].children.length; j++){
let nomeAval = seletorAvalRelatorio[i].children[j].textContent
if(nomeAval.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0){
seletorAvalRelatorio[i].children[j].style.display = "";
}else {
seletorAvalRelatorio[i].children[j].style.display = "none";
}
}
}
}
</script>
@endsection
......@@ -38,12 +38,13 @@
</div>
<div class="col-2 align-self-center">
<div class="row justify-content-around">
<a href="" data-toggle="modal" data-target="#modalTestSubParticipante{{$participante->id}}" class="button"
@if(($substituicoesProjeto->first() != null) && (($substituicoesProjeto->first()->status == 'Em Aguardo') || ($desligamentosProjeto->first()->status == 1))) style="pointer-events: none; cursor: default;" @endif>
@if(($substituicoesProjeto->first() != null) && (($substituicoesProjeto->first()->status == 'Em Aguardo') || ($desligamentosProjeto->first() !=null &&$desligamentosProjeto->first()->status == 1))) style="pointer-events: none; cursor: default; color:gray;" @endif>
<i class="fas fa-exchange-alt fa-2x"></i></a>
<a href="" data-toggle="modal" data-target="#modalVizuParticipante{{$participante->id}}" class="button"><i class="far fa-eye fa-2x"></i></a>
<a href="" data-toggle="modal" data-target="#modalSolicitarDesligamentoParticipante{{$participante->id}}" class="button" @if(($substituicoesProjeto->first() != null) && (($substituicoesProjeto->first()->status == 'Em Aguardo') || ($desligamentosProjeto->first()->status == 1))) style="pointer-events: none; cursor: default;" @endif>Solicitar desligamento</a>
<a href="" data-toggle="modal" data-target="#modalSolicitarDesligamentoParticipante{{$participante->id}}" class="button" @if((($substituicoesProjeto->first() != null) && (($substituicoesProjeto->first()->status == 'Em Aguardo') || ($desligamentosProjeto->first() !=null && $desligamentosProjeto->first()->status == 1)) || count($participantes) <= 1)) style="pointer-events: none; cursor: default; color: gray;" @endif>Solicitar desligamento</a>
</div>
</div>
......
......@@ -18,7 +18,7 @@
</a>
</div>
</div>
@if(\App\AvaliacaoRelatorio::where('user_id',Auth::user()->id )->get()->count()!=0)
@if($flagAvalRelatorio != 0)
<div class="" style="text-align: center">
<div class="form-group imagem_shadow" style="border-radius: 12px; padding:14px; height:200px; width:190px; margin:15px">
<a href="{{ route('planos.avaliacoes.index') }}" style="text-decoration:none; color: inherit;">
......
......@@ -51,7 +51,8 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
//######## Rotas Avaliador ####################################
Route::prefix('avaliacaoRelatorio')->name('avaliacaoRelatorio.')->group(function(){
Route::post('/atribuirAvaliadorPlano', 'AvaliacaoRelatorioController@atribuicaoAvaliador')->name('atribuicao.avaliador');
Route::post('/atribuirAvaliadorPlano', 'AvaliacaoRelatorioController@atribuicaoAvaliador')->name('atribuicao.avaliador')->middleware('checkRoles:coordenador,administrador');
Route::get('/removerAvaliadorPlano/{id}', 'AvaliacaoRelatorioController@removerAvaliador')->name('remover.avaliador')->middleware('checkRoles:coordenador,administrador');
});
Route::post('/trabalho/planos/avaliacoes', 'AvaliacaoRelatorioController@listarUser')->name('planos.avaliacoesUser');
Route::get('/trabalho/planos/avaliacoes/index', 'AvaliacaoRelatorioController@index')->name('planos.avaliacoes.index');
......
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