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

funcionalidade submeter edital

parent 381d10f5
......@@ -4,7 +4,7 @@ namespace App;
use Illuminate\Database\Eloquent\Model;
class CoordenadorComite extends Model
class AdministradorResponsavel extends Model
{
public function user(){
return $this->belongsTo('App\User');
......
......@@ -4,9 +4,7 @@ namespace App;
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;
use App\Modalidade;
use App\Atribuicao;
use App\Arquivo;
use App\GrandeArea;
use App\SubArea;
use App\FuncaoParticipantes;
use Carbon\Carbon;
use Auth;
use Illuminate\Http\Request;
......@@ -31,31 +34,18 @@ class TrabalhoController extends Controller
*/
public function index($id)
{
$evento = Evento::find($id);
$areas = Area::where('eventoId', $evento->id)->get();
$areasId = Area::where('eventoId', $evento->id)->select('id')->get();
$revisores = Revisor::where('eventoId', $evento->id)->get();
$modalidades = Modalidade::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);
$edital = Evento::find($id);
$grandeAreas = GrandeArea::all();
$areas = Area::all();
$subAreas = SubArea::all();
$funcaoParticipantes = FuncaoParticipantes::all();
return view('evento.submeterTrabalho',[
'evento' => $evento,
'edital' => $edital,
'grandeAreas' => $grandeAreas,
'areas' => $areas,
'revisores' => $revisores,
'modalidades' => $modalidades,
'areaModalidades' => $areaModalidades,
'trabalhos' => $trabalhos,
'areasEnomes' => $areasEnomes,
'modalidadesIDeNome' => $modalidadesIDeNome,
'subAreas' => $subAreas,
'funcaoParticipantes'=> $funcaoParticipantes
]);
}
......@@ -76,6 +66,7 @@ class TrabalhoController extends Controller
* @return \Illuminate\Http\Response
*/
public function store(Request $request){
dd($request->all());
$mytime = Carbon::now('America/Recife');
$mytime = $mytime->toDateString();
$evento = Evento::find($request->eventoId);
......
......@@ -4,9 +4,10 @@ namespace App;
use Illuminate\Database\Eloquent\Model;
class ProReitor extends Model
class PlanoTrabalho extends Model
{
public function user(){
return $this->belongsTo('App\User');
public function trabalho()
{
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
public function evento(){
return $this->belongsTo('App\Evento', 'eventoId');
}
public function planoTrabalho(){
return $this->hasMany('App\PlanoTrabalho');
}
}
......@@ -82,16 +82,9 @@ class User extends Authenticatable implements MustVerifyEmail
public function Proponentes(){
return $this->hasMany('App\Proponente');
}
public function Reitors(){
return $this->hasMany('App\Reitor');
public function AdministradorResponsavel(){
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){
$this->notify(new recuperacaoSenha($token));
......
......@@ -17,6 +17,19 @@ class CreateTrabalhosTable extends Migration
$table->bigIncrements('id');
$table->timestamps();
$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->date('data')->nullable();
$table->text('resumo')->nullable();
......@@ -26,6 +39,7 @@ class CreateTrabalhosTable extends Migration
$table->integer('areaId');
$table->integer('autorId');
$table->integer('eventoId');
$table->integer('proponente_id');
});
}
......
......@@ -15,11 +15,11 @@ class CreateAreasTable extends Migration
{
Schema::create('areas', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->string('nome');
$table->integer('modalidadeId')->nullable();
$table->integer('eventoId');
$table->timestamps();
// $table->integer('modalidadeId')->nullable();
// $table->integer('eventoId');
});
}
......
......@@ -16,18 +16,18 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------
Schema::table('areas', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos');
});
// Schema::table('areas', function (Blueprint $table) {
// $table->foreign('eventoId')->references('id')->on('eventos');
// });
//------------------------------------------------------------------------
// //------------------------------------------------------------------------
Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas');
});
Schema::table('area_modalidades', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades');
});
// Schema::table('area_modalidades', function (Blueprint $table) {
// $table->foreign('areaId')->references('id')->on('areas');
// });
// Schema::table('area_modalidades', function (Blueprint $table) {
// $table->foreign('modalidadeId')->references('id')->on('modalidades');
// });
//------------------------------------------------------------------------
......@@ -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) {
$table->foreign('coordenadorId')->references('id')->on('users');
});
......@@ -85,9 +83,9 @@ class ChavesEstrangeiras extends Migration
//------------------------------------------------------------------------
Schema::table('pertences', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas');
});
// Schema::table('pertences', function (Blueprint $table) {
// $table->foreign('areaId')->references('id')->on('areas');
// });
Schema::table('pertences', function (Blueprint $table) {
$table->foreign('revisorId')->references('id')->on('users');
});
......@@ -106,9 +104,9 @@ class ChavesEstrangeiras extends Migration
Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('modalidadeId')->references('id')->on('modalidades');
});
Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas');
});
// Schema::table('trabalhos', function (Blueprint $table) {
// $table->foreign('areaId')->references('id')->on('areas');
// });
Schema::table('trabalhos', function (Blueprint $table) {
$table->foreign('autorId')->references('id')->on('users');
});
......@@ -130,9 +128,9 @@ class ChavesEstrangeiras extends Migration
Schema::table('revisors', function (Blueprint $table) {
$table->foreign('eventoId')->references('id')->on('eventos');
});
Schema::table('revisors', function (Blueprint $table) {
$table->foreign('areaId')->references('id')->on('areas');
});
// Schema::table('revisors', function (Blueprint $table) {
// $table->foreign('areaId')->references('id')->on('areas');
// });
Schema::table('eventos',function (Blueprint $table){
$table->foreign('coordComissaoId')->references('id')->on('users');
});
......
......@@ -15,6 +15,19 @@ class CreateProponentesTable extends Migration
{
Schema::create('proponentes', function (Blueprint $table) {
$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();
});
}
......
......@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsersToProReitorsTable extends Migration
class AddTrabalhosToProponentesTable extends Migration
{
/**
* Run the migrations.
......@@ -13,9 +13,9 @@ class AddUsersToProReitorsTable extends Migration
*/
public function up()
{
Schema::table('pro_reitors', function (Blueprint $table) {
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
Schema::table('proponentes', function (Blueprint $table) {
$table->unsignedBigInteger('trabalho_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
});
}
......@@ -26,9 +26,9 @@ class AddUsersToProReitorsTable extends Migration
*/
public function down()
{
Schema::table('pro_reitors', function (Blueprint $table) {
$table->dropForeign('pro_reitors_user_id_foreign');
$table->dropColumn('user_id');
Schema::table('proponentes', function (Blueprint $table) {
$table->dropForeign('proponentes_trabalho_id_foreign');
$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;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCoordenadorComitesTable extends Migration
class CreateAdministradorResponsavelsTable extends Migration
{
/**
* Run the migrations.
......@@ -13,7 +13,7 @@ class CreateCoordenadorComitesTable extends Migration
*/
public function up()
{
Schema::create('coordenador_comites', function (Blueprint $table) {
Schema::create('administrador_responsavels', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
......@@ -26,6 +26,6 @@ class CreateCoordenadorComitesTable extends Migration
*/
public function down()
{
Schema::dropIfExists('coordenador_comites');
Schema::dropIfExists('administrador_responsavels');
}
}
......@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddUsersToCoordenadorComitesTable extends Migration
class AddUsersToAdministradorResponsavelsTable extends Migration
{
/**
* Run the migrations.
......@@ -13,7 +13,7 @@ class AddUsersToCoordenadorComitesTable extends Migration
*/
public function up()
{
Schema::table('coordenador_comites', function (Blueprint $table) {
Schema::table('administrador_responsavels', function (Blueprint $table) {
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
});
......@@ -26,8 +26,8 @@ class AddUsersToCoordenadorComitesTable extends Migration
*/
public function down()
{
Schema::table('coordenador_comites', function (Blueprint $table) {
$table->dropForeign('coordenador_comites_user_id_foreign');
Schema::table('administrador_responsavels', function (Blueprint $table) {
$table->dropForeign('administrador_responsavels_user_id_foreign');
$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