Unverified Commit caaea21e authored by Nathalia Santos's avatar Nathalia Santos Committed by GitHub
Browse files

Merge pull request #727 from Wolf-gangSE/remover-obrigatoriedade-discente

Remover obrigatoriedade do discente em edital
parents 2be90919 4e072167
...@@ -15,7 +15,7 @@ class Arquivo extends Model ...@@ -15,7 +15,7 @@ class Arquivo extends Model
use SoftDeletes; use SoftDeletes;
protected $fillable = [ protected $fillable = [
'nome','titulo', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId' 'nome','titulo', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId', 'proponenteId'
]; ];
public function trabalho(){ public function trabalho(){
...@@ -29,6 +29,11 @@ class Arquivo extends Model ...@@ -29,6 +29,11 @@ class Arquivo extends Model
public function participante() { public function participante() {
return $this->belongsTo('App\Participante', 'participanteId'); return $this->belongsTo('App\Participante', 'participanteId');
} }
public function proponente() {
return $this->belongsTo('App\Proponente', 'proponenteId');
}
public function avaliadors(){ public function avaliadors(){
return $this->belongsToMany('App\Avaliador', 'avaliadors_plano_trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at'); return $this->belongsToMany('App\Avaliador', 'avaliadors_plano_trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at');
} }
......
...@@ -124,6 +124,7 @@ class ArquivoController extends Controller ...@@ -124,6 +124,7 @@ class ArquivoController extends Controller
$trabalho = Trabalho::where('id',$id)->first(); $trabalho = Trabalho::where('id',$id)->first();
$participantes = $trabalho->participantes; $participantes = $trabalho->participantes;
$evento = $trabalho->evento;
// Verficação de pendencia de substituição // Verficação de pendencia de substituição
$aux = count(Substituicao::where('status','Em Aguardo')->whereIn('participanteSubstituido_id',$trabalho->participantes->pluck('id'))->get()); $aux = count(Substituicao::where('status','Em Aguardo')->whereIn('participanteSubstituido_id',$trabalho->participantes->pluck('id'))->get());
...@@ -139,12 +140,18 @@ class ArquivoController extends Controller ...@@ -139,12 +140,18 @@ class ArquivoController extends Controller
return redirect()->back(); return redirect()->back();
} }
foreach ($participantes as $participante){ if ($evento->numParticipantes != 0) {
array_push($arquivos, $participante->planoTrabalho); foreach ($participantes as $participante){
array_push($arquivos, $participante->planoTrabalho);
}
} else {
$arquivo = Arquivo::where("trabalhoId", $trabalho->id)->first();
array_push($arquivos, $arquivo);
} }
$hoje = Carbon::today('America/Recife'); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString(); $hoje = $hoje->toDateString();
return view('planosTrabalho.listar')->with(['arquivos' => $arquivos, 'hoje' => $hoje, 'trabalho' => $trabalho]); return view('planosTrabalho.listar')->with(['arquivos' => $arquivos, 'hoje' => $hoje, 'trabalho' => $trabalho, 'evento' => $evento]);
} }
public function anexarRelatorio(Request $request){ public function anexarRelatorio(Request $request){
......
...@@ -86,9 +86,11 @@ class AvaliacaoRelatorioController extends Controller ...@@ -86,9 +86,11 @@ class AvaliacaoRelatorioController extends Controller
public function atribuicaoAvaliador(Request $request){ public function atribuicaoAvaliador(Request $request){
$trabalho = Trabalho::find($request->trabalho_id); $trabalho = Trabalho::find($request->trabalho_id);
foreach ($trabalho->participantes as $participante){ $evento = $trabalho->evento;
$avaliadoresId= $request->input('avaliadores_'.$participante->planoTrabalho->id.'_id'); if ($evento->numParticipantes == 0) {
// utilizado desta forma pois a versão do PHP 7.2 é preciso que o $array usado na função count($array) não pode ser um valor NULL. $arquivo = Arquivo::where("trabalhoId", $trabalho->id)->first();
$avaliadoresId = $request->input('avaliadores_'.$arquivo->id.'_id');
$numeroDeItens = is_countable( $avaliadoresId ) ? count( $avaliadoresId ) : 0; $numeroDeItens = is_countable( $avaliadoresId ) ? count( $avaliadoresId ) : 0;
for ($i = 0; $i < $numeroDeItens; $i++){ for ($i = 0; $i < $numeroDeItens; $i++){
...@@ -97,7 +99,7 @@ class AvaliacaoRelatorioController extends Controller ...@@ -97,7 +99,7 @@ class AvaliacaoRelatorioController extends Controller
'comentario'=>'', 'comentario'=>'',
'nota'=>null, 'nota'=>null,
'user_id'=>$avaliadoresId[$i], 'user_id'=>$avaliadoresId[$i],
'arquivo_id'=>$participante->planoTrabalho->id, 'arquivo_id'=>$arquivo->id,
]); ]);
$avaliacao->save(); $avaliacao->save();
Notification::send( $avaliacao->user, new AtribuicaoAvaliadorRelatorioNotification($avaliacao->tipo, $avaliacao->plano, $trabalho, $avaliacao->user)); Notification::send( $avaliacao->user, new AtribuicaoAvaliadorRelatorioNotification($avaliacao->tipo, $avaliacao->plano, $trabalho, $avaliacao->user));
...@@ -115,6 +117,38 @@ class AvaliacaoRelatorioController extends Controller ...@@ -115,6 +117,38 @@ class AvaliacaoRelatorioController extends Controller
$avaliador->save(); $avaliador->save();
} }
} }
} else {
foreach ($trabalho->participantes as $participante){
$avaliadoresId= $request->input('avaliadores_'.$participante->planoTrabalho->id.'_id');
// utilizado desta forma pois a versão do PHP 7.2 é preciso que o $array usado na função count($array) não pode ser um valor NULL.
$numeroDeItens = is_countable( $avaliadoresId ) ? count( $avaliadoresId ) : 0;
for ($i = 0; $i < $numeroDeItens; $i++){
$avaliacao = AvaliacaoRelatorio::create([
'tipo'=>$request->tipo_relatorio,
'comentario'=>'',
'nota'=>null,
'user_id'=>$avaliadoresId[$i],
'arquivo_id'=>$participante->planoTrabalho->id,
]);
$avaliacao->save();
Notification::send( $avaliacao->user, new AtribuicaoAvaliadorRelatorioNotification($avaliacao->tipo, $avaliacao->plano, $trabalho, $avaliacao->user));
if(Avaliador::where('user_id',$avaliadoresId[$i])->get()->count()==0){
$userTemp = User::find($avaliadoresId[$i]);
if($userTemp->instituicao==null || $userTemp->instituicao == "UFAPE" || $userTemp->instituicao == "Universidade Federal do Agreste de Pernambuco"){
$tipoAvaliador = "Interno";
}else{
$tipoAvaliador = "Externo";
}
$avaliador = new Avaliador();
$avaliador->tipo = $tipoAvaliador;
$avaliador->user_id = $avaliadoresId[$i];
$avaliador->save();
}
}
}
} }
return redirect()->back(); return redirect()->back();
} }
......
This diff is collapsed.
...@@ -31,9 +31,6 @@ class StoreTrabalho extends FormRequest ...@@ -31,9 +31,6 @@ class StoreTrabalho extends FormRequest
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
$rules = []; $rules = [];
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){ if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) { foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){ if( intval($value) == $key){
...@@ -67,6 +64,9 @@ class StoreTrabalho extends FormRequest ...@@ -67,6 +64,9 @@ class StoreTrabalho extends FormRequest
} }
} }
} else {
$rules['anexoPlanoTrabalho'] = ['required'];
$rules['nomePlanoTrabalho'] = ['required', 'string'];
} }
if($this->has('rascunho')) { if($this->has('rascunho')) {
......
...@@ -6,6 +6,7 @@ use App\Arquivo; ...@@ -6,6 +6,7 @@ use App\Arquivo;
use App\Evento; use App\Evento;
use App\Participante; use App\Participante;
use App\Trabalho; use App\Trabalho;
use App\Proponente;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
...@@ -32,9 +33,6 @@ class UpdateTrabalho extends FormRequest ...@@ -32,9 +33,6 @@ class UpdateTrabalho extends FormRequest
$projeto = Trabalho::find($this->id); $projeto = Trabalho::find($this->id);
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){ if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) { foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){ if( intval($value) == $key){
...@@ -67,20 +65,17 @@ class UpdateTrabalho extends FormRequest ...@@ -67,20 +65,17 @@ class UpdateTrabalho extends FormRequest
if($evento->tipo != "PIBEX") { if($evento->tipo != "PIBEX") {
$rules['media_do_curso.' . $value] = ['required', 'string']; $rules['media_do_curso.' . $value] = ['required', 'string'];
} }
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($participante->planoTrabalho == null)];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; $rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if($participante !=null){
$arquivo = Arquivo::where('participanteId',$participante->id)->where('trabalhoId',$projeto->id)->first();
if($arquivo == null || $this->nomePlanoTrabalho[$value] != $arquivo->titulo){
$rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf'];
}
}else{
$rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf'];
}
} }
} }
} else {
$arquivo = Arquivo::where("trabalhoId", $projeto->id)->first();
$rules['anexoPlanoTrabalho'] = [Rule::requiredIf($arquivo == null)];
$rules['nomePlanoTrabalho'] = [Rule::requiredIf($arquivo->titulo == null), 'string'];
} }
// dd($this->all()); // dd($this->all());
if ($this->has('rascunho')) { if ($this->has('rascunho')) {
$rules = []; $rules = [];
......
...@@ -11,6 +11,9 @@ class Proponente extends Model ...@@ -11,6 +11,9 @@ class Proponente extends Model
public function user(){ public function user(){
return $this->belongsTo('App\User'); return $this->belongsTo('App\User');
} }
public function planoTrabalho() {
return $this->hasOne('App\Arquivo', 'proponenteId');
}
public function trabalhos(){ public function trabalhos(){
return $this->hasMany('App\Trabalho'); return $this->hasMany('App\Trabalho');
} }
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableArquivos3 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('arquivos', function (Blueprint $table) {
$table->integer('participanteId')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddProponenteArquivosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('arquivos', function (Blueprint $table) {
$table->integer('proponenteId')->nullable();
$table->foreign('proponenteId')->references('id')->on('proponentes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
...@@ -103,12 +103,13 @@ ...@@ -103,12 +103,13 @@
<div class="col-md-12"> <div class="col-md-12">
<p class="proponenteProj" style="color: #4D4D4D; padding: 0px"><b>Proponente:</b> {{ App\Proponente::find($trabalho->proponente_id)->user->name }}</p> <p class="proponenteProj" style="color: #4D4D4D; padding: 0px"><b>Proponente:</b> {{ App\Proponente::find($trabalho->proponente_id)->user->name }}</p>
</div> </div>
@if ($evento->numParticipantes != 0)
<div class="col-md-12"> <p style="color: #4D4D4D; padding: 0px"><b>Discentes:</b> <div class="col-md-12"> <p style="color: #4D4D4D; padding: 0px"><b>Discentes:</b>
@foreach($trabalho->participantes as $participante) @foreach($trabalho->participantes as $participante)
{{$participante->user->name}}; {{$participante->user->name}};
@endforeach @endforeach
</div> </div>
@endif
@if($trabalho->grande_area_id != null && $trabalho->area_id != null && $trabalho->sub_area_id != null) @if($trabalho->grande_area_id != null && $trabalho->area_id != null && $trabalho->sub_area_id != null)
<div class="col-md-12"> <div class="col-md-12">
<h6 style="color: #234B8B; font-weight: bold;font-size: 13px;">{{$trabalho->grandeArea->nome}} > {{$trabalho->area->nome}} > {{$trabalho->subArea->nome}}</h6> <h6 style="color: #234B8B; font-weight: bold;font-size: 13px;">{{$trabalho->grandeArea->nome}} > {{$trabalho->area->nome}} > {{$trabalho->subArea->nome}}</h6>
......
...@@ -60,7 +60,9 @@ ...@@ -60,7 +60,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
@endif @endif
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -119,11 +121,13 @@ ...@@ -119,11 +121,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -154,7 +158,9 @@ ...@@ -154,7 +158,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -178,7 +184,7 @@ ...@@ -178,7 +184,7 @@
@endif @endif
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -213,11 +219,13 @@ ...@@ -213,11 +219,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -249,7 +257,9 @@ ...@@ -249,7 +257,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -273,7 +283,7 @@ ...@@ -273,7 +283,7 @@
@endif @endif
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -308,11 +318,13 @@ ...@@ -308,11 +318,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
......
...@@ -63,7 +63,9 @@ ...@@ -63,7 +63,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -119,11 +121,13 @@ ...@@ -119,11 +121,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -151,7 +155,9 @@ ...@@ -151,7 +155,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -171,7 +177,7 @@ ...@@ -171,7 +177,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -206,11 +212,13 @@ ...@@ -206,11 +212,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -239,7 +247,9 @@ ...@@ -239,7 +247,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -260,7 +270,7 @@ ...@@ -260,7 +270,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -295,11 +305,13 @@ ...@@ -295,11 +305,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -320,7 +332,7 @@ ...@@ -320,7 +332,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -355,11 +367,13 @@ ...@@ -355,11 +367,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -387,7 +401,9 @@ ...@@ -387,7 +401,9 @@
<th scope="col">N. Planos</th> <th scope="col">N. Planos</th>
<th scope="col">Avaliador</th> <th scope="col">Avaliador</th>
<th scope="col">Status</th> <th scope="col">Status</th>
@if ($evento->numParticipantes != 0)
<th scope="col">Bolsas</th> <th scope="col">Bolsas</th>
@endif
</tr> </tr>
</thead> </thead>
<tbody id="projetos"> <tbody id="projetos">
...@@ -408,7 +424,7 @@ ...@@ -408,7 +424,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -443,11 +459,13 @@ ...@@ -443,11 +459,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
...@@ -468,7 +486,7 @@ ...@@ -468,7 +486,7 @@
{{$trabalho->area->nome}} {{$trabalho->area->nome}}
</td> </td>
<td> <td>
{{$trabalho->participantes->count()}} @if ($evento->numParticipantes != 0) {{$trabalho->participantes->count()}} @else {{$trabalho->proponente->count()}} @endif
</td> </td>
<td> <td>
@if($trabalho->avaliadors->count() > 0) @if($trabalho->avaliadors->count() > 0)
...@@ -503,11 +521,13 @@ ...@@ -503,11 +521,13 @@
@else @else
<td>Pendente</td> <td>Pendente</td>
@endif @endif
@if ($evento->numParticipantes != 0)
<td> <td>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" > <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalConfirmTrab{{$trabalho->id}}" >
Definir Definir
</button> </button>
</td> </td>
@endif
</tr> </tr>
@php $cont+=1;@endphp @php $cont+=1;@endphp
@endif @endif
......
...@@ -135,11 +135,18 @@ ...@@ -135,11 +135,18 @@
<input type="radio" name="anexoJustificativa" value="recusado" @if($parecer!=null && $parecer->statusJustificativaAutorizacaoEtica =='recusado' ) checked @else disabled @endif> <input type="radio" name="anexoJustificativa" value="recusado" @if($parecer!=null && $parecer->statusJustificativaAutorizacaoEtica =='recusado' ) checked @else disabled @endif>
</div> </div>
{{--Planos de trabalho--}} {{--Planos de trabalho MUDAR AQUI--}}
<div class="col-sm-3"> <div class="col-sm-3">
<label for="nomeTrabalho" class="col-form-label">{{ __('Plano de Trabalho: ') }}</label> <label for="nomeTrabalho" class="col-form-label">{{ __('Plano de Trabalho: ') }}</label>
@if ($trabalho->participantes != null) @if ($trabalho->participantes != null)
<a href=" " data-toggle="modal" data-target="#modalPlanos">Planos</a> @if ($evento->numParticipantes == 0)
@php
$arquivo = App\Arquivo::where("trabalhoId", $trabalho->id)->first();
@endphp
<a href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}">Arquivo</a>
@else
<a href=" " data-toggle="modal" data-target="#modalPlanos">Planos</a>
@endif
@else @else
- -
@endif @endif
......
@php $arquivo = \App\Arquivo::find($aval->arquivo_id); @endphp @php $arquivo = \App\Arquivo::find($aval->arquivo_id); @endphp
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
@if ($arquivo->trabalho->evento->numParticipante != 0)
<h5><b>Discente:</b> <h5><b>Discente:</b>
{{\App\Participante::find($arquivo->participanteId)->user->name}}</h5> {{\App\Participante::find($arquivo->participanteId)->user->name}}</h5>
@else
<h5><b>Proponente:</b>
{{$arquivo->trabalho->proponente->user->name}}</h5>
@endif
</div> </div>
<div class="row"> <div class="row">
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<th scope="col">Nome do Evento</th> <th scope="col">Nome do Evento</th>
<th scope="col">Nome do Projeto</th> <th scope="col">Nome do Projeto</th>
<th scope="col">Nome do plano</th> <th scope="col">Nome do plano</th>
<th scope="col">Discente</th> <th scope="col">Nome</th>
<th scope="col">Tipo do Relatório</th> <th scope="col">Tipo do Relatório</th>
<th scope="col">Status</th> <th scope="col">Status</th>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->trabalho->evento->nome }}</td> <td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->trabalho->evento->nome }}</td>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->trabalho->titulo }}</td> <td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->trabalho->titulo }}</td>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->titulo }}</td> <td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->titulo }}</td>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->participante->user->name }}</td> <td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->plano->trabalho->evento->numParticipantes == 0 ? $avaliacao->plano->proponente->user->name : $avaliacao->plano->participante->user->name }}</td>
<td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->tipo }}</td> <td style="max-width:100px; overflow-x:hidden; text-overflow:ellipsis">{{ $avaliacao->tipo }}</td>
<td> <td>
<div class="row justify-content-center"> <div class="row justify-content-center">
......
...@@ -85,22 +85,31 @@ ...@@ -85,22 +85,31 @@
</a> </a>
</td> </td>
<td> <td>
@foreach( $trabalho->participantes as $participante) @if ($evento->numParticipantes == 0)
@php @php
if( App\Arquivo::where('participanteId', $participante->id)->first() != null){ $planoTrabalho = App\Arquivo::where("trabalhoId", $trabalho->id)->first();
$planoTrabalho = App\Arquivo::where('participanteId', $participante->id)->first()->nome;
}else{
$planoTrabalho = null;
}
@endphp @endphp
@if ($planoTrabalho != null) <a href="{{ route('baixar.plano', ['id' => $planoTrabalho->id]) }}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light">
<a href="{{route('download', ['file' => $planoTrabalho])}}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light"> <img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px"> </a>
</a> @else
@else @foreach( $trabalho->participantes as $participante)
Não planos de trabalho. @php
@endif if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
@endforeach $planoTrabalho = App\Arquivo::where('participanteId', $participante->id)->first()->nome;
}else{
$planoTrabalho = null;
}
@endphp
@if ($planoTrabalho != null)
<a href="{{route('download', ['file' => $planoTrabalho])}}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light">
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
</a>
@else
Não planos de trabalho.
@endif
@endforeach
@endif
</td> </td>
<td> <td>
<div class="row justify-content-center"> <div class="row justify-content-center">
...@@ -186,7 +195,15 @@ ...@@ -186,7 +195,15 @@
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px"> <img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
</a> </a>
</td> </td>
<td style="text-align: center"> <td style="text-align: center">
@if ($evento->numParticipantes == 0)
@php
$planoTrabalho = App\Arquivo::where("trabalhoId", $trabalho->id)->first();
@endphp
<a href="{{ route('baixar.plano', ['id' => $planoTrabalho->id]) }}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light">
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
</a>
@else
@foreach( $trabalho->participantes as $participante) @foreach( $trabalho->participantes as $participante)
@php @php
if( App\Arquivo::where('participanteId', $participante->id)->first() != null){ if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
...@@ -203,6 +220,7 @@ ...@@ -203,6 +220,7 @@
Não planos de trabalho. Não planos de trabalho.
@endif @endif
@endforeach @endforeach
@endif
</td> </td>
<td style="text-align: center"> <td style="text-align: center">
@if($trabalho->pivot->recomendacao == 'RECOMENDADO') @if($trabalho->pivot->recomendacao == 'RECOMENDADO')
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
@component('projeto.formularioVisualizar.anexos2', ['edital' => $trabalho->evento, 'projeto' => $trabalho]) @component('projeto.formularioVisualizar.anexos2', ['edital' => $trabalho->evento, 'projeto' => $trabalho])
@endcomponent @endcomponent
</div> </div>
@if ($evento->numParticipantes != 0)
<!-- Participantes --> <!-- Participantes -->
<div class="col-sm-10" style="margin-top: 20px"> <div class="col-sm-10" style="margin-top: 20px">
<div class="card" style="border-radius: 5px"> <div class="card" style="border-radius: 5px">
...@@ -64,6 +65,7 @@ ...@@ -64,6 +65,7 @@
</div> </div>
</div> </div>
</div> </div>
@endif
</div> </div>
</div> </div>
{{-- Parecer Interno --}} {{-- Parecer Interno --}}
......
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