Commit 37220c29 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

funcionalidade submeter edital

parent 381d10f5
...@@ -4,7 +4,7 @@ namespace App; ...@@ -4,7 +4,7 @@ namespace App;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class CoordenadorComite extends Model class AdministradorResponsavel extends Model
{ {
public function user(){ public function user(){
return $this->belongsTo('App\User'); return $this->belongsTo('App\User');
......
...@@ -4,9 +4,7 @@ namespace App; ...@@ -4,9 +4,7 @@ namespace App;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class Reitor extends Model class FuncaoParticipantes extends Model
{ {
public function user(){ //
return $this->belongsTo('App\User');
}
} }
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class GrandeArea extends Model
{
//
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class CoordenadorComiteController extends Controller
{
//
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ProReitorController extends Controller
{
//
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ReitorController extends Controller
{
//
}
...@@ -12,6 +12,9 @@ use App\Revisor; ...@@ -12,6 +12,9 @@ use App\Revisor;
use App\Modalidade; use App\Modalidade;
use App\Atribuicao; use App\Atribuicao;
use App\Arquivo; use App\Arquivo;
use App\GrandeArea;
use App\SubArea;
use App\FuncaoParticipantes;
use Carbon\Carbon; use Carbon\Carbon;
use Auth; use Auth;
use Illuminate\Http\Request; use Illuminate\Http\Request;
...@@ -31,31 +34,18 @@ class TrabalhoController extends Controller ...@@ -31,31 +34,18 @@ class TrabalhoController extends Controller
*/ */
public function index($id) public function index($id)
{ {
$evento = Evento::find($id); $edital = Evento::find($id);
$areas = Area::where('eventoId', $evento->id)->get(); $grandeAreas = GrandeArea::all();
$areasId = Area::where('eventoId', $evento->id)->select('id')->get(); $areas = Area::all();
$revisores = Revisor::where('eventoId', $evento->id)->get(); $subAreas = SubArea::all();
$modalidades = Modalidade::all(); $funcaoParticipantes = FuncaoParticipantes::all();
$areaModalidades = AreaModalidade::whereIn('areaId', $areasId)->get();
$areasEnomes = Area::wherein('id', $areasId)->get();
$modalidadesIDeNome = [];
foreach ($areaModalidades as $key) {
array_push($modalidadesIDeNome,['areaId' => $key->area->id,
'modalidadeId' => $key->modalidade->id,
'modalidadeNome' => $key->modalidade->nome]);
}
$trabalhos = Trabalho::where('autorId', Auth::user()->id)->whereIn('areaId', $areasId)->get();
// dd($evento);
return view('evento.submeterTrabalho',[ return view('evento.submeterTrabalho',[
'evento' => $evento, 'edital' => $edital,
'grandeAreas' => $grandeAreas,
'areas' => $areas, 'areas' => $areas,
'revisores' => $revisores, 'subAreas' => $subAreas,
'modalidades' => $modalidades, 'funcaoParticipantes'=> $funcaoParticipantes
'areaModalidades' => $areaModalidades,
'trabalhos' => $trabalhos,
'areasEnomes' => $areasEnomes,
'modalidadesIDeNome' => $modalidadesIDeNome,
]); ]);
} }
...@@ -76,6 +66,7 @@ class TrabalhoController extends Controller ...@@ -76,6 +66,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());
$mytime = Carbon::now('America/Recife'); $mytime = Carbon::now('America/Recife');
$mytime = $mytime->toDateString(); $mytime = $mytime->toDateString();
$evento = Evento::find($request->eventoId); $evento = Evento::find($request->eventoId);
......
...@@ -4,9 +4,10 @@ namespace App; ...@@ -4,9 +4,10 @@ namespace App;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class ProReitor extends Model class PlanoTrabalho extends Model
{ {
public function user(){ public function trabalho()
return $this->belongsTo('App\User'); {
return $this->belongsTo('App\Trabalho');
} }
} }
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SubArea extends Model
{
//
}
...@@ -50,4 +50,7 @@ class Trabalho extends Model ...@@ -50,4 +50,7 @@ class Trabalho extends Model
public function evento(){ public function evento(){
return $this->belongsTo('App\Evento', 'eventoId'); return $this->belongsTo('App\Evento', 'eventoId');
} }
public function planoTrabalho(){
return $this->hasMany('App\PlanoTrabalho');
}
} }
...@@ -82,16 +82,9 @@ class User extends Authenticatable implements MustVerifyEmail ...@@ -82,16 +82,9 @@ class User extends Authenticatable implements MustVerifyEmail
public function Proponentes(){ public function Proponentes(){
return $this->hasMany('App\Proponente'); return $this->hasMany('App\Proponente');
} }
public function Reitors(){ public function AdministradorResponsavel(){
return $this->hasMany('App\Reitor'); return $this->hasMany('App\AdministradorResponsavel');
} }
public function ProReitors(){
return $this->hasMany('App\ProReitor');
}
public function CoordenadorComites(){
return $this->hasMany('App\CoordenadorComite');
}
public function sendPasswordResetNotification($token){ public function sendPasswordResetNotification($token){
$this->notify(new recuperacaoSenha($token)); $this->notify(new recuperacaoSenha($token));
......
...@@ -17,6 +17,19 @@ class CreateTrabalhosTable extends Migration ...@@ -17,6 +17,19 @@ class CreateTrabalhosTable extends Migration
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->timestamps(); $table->timestamps();
$table->string('titulo'); $table->string('titulo');
$table->string('grandeArea');
$table->string('area');
$table->string('subArea');
$table->string('decisaoCONSU');
$table->string('anexoDecisaoCONSU');
$table->string('autorizacaoComiteEtica');
$table->string('anexoAutorizacaoComiteEtica');
$table->string('coordenador'); //preencher automaticamente
$table->string('anexoLattesCoordenador');
$table->string('anexoPlanilhaPontuacao');
$table->string('pontuacaoPlanilha');
$table->string('linkGrupoPesquisa');
$table->string('linkLattesEstudante');
$table->string('autores')->nullable(); $table->string('autores')->nullable();
$table->date('data')->nullable(); $table->date('data')->nullable();
$table->text('resumo')->nullable(); $table->text('resumo')->nullable();
...@@ -26,6 +39,7 @@ class CreateTrabalhosTable extends Migration ...@@ -26,6 +39,7 @@ class CreateTrabalhosTable extends Migration
$table->integer('areaId'); $table->integer('areaId');
$table->integer('autorId'); $table->integer('autorId');
$table->integer('eventoId'); $table->integer('eventoId');
$table->integer('proponente_id');
}); });
} }
......
...@@ -15,11 +15,11 @@ class CreateAreasTable extends Migration ...@@ -15,11 +15,11 @@ class CreateAreasTable extends Migration
{ {
Schema::create('areas', function (Blueprint $table) { Schema::create('areas', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->timestamps();
$table->string('nome'); $table->string('nome');
$table->integer('modalidadeId')->nullable(); $table->timestamps();
$table->integer('eventoId'); // $table->integer('modalidadeId')->nullable();
// $table->integer('eventoId');
}); });
} }
......
...@@ -16,18 +16,18 @@ class ChavesEstrangeiras extends Migration ...@@ -16,18 +16,18 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('areas', function (Blueprint $table) { // Schema::table('areas', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos'); // $table->foreign('eventoId')->references('id')->on('eventos');
}); // });
//------------------------------------------------------------------------ // //------------------------------------------------------------------------
Schema::table('area_modalidades', function (Blueprint $table) { // Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('area_modalidades', function (Blueprint $table) { // Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades'); // $table->foreign('modalidadeId')->references('id')->on('modalidades');
}); // });
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -61,9 +61,7 @@ class ChavesEstrangeiras extends Migration ...@@ -61,9 +61,7 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('eventos', function (Blueprint $table) {
$table->foreign('enderecoId')->references('id')->on('enderecos');
});
Schema::table('eventos', function (Blueprint $table) { Schema::table('eventos', function (Blueprint $table) {
$table->foreign('coordenadorId')->references('id')->on('users'); $table->foreign('coordenadorId')->references('id')->on('users');
}); });
...@@ -85,9 +83,9 @@ class ChavesEstrangeiras extends Migration ...@@ -85,9 +83,9 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Schema::table('pertences', function (Blueprint $table) { // Schema::table('pertences', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('pertences', function (Blueprint $table) { Schema::table('pertences', function (Blueprint $table) {
$table->foreign('revisorId')->references('id')->on('users'); $table->foreign('revisorId')->references('id')->on('users');
}); });
...@@ -106,9 +104,9 @@ class ChavesEstrangeiras extends Migration ...@@ -106,9 +104,9 @@ class ChavesEstrangeiras extends Migration
Schema::table('trabalhos', function (Blueprint $table) { Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades'); $table->foreign('modalidadeId')->references('id')->on('modalidades');
}); });
Schema::table('trabalhos', function (Blueprint $table) { // Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('trabalhos', function (Blueprint $table) { Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('autorId')->references('id')->on('users'); $table->foreign('autorId')->references('id')->on('users');
}); });
...@@ -130,9 +128,9 @@ class ChavesEstrangeiras extends Migration ...@@ -130,9 +128,9 @@ class ChavesEstrangeiras extends Migration
Schema::table('revisors', function (Blueprint $table) { Schema::table('revisors', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos'); $table->foreign('eventoId')->references('id')->on('eventos');
}); });
Schema::table('revisors', function (Blueprint $table) { // Schema::table('revisors', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas'); // $table->foreign('areaId')->references('id')->on('areas');
}); // });
Schema::table('eventos',function (Blueprint $table){ Schema::table('eventos',function (Blueprint $table){
$table->foreign('coordComissaoId')->references('id')->on('users'); $table->foreign('coordComissaoId')->references('id')->on('users');
}); });
......
...@@ -15,6 +15,19 @@ class CreateProponentesTable extends Migration ...@@ -15,6 +15,19 @@ class CreateProponentesTable extends Migration
{ {
Schema::create('proponentes', function (Blueprint $table) { Schema::create('proponentes', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->string('CPF');
$table->string('SIAPE');
$table->string('email')->unique();
$table->string('cargo');
$table->string('vinculo');
$table->string('titulacaoMaxima');
$table->string('anoTitulacao');
$table->string('grandeArea');
$table->string('area');
$table->string('subArea');
$table->string('bolsistaProdutividade');
$table->string('nivel');
$table->string('linkLattes');
$table->timestamps(); $table->timestamps();
}); });
} }
......
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class AddUsersToProReitorsTable extends Migration class AddTrabalhosToProponentesTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,9 +13,9 @@ class AddUsersToProReitorsTable extends Migration ...@@ -13,9 +13,9 @@ class AddUsersToProReitorsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::table('pro_reitors', function (Blueprint $table) { Schema::table('proponentes', function (Blueprint $table) {
$table->unsignedBigInteger('user_id'); $table->unsignedBigInteger('trabalho_id');
$table->foreign('user_id')->references('id')->on('users'); $table->foreign('trabalho_id')->references('id')->on('trabalhos');
}); });
} }
...@@ -26,9 +26,9 @@ class AddUsersToProReitorsTable extends Migration ...@@ -26,9 +26,9 @@ class AddUsersToProReitorsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::table('pro_reitors', function (Blueprint $table) { Schema::table('proponentes', function (Blueprint $table) {
$table->dropForeign('pro_reitors_user_id_foreign'); $table->dropForeign('proponentes_trabalho_id_foreign');
$table->dropColumn('user_id'); $table->dropColumn('trabalho_id');
}); });
} }
} }
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePlanoTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('plano_trabalhos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('titulo');
$table->string('anexoPlanoTrabalho');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('plano_trabalhos');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTrabalhosToPlanoTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('plano_trabalhos', function (Blueprint $table) {
$table->unsignedBigInteger('trabalho_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('plano_trabalhos', function (Blueprint $table) {
$table->dropForeign('plano_trabalhos_trabalho_id_foreign');
$table->dropColumn('trabalho_id');
});
}
}
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class CreateCoordenadorComitesTable extends Migration class CreateAdministradorResponsavelsTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,7 +13,7 @@ class CreateCoordenadorComitesTable extends Migration ...@@ -13,7 +13,7 @@ class CreateCoordenadorComitesTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('coordenador_comites', function (Blueprint $table) { Schema::create('administrador_responsavels', function (Blueprint $table) {
$table->bigIncrements('id'); $table->bigIncrements('id');
$table->timestamps(); $table->timestamps();
}); });
...@@ -26,6 +26,6 @@ class CreateCoordenadorComitesTable extends Migration ...@@ -26,6 +26,6 @@ class CreateCoordenadorComitesTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('coordenador_comites'); Schema::dropIfExists('administrador_responsavels');
} }
} }
...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; ...@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
class AddUsersToCoordenadorComitesTable extends Migration class AddUsersToAdministradorResponsavelsTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
...@@ -13,7 +13,7 @@ class AddUsersToCoordenadorComitesTable extends Migration ...@@ -13,7 +13,7 @@ class AddUsersToCoordenadorComitesTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::table('coordenador_comites', function (Blueprint $table) { Schema::table('administrador_responsavels', function (Blueprint $table) {
$table->unsignedBigInteger('user_id'); $table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users'); $table->foreign('user_id')->references('id')->on('users');
}); });
...@@ -26,8 +26,8 @@ class AddUsersToCoordenadorComitesTable extends Migration ...@@ -26,8 +26,8 @@ class AddUsersToCoordenadorComitesTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::table('coordenador_comites', function (Blueprint $table) { Schema::table('administrador_responsavels', function (Blueprint $table) {
$table->dropForeign('coordenador_comites_user_id_foreign'); $table->dropForeign('administrador_responsavels_user_id_foreign');
$table->dropColumn('user_id'); $table->dropColumn('user_id');
}); });
} }
......
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