diff --git a/app/CoordenadorComissao.php b/app/CoordenadorComissao.php index f5a252800b0daaf4affe5e6aed8b7d215d36c74c..ff8f19593b819ee4e09ecf0d429b5f5075f5db4d 100644 --- a/app/CoordenadorComissao.php +++ b/app/CoordenadorComissao.php @@ -14,4 +14,8 @@ class CoordenadorComissao extends Model return $this->hasMany('App\Evento', 'coordenadorId'); } + public function trabalho(){ + return $this->hasMany('App\Trabalho'); + } + } diff --git a/app/Http/Controllers/EventoController.php b/app/Http/Controllers/EventoController.php index 51687d8c78c1f6a58f149a6b4aabd74879762191..180ac8c1bd95739a0f14d8f97a0e6f8be0c9d39f 100644 --- a/app/Http/Controllers/EventoController.php +++ b/app/Http/Controllers/EventoController.php @@ -11,6 +11,7 @@ use App\Atribuicao; use App\Modalidade; use App\ComissaoEvento; use App\User; +use App\Proponente; use App\Trabalho; use App\AreaModalidade; use App\CoordenadorComissao; @@ -170,19 +171,30 @@ class EventoController extends Controller public function show($id) { $evento = Evento::find($id); - $hasTrabalho = false; - $hasTrabalhoCoautor = false; - $hasFile = false; - $trabalhos = Trabalho::where('proponente_id', Auth::user()->id)->get(); - $trabalhosCount = Trabalho::where('proponente_id', Auth::user()->id)->count(); + $proponente = Proponente::where('user_id', Auth::user()->id)->first(); + if($proponente = null){ + $hasTrabalho = false; + $hasFile = false; + $trabalhos = $proponente->trabalhos()->get(); + $trabalhosCount = $proponente->trabalhos()->count(); + + if($trabalhosCount != 0){ + $hasTrabalho = true; + $hasFile = true; + } + }else{ + $hasTrabalho = false; + $hasFile = false; + $trabalhos = 0; + $trabalhosCount = 0; + } + + $trabalhosId = Trabalho::where('evento_id', $evento->id)->select('id')->get(); //$trabalhosIdCoautor = Proponente::whereIn('trabalhoId', $trabalhosId)->where('proponente_id', Auth::user()->id)->select('trabalhoId')->get(); //$coautorCount = Coautor::whereIn('trabalhoId', $trabalhosId)->where('proponente_id', Auth::user()->id)->count(); //$trabalhosCoautor = Trabalho::whereIn('id', $trabalhosIdCoautor)->get(); - if($trabalhosCount != 0){ - $hasTrabalho = true; - $hasFile = true; - } + // if($coautorCount != 0){ // $hasTrabalhoCoautor = true; // $hasFile = true; diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index bbde486ef864ad6bcce07a74a1297ec41c30e663..621c91b1abe4b7ab4f254b7d2ad1e989fe77a7db 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -5,7 +5,9 @@ namespace App\Http\Controllers; use App\Trabalho; use App\Coautor; use App\Evento; +use App\CoordenadorComissao; use App\User; +use App\Proponente; use App\AreaModalidade; use App\Area; use App\Revisor; @@ -71,6 +73,8 @@ class TrabalhoController extends Controller $mytime = Carbon::now('America/Recife'); $mytime = $mytime->toDateString(); $evento = Evento::find($request->editalId); + $coordenador = CoordenadorComissao::find($evento->coordenadorId); + //dd($coordenador->id); if($evento->inicioSubmissao > $mytime){ if($mytime >= $evento->fimSubmissao){ @@ -83,19 +87,18 @@ class TrabalhoController extends Controller $validatedData = $request->validate([ 'editalId' => ['required', 'integer'], - 'nomeProjeto' => ['required', 'string',], + 'nomeProjeto' => ['required', 'string'], 'grandeAreaId' => ['required', 'integer'], 'areaId' => ['required', 'integer'], 'subAreaId' => ['required', 'integer'], 'pontuacaoPlanilha' => ['required', 'integer'], 'linkGrupo' => ['required', 'string'], 'linkLattesEstudante' => ['required', 'string'], - 'nomeCoordenador' => ['required', 'string'], 'nomeParticipante.*' => ['required', 'string'], 'emailParticipante.*' => ['string'], 'nomePlanoTrabalho.*' => ['string'], 'anexoProjeto' => ['required', 'file', 'mimes:pdf', 'max:2000000'], - 'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + //'anexoCONSU' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoLatterCoordenador' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'], 'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'], @@ -103,10 +106,10 @@ class TrabalhoController extends Controller $trabalho = Trabalho::create([ 'titulo' => $request->nomeProjeto, + 'coordenador_id' => $coordenador->id, 'grande_area_id' => $request->grandeAreaId, 'area_id' => $request->areaId, - 'sub_area_id' => $request->subAreaId, - 'coordenador' => $request->nomeCoordenador, + 'sub_area_id' => $request->subAreaId, 'pontuacaoPlanilha' => $request->pontuacaoPlanilha, 'linkGrupoPesquisa' => $request->linkGrupo, 'linkLattesEstudante' => $request->linkLattesEstudante, @@ -120,6 +123,7 @@ class TrabalhoController extends Controller 'anexoLattesCoordenador' => $request->anexoLatterCoordenador, 'anexoPlanilhaPontuacao' => $request->anexoPlanilha, ]); + //dd($request->all()); }else{ //Caso em que o anexo da Decisão do CONSU não necessário $validatedData = $request->validate([ @@ -143,6 +147,7 @@ class TrabalhoController extends Controller $trabalho = Trabalho::create([ 'titulo' => $request->nomeProjeto, + 'coordenador_id' => $coordenador->id, 'grande_area_id' => $request->grandeAreaId, 'area_id' => $request->areaId, 'sub_area_id' => $request->subAreaId, @@ -163,7 +168,8 @@ class TrabalhoController extends Controller } //Relaciona o projeto criado com o proponente que criou o projeto - $trabalho->proponente()->save(Auth()->user()); + $proponente = Proponente::where('user_id', Auth::user()->id)->first(); + $trabalho->proponentes()->save($proponente); //Envia email com senha temp para cada participante do projeto if($request->emailParticipante != null){ diff --git a/app/Trabalho.php b/app/Trabalho.php index 30925794100db224f2324bb4bc1503ec56371e44..c19ebe66492087b03410a021131aeefe93269609 100644 --- a/app/Trabalho.php +++ b/app/Trabalho.php @@ -31,6 +31,7 @@ class Trabalho extends Model 'sub_area_id', 'evento_id', 'proponente_id', + 'coordenador_id', ]; public function recurso(){ @@ -77,4 +78,7 @@ class Trabalho extends Model public function proponentes(){ return $this->belongsToMany('App\Proponente', 'trabalho_proponente'); } + public function coordenador(){ + return $this->belongsTo('App\CoordenadorComissao'); + } } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 55ad718f4e5a752d779c6bd1d5c7ff5d4503b70b..67fb576c9ad5be5e311371051326dc90ecbe95ef 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -22,7 +22,8 @@ class CreateUsersTable extends Migration $table->string('celular')->nullable(); $table->string('cpf')->nullable(); $table->string('tipo')->nullable(); - $table->boolean('usuarioTemp')->nullable(); + $table->boolean('usuarioTemp')->nullable(); + $table->rememberToken(); $table->timestamps(); $table->timestamp('email_verified_at')->nullable(); diff --git a/database/migrations/2020_02_05_123048_create_trabalhos_table.php b/database/migrations/2020_02_05_123048_create_trabalhos_table.php index ff970a8b466f7e9bd7be5c76aadd7147cab149f5..26e41338f43237dba51f25980e8df1fcb24a055b 100644 --- a/database/migrations/2020_02_05_123048_create_trabalhos_table.php +++ b/database/migrations/2020_02_05_123048_create_trabalhos_table.php @@ -32,7 +32,7 @@ class CreateTrabalhosTable extends Migration $table->unsignedBigInteger('area_id'); $table->unsignedBigInteger('sub_area_id'); $table->unsignedBigInteger('evento_id'); - $table->unsignedBigInteger('proponente_id'); + $table->unsignedBigInteger('coordenador_id'); $table->timestamps(); }); diff --git a/database/migrations/2020_02_05_123139_create_areas_table.php b/database/migrations/2020_02_05_123139_create_areas_table.php index aa1ca0b64ba141ff1c5c0c14cdd217c79b3c9f61..57b4d0d05b794b50540f2fe3dfa84d06cf600903 100644 --- a/database/migrations/2020_02_05_123139_create_areas_table.php +++ b/database/migrations/2020_02_05_123139_create_areas_table.php @@ -17,6 +17,7 @@ class CreateAreasTable extends Migration $table->bigIncrements('id'); $table->string('nome'); + $table->unsignedBigInteger('grande_area_id'); $table->timestamps(); // $table->integer('modalidadeId')->nullable(); // $table->integer('eventoId'); diff --git a/database/migrations/2020_05_20_163253_create_administradors_table.php b/database/migrations/2020_05_20_163253_create_administradors_table.php index 33231fad96672f490155fb9b011e308be57d1eac..b500b62d7e8a1b6733f57dcadb8978df68654cb5 100644 --- a/database/migrations/2020_05_20_163253_create_administradors_table.php +++ b/database/migrations/2020_05_20_163253_create_administradors_table.php @@ -14,9 +14,13 @@ class CreateAdministradorsTable extends Migration public function up() { Schema::create('administradors', function (Blueprint $table) { - $table->bigIncrements('id');/*Igor pediu que as PK das tabelas fossem o id */ + $table->bigIncrements('id'); + $table->string('matricula')->unique(); $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); }); } diff --git a/database/migrations/2020_05_20_163721_add_users_to_administradors_table.php b/database/migrations/2020_05_20_163721_add_users_to_administradors_table.php deleted file mode 100644 index baf1acfec60fb7ba34b3877aea0a9518c1ad2fc7..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_20_163721_add_users_to_administradors_table.php +++ /dev/null @@ -1,35 +0,0 @@ -unsignedBigInteger('user_id'); - $table->foreign('user_id')->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('administradors', function (Blueprint $table) { - // - $table->dropForeign('administradors_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_20_211421_create_proponentes_table.php b/database/migrations/2020_05_20_211421_create_proponentes_table.php index 317d8a485c2e057b3034926bbaebb078da6f7445..b80eb9ca78ac2d79652ab3e41ae12af6f1cbc4c5 100644 --- a/database/migrations/2020_05_20_211421_create_proponentes_table.php +++ b/database/migrations/2020_05_20_211421_create_proponentes_table.php @@ -29,6 +29,10 @@ class CreateProponentesTable extends Migration $table->string('nivel'); $table->string('linkLattes'); $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); + }); } diff --git a/database/migrations/2020_05_20_211451_add_users_to_proponentes_table.php b/database/migrations/2020_05_20_211451_add_users_to_proponentes_table.php deleted file mode 100644 index 232eef64d84532652bb45c5904d0c29978913ab4..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_20_211451_add_users_to_proponentes_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('user_id'); - $table->foreign('user_id')->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('proponentes', function (Blueprint $table) { - $table->dropForeign('proponentes_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_21_014825_add_trabalhos_to_proponentes_table.php b/database/migrations/2020_05_21_014825_add_trabalhos_to_proponentes_table.php deleted file mode 100644 index ffbc2c087d829291c68dcfac9cd9e847dbe66948..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_21_014825_add_trabalhos_to_proponentes_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('trabalho_id')->nullable(); - $table->foreign('trabalho_id')->references('id')->on('trabalhos'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('proponentes', function (Blueprint $table) { - $table->dropForeign('proponentes_trabalho_id_foreign'); - $table->dropColumn('trabalho_id'); - }); - } -} diff --git a/database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php b/database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php index e339b504a4f28fa1e8e5993abcdb183d2c490b0f..26e51d22894240fab1557fc426cd2b944bf12f50 100644 --- a/database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php +++ b/database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php @@ -18,6 +18,9 @@ class CreatePlanoTrabalhosTable extends Migration $table->string('titulo'); $table->string('anexoPlanoTrabalho'); $table->timestamps(); + + $table->unsignedBigInteger('trabalho_id'); + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); }); } diff --git a/database/migrations/2020_05_21_020133_add_trabalhos_to_plano_trabalhos_table.php b/database/migrations/2020_05_21_020133_add_trabalhos_to_plano_trabalhos_table.php deleted file mode 100644 index 11e27ed625537e40764f476cedac140421c97e75..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_21_020133_add_trabalhos_to_plano_trabalhos_table.php +++ /dev/null @@ -1,34 +0,0 @@ -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'); - }); - } -} diff --git a/database/migrations/2020_05_21_025543_create_administrador_responsavels_table.php b/database/migrations/2020_05_21_025543_create_administrador_responsavels_table.php index ab128e3e81deb272dbebeea6804aa72087f1cc14..61a37132c0df6734b7342bae3700ff4deaf33b62 100644 --- a/database/migrations/2020_05_21_025543_create_administrador_responsavels_table.php +++ b/database/migrations/2020_05_21_025543_create_administrador_responsavels_table.php @@ -16,6 +16,9 @@ class CreateAdministradorResponsavelsTable extends Migration Schema::create('administrador_responsavels', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); }); } diff --git a/database/migrations/2020_05_21_025624_add_users_to_administrador_responsavels_table.php b/database/migrations/2020_05_21_025624_add_users_to_administrador_responsavels_table.php deleted file mode 100644 index d20d2e10a1768d48dfbeaacfee5e0cd6882f76a2..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_21_025624_add_users_to_administrador_responsavels_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('user_id'); - $table->foreign('user_id')->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('administrador_responsavels', function (Blueprint $table) { - $table->dropForeign('administrador_responsavels_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_22_031644_create_grande_areas_table.php b/database/migrations/2020_05_22_031644_create_grande_areas_table.php index 553f6054d3dfb3ef40454aaf68438cba5fb12220..66c5c356af3e4ff2cfb3e7c856160108bad47b1c 100644 --- a/database/migrations/2020_05_22_031644_create_grande_areas_table.php +++ b/database/migrations/2020_05_22_031644_create_grande_areas_table.php @@ -16,7 +16,7 @@ class CreateGrandeAreasTable extends Migration Schema::create('grande_areas', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('nome'); - $table->timestamps(); + $table->timestamps(); }); } diff --git a/database/migrations/2020_05_22_031838_create_sub_areas_table.php b/database/migrations/2020_05_22_031838_create_sub_areas_table.php index d7fe6e6d93296c50bfe68248edcdc06cdd6228bb..4c6ec46d1191ad45a3d23ffee4518b00c654a3e9 100644 --- a/database/migrations/2020_05_22_031838_create_sub_areas_table.php +++ b/database/migrations/2020_05_22_031838_create_sub_areas_table.php @@ -17,6 +17,10 @@ class CreateSubAreasTable extends Migration $table->bigIncrements('id'); $table->string("nome"); $table->timestamps(); + + + $table->unsignedBigInteger('area_id'); + $table->foreign('area_id')->references('id')->on('areas'); }); } diff --git a/database/migrations/2020_05_22_032753_add_areas_to_sub_areas_table.php b/database/migrations/2020_05_22_032753_add_areas_to_sub_areas_table.php deleted file mode 100644 index baa6be657d830d2ef7906692034cd402143f8171..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_22_032753_add_areas_to_sub_areas_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('area_id'); - $table->foreign('area_id')->references('id')->on('areas'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('sub_areas', function (Blueprint $table) { - $table->dropForeign('sub_areas_area_id_foreign'); - $table->dropColumn('area_id'); - }); - } -} diff --git a/database/migrations/2020_05_22_044450_create_funcao_participantes_table.php b/database/migrations/2020_05_22_044450_create_funcao_participantes_table.php index 0df1c1293c5920d16095d3166b96af225d83a695..0ea32304e0c313499a95722d5324c98c17d64a38 100644 --- a/database/migrations/2020_05_22_044450_create_funcao_participantes_table.php +++ b/database/migrations/2020_05_22_044450_create_funcao_participantes_table.php @@ -17,6 +17,8 @@ class CreateFuncaoParticipantesTable extends Migration $table->bigIncrements('id'); $table->string('nome'); $table->timestamps(); + + }); } diff --git a/database/migrations/2020_05_22_044629_add_users_to_funcao_participantes_table.php b/database/migrations/2020_05_22_044629_add_users_to_funcao_participantes_table.php deleted file mode 100644 index 3f9262465c178a873f15b4c89fc6465eef844710..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_22_044629_add_users_to_funcao_participantes_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('funcao_participante_id')->nullable();; - $table->foreign('funcao_participante_id')->references('id')->on('funcao_participantes'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - $table->dropForeign('users_funcao_participante_id_foreign'); - $table->dropColumn('funcao_participante_id'); - }); - } -} diff --git a/database/migrations/2020_05_23_054649_create_coordenador_comissaos_table.php b/database/migrations/2020_05_23_054649_create_coordenador_comissaos_table.php index 88d8d24d843088082458bc03b2e1816936ec4a47..c519b8b589abc022a210b37a7b3a962113b09c5f 100644 --- a/database/migrations/2020_05_23_054649_create_coordenador_comissaos_table.php +++ b/database/migrations/2020_05_23_054649_create_coordenador_comissaos_table.php @@ -16,6 +16,9 @@ class CreateCoordenadorComissaosTable extends Migration Schema::create('coordenador_comissaos', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); }); } diff --git a/database/migrations/2020_05_23_054741_add_users_to_coordenador_comissaos_table.php b/database/migrations/2020_05_23_054741_add_users_to_coordenador_comissaos_table.php deleted file mode 100644 index a5a7e30c358072204198f22159bd1f9cc12a4867..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_23_054741_add_users_to_coordenador_comissaos_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('user_id'); - $table->foreign('user_id')->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('coordenador_comissaos', function (Blueprint $table) { - $table->dropForeign('coordenador_comissaos_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_23_054805_create_avaliadors_table.php b/database/migrations/2020_05_23_054805_create_avaliadors_table.php index 72c88665c593e0ee33c8d347bc8494cdf9ed0a84..54a9372d54609319962618f1ff396e8bb15b7912 100644 --- a/database/migrations/2020_05_23_054805_create_avaliadors_table.php +++ b/database/migrations/2020_05_23_054805_create_avaliadors_table.php @@ -16,6 +16,9 @@ class CreateAvaliadorsTable extends Migration Schema::create('avaliadors', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); }); } diff --git a/database/migrations/2020_05_23_054859_add_users_to_avaliadors_table.php b/database/migrations/2020_05_23_054859_add_users_to_avaliadors_table.php deleted file mode 100644 index edecce58d2a5277e3851154b4d81231072844b82..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_23_054859_add_users_to_avaliadors_table.php +++ /dev/null @@ -1,34 +0,0 @@ -unsignedBigInteger('user_id'); - $table->foreign('user_id')->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('avaliadors', function (Blueprint $table) { - $table->dropForeign('avaliadors_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_23_054945_create_participantes_table.php b/database/migrations/2020_05_23_054945_create_participantes_table.php index a0132d8feccac2946c6c21ad8a0b2bdef93ccce1..0a004993703adb218381d68b4235510c5cfd1965 100644 --- a/database/migrations/2020_05_23_054945_create_participantes_table.php +++ b/database/migrations/2020_05_23_054945_create_participantes_table.php @@ -16,6 +16,14 @@ class CreateParticipantesTable extends Migration Schema::create('participantes', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); + + $table->unsignedBigInteger('user_id')->nullable(); + $table->foreign('user_id')->references('id')->on('users'); + $table->unsignedBigInteger('trabalho_id')->nullable(); + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + + $table->unsignedBigInteger('funcao_participante_id')->nullable(); + $table->foreign('funcao_participante_id')->references('id')->on('funcao_participantes'); }); } diff --git a/database/migrations/2020_05_23_055033_add_users_to_participantes_table.php b/database/migrations/2020_05_23_055033_add_users_to_participantes_table.php deleted file mode 100644 index 19e71cf54df403370b8c90be202f038a1ae90359..0000000000000000000000000000000000000000 --- a/database/migrations/2020_05_23_055033_add_users_to_participantes_table.php +++ /dev/null @@ -1,36 +0,0 @@ -unsignedBigInteger('user_id')->nullable(); - $table->foreign('user_id')->references('id')->on('users'); - $table->unsignedBigInteger('trabalho_id')->nullable(); - $table->foreign('trabalho_id')->references('id')->on('trabalhos'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('participantes', function (Blueprint $table) { - $table->dropForeign('participantes_user_id_foreign'); - $table->dropColumn('user_id'); - }); - } -} diff --git a/database/migrations/2020_05_23_071949_add_foreign_to_trabalhos_table.php b/database/migrations/2020_05_23_071949_add_foreign_to_trabalhos_table.php index 3f33152c121221a5262cd59ecc9e6f61b40cd6b9..61c88c2d3498e655bd15d36dad515feb1be6189a 100644 --- a/database/migrations/2020_05_23_071949_add_foreign_to_trabalhos_table.php +++ b/database/migrations/2020_05_23_071949_add_foreign_to_trabalhos_table.php @@ -19,7 +19,7 @@ class AddForeignToTrabalhosTable extends Migration $table->foreign('area_id')->references('id')->on('areas'); $table->foreign('sub_area_id')->references('id')->on('sub_areas'); $table->foreign('evento_id')->references('id')->on('eventos'); - $table->foreign('proponente_id')->references('id')->on('proponentes'); + $table->foreign('coordenador_id')->references('id')->on('coordenador_comissaos'); //$table->foreignId('user_id')->constrained(); // $table->integer('coordenador'); diff --git a/database/migrations/2020_05_22_032714_add_grande_areas_to_areas_table.php b/database/migrations/2020_05_25_193809_add_grande_areas_area_table.php similarity index 72% rename from database/migrations/2020_05_22_032714_add_grande_areas_to_areas_table.php rename to database/migrations/2020_05_25_193809_add_grande_areas_area_table.php index c732329cb074a464970f09963e22f2410bd33cba..ed7da9a7e6c94397d4a4f3485824b040f2df2a12 100644 --- a/database/migrations/2020_05_22_032714_add_grande_areas_to_areas_table.php +++ b/database/migrations/2020_05_25_193809_add_grande_areas_area_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddGrandeAreasToAreasTable extends Migration +class AddGrandeAreasAreaTable extends Migration { /** * Run the migrations. @@ -14,7 +14,6 @@ class AddGrandeAreasToAreasTable extends Migration public function up() { Schema::table('areas', function (Blueprint $table) { - $table->unsignedBigInteger('grande_area_id'); $table->foreign('grande_area_id')->references('id')->on('grande_areas'); }); } @@ -27,8 +26,7 @@ class AddGrandeAreasToAreasTable extends Migration public function down() { Schema::table('areas', function (Blueprint $table) { - $table->dropForeign('areas_grande_area_id_foreign'); - $table->dropColumn('grande_area_id'); + // }); } } diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 3f8cf254c2dfcbfb286e40d7f629caddb0b6a249..b3c7ad62da41a64fc648f05c157603805c271793 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -71,7 +71,7 @@ class DatabaseSeeder extends Seeder 'descricao'=>'Cada autor inscrito poderá submeter até dois (2) resumos; O número máximo de autores por trabalho será seis autores; Os trabalhos deverão ser submetidos na forma de resumo simples com no máximo uma (01) página, no formato PDF;', - 'tipo'=>'teste', + 'tipo'=>'PIBIC', 'inicioSubmissao'=>'2020-03-30', 'fimSubmissao'=>'2020-09-20', 'inicioRevisao'=>'2020-04-21', diff --git a/database/seeds/ProponenteSeeder.php b/database/seeds/ProponenteSeeder.php index 357c68a0edc9bf33fcbccd2776cd90293283acc0..69615fb25dbf5cec62ecb0014465605bc0f63000 100644 --- a/database/seeds/ProponenteSeeder.php +++ b/database/seeds/ProponenteSeeder.php @@ -30,6 +30,7 @@ class ProponenteSeeder extends Seeder 'bolsistaProdutividade' => '123123123', 'nivel' => '123123123', 'linkLattes' => '123123123', + 'created_at' => '2020-01-01 00:00:00' ]); } diff --git a/resources/views/evento/submeterTrabalho.blade.php b/resources/views/evento/submeterTrabalho.blade.php index af47298afa52bb352ec134a18c89830dac48ad71..eadb0246af76f9a12385fa2bd7b3e3d1d364f6c0 100644 --- a/resources/views/evento/submeterTrabalho.blade.php +++ b/resources/views/evento/submeterTrabalho.blade.php @@ -208,7 +208,7 @@ - + @if($edital->tipo == 'PIBIC' || $edital->tipo == 'PIBIC-EM') {{-- Decisão do CONSU --}}
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 5b244c496eac941af51b682022a496ad621cc192..b525f134c58fcf50df3bede2276ac3265b49e377 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -58,6 +58,9 @@ @else @if(Auth::user()->tipo == 'administrador') + @@ -180,17 +188,38 @@ @endif @if(Auth::user()->tipo == 'proponente') + + + + @endif @if(Auth::user()->tipo == 'participante')