"database/seeders/DatabaseSeeder.php" did not exist on "3bc67fa99eb68bef2c89b18b6b83326b60a38ecf"
Commit a916ed13 authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Ajuste na remoção de remover avaliador

parent 906a6afc
...@@ -611,9 +611,25 @@ class AdministradorController extends Controller ...@@ -611,9 +611,25 @@ class AdministradorController extends Controller
} }
public function removerProjAval(Request $request){ public function removerProjAval(Request $request){
//Acesso 1 = Ad Hoc, 2 - Interno, 3 - Interno e Ad Hoc
$aval = Avaliador::where('id', $request->avaliador_id)->first(); $aval = Avaliador::where('id', $request->avaliador_id)->first();
$trabalho = Trabalho::where('id', $request->trabalho_id)->first(); $trabalho = Trabalho::where('id', $request->trabalho_id)->first();
$aval->trabalhos()->detach($trabalho); if($request->flag == 0){
if($aval->tipo == "Interno" && $aval->trabalhos()->where("trabalho_id",$trabalho->id)->first()->pivot->acesso == 3){
$aval->trabalhos()
->updateExistingPivot($trabalho->id,['acesso'=>2]);
}else{
$aval->trabalhos()->detach($trabalho);
}
}else{
if($aval->tipo == "Interno" && $aval->trabalhos()->where("trabalho_id",$trabalho->id)->first()->pivot->acesso == 3){
$aval->trabalhos()
->updateExistingPivot($trabalho->id,['acesso'=>1]);
}else{
$aval->trabalhos()->detach($trabalho);
}
}
if($trabalho->status === 'avaliado'){ if($trabalho->status === 'avaliado'){
$trabalho->status = 'submetido'; $trabalho->status = 'submetido';
......
...@@ -920,7 +920,7 @@ ...@@ -920,7 +920,7 @@
href="{{ route('admin.visualizarParecerInterno', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}">Avaliado</a> @endif href="{{ route('admin.visualizarParecerInterno', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}">Avaliado</a> @endif
</h9> </h9>
<br> <br>
<a href="{{ route('admin.removerProjAval', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}" > <a href="{{ route('admin.removerProjAval', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id,'flag'=>1]) }}" >
Remover Remover
</a> </a>
<br> <br>
...@@ -952,7 +952,7 @@ ...@@ -952,7 +952,7 @@
</h9> </h9>
<br> <br>
<a href="{{ route('admin.removerProjAval', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id]) }}" > <a href="{{ route('admin.removerProjAval', ['trabalho_id' => $trabalho->id, 'avaliador_id' => $avaliador->id,'flag'=>0]) }}" >
Remover Remover
</a> </a>
<br> <br>
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
@foreach($arquivos as $arquivo) @foreach($arquivos as $arquivo)
<tbody> <tbody>
<td style="text-align: center;" title="{{$arquivo->trabalho->titulo}}">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{{$arquivo->trabalho->titulo}}</td> <td style="text-align: center;" title="{{$arquivo->trabalho->titulo}}">{{$arquivo->trabalho->titulo}}</td>
<td style="text-align: center;" title="{{$arquivo->trabalho->proponente->user->name}}">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{{$arquivo->trabalho->proponente->user->name}}</td> <td style="text-align: center;" title="{{$arquivo->trabalho->proponente->user->name}}">{{$arquivo->trabalho->proponente->user->name}}</td>
<td style="text-align: center;" title="{{$arquivo->titulo}}">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{{$arquivo->titulo}}</td> <td style="text-align: center;" title="{{$arquivo->titulo}}">{{$arquivo->titulo}}</td>
<td style="text-align: center;" title="{{$arquivo->participante->user->name}}" id="td-nomeAluno">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{{$arquivo->participante->user->name}}</td> <td style="text-align: center;" title="{{$arquivo->participante->user->name}}" id="td-nomeAluno">{{$arquivo->participante->user->name}}</td>
<td style="text-align: center;"> <td style="text-align: center;">
@if((Auth::user()->proponentes != null) && ($arquivo->relatorioParcial == null) && @if((Auth::user()->proponentes != null) && ($arquivo->relatorioParcial == null) &&
($arquivo->trabalho->evento->dt_inicioRelatorioParcial <= $hoje) && ($hoje <= $arquivo->trabalho->evento->dt_fimRelatorioParcial)) ($arquivo->trabalho->evento->dt_inicioRelatorioParcial <= $hoje) && ($hoje <= $arquivo->trabalho->evento->dt_fimRelatorioParcial))
......
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