Unverified Commit ff70569f authored by carlos1270's avatar carlos1270 Committed by GitHub
Browse files

Merge pull request #73 from carlos1270/master

Ajustes
parents d1b7ac59 7e1ad722
# EventosCientificos_ModuloTrabalhos <a href="http://app.uag.ufrpe.br/submeta/" target="_blank"><img src="http://app.uag.ufrpe.br/submeta/img/icons/logo_submeta_pemenor.png"><a>
...@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho; ...@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho;
use App\Mail\EventoCriado; use App\Mail\EventoCriado;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use App\OutrasInfoParticipante;
class TrabalhoController extends Controller class TrabalhoController extends Controller
{ {
...@@ -45,7 +46,7 @@ class TrabalhoController extends Controller ...@@ -45,7 +46,7 @@ class TrabalhoController extends Controller
{ {
$edital = Evento::find($id); $edital = Evento::find($id);
$grandeAreas = GrandeArea::orderBy('nome')->get(); $grandeAreas = GrandeArea::orderBy('nome')->get();
$funcaoParticipantes = FuncaoParticipantes::all(); $funcaoParticipantes = FuncaoParticipantes::orderBy('nome')->get();
$proponente = Proponente::where('user_id', Auth::user()->id)->first(); $proponente = Proponente::where('user_id', Auth::user()->id)->first();
if($proponente == null){ if($proponente == null){
...@@ -61,7 +62,8 @@ class TrabalhoController extends Controller ...@@ -61,7 +62,8 @@ class TrabalhoController extends Controller
'edital' => $edital, 'edital' => $edital,
'grandeAreas' => $grandeAreas, 'grandeAreas' => $grandeAreas,
'funcaoParticipantes'=> $funcaoParticipantes, 'funcaoParticipantes'=> $funcaoParticipantes,
'rascunho' => $rascunho 'rascunho' => $rascunho,
'enum_turno' => OutrasInfoParticipante::ENUM_TURNO
]); ]);
} }
...@@ -82,7 +84,7 @@ class TrabalhoController extends Controller ...@@ -82,7 +84,7 @@ class TrabalhoController extends Controller
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function store(Request $request){ public function store(Request $request){
// dd($request->all()); dd($request);
$mytime = Carbon::now('America/Recife'); $mytime = Carbon::now('America/Recife');
$mytime = $mytime->toDateString(); $mytime = $mytime->toDateString();
$evento = Evento::find($request->editalId); $evento = Evento::find($request->editalId);
...@@ -128,10 +130,10 @@ class TrabalhoController extends Controller ...@@ -128,10 +130,10 @@ class TrabalhoController extends Controller
'anexoComiteEtica' => [($request->anexoComitePreenchido!=='sim'&&$request->anexoJustificativaPreenchido!=='sim'?'required_without:justificativaAutorizacaoEtica':''), 'file', 'mimes:pdf', 'max:2048'], 'anexoComiteEtica' => [($request->anexoComitePreenchido!=='sim'&&$request->anexoJustificativaPreenchido!=='sim'?'required_without:justificativaAutorizacaoEtica':''), 'file', 'mimes:pdf', 'max:2048'],
'justificativaAutorizacaoEtica' => [($request->anexoJustificativaPreenchido!=='sim'&&$request->anexoComitePreenchido!=='sim'?'required_without:anexoComiteEtica':''), 'file', 'mimes:pdf', 'max:2048'], 'justificativaAutorizacaoEtica' => [($request->anexoJustificativaPreenchido!=='sim'&&$request->anexoComitePreenchido!=='sim'?'required_without:anexoComiteEtica':''), 'file', 'mimes:pdf', 'max:2048'],
'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required': ''), 'file', 'mimes:pdf', 'max:2048'], 'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required': ''), 'file', 'mimes:pdf', 'max:2048'],
'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf,xls,xlsx', 'max:2048'], 'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:xls,xlsx,ods', 'max:2048'],
'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'], 'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'],
]); ]);
if(gettype($this->validarAnexosRascunho($request, $trabalho)) != 'integer'){ if(gettype($this->validarAnexosRascunho($request, $trabalho)) != 'integer'){
return $this->validarAnexosRascunho($request, $trabalho); return $this->validarAnexosRascunho($request, $trabalho);
} }
...@@ -175,7 +177,7 @@ class TrabalhoController extends Controller ...@@ -175,7 +177,7 @@ class TrabalhoController extends Controller
'nomePlanoTrabalho.*' => ['nullable', 'string'], 'nomePlanoTrabalho.*' => ['nullable', 'string'],
'anexoProjeto' => [($request->anexoProjetoPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'], 'anexoProjeto' => [($request->anexoProjetoPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'], 'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf,xls,xlsx', 'max:2048'], 'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:xls,xlsx,ods', 'max:2048'],
'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'], 'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'],
]); ]);
......
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class OutrasInfoParticipante extends Model
{
protected $fillable = ['name', 'user_id', 'trabalho_id', 'participante_id'];
public const ENUM_TURNO = ['Matutino', 'Vespertino', 'Noturno', 'Integral'];
}
This diff is collapsed.
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\OutrasInfoParticipante;
class CreateOutrasInfoParticipantesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('outras_info_participantes', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string("rg");
$table->date("data_de_nascimento");
$table->string("curso");
$table->enum("turno", OutrasInfoParticipante::ENUM_TURNO)->nullable(true);
$table->integer("ordem_prioridade")->nullable(true);
$table->string("periodo_atual")->nullable(true);
$table->string("total_periodos")->nullable(true);
$table->double("media_do_curso", 3, 2)->nullable(true);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('outras_info_participantes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnParticipante extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('participantes', function (Blueprint $table) {
$table->unsignedBigInteger('outras_info_participante_id')->nullable(true);
$table->foreign('outras_info_participante_id')->references('id')->on('outras_info_participantes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
...@@ -34,6 +34,11 @@ class FuncaoParticipanteSeeder extends Seeder ...@@ -34,6 +34,11 @@ class FuncaoParticipanteSeeder extends Seeder
DB::table('funcao_participantes')->insert([ DB::table('funcao_participantes')->insert([
'nome'=>'Voluntário', 'nome'=>'Voluntário',
]);
DB::table('funcao_participantes')->insert([
'nome'=>'Pesquisador',
]); ]);
} }
} }
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