Commit 5dd03291 authored by GuilhermeGz's avatar GuilhermeGz
Browse files

Realizado arquivamento de planos de trabalho caso o projeto em si seja arquivado

parent 7b287f93
......@@ -117,11 +117,20 @@ class TrabalhoController extends Controller
public function arquivar(Request $request){
$trabalho = Trabalho::find($request->trabalho_id);
$arquivos = Arquivo::where('trabalhoId',$trabalho->id)->get();
if($request->arquivar_tipo == 1 ){
$trabalho->arquivado = true;
foreach ($arquivos as $arquivo){
$arquivo->arquivado = true;
$arquivo->update();
}
$message = "Projeto ".$trabalho->titulo." arquivado";
}else{
$trabalho->arquivado = false;
foreach ($arquivos as $arquivo){
$arquivo->arquivado = false;
$arquivo->update();
}
$message = "Projeto ".$trabalho->titulo." desarquivado";
}
$trabalho->update();
......
......@@ -185,7 +185,7 @@
<input value='1' name='arquivar_tipo' type='hidden'/>
</form>
@else
<a title="Desarquivar" href='javascript:arquivar2{{$participante->id}}.submit()'>
<a @if($trabalho->arquivado == true) style="pointer-events: none" @endif title="Desarquivar" href='javascript:arquivar2{{$participante->id}}.submit()'>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#808080" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h5l2 3h9a2 2 0 0 1 2 2v11zM9.9 16.1L14 12M9.9 11.9L14 16"/></svg>
</a>
<form method="GET" name='arquivar2{{$participante->id}}' action='{{route('arquivo.arquivar')}}' >
......
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