diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..ac748637ae52e837bedc4234dbcad2f82e5187e7 --- /dev/null +++ b/.env.example @@ -0,0 +1,46 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=laravel +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0f7df0fbef7c3ea7cf8299cd2601b54e9de6eb9e --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +/node_modules +/public/hot +/public/storage +/storage/*.key +/vendor +.env +.env.backup +.phpunit.result.cache +Homestead.json +Homestead.yaml +npm-debug.log +yarn-error.log diff --git a/app/Administrador.php b/app/Administrador.php new file mode 100644 index 0000000000000000000000000000000000000000..2100c353e87b637ba8528066a11ee61c7c130de0 --- /dev/null +++ b/app/Administrador.php @@ -0,0 +1,14 @@ +belongsTo('App\User'); + } +} diff --git a/app/AdministradorResponsavel.php b/app/AdministradorResponsavel.php new file mode 100644 index 0000000000000000000000000000000000000000..9768c542a875d3da94740d769cb91b07702787cb --- /dev/null +++ b/app/AdministradorResponsavel.php @@ -0,0 +1,12 @@ +belongsTo('App\User'); + } +} diff --git a/app/Avaliador.php b/app/Avaliador.php new file mode 100644 index 0000000000000000000000000000000000000000..012cfa8bbb0845242b78459c2d6af4b8d3e175cc --- /dev/null +++ b/app/Avaliador.php @@ -0,0 +1,15 @@ +belongsTo('App\User'); + } + public function trabalhos(){ + return $this->belongsToMany('App\Trabalho'); + } +} diff --git a/app/CoordenadorComissao.php b/app/CoordenadorComissao.php new file mode 100644 index 0000000000000000000000000000000000000000..edd4d694aa50e8387bcedafa8135a689d6d6cb9d --- /dev/null +++ b/app/CoordenadorComissao.php @@ -0,0 +1,21 @@ +belongsTo('App\User'); + } + + public function editais(){ + return $this->hasMany('App\Evento'); + } + + public function trabalho(){ + return $this->hasMany('App\Trabalho'); + } + +} diff --git a/app/Evento.php b/app/Evento.php index 0fdba128b3baeb6300325c94231e4417f6aa4e0c..40bc8a01792ed8b1f636b4f9e51e9f173947db24 100644 --- a/app/Evento.php +++ b/app/Evento.php @@ -12,11 +12,10 @@ class Evento extends Model * @var array */ protected $fillable = [ - 'nome', 'descricao', 'tipo', 'dataInicio', 'dataFim', + 'nome', 'descricao', 'tipo', 'inicioSubmissao', 'fimSubmissao', 'inicioRevisao', 'fimRevisao', - 'inicioResultado', 'fimResultado', 'possuiTaxa', 'valorTaxa', 'fotoEvento', - 'enderecoId', 'coordenadorId', - 'numMaxTrabalhos', 'numMaxCoautores', 'hasResumo', + 'resultado', 'coordenadorId', + 'numMaxTrabalhos', 'numMaxCoautores', 'hasResumo', 'criador_id' ]; public function endereco(){ @@ -35,5 +34,9 @@ class Evento extends Model return $this->belongsTo('App\User', 'coordenadorId'); } + public function coordenadorComissao(){ + return $this->belongsTo('App\CoordenadorComissao', 'coordenadorId'); + } + } diff --git a/app/FuncaoParticipantes.php b/app/FuncaoParticipantes.php new file mode 100644 index 0000000000000000000000000000000000000000..e5632fdb1df7b2f15ba89fa4739113cf363b4239 --- /dev/null +++ b/app/FuncaoParticipantes.php @@ -0,0 +1,10 @@ +get(); + return view('administrador.usersAdmin')->with(['users' => $users]); + } + + public function editais(){ + //$admin = Administrador::with('user')->where('user_id', Auth()->user()->id)->first(); + //$eventos = Evento::where('coordenadorId',$admin->id )->get(); + $eventos = Evento::where('criador_id',Auth()->user()->id )->get(); + + return view('administrador.editais', ['eventos'=> $eventos]); + } + + public function create() { + $grandesAreas = GrandeArea::orderBy('nome')->get(); + return view('administrador.novo_user')->with(['grandeAreas' => $grandesAreas]); + } + + public function salvar(Request $request) { + if ($request->tipo != "proponente") { + $validated = $request->validate([ + 'nome' => 'required', + 'tipo' => 'required', + 'email' => 'required|unique:users', + 'senha' => 'required', + 'confirmar_senha' => 'required', + 'cpf' => 'required|cpf|unique:users', + ]); + } else { + $validated = $request->validate([ + 'nome' => 'required', + 'tipo' => 'required', + 'email' => 'required|unique:users', + 'senha' => 'required', + 'confirmar_senha' => 'required', + 'cpf' => 'required|cpf|unique:users', + 'cargo' => 'required', + 'titulacaoMaxima' => 'required', + 'anoTitulacao' => 'required', + 'area' => 'required', + 'bolsistaProdutividade' => 'required', + 'nivel' => 'required', + 'linkLattes' => 'required', + ]); + } + + if (!($request->senha === $request->confirmar_senha)) { + return redirect()->back()->withErrors(['senha' => 'Senhas diferentes']); + } + + $user = new User(); + $user->name = $request->nome; + $user->tipo = $request->tipo; + $user->cpf = $request->cpf; + $user->email = $request->email; + $user->password = bcrypt($request->senha); + $user->save(); + + + switch ($request->tipo) { + case "administradorResponsavel": + $adminResp = new AdministradorResponsavel(); + $adminResp->user_id = $user->id; + $adminResp->save(); + break; + case "avaliador": + $avaliador = new Avaliador(); + $avaliador->user_id = $user->id; + $avaliador->save(); + break; + case "proponente": + $proponente = new Proponente(); + $proponente->SIAPE = $request->SIAPE; + $proponente->cargo = $request->cargo; + $proponente->vinculo = $request->vinculo; + $proponente->titulacaoMaxima = $request->titulacaoMaxima; + $proponente->anoTitulacao = $request->anoTitulacao; + $proponente->grandeArea = $request->area; + $proponente->area = "teste"; + $proponente->subArea = "teste"; + $proponente->bolsistaProdutividade = $request->bolsistaProdutividade; + $proponente->nivel = $request->nivel; + $proponente->linkLattes = $request->linkLattes; + $proponente->user_id = $user->id; + $proponente->save(); + break; + case "participante": + $participante = new Participante(); + $participante->user_id = $user->id; + $participante->save(); + break; + } + + return redirect( route('admin.usuarios') )->with(['mensagem' => 'Usuário cadastrado com sucesso']); + } + + public function edit($id) { + $user = User::find($id); + + $adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first(); + $avaliador = Avaliador::where('user_id', '=', $id)->first(); + $proponente = Proponente::where('user_id', '=', $id)->first(); + $participante = Participante::where('user_id', '=', $id)->first(); + + return view ('administrador.editar_user')->with(['user' => $user, + 'adminResp' => $adminResp, + 'proponente' => $proponente, + 'participante' => $participante,]); + } + + public function update(Request $request, $id) { + $user = User::find($id); + + if ($request->tipo != "proponente") { + $validated = $request->validate([ + 'nome' => 'required', + 'tipo' => 'required', + 'email' => 'required', + // 'senha' => 'required', + // 'confirmar_senha' => 'required', + 'cpf' => 'required|cpf', + ]); + } else { + $validated = $request->validate([ + 'nome' => 'required', + 'tipo' => 'required', + 'email' => 'required', + // 'senha' => 'required', + // 'confirmar_senha' => 'required', + 'cpf' => 'required|cpf', + 'cargo' => 'required', + 'titulacaoMaxima' => 'required', + 'anoTitulacao' => 'required', + 'grandeArea' => 'required', + 'bolsistaProdutividade' => 'required', + 'nivel' => 'required', + 'linkLattes' => 'required', + ]); + } + + // if (!(Hash::check($request->senha_atual, $user->password))) { + // return redirect()->back()->withErrors(['senha_atual' => 'Senha atual não correspondente']); + // } + + // if (!($request->nova_senha === $request->confirmar_senha)) { + // return redirect()->back()->withErrors(['nova_senha' => 'Senhas diferentes']); + // } + + switch ($request->tipo) { + case "administradorResponsavel": + $adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first(); + $adminResp->user_id = $user->id; + $adminResp->update(); + break; + case "avaliador": + $avaliador = Avaliador::where('user_id', '=', $id)->first(); + $avaliador->user_id = $user->id; + $avaliador->update(); + break; + case "proponente": + $proponente = Proponente::where('user_id', '=', $id)->first(); + $proponente->SIAPE = $request->SIAPE; + $proponente->cargo = $request->cargo; + $proponente->vinculo = $request->vinculo; + $proponente->titulacaoMaxima = $request->titulacaoMaxima; + $proponente->anoTitulacao = $request->anoTitulacao; + $proponente->grandeArea = $request->grandeArea; + $proponente->area = "teste"; + $proponente->subArea = "teste"; + $proponente->bolsistaProdutividade = $request->bolsistaProdutividade; + $proponente->nivel = $request->nivel; + $proponente->linkLattes = $request->linkLattes; + $proponente->user_id = $user->id; + $proponente->update(); + break; + case "participante": + $participante = Participante::where('user_id', '=', $id)->first(); + $participante->user_id = $user->id; + $participante->update(); + break; + } + + $user->name = $request->nome; + $user->tipo = $request->tipo; + $user->email = $request->email; + $user->cpf = $request->cpf; + // $user->password = bcrypt($request->nova_senha); + $user->update(); + + + + return redirect( route('admin.usuarios') )->with(['mensagem' => 'Usuário atualizado com sucesso']); + } + + public function destroy($id) { + $user = User::find($id); + + $adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first(); + $avaliador = Avaliador::where('user_id', '=', $id)->first(); + $proponente = Proponente::where('user_id', '=', $id)->first(); + $participante = Participante::where('user_id', '=', $id)->first(); + + if (!(is_null($adminResp))) { + $adminResp->delete(); + } else if (!(is_null($avaliador))) { + $avaliador->delete(); + } else if (!(is_null($proponente))) { + $proponente->delete(); + } else if (!(is_null($participante))) { + $participante->delete(); + } + + $user->delete(); + return redirect( route('admin.usuarios') )->with(['mensagem' => 'Usuário deletado com sucesso']); + } +} diff --git a/app/Http/Controllers/AdministradorResponsavelController.php b/app/Http/Controllers/AdministradorResponsavelController.php new file mode 100644 index 0000000000000000000000000000000000000000..7c6d89e6b34eddfe0e01af8ee250d58395f0b7ed --- /dev/null +++ b/app/Http/Controllers/AdministradorResponsavelController.php @@ -0,0 +1,78 @@ +where('user_id', Auth()->user()->id)->first(); + $eventos = Evento::where('criador_id',Auth()->user()->id )->get(); + + return view('administradorResponsavel.editais', ['eventos'=> $eventos]); + } + public function usuarios(){ + + return view('administradorResponsavel.usuarios'); + } + + public function atribuirPermissao(Request $request){ + + + $user = User::where('id', $request->user_id)->first(); + $isAvaliador = Avaliador::where('user_id', $request->user_id )->count(); + $avaliador = new Avaliador(); + $avaliador->save(); + if($isAvaliador == 0){ + + //$user->avaliadors()->save($user); + $avaliador->user()->associate($user); // um avaliador tem um usuario + $avaliador->save(); + //$user->avaliadors()->save($avaliador); //um usuario pode ter muitos avaliadores + //$user->save(); + //$avaliador->user_id = $user->id; + $success = true; + + }else{ + $avaliador = Avaliador::where('user_id', $request->user_id )->first(); + $avaliador->user()->dissociate($user); // um avaliador tem um usuario + $avaliador->save(); + $success = false; + } + + return response()->json( $success ); + + } + public function verPermissao(Request $request){ + + $user = User::where('id', $request->user_id)->first(); + $isAvaliador = Avaliador::where('user_id', $request->user_id)->count(); + + if($isAvaliador != 0){ + + $success = true; + + }else{ + + $success = false; + } + + + + return response()->json( [$success] ); + //return response()->json( $request->user_id ); + + } + + +} diff --git a/app/Http/Controllers/AreaController.php b/app/Http/Controllers/AreaController.php index 6c7eb5cae2b45f8cf4ac574abfda71a0cfcb3a93..bd837d5c0003ee37b5b2b474d2a048cc3b6b0d25 100644 --- a/app/Http/Controllers/AreaController.php +++ b/app/Http/Controllers/AreaController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers; use App\Area; +use App\GrandeArea; +use App\SubArea; use App\AreaModalidade; use App\Pertence; use App\Revisor; @@ -18,7 +20,8 @@ class AreaController extends Controller */ public function index() { - // + $areas = Area::orderBy('nome')->get(); + return view('naturezas.area.index')->with(['areas' => $areas]); } /** @@ -26,9 +29,9 @@ class AreaController extends Controller * * @return \Illuminate\Http\Response */ - public function create() + public function create($grandeAreaid) { - // + return view('naturezas.area.nova_area')->with(['grandeAreaId' => $grandeAreaid]); } /** @@ -37,18 +40,18 @@ class AreaController extends Controller * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function store(Request $request) + public function store(Request $request, $id) { $validatedData = $request->validate([ - 'nome' => ['required', 'string'], + 'nome' => 'required', ]); - Area::create([ - 'nome' => $request->nome, - 'eventoId' => $request->eventoId, - ]); + $area = new Area(); + $area->nome = $request->nome; + $area->grande_area_id = $id; + $area->save(); - return redirect()->route('coord.detalhesEvento', ['eventoId' => $request->eventoId]); + return redirect( route('grandearea.show', ['id' => $id]) )->with(['mensagem' => 'Nova área cadastrada com sucesso']); } /** @@ -57,9 +60,12 @@ class AreaController extends Controller * @param \App\Area $area * @return \Illuminate\Http\Response */ - public function show(Area $area) + public function show($id) { - // + $area = Area::find($id); + $subAreas = SubArea::where('area_id', '=', $id)->orderBy('nome')->get(); + + return view('naturezas.area.detalhes')->with(['area' => $area, 'subAreas' => $subAreas]); } /** @@ -68,9 +74,10 @@ class AreaController extends Controller * @param \App\Area $area * @return \Illuminate\Http\Response */ - public function edit(Area $area) + public function edit($id) { - // + $area = Area::find($id); + return view('naturezas.area.editar_area')->with(['area' => $area]); } /** @@ -80,9 +87,18 @@ class AreaController extends Controller * @param \App\Area $area * @return \Illuminate\Http\Response */ - public function update(Request $request, Area $area) + public function update(Request $request, $id) { - // + $validated = $request->validate([ + 'nome' => 'required', + ]); + + $area = Area::find($id); + $grandeArea = GrandeArea::find($area->grande_area_id); + $area->nome = $request->nome; + $area->update(); + + return redirect( route('grandearea.show', ['id' => $area->grande_area_id]) )->with(['grandeArea' => $grandeArea,'mensagem' => 'Área atualizada com sucesso']); } /** @@ -94,26 +110,11 @@ class AreaController extends Controller public function destroy($id) { $area = Area::find($id); - $area_modalidade = AreaModalidade::where('areaId', $id); - $pertence = Pertence::where('areaId', $id); - $revisores = Revisor::where('areaId', $id); - $trabalhos = Trabalho::where('areaId', $id); - - if(isset($area_modalidade)){ - $area_modalidade->delete(); - } - if(isset($pertence)){ - $pertence->delete(); - } - if(isset($revisores)){ - $revisores->delete(); - } - if(isset($trabalhos)){ - $trabalhos->delete(); - } - + $id = $area->grande_area_id; $area->delete(); + //ver a questão de chave estrangeira para a tabela sub-áreas - return redirect()->back(); + $grandeArea = GrandeArea::find($id); + return redirect( route('grandearea.show', ['id' => $id]) )->with(['grandeArea' => $grandeArea,'mensagem' => 'Área deletada com sucesso']); } } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index ea412c323ddb6aa8e851b89be95e9865e8582bc6..75a480e0801182bb5e2e3629c4dfce0b27318193 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -9,7 +9,9 @@ use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use App\User; +use App\Participante; use App\Endereco; + class RegisterController extends Controller { /* @@ -98,10 +100,14 @@ class RegisterController extends Controller $user->cpf = $data['cpf']; $user->celular = $data['celular']; $user->instituicao = $data['instituicao']; + $user->tipo = 'participante'; $user->enderecoId = $end->id; $user->save(); + $participante = new Participante(); + $user->participantes()->save($participante); + return $user; } } diff --git a/app/Http/Controllers/CoordenadorComissaoController.php b/app/Http/Controllers/CoordenadorComissaoController.php new file mode 100644 index 0000000000000000000000000000000000000000..ef1d5d6fb36086f4c641c2a47ac16a87b6625502 --- /dev/null +++ b/app/Http/Controllers/CoordenadorComissaoController.php @@ -0,0 +1,54 @@ +where('user_id', Auth()->user()->id)->first(); + $eventos = Evento::where('coordenadorId',$coordenador->id )->get(); + + + return view('coordenadorComissao.editais', ['eventos'=> $eventos]); + } + public function coordenadorComite(){ + + $usuarios = CoordenadorComissao::all(); + + return view('coordenadorComissao.listarUsuarios', ['usuarios' => $usuarios]); + } + public function avaliador(){ + $usuarios = Avaliador::all(); + + return view('coordenadorComissao.listarUsuarios', ['usuarios' => $usuarios]); + } + public function proponente(){ + $usuarios = Proponente::all(); + + return view('coordenadorComissao.listarUsuarios', ['usuarios' => $usuarios]); + } + public function participante(){ + $usuarios = Participante::all(); + + return view('coordenadorComissao.listarUsuarios', ['usuarios' => $usuarios]); + } +} diff --git a/app/Http/Controllers/EventoController.php b/app/Http/Controllers/EventoController.php index 64d566540a0ea05d78d9bba0b79ba35288b1661b..f4ec941195febdb66cd6eab35865b88aa6080c87 100644 --- a/app/Http/Controllers/EventoController.php +++ b/app/Http/Controllers/EventoController.php @@ -11,8 +11,10 @@ use App\Atribuicao; use App\Modalidade; use App\ComissaoEvento; use App\User; +use App\Proponente; use App\Trabalho; use App\AreaModalidade; +use App\CoordenadorComissao; use Illuminate\Http\Request; use Carbon\Carbon; use Illuminate\Support\Facades\Storage; @@ -36,6 +38,17 @@ class EventoController extends Controller } + public function listar() + { + // + $eventos = Evento::all(); + // $comissaoEvento = ComissaoEvento::all(); + // $eventos = Evento::where('coordenadorId', Auth::user()->id)->get(); + + return view('evento.listarEvento',['eventos'=>$eventos]); + + } + /** * Show the form for creating a new resource. * @@ -43,8 +56,8 @@ class EventoController extends Controller */ public function create() { - // - return view('evento.criarEvento'); + $coordenadors = CoordenadorComissao::with('user')->get(); + return view('evento.criarEvento', ['coordenadors' => $coordenadors]); } /** @@ -59,106 +72,64 @@ class EventoController extends Controller $mytime = Carbon::now('America/Recife'); $yesterday = Carbon::yesterday('America/Recife'); $yesterday = $yesterday->toDateString(); + //$admResponsavel = AdministradorResponsavel::with('user')->where('user_id', Auth()->user()->id)->first(); + $user_id = Auth()->user()->id; - // dd($request); + //dd($user_id); // validar datas nulas antes, pois pode gerar um bug if( - $request->dataInicio == null || - $request->dataFim == null || $request->inicioSubmissao == null || $request->fimSubmissao == null || $request->inicioRevisao == null || $request->fimRevisao == null || - $request->inicioResultado == null || - $request->fimResultado == null + $request->resultado == null + ){ $validatedData = $request->validate([ 'nome' => ['required', 'string'], - // 'numeroParticipantes' => ['required', 'integer', 'gt:0'], 'descricao' => ['required', 'string'], - 'tipo' => ['required', 'string'], - 'dataInicio' => ['required', 'date','after:'. $yesterday], - 'dataFim' => ['required', 'date'], + 'tipo' => ['required', 'string'], 'inicioSubmissao' => ['required', 'date'], 'fimSubmissao' => ['required', 'date'], 'inicioRevisao' => ['required', 'date'], 'fimRevisao' => ['required', 'date'], - 'inicioResultado' => ['required', 'date'], - 'fimResultado' => ['required', 'date'], - // 'valorTaxa' => ['required', 'integer'], - 'fotoEvento' => ['file', 'mimes:png'], + 'resultado' => ['required', 'date'], + 'pdfEdital' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'modeloDocumento' => ['required', 'file', 'mimes:zip,doc,docx,odt,pdf', 'max:2000000'], ]); } // validacao normal $validatedData = $request->validate([ - 'nome' => ['required', 'string'], - // 'numeroParticipantes' => ['required', 'integer', 'gt:0'], + 'nome' => ['required', 'string'], 'descricao' => ['required', 'string'], 'tipo' => ['required', 'string'], - 'dataInicio' => ['required', 'date', 'after:' . $yesterday], - 'dataFim' => ['required', 'date', 'after:' . $request->dataInicio], 'inicioSubmissao' => ['required', 'date', 'after:' . $yesterday], 'fimSubmissao' => ['required', 'date', 'after:' . $request->inicioSubmissao], 'inicioRevisao' => ['required', 'date', 'after:' . $yesterday], 'fimRevisao' => ['required', 'date', 'after:' . $request->inicioRevisao], - 'inicioResultado' => ['required', 'date', 'after:' . $yesterday], - 'fimResultado' => ['required', 'date', 'after:' . $request->inicioResultado], - // 'valorTaxa' => ['required', 'integer'], - 'fotoEvento' => ['file', 'mimes:png'], - ]); - - // validar endereco - - $validatedData = $request->validate([ - 'rua' => ['required', 'string'], - 'numero' => ['required', 'string'], - 'bairro' => ['required', 'string'], - 'cidade' => ['required', 'string'], - 'uf' => ['required', 'string'], - 'cep' => ['required', 'string'], - ]); - - $endereco = Endereco::create([ - 'rua' => $request->rua, - 'numero' => $request->numero, - 'bairro' => $request->bairro, - 'cidade' => $request->cidade, - 'uf' => $request->uf, - 'cep' => $request->cep, + 'resultado' => ['required', 'date', 'after:' . $yesterday], + 'pdfEdital' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'modeloDocumento' => ['required', 'file', 'mimes:zip,doc,docx,odt,pdf', 'max:2000000'], ]); $evento = Evento::create([ 'nome' => $request->nome, - // 'numeroParticipantes' => $request->numeroParticipantes, 'descricao' => $request->descricao, 'tipo' => $request->tipo, - 'dataInicio' => $request->dataInicio, - 'dataFim' => $request->dataFim, 'inicioSubmissao' => $request->inicioSubmissao, 'fimSubmissao' => $request->fimSubmissao, 'inicioRevisao' => $request->inicioRevisao, 'fimRevisao' => $request->fimRevisao, - 'inicioResultado' => $request->inicioResultado, - 'fimResultado' => $request->fimResultado, - // 'possuiTaxa' => $request->possuiTaxa, - // 'valorTaxa' => $request->valorTaxa, - 'enderecoId' => $endereco->id, - 'coordenadorId' => Auth::user()->id, + 'resultado' => $request->resultado, + 'coordenadorId' => $request->coordenador_id, + 'criador_id' => $user_id, ]); - - // se o evento tem foto - - if($request->fotoEvento != null){ - $file = $request->fotoEvento; - $path = 'public/eventos/' . $evento->id; - $nome = '/logo.png'; - Storage::putFileAs($path, $file, $nome); - $evento->fotoEvento = $path . $nome; - $evento->save(); - } + //dd($evento); + // $user = User::find($request->coordenador_id); + // $user->coordenadorComissao()->editais()->save($evento); // se vou me tornar coordenador do Evento @@ -167,13 +138,29 @@ class EventoController extends Controller // $evento->save(); // } - $evento->coordenadorId = Auth::user()->id; + //$evento->coordenadorId = Auth::user()->id; + + $pdfEdital = $request->pdfEdital; + $path = 'pdfEdital/' . $evento->id . '/'; + $nome = "edital.pdf"; + Storage::putFileAs($path, $pdfEdital, $nome); + $evento->pdfEdital = $path . $nome; + + $modeloDocumento = $request->modeloDocumento; + $extension = $modeloDocumento->extension(); + $path = 'modeloDocumento/' . $evento->id . '/'; + $nome = "modelo" . "." . $extension; + Storage::putFileAs($path, $modeloDocumento, $nome); + + $evento->modeloDocumento = $path . $nome; + + $evento->save(); - $user = Auth::user(); - $subject = "Evento Criado"; - Mail::to($user->email) - ->send(new EventoCriado($user, $subject)); + // $user = Auth::user(); + // $subject = "Evento Criado"; + // Mail::to($user->email) + // ->send(new EventoCriado($user, $subject)); return redirect()->route('coord.home'); } @@ -187,32 +174,43 @@ class EventoController extends Controller public function show($id) { $evento = Evento::find($id); - $hasTrabalho = false; - $hasTrabalhoCoautor = false; - $hasFile = false; - $trabalhos = Trabalho::where('autorId', Auth::user()->id)->get(); - $trabalhosCount = Trabalho::where('autorId', Auth::user()->id)->count(); - $trabalhosId = Trabalho::where('eventoId', $evento->id)->select('id')->get(); - $trabalhosIdCoautor = Coautor::whereIn('trabalhoId', $trabalhosId)->where('autorId', Auth::user()->id)->select('trabalhoId')->get(); - $coautorCount = Coautor::whereIn('trabalhoId', $trabalhosId)->where('autorId', Auth::user()->id)->count(); - $trabalhosCoautor = Trabalho::whereIn('id', $trabalhosIdCoautor)->get(); - if($trabalhosCount != 0){ - $hasTrabalho = true; - $hasFile = true; - } - if($coautorCount != 0){ - $hasTrabalhoCoautor = true; - $hasFile = true; + $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($coautorCount != 0){ + // $hasTrabalhoCoautor = true; + // $hasFile = true; + // } $mytime = Carbon::now('America/Recife'); // dd(false); return view('evento.visualizarEvento', [ 'evento' => $evento, 'trabalhos' => $trabalhos, - 'trabalhosCoautor' => $trabalhosCoautor, + // 'trabalhosCoautor' => $trabalhosCoautor, 'hasTrabalho' => $hasTrabalho, - 'hasTrabalhoCoautor' => $hasTrabalhoCoautor, + // 'hasTrabalhoCoautor' => $hasTrabalhoCoautor, 'hasFile' => $hasFile, 'mytime' => $mytime ]); @@ -249,9 +247,8 @@ class EventoController extends Controller public function edit($id) { // dd($id); - $evento = Evento::find($id); - $endereco = Endereco::find($evento->enderecoId); - return view('evento.editarEvento',['evento'=>$evento,'endereco'=>$endereco]); + $evento = Evento::find($id); + return view('evento.editarEvento',['evento'=>$evento]); } /** @@ -263,33 +260,35 @@ class EventoController extends Controller */ public function update(Request $request, $id) { - $evento = Evento::find($id); - $endereco = Endereco::find($evento->enderecoId); + //dd($request); + $evento = Evento::find($id); - $evento->nome = $request->nome; - // $evento->numeroParticipantes = $request->numeroParticipantes; + $evento->nome = $request->nome; $evento->descricao = $request->descricao; - $evento->tipo = $request->tipo; - $evento->dataInicio = $request->dataInicio; - $evento->dataFim = $request->dataFim; + $evento->tipo = $request->tipo; $evento->inicioSubmissao = $request->inicioSubmissao; $evento->fimSubmissao = $request->fimSubmissao; $evento->inicioRevisao = $request->inicioRevisao; $evento->fimRevisao = $request->fimRevisao; - $evento->inicioResultado = $request->inicioResultado; - $evento->fimResultado = $request->fimResultado; - // $evento->possuiTaxa = $request->possuiTaxa; - // $evento->valorTaxa = $request->valorTaxa; - $evento->enderecoId = $endereco->id; - $evento->save(); + $evento->resultado = $request->resultado; + + if($request->pdfEdital != null){ + $pdfEdital = $request->pdfEdital; + $path = 'pdfEdital/' . $evento->id . '/'; + $nome = "edital.pdf"; + Storage::putFileAs($path, $pdfEdital, $nome); + } + + if($request->modeloDocumento != null){ + $modeloDocumento = $request->modeloDocumento; + $extension = $modeloDocumento->extension(); + $path = 'modeloDocumento/' . $evento->id . '/'; + $nome = "modelo" . "." . $extension; + Storage::putFileAs($path, $modeloDocumento, $nome); + $evento->modeloDocumento = $path . $nome; + } - $endereco->rua = $request->rua; - $endereco->numero = $request->numero; - $endereco->bairro = $request->bairro; - $endereco->cidade = $request->cidade; - $endereco->uf = $request->uf; - $endereco->cep = $request->cep; - $endereco->save(); + $evento->save(); $eventos = Evento::all(); return view('coordenador.home',['eventos'=>$eventos]); @@ -304,7 +303,6 @@ class EventoController extends Controller public function destroy($id) { $evento = Evento::find($id); - $endereco = Endereco::find($evento->enderecoId); $areas = Area::where('eventoId', $id); $atividades = Atividade::where('eventoId', $id); @@ -328,8 +326,10 @@ class EventoController extends Controller $trabalhos->delete(); } + Storage::deleteDirectory('pdfEdital/' . $evento->id ); + Storage::deleteDirectory('modeloDocumento/' . $evento->id); + $evento->delete(); - $endereco->delete(); return redirect()->back(); } diff --git a/app/Http/Controllers/GrandeAreaController.php b/app/Http/Controllers/GrandeAreaController.php new file mode 100644 index 0000000000000000000000000000000000000000..66126253066503b0e95d2f50273bb59f6eb5b45f --- /dev/null +++ b/app/Http/Controllers/GrandeAreaController.php @@ -0,0 +1,106 @@ +get(); + return view('naturezas.grandeArea.index')->with(['grandesAreas' => $grandesAreas]); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create() + { + return view('naturezas.grandeArea.nova_grande_area'); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request) + { + $validatedData = $request->validate([ + 'nome' => 'required', + ]); + + $GrandeArea = new GrandeArea(); + $GrandeArea->nome = $request->nome; + $GrandeArea->save(); + + return redirect( route('grandearea.index') )->with(['mensagem' => 'Área cadastrada com sucesso']); + } + + /** + * Display the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function show($id) + { + $grandeArea = GrandeArea::find($id); + $areas = Area::where('grande_area_id', '=', $id)->orderBy('nome')->get(); + + return view('naturezas.grandeArea.detalhes')->with(['grandeArea' => $grandeArea, 'areas' => $areas]); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $grandeArea = GrandeArea::find($id); + return view('naturezas.grandeArea.editar_grande_area')->with(['grandeArea' => $grandeArea]); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $grandeArea = GrandeArea::find($id); + $grandeArea->nome = $request->nome; + $grandeArea->update(); + + return redirect( route('grandearea.index') )->with(['mensagem' => 'Área editada com sucesso']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + $grandeArea = GrandeArea::find($id); + $grandeArea->delete(); + + return redirect( route('grandearea.index') )->with(['mensagem' => 'Área excluida com sucesso']); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index d31c45e7b133cd53bce104eabdc90bcf3b012331..2c2f07d1a6837acbe0122e50859a07e910d5fbf7 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -3,6 +3,8 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Auth; +use Illuminate\Support\Facades\Log; class HomeController extends Controller { @@ -13,7 +15,7 @@ class HomeController extends Controller */ public function __construct() { - $this->middleware(['auth','verified']); + $this->middleware(['auth']); } /** @@ -22,8 +24,27 @@ class HomeController extends Controller * @return \Illuminate\Contracts\Support\Renderable */ public function index() - { - return view('home'); + { + $eventos = \App\Evento::all(); + if(Auth::check()){ + if(Auth::user()->tipo == 'administrador'){ + return view('administrador.index'); + } + else if (Auth::user()->tipo == 'administradorResponsavel') { + return view('administradorResponsavel.index'); + } + else if (Auth::user()->tipo == 'coordenador') { + return view('coordenadorComissao.index'); + } + else if (Auth::user()->tipo == 'proponente') { + return view('proponente.index'); + } + else if (Auth::user()->tipo == 'participante') { + return view('participante.index'); + } + } + Log::debug('HomeController'); + return view('index', ['eventos' => $eventos]); } public function downloadArquivo(Request $request){ diff --git a/app/Http/Controllers/ProponenteController.php b/app/Http/Controllers/ProponenteController.php new file mode 100644 index 0000000000000000000000000000000000000000..186900a4ace8c76d3fc726e95baecfff990ace28 --- /dev/null +++ b/app/Http/Controllers/ProponenteController.php @@ -0,0 +1,10 @@ +get(); + return view('naturezas.subArea.index')->with(['subAreas' => $subAreas]); + } + + /** + * Show the form for creating a new resource. + * + * @return \Illuminate\Http\Response + */ + public function create($areaId) + { + return view('naturezas.subArea.nova_subarea')->with(['areaId' => $areaId]); + } + + /** + * Store a newly created resource in storage. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\Response + */ + public function store(Request $request, $id) + { + $validated = $request->validate([ + 'nome' => 'required', + ]); + + $subarea = new SubArea(); + $subarea->nome = $request->nome; + $subarea->area_id = $id; + $subarea->save(); + + return redirect( route('area.show', ['id' => $id]) )->with(['mensagem' => 'Subárea cadastrada com sucesso']); + } + + /** + * Display the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function show($id) + { + // + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + $subarea = SubArea::find($id); + return view('naturezas.subArea.editar_subarea')->with(['subarea' => $subarea]); + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + $validated = $request->validate([ + 'nome' => 'required', + ]); + + $subarea = SubArea::find($id); + $subarea->nome = $request->nome; + $subarea->update(); + + return redirect( route('area.show', ['id' => $subarea->area_id]) )->with(['mensagem' => 'Subárea atualizada com sucesso']); + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + $subarea = SubArea::find($id); + $areaId = $subarea->area_id; + $subarea->delete(); + + return redirect( route('area.show', ['id' => $areaId]) )->with(['mensagem' => 'Subárea deletada com sucesso']); + } +} diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index b5a9756a5861a900c8ec344bc57cb0242ef0abd4..86a2a472e3c4ea1f02ffef8bd05b6ff452735838 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -5,13 +5,19 @@ 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; use App\Modalidade; use App\Atribuicao; use App\Arquivo; +use App\GrandeArea; +use App\SubArea; +use App\FuncaoParticipantes; +use App\Participante; use Carbon\Carbon; use Auth; use Illuminate\Http\Request; @@ -31,31 +37,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, - 'areas' => $areas, - 'revisores' => $revisores, - 'modalidades' => $modalidades, - 'areaModalidades' => $areaModalidades, - 'trabalhos' => $trabalhos, - 'areasEnomes' => $areasEnomes, - 'modalidadesIDeNome' => $modalidadesIDeNome, + 'edital' => $edital, + 'grandeAreas' => $grandeAreas, + 'areas' => $areas, + 'subAreas' => $subAreas, + 'funcaoParticipantes'=> $funcaoParticipantes + ]); } @@ -76,104 +69,193 @@ 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); + $evento = Evento::find($request->editalId); + $coordenador = CoordenadorComissao::find($evento->coordenadorId); + //dd($coordenador->id); + if($evento->inicioSubmissao > $mytime){ if($mytime >= $evento->fimSubmissao){ return redirect()->route('home'); } } - $validatedData = $request->validate([ - 'nomeTrabalho' => ['required', 'string',], - 'areaId' => ['required', 'integer'], - 'modalidadeId' => ['required', 'integer'], - 'eventoId' => ['required', 'integer'], - 'resumo' => ['nullable','string'], - 'nomeCoautor.*' => ['string'], - 'emailCoautor.*' => ['string'], - 'arquivo' => ['required', 'file', 'mimes:pdf', 'max:2000000'], - ]); + + //O anexo de Decisão do CONSU dependo do tipo de edital + if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){ + $validatedData = $request->validate([ + 'editalId' => ['required', 'integer'], + 'nomeProjeto' => ['required', 'string'], + 'grandeAreaId' => ['required', 'integer'], + 'areaId' => ['required', 'integer'], + 'subAreaId' => ['required', 'integer'], + 'pontuacaoPlanilha' => ['required', 'integer'], + 'linkGrupo' => ['required', 'string'], + 'linkLattesEstudante' => ['required', 'string'], + 'nomeParticipante.*' => ['required', 'string'], + 'emailParticipante.*' => ['string'], + 'nomePlanoTrabalho.*' => ['string'], + 'anexoProjeto' => ['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'], + ]); - $autor = Auth::user(); - $trabalhosDoAutor = Trabalho::where('eventoId', $request->eventoId)->where('autorId', Auth::user()->id)->count(); - $areaModalidade = AreaModalidade::where('areaId', $request->areaId)->where('modalidadeId', $request->modalidadeId)->first(); - Log::debug('Numero de trabalhos' . $evento); - if($trabalhosDoAutor >= $evento->numMaxTrabalhos){ - return redirect()->back()->withErrors(['numeroMax' => 'Número máximo de trabalhos permitidos atingido.']); - } + $trabalho = Trabalho::create([ + 'titulo' => $request->nomeProjeto, + 'coordenador_id' => $coordenador->id, + 'grande_area_id' => $request->grandeAreaId, + 'area_id' => $request->areaId, + 'sub_area_id' => $request->subAreaId, + 'pontuacaoPlanilha' => $request->pontuacaoPlanilha, + 'linkGrupoPesquisa' => $request->linkGrupo, + 'linkLattesEstudante' => $request->linkLattesEstudante, + 'data' => $mytime, + 'evento_id' => $request->editalId, + 'avaliado' => 0, + //Anexos + 'anexoDecisaoCONSU' => $request->anexoCONSU, + 'anexoProjeto' => $request->anexoProjeto, + 'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica, + '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([ + 'editalId' => ['required', 'integer'], + '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'], + 'anexoLatterCoordenador' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoPlanilha' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + 'anexoPlanoTrabalho.*' => ['required', 'file', 'mimes:pdf', 'max:2000000'], + ]); + + $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, + 'pontuacaoPlanilha' => $request->pontuacaoPlanilha, + 'linkGrupoPesquisa' => $request->linkGrupo, + 'linkLattesEstudante' => $request->linkLattesEstudante, + 'data' => $mytime, + 'evento_id' => $request->editalId, + 'avaliado' => 0, + //Anexos + 'anexoProjeto' => $request->anexoProjeto, + 'anexoAutorizacaoComiteEtica' => $request->anexoComiteEtica, + 'anexoLattesCoordenador' => $request->anexoLatterCoordenador, + 'anexoPlanilhaPontuacao' => $request->anexoPlanilha, + ]); - if($request->emailCoautor != null){ - $i = 0; - foreach ($request->emailCoautor as $key) { - $i++; - } - if($i > $evento->numMaxCoautores){ - return redirect()->back()->withErrors(['numeroMax' => 'Número de coautores deve ser menor igual a '.$evento->numMaxCoautores]); - } } - if($request->emailCoautor != null){ - $i = 0; - foreach ($request->emailCoautor as $key) { - $userCoautor = User::where('email', $key)->first(); - if($userCoautor == null){ + //Relaciona o projeto criado com o proponente que criou o projeto + $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){ + + foreach ($request->emailParticipante as $key => $value) { + + $userParticipante = User::where('email', $value)->first(); + + if($userParticipante == null){ + $passwordTemporario = Str::random(8); - Mail::to($key)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Coautor', $evento->nome, $passwordTemporario)); + Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario)); $usuario = User::create([ - 'email' => $key, + 'email' => $value, 'password' => bcrypt($passwordTemporario), 'usuarioTemp' => true, - 'name' => $request->nomeCoautor[$i], + 'name' => $request->nomeParticipante[$key], + 'tipo' => 'participante', + 'funcao_participante_id' => $request->funcaoParticipante[$key], ]); + + $participante = $usuario->participantes()->create([ + 'trabalho_id' => $trabalho->id, + ]); + + $participante->trabalhos()->save($trabalho); + }else{ + + $subject = "Participante de Projeto"; + $email = $value; + Mail::to($email) + ->send(new SubmissaoTrabalho($userParticipante, $subject)); } - $i++; } } + + $anexos = array( + $request->anexoCONSU, + $request->anexoProjeto, + $request->anexoComiteEtica, + $request->anexoLatterCoordenador, + $request->anexoPlanilha, + ); - $trabalho = Trabalho::create([ - 'titulo' => $request->nomeTrabalho, - 'modalidadeId' => $areaModalidade->modalidade->id, - 'areaId' => $areaModalidade->area->id, - 'autorId' => $autor->id, - 'eventoId' => $evento->id, - 'avaliado' => 'nao' - ]); + foreach ($anexos as $key => $value) { + + $file = $value; + $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; + $nome = "1.pdf"; + Storage::putFileAs($path, $file, $nome); + + $arquivo = Arquivo::create([ + 'nome' => $path . $nome, + 'trabalhoId' => $trabalho->id, + 'data' => $mytime, + 'versaoFinal' => true, + ]); + + } + + if($request->anexoPlanoTrabalho != null){ + foreach ($request->anexoPlanoTrabalho as $key => $value) { + + $file = $value; + $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; + $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + Storage::putFileAs($path, $file, $nome); - if($request->emailCoautor != null){ - foreach ($request->emailCoautor as $key) { - $userCoautor = User::where('email', $key)->first(); - Coautor::create([ - 'ordem' => '-', - 'autorId' => $userCoautor->id, + $arquivo = Arquivo::create([ + 'nome' => $path . $nome, 'trabalhoId' => $trabalho->id, + 'data' => $mytime, + 'versaoFinal' => true, ]); + } } - $file = $request->arquivo; - $path = 'trabalhos/' . $request->eventoId . '/' . $trabalho->id .'/'; - $nome = "1.pdf"; - Storage::putFileAs($path, $file, $nome); + //dd($trabalho); - $arquivo = Arquivo::create([ - 'nome' => $path . $nome, - 'trabalhoId' => $trabalho->id, - 'versaoFinal' => true, - ]); $subject = "Submissão de Trabalho"; + $autor = Auth()->user(); Mail::to($autor->email) ->send(new SubmissaoTrabalho($autor, $subject)); - if($request->emailCoautor != null){ - foreach ($request->emailCoautor as $key) { - $userCoautor = User::where('email', $key)->first(); - Mail::to($userCoautor->email) - ->send(new SubmissaoTrabalho($userCoautor, $subject)); - } - } - - return redirect()->route('evento.visualizar',['id'=>$request->eventoId]); + + return redirect()->route('evento.visualizar',['id'=>$request->editalId]); } /** diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 47a5651a8e81d01a4ee20ff73acefdca0f5f580a..c28ad4015cc9d9d1394510a8b9c2fb2b184b036f 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -6,13 +6,32 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; use App\User; +use App\AdministradorResponsavel; +use App\Avaliador; +use App\Proponente; +use App\Participante; use App\Endereco; use App\Trabalho; use App\Coautor; +use App\Evento; +use Illuminate\Support\Facades\Log; class UserController extends Controller { - // + + public function index() + { + $eventos = Evento::all(); + if(Auth::check()){ + Log::debug('UserController check'); + return redirect()->route('home'); + } + Log::debug('UserController index'); + return view('index', ['eventos' => $eventos]); + //return view('auth.login'); + } + + function perfil(){ $user = User::find(Auth::user()->id); $end = $user->endereco; @@ -93,9 +112,29 @@ class UserController extends Controller public function meusTrabalhos(){ - $trabalhos = Trabalho::where('autorId', Auth::user()->id)->get(); + //$trabalhos = Trabalho::where('autorId', Auth::user()->id)->get(); + $proponente = Proponente::with('user')->where('user_id', Auth::user()->id)->first(); + $trabalhos = $proponente->trabalhos; + //dd($trabalhos); + return view('user.meusTrabalhos',[ - 'trabalhos' => $trabalhos, + 'trabalhos' => $trabalhos, ]); } + + public function minhaConta() { + $id = Auth::user()->id; + $user = User::find($id); + + $adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first(); + $avaliador = Avaliador::where('user_id', '=', $id)->first(); + $proponente = Proponente::where('user_id', '=', $id)->first(); + $participante = Participante::where('user_id', '=', $id)->first(); + + return view('user.perfilUser')->with(['user' => $user, + 'adminResp' => $adminResp, + 'avaliador' => $avaliador, + 'proponente' => $proponente, + 'participante' => $participante]); + } } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 77ee1dcba6e6567b5a3a12f404f7dfee20bf5ba4..ccda74b68d2fb965e841194b4a9d7dd53d562133 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -19,6 +19,7 @@ class Kernel extends HttpKernel \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, + //\App\Http\Middleware\checkAdministrador::class ]; /** @@ -62,6 +63,8 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'isTemp' => \App\Http\Middleware\IsTemp::class, + 'checkAdministrador' => \App\Http\Middleware\checkAdministrador::class, + 'checkAdminResp' => \App\Http\Middleware\checkAdminResp::class, ]; /** diff --git a/app/Http/Middleware/checkAdminResp.php b/app/Http/Middleware/checkAdminResp.php new file mode 100644 index 0000000000000000000000000000000000000000..0173f1e4a61baf7b1b91d2a270e0b06db5cab271 --- /dev/null +++ b/app/Http/Middleware/checkAdminResp.php @@ -0,0 +1,31 @@ +tipo=='administradorResponsavel' || Auth::user()->tipo=='administrador'){ + return $next($request); + } + else{ + return redirect('home')->with('error', 'Você não possui privilégios para acessa esta funcionalidade'); + } + } +} diff --git a/app/Http/Middleware/checkAdministrador.php b/app/Http/Middleware/checkAdministrador.php new file mode 100644 index 0000000000000000000000000000000000000000..cdfe1d6a72d9c759ddec5d2afa5dd75123663569 --- /dev/null +++ b/app/Http/Middleware/checkAdministrador.php @@ -0,0 +1,30 @@ +tipo=='administrador'){ + return $next($request); + } + else{ + return redirect('home')->with('error', 'Você não possui privilégios para acessa esta funcionalidade'); + } + } +} diff --git a/app/Participante.php b/app/Participante.php new file mode 100644 index 0000000000000000000000000000000000000000..5b5cb1c6887a155a41200c434eade891be8f2120 --- /dev/null +++ b/app/Participante.php @@ -0,0 +1,17 @@ +belongsTo('App\User'); + } + public function trabalhos(){ + return $this->belongsToMany('App\Trabalho', 'trabalho_participante'); + } +} diff --git a/app/PlanoTrabalho.php b/app/PlanoTrabalho.php new file mode 100644 index 0000000000000000000000000000000000000000..6705d9740f6060792c65171f409f30fb83ea8f51 --- /dev/null +++ b/app/PlanoTrabalho.php @@ -0,0 +1,13 @@ +belongsTo('App\Trabalho'); + } +} diff --git a/app/Policies/AdminPolicy.php b/app/Policies/AdminPolicy.php new file mode 100644 index 0000000000000000000000000000000000000000..6375448239b5cbc2e65ef0bd03dc0fe3071d80a4 --- /dev/null +++ b/app/Policies/AdminPolicy.php @@ -0,0 +1,29 @@ +tipo === "administrador"; + } + + public function isAdminResp(User $user) { + return $user->tipo === "administradorResponsavel"; + } +} diff --git a/app/Policies/EventoPolicy.php b/app/Policies/EventoPolicy.php index 3ac4a370f0ed29fb96f0fb9183911977d5f115b1..25b9d3a5d9949bef65efe8f831e8e37e02aa2ec5 100644 --- a/app/Policies/EventoPolicy.php +++ b/app/Policies/EventoPolicy.php @@ -4,6 +4,8 @@ namespace App\Policies; use App\User; use App\Evento; +use App\CoordenadorComissao; +use App\AdministradorResponsavel; use Illuminate\Auth\Access\HandlesAuthorization; class EventoPolicy @@ -21,6 +23,9 @@ class EventoPolicy } public function isCoordenador(User $user, Evento $evento){ - return $user->id === $evento->coordenador->id; + + + return $evento->criador_id == Auth()->user()->id; + } } diff --git a/app/Proponente.php b/app/Proponente.php new file mode 100644 index 0000000000000000000000000000000000000000..c597aae5ad07ac3c000878fe8c888098e39b59d8 --- /dev/null +++ b/app/Proponente.php @@ -0,0 +1,15 @@ +belongsTo('App\User'); + } + public function trabalhos(){ + return $this->belongsToMany('App\Trabalho', 'trabalho_proponente'); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5bcd8f77d219f29529a9163587235c545d5..d006879e2204a42cd288114974fa029c162b5fe6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Support\Facades\Validator; class AppServiceProvider extends ServiceProvider { @@ -23,6 +24,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - // + Validator::extend('cpf', '\App\Utils\CpfValidation@validate'); } } diff --git a/app/SubArea.php b/app/SubArea.php new file mode 100644 index 0000000000000000000000000000000000000000..859e5edac4cb4418481ba7547d883f07eba215a1 --- /dev/null +++ b/app/SubArea.php @@ -0,0 +1,10 @@ +belongsTo('App\Evento', 'eventoId'); } + public function planoTrabalho(){ + return $this->hasMany('App\PlanoTrabalho'); + } + public function participantes(){ + return $this->belongsToMany('App\Participante', 'trabalho_participante'); + } + public function proponentes(){ + return $this->belongsToMany('App\Proponente', 'trabalho_proponente'); + } + public function coordenador(){ + return $this->belongsTo('App\CoordenadorComissao'); + } + public function avaliadors(){ + return $this->belongsToMany('App\Avaliador'); + } } diff --git a/app/User.php b/app/User.php index 3a9589eee5cf4745854690fc6017227aeda5efde..ec0a6570f263d7ccbd1a784f7ea9afa00b719ba7 100644 --- a/app/User.php +++ b/app/User.php @@ -20,7 +20,7 @@ class User extends Authenticatable implements MustVerifyEmail protected $fillable = [ 'name', 'email', 'password', 'cpf', 'instituicao', 'celular', 'especProfissional', 'enderecoId', - 'usuarioTemp', + 'usuarioTemp', 'tipo', 'user_id' ]; /** @@ -76,8 +76,25 @@ class User extends Authenticatable implements MustVerifyEmail public function evento(){ return $this->hasMany('App\Evento', 'coordenadorId'); } - - + public function administradors(){ + return $this->hasMany('App\Administrador'); + } + public function proponentes(){ + return $this->hasMany('App\Proponente'); + } + public function AdministradorResponsavel(){ + return $this->hasMany('App\AdministradorResponsavel'); + } + public function participantes(){ + return $this->hasMany('App\Participante'); + } + public function avaliadors(){ + return $this->hasMany('App\Avaliador'); + } + public function coordenadorComissao(){ + return $this->hasMany('App\CoordenadorComissao'); + } + public function sendPasswordResetNotification($token){ $this->notify(new recuperacaoSenha($token)); } diff --git a/app/Utils/CpfValidation.php b/app/Utils/CpfValidation.php new file mode 100644 index 0000000000000000000000000000000000000000..781ae08b60b81e5ba429f6b2ae1d37f9b3d5918b --- /dev/null +++ b/app/Utils/CpfValidation.php @@ -0,0 +1,26 @@ +isValidate($attribute, $value); + } + + protected function isValidate($attribute, $value) + { + $c = preg_replace('/\D/', '', $value); + if (strlen($c) != 11 || preg_match("/^{$c[0]}{11}$/", $c)) { + return false; + } + for ($s = 10, $n = 0, $i = 0; $s >= 2; $n += $c[$i++] * $s--); + if ($c[9] != ((($n %= 11) < 2) ? 0 : 11 - $n)) { + return false; + } + for ($s = 11, $n = 0, $i = 0; $s >= 2; $n += $c[$i++] * $s--); + if ($c[10] != ((($n %= 11) < 2) ? 0 : 11 - $n)) { + return false; + } + return true; + } +} \ No newline at end of file diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/composer.lock b/composer.lock index cf140f81600ef7e3070e555050554d7afa098ae2..c65988d4379f35297291b6f0cf053e4f7d8b8dce 100644 --- a/composer.lock +++ b/composer.lock @@ -41,33 +41,37 @@ }, { "name": "doctrine/inflector", - "version": "1.3.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" + "reference": "3fc171224a316569faad2df6b18a1fd8cce5a56d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/3fc171224a316569faad2df6b18a1fd8cce5a56d", + "reference": "3fc171224a316569faad2df6b18a1fd8cce5a56d", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^7.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -96,32 +100,38 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ "inflection", - "pluralize", - "singularize", - "string" + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" ], - "time": "2019-10-30T19:59:35+00:00" + "time": "2020-05-25T20:08:47+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", - "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.2 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -166,7 +176,7 @@ "parser", "php" ], - "time": "2019-10-30T14:39:59+00:00" + "time": "2020-05-25T17:44:05+00:00" }, { "name": "dragonmantank/cron-expression", @@ -387,16 +397,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.3", + "version": "6.5.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e" + "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a4a1b6930528a8f7ee03518e6442ec7a44155d9d", + "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d", "shasum": "" }, "require": { @@ -404,7 +414,7 @@ "guzzlehttp/promises": "^1.0", "guzzlehttp/psr7": "^1.6.1", "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.11" + "symfony/polyfill-intl-idn": "1.17.0" }, "require-dev": { "ext-curl": "*", @@ -450,7 +460,7 @@ "rest", "web service" ], - "time": "2020-04-18T10:38:46+00:00" + "time": "2020-05-25T19:35:05+00:00" }, { "name": "guzzlehttp/promises", @@ -576,20 +586,20 @@ }, { "name": "laravel/framework", - "version": "v6.18.11", + "version": "v6.18.16", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "73bc10bb23aab7539c8ffae6d5dc3c4b277de557" + "reference": "73f18a6bc58fb91aa83925161db25aa3674b73e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/73bc10bb23aab7539c8ffae6d5dc3c4b277de557", - "reference": "73bc10bb23aab7539c8ffae6d5dc3c4b277de557", + "url": "https://api.github.com/repos/laravel/framework/zipball/73f18a6bc58fb91aa83925161db25aa3674b73e9", + "reference": "73f18a6bc58fb91aa83925161db25aa3674b73e9", "shasum": "" }, "require": { - "doctrine/inflector": "^1.1", + "doctrine/inflector": "^1.4|^2.0", "dragonmantank/cron-expression": "^2.0", "egulias/email-validator": "^2.1.10", "ext-json": "*", @@ -610,6 +620,7 @@ "symfony/finder": "^4.3.4", "symfony/http-foundation": "^4.3.4", "symfony/http-kernel": "^4.3.4", + "symfony/polyfill-php73": "^1.17", "symfony/process": "^4.3.4", "symfony/routing": "^4.3.4", "symfony/var-dumper": "^4.3.4", @@ -718,7 +729,7 @@ "framework", "laravel" ], - "time": "2020-04-28T15:18:58+00:00" + "time": "2020-05-26T14:31:44+00:00" }, { "name": "laravel/tinker", @@ -840,16 +851,16 @@ }, { "name": "league/commonmark", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "9e780d972185e4f737a03bade0fd34a9e67bbf31" + "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/9e780d972185e4f737a03bade0fd34a9e67bbf31", - "reference": "9e780d972185e4f737a03bade0fd34a9e67bbf31", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/412639f7cfbc0b31ad2455b2fe965095f66ae505", + "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505", "shasum": "" }, "require": { @@ -910,46 +921,20 @@ "md", "parser" ], - "funding": [ - { - "url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark", - "type": "custom" - }, - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/commonmark", - "type": "tidelift" - } - ], - "time": "2020-04-24T13:39:56+00:00" + "time": "2020-05-04T22:15:21+00:00" }, { "name": "league/flysystem", - "version": "1.0.67", + "version": "1.0.69", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "5b1f36c75c4bdde981294c2a0ebdb437ee6f275e" + "reference": "7106f78428a344bc4f643c233a94e48795f10967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/5b1f36c75c4bdde981294c2a0ebdb437ee6f275e", - "reference": "5b1f36c75c4bdde981294c2a0ebdb437ee6f275e", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7106f78428a344bc4f643c233a94e48795f10967", + "reference": "7106f78428a344bc4f643c233a94e48795f10967", "shasum": "" }, "require": { @@ -1020,30 +1005,24 @@ "sftp", "storage" ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2020-04-16T13:21:26+00:00" + "time": "2020-05-18T15:13:39+00:00" }, { "name": "monolog/monolog", - "version": "2.0.2", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8" + "reference": "38914429aac460e8e4616c8cb486ecb40ec90bb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c861fcba2ca29404dc9e617eedd9eff4616986b8", - "reference": "c861fcba2ca29404dc9e617eedd9eff4616986b8", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/38914429aac460e8e4616c8cb486ecb40ec90bb1", + "reference": "38914429aac460e8e4616c8cb486ecb40ec90bb1", "shasum": "" }, "require": { - "php": "^7.2", + "php": ">=7.2", "psr/log": "^1.0.1" }, "provide": { @@ -1054,11 +1033,11 @@ "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^6.0", "graylog2/gelf-php": "^1.4.2", - "jakub-onderka/php-parallel-lint": "^0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpspec/prophecy": "^1.6.1", - "phpunit/phpunit": "^8.3", + "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", "rollbar/rollbar": "^1.3", "ruflin/elastica": ">=0.90 <3.0", @@ -1107,20 +1086,20 @@ "logging", "psr-3" ], - "time": "2019-12-20T14:22:59+00:00" + "time": "2020-05-22T08:12:19+00:00" }, { "name": "nesbot/carbon", - "version": "2.33.0", + "version": "2.34.2", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4d93cb95a80d9ffbff4018fe58ae3b7dd7f4b99b" + "reference": "3e87404329b8072295ea11d548b47a1eefe5a162" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4d93cb95a80d9ffbff4018fe58ae3b7dd7f4b99b", - "reference": "4d93cb95a80d9ffbff4018fe58ae3b7dd7f4b99b", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/3e87404329b8072295ea11d548b47a1eefe5a162", + "reference": "3e87404329b8072295ea11d548b47a1eefe5a162", "shasum": "" }, "require": { @@ -1144,7 +1123,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "2.x-dev", + "dev-3.x": "3.x-dev" }, "laravel": { "providers": [ @@ -1179,17 +1159,7 @@ "datetime", "time" ], - "funding": [ - { - "url": "https://opencollective.com/Carbon", - "type": "open_collective" - }, - { - "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", - "type": "tidelift" - } - ], - "time": "2020-04-20T15:05:43+00:00" + "time": "2020-05-19T22:14:16+00:00" }, { "name": "nikic/php-parser", @@ -1245,16 +1215,16 @@ }, { "name": "opis/closure", - "version": "3.5.1", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969" + "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/93ebc5712cdad8d5f489b500c59d122df2e53969", - "reference": "93ebc5712cdad8d5f489b500c59d122df2e53969", + "url": "https://api.github.com/repos/opis/closure/zipball/cac47092144043d5d676e2e7cf8d0d2f83fc89ca", + "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca", "shasum": "" }, "require": { @@ -1302,7 +1272,7 @@ "serialization", "serialize" ], - "time": "2019-11-29T22:36:02+00:00" + "time": "2020-05-25T09:32:45+00:00" }, { "name": "paragonie/random_compat", @@ -1600,16 +1570,16 @@ }, { "name": "psy/psysh", - "version": "v0.10.3", + "version": "v0.10.4", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "2bde2fa03e05dff0aee834598b951d6fc7c6fe02" + "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/2bde2fa03e05dff0aee834598b951d6fc7c6fe02", - "reference": "2bde2fa03e05dff0aee834598b951d6fc7c6fe02", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a8aec1b2981ab66882a01cce36a49b6317dc3560", + "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560", "shasum": "" }, "require": { @@ -1668,7 +1638,7 @@ "interactive", "shell" ], - "time": "2020-04-07T06:44:48+00:00" + "time": "2020-05-03T19:32:03+00:00" }, { "name": "ralouphie/getallheaders", @@ -1933,20 +1903,6 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-30T11:41:10+00:00" }, { @@ -2000,20 +1956,6 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-27T16:56:45+00:00" }, { @@ -2070,20 +2012,6 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-27T16:54:36+00:00" }, { @@ -2140,20 +2068,6 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-30T14:07:33+00:00" }, { @@ -2224,20 +2138,6 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-27T16:54:36+00:00" }, { @@ -2345,25 +2245,10 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-03-27T16:54:36+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.4.8", "source": { "type": "git", @@ -2415,20 +2300,6 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-18T20:40:08+00:00" }, { @@ -2519,20 +2390,6 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-28T18:47:42+00:00" }, { @@ -2595,34 +2452,20 @@ "mime", "mime-type" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-17T03:29:44+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { @@ -2634,7 +2477,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2667,34 +2510,20 @@ "polyfill", "portable" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:14:59+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "ad6d62792bfbcfc385dd34b424d4fcf9712a32c8" + "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ad6d62792bfbcfc385dd34b424d4fcf9712a32c8", - "reference": "ad6d62792bfbcfc385dd34b424d4fcf9712a32c8", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c4de7601eefbf25f9d47190abe07f79fe0a27424", + "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424", "shasum": "" }, "require": { @@ -2706,7 +2535,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2740,34 +2569,20 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-03-09T19:04:49+00:00" + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf" + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", "shasum": "" }, "require": { @@ -2781,7 +2596,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2816,34 +2631,20 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-03-09T19:04:49+00:00" + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", "shasum": "" }, "require": { @@ -2855,7 +2656,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2889,34 +2690,20 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-03-09T19:04:49+00:00" + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "37b0976c78b94856543260ce09b460a7bc852747" + "reference": "f048e612a3905f34931127360bdd2def19a5e582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747", - "reference": "37b0976c78b94856543260ce09b460a7bc852747", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", + "reference": "f048e612a3905f34931127360bdd2def19a5e582", "shasum": "" }, "require": { @@ -2925,7 +2712,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2958,34 +2745,20 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7" + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", - "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", "shasum": "" }, "require": { @@ -2994,7 +2767,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -3030,21 +2803,7 @@ "portable", "shim" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:47:27+00:00" }, { "name": "symfony/process", @@ -3093,20 +2852,6 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-15T15:56:18+00:00" }, { @@ -3183,20 +2928,6 @@ "uri", "url" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-21T19:59:53+00:00" }, { @@ -3331,20 +3062,6 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-12T16:45:36+00:00" }, { @@ -3478,20 +3195,6 @@ "debug", "dump" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-04-12T16:14:02+00:00" }, { @@ -3545,20 +3248,20 @@ }, { "name": "vlucas/phpdotenv", - "version": "v3.6.3", + "version": "v3.6.5", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1b3103013797f04521c6cae5560f604649484066" + "reference": "8b64814b356b96a90d2bc942b152c80d8888b8d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1b3103013797f04521c6cae5560f604649484066", - "reference": "1b3103013797f04521c6cae5560f604649484066", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/8b64814b356b96a90d2bc942b152c80d8888b8d4", + "reference": "8b64814b356b96a90d2bc942b152c80d8888b8d4", "shasum": "" }, "require": { - "php": "^5.4 || ^7.0", + "php": "^5.4 || ^7.0 || ^8.0", "phpoption/phpoption": "^1.5", "symfony/polyfill-ctype": "^1.9" }, @@ -3604,13 +3307,7 @@ "env", "environment" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "time": "2020-04-12T15:18:03+00:00" + "time": "2020-05-23T09:42:03+00:00" } ], "packages-dev": [ @@ -3841,16 +3538,16 @@ }, { "name": "filp/whoops", - "version": "2.7.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130" + "reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", - "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", + "url": "https://api.github.com/repos/filp/whoops/zipball/17d0d3f266c8f925ebd035cd36f83cf802b47d4a", + "reference": "17d0d3f266c8f925ebd035cd36f83cf802b47d4a", "shasum": "" }, "require": { @@ -3898,7 +3595,7 @@ "throwable", "whoops" ], - "time": "2020-01-15T10:00:00+00:00" + "time": "2020-05-05T12:28:07+00:00" }, { "name": "fzaninotto/faker", @@ -4090,30 +3787,33 @@ }, { "name": "mockery/mockery", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be" + "reference": "6c6a7c533469873deacf998237e7649fc6b36223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", - "reference": "f69bbde7d7a75d6b2862d9ca8fab1cd28014b4be", + "url": "https://api.github.com/repos/mockery/mockery/zipball/6c6a7c533469873deacf998237e7649fc6b36223", + "reference": "6c6a7c533469873deacf998237e7649fc6b36223", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "~2.0", "lib-pcre": ">=7.0", - "php": ">=5.6.0" + "php": "^7.3.0" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" + "phpunit/phpunit": "^8.0.0 || ^9.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -4151,7 +3851,7 @@ "test double", "testing" ], - "time": "2019-12-26T09:49:15+00:00" + "time": "2020-05-19T14:25:16+00:00" }, { "name": "myclabs/deep-copy", @@ -4832,16 +4532,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.4", + "version": "8.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23" + "reference": "63dda3b212a0025d380a745f91bdb4d8c985adb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8474e22d7d642f665084ba5ec780626cbd1efd23", - "reference": "8474e22d7d642f665084ba5ec780626cbd1efd23", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/63dda3b212a0025d380a745f91bdb4d8c985adb7", + "reference": "63dda3b212a0025d380a745f91bdb4d8c985adb7", "shasum": "" }, "require": { @@ -4911,17 +4611,7 @@ "testing", "xunit" ], - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-04-23T04:39:42+00:00" + "time": "2020-05-22T13:51:52+00:00" }, { "name": "scrivo/highlight.php", @@ -5704,6 +5394,5 @@ "platform": { "php": "^7.2" }, - "platform-dev": [], - "plugin-api-version": "1.1.0" + "platform-dev": [] } 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 84be0461e6573cc106499830a67b55a54c40ce81..67fb576c9ad5be5e311371051326dc90ecbe95ef 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -16,16 +16,17 @@ class CreateUsersTable extends Migration Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name')->nullable(); - $table->string('email')->unique(); - $table->timestamp('email_verified_at')->nullable(); + $table->string('email')->unique(); $table->string('password'); $table->string('instituicao')->nullable(); $table->string('celular')->nullable(); $table->string('cpf')->nullable(); - $table->string('especProfissional')->nullable(); + $table->string('tipo')->nullable(); $table->boolean('usuarioTemp')->nullable(); + $table->rememberToken(); $table->timestamps(); + $table->timestamp('email_verified_at')->nullable(); $table->integer('enderecoId')->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 00ad7a58f2aa68b681f36aa6d3f704996c13aab5..26e41338f43237dba51f25980e8df1fcb24a055b 100644 --- a/database/migrations/2020_02_05_123048_create_trabalhos_table.php +++ b/database/migrations/2020_02_05_123048_create_trabalhos_table.php @@ -15,17 +15,26 @@ class CreateTrabalhosTable extends Migration { Schema::create('trabalhos', function (Blueprint $table) { $table->bigIncrements('id'); - $table->timestamps(); $table->string('titulo'); - $table->string('autores')->nullable(); + $table->boolean('avaliado')->nullable(); + $table->string('linkGrupoPesquisa'); + $table->string('linkLattesEstudante'); + $table->string('pontuacaoPlanilha'); $table->date('data')->nullable(); - $table->text('resumo')->nullable(); - $table->text('avaliado')->nullable(); + //Anexos + $table->string('anexoProjeto'); + $table->string('anexoDecisaoCONSU')->nullable(); + $table->string('anexoPlanilhaPontuacao'); + $table->string('anexoLattesCoordenador'); + $table->string('anexoAutorizacaoComiteEtica'); + //chaves estrangeiras + $table->unsignedBigInteger('grande_area_id'); + $table->unsignedBigInteger('area_id'); + $table->unsignedBigInteger('sub_area_id'); + $table->unsignedBigInteger('evento_id'); + $table->unsignedBigInteger('coordenador_id'); - $table->integer('modalidadeId'); - $table->integer('areaId'); - $table->integer('autorId'); - $table->integer('eventoId'); + $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 08264032a0ac6a8ebd2f1ea0d5109cc29ee51a04..57b4d0d05b794b50540f2fe3dfa84d06cf600903 100644 --- a/database/migrations/2020_02_05_123139_create_areas_table.php +++ b/database/migrations/2020_02_05_123139_create_areas_table.php @@ -14,12 +14,13 @@ class CreateAreasTable extends Migration public function up() { Schema::create('areas', function (Blueprint $table) { - $table->bigIncrements('id'); - $table->timestamps(); + $table->bigIncrements('id'); $table->string('nome'); - - $table->integer('modalidadeId')->nullable(); - $table->integer('eventoId'); + + $table->unsignedBigInteger('grande_area_id'); + $table->timestamps(); + // $table->integer('modalidadeId')->nullable(); + // $table->integer('eventoId'); }); } diff --git a/database/migrations/2020_02_05_123153_create_eventos_table.php b/database/migrations/2020_02_05_123153_create_eventos_table.php index 3e08423f8fe46b8899c1002e86eb886a69db6ed4..6012d9003ba8b2b568beb5ba3b8cd05f9bafa079 100644 --- a/database/migrations/2020_02_05_123153_create_eventos_table.php +++ b/database/migrations/2020_02_05_123153_create_eventos_table.php @@ -16,28 +16,21 @@ class CreateEventosTable extends Migration Schema::create('eventos', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamps(); - $table->string('nome')->nullable(); - // $table->integer('numeroParticipantes'); + $table->string('nome')->nullable(); $table->string('descricao')->nullable(); - $table->string('tipo')->nullable(); - $table->date('dataInicio')->nullable(); - $table->date('dataFim')->nullable(); + $table->string('tipo')->nullable(); $table->date('inicioSubmissao')->nullable(); $table->date('fimSubmissao')->nullable(); $table->date('inicioRevisao')->nullable(); $table->date('fimRevisao')->nullable(); - $table->date('inicioResultado')->nullable(); - $table->date('fimResultado')->nullable(); + $table->date('resultado')->nullable(); $table->integer('numMaxTrabalhos')->nullable(); $table->integer('numMaxCoautores')->nullable(); - // $table->boolean('possuiTaxa'); - // $table->double('valorTaxa'); - $table->string('fotoEvento')->nullable(); $table->boolean('hasResumo')->nullable(); - - $table->integer('coordComissaoId')->nullable(); - $table->integer('enderecoId')->nullable(); + $table->integer('criador_id')->nullable(); $table->integer('coordenadorId')->nullable(); + $table->string('pdfEdital')->nullable(); + $table->string('modeloDocumento')->nullable(); }); } diff --git a/database/migrations/2020_02_06_132418_chaves_estrangeiras.php b/database/migrations/2020_02_06_132418_chaves_estrangeiras.php index a0fc64d7614afa6c97a0d040ef324b1017cd6d88..e6194b4462ef064049bd48e92330d098e99cd79d 100644 --- a/database/migrations/2020_02_06_132418_chaves_estrangeiras.php +++ b/database/migrations/2020_02_06_132418_chaves_estrangeiras.php @@ -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'); }); @@ -103,39 +101,39 @@ 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('autorId')->references('id')->on('users'); - }); - Schema::table('trabalhos', function (Blueprint $table) { - $table->foreign('eventoId')->references('id')->on('eventos'); - }); + // 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('autorId')->references('id')->on('users'); + // }); + // Schema::table('trabalhos', function (Blueprint $table) { + // $table->foreign('eventoId')->references('id')->on('eventos'); + // }); //------------------------------------------------------------------------ - Schema::table('users', function (Blueprint $table) { - $table->foreign('enderecoId')->references('id')->on('enderecos'); - }); + // Schema::table('users', function (Blueprint $table) { + // $table->foreign('enderecoId')->references('id')->on('enderecos'); + // }); //------------------------------------------------------------------------ - Schema::table('revisors', function (Blueprint $table) { - $table->foreign('revisorId')->references('id')->on('users'); - }); - 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('eventos',function (Blueprint $table){ - $table->foreign('coordComissaoId')->references('id')->on('users'); - }); + // Schema::table('revisors', function (Blueprint $table) { + // $table->foreign('revisorId')->references('id')->on('users'); + // }); + // 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('eventos',function (Blueprint $table){ + // $table->foreign('coordComissaoId')->references('id')->on('users'); + // }); //------------------------------------------------------------------------ } diff --git a/database/migrations/2020_05_20_163253_create_administradors_table.php b/database/migrations/2020_05_20_163253_create_administradors_table.php new file mode 100644 index 0000000000000000000000000000000000000000..b500b62d7e8a1b6733f57dcadb8978df68654cb5 --- /dev/null +++ b/database/migrations/2020_05_20_163253_create_administradors_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + + $table->string('matricula')->unique(); + $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('administradors'); + } +} diff --git a/database/migrations/2020_05_20_211421_create_proponentes_table.php b/database/migrations/2020_05_20_211421_create_proponentes_table.php new file mode 100644 index 0000000000000000000000000000000000000000..b80eb9ca78ac2d79652ab3e41ae12af6f1cbc4c5 --- /dev/null +++ b/database/migrations/2020_05_20_211421_create_proponentes_table.php @@ -0,0 +1,48 @@ +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->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('proponentes'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..26e51d22894240fab1557fc426cd2b944bf12f50 --- /dev/null +++ b/database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('titulo'); + $table->string('anexoPlanoTrabalho'); + $table->timestamps(); + + $table->unsignedBigInteger('trabalho_id'); + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('plano_trabalhos'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..61a37132c0df6734b7342bae3700ff4deaf33b62 --- /dev/null +++ b/database/migrations/2020_05_21_025543_create_administrador_responsavels_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('administrador_responsavels'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..66c5c356af3e4ff2cfb3e7c856160108bad47b1c --- /dev/null +++ b/database/migrations/2020_05_22_031644_create_grande_areas_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->string('nome'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('grande_areas'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..4c6ec46d1191ad45a3d23ffee4518b00c654a3e9 --- /dev/null +++ b/database/migrations/2020_05_22_031838_create_sub_areas_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string("nome"); + $table->timestamps(); + + + $table->unsignedBigInteger('area_id'); + $table->foreign('area_id')->references('id')->on('areas'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('sub_areas'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..0ea32304e0c313499a95722d5324c98c17d64a38 --- /dev/null +++ b/database/migrations/2020_05_22_044450_create_funcao_participantes_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('nome'); + $table->timestamps(); + + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('funcao_participantes'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..c519b8b589abc022a210b37a7b3a962113b09c5f --- /dev/null +++ b/database/migrations/2020_05_23_054649_create_coordenador_comissaos_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->timestamps(); + + $table->unsignedBigInteger('user_id'); + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('coordenador_comissaos'); + } +} diff --git a/database/migrations/2020_05_23_054805_create_avaliadors_table.php b/database/migrations/2020_05_23_054805_create_avaliadors_table.php new file mode 100644 index 0000000000000000000000000000000000000000..0db3c6ca5556124ec5d145ecf04524b3257165d3 --- /dev/null +++ b/database/migrations/2020_05_23_054805_create_avaliadors_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->timestamps(); + + $table->unsignedBigInteger('user_id')->nullable(); + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('avaliadors'); + } +} diff --git a/database/migrations/2020_05_23_054945_create_participantes_table.php b/database/migrations/2020_05_23_054945_create_participantes_table.php new file mode 100644 index 0000000000000000000000000000000000000000..0a004993703adb218381d68b4235510c5cfd1965 --- /dev/null +++ b/database/migrations/2020_05_23_054945_create_participantes_table.php @@ -0,0 +1,39 @@ +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'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('participantes'); + } +} 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 new file mode 100644 index 0000000000000000000000000000000000000000..61c88c2d3498e655bd15d36dad515feb1be6189a --- /dev/null +++ b/database/migrations/2020_05_23_071949_add_foreign_to_trabalhos_table.php @@ -0,0 +1,45 @@ +foreign('grande_area_id')->references('id')->on('grande_areas'); + $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('coordenador_id')->references('id')->on('coordenador_comissaos'); + + //$table->foreignId('user_id')->constrained(); + // $table->integer('coordenador'); + // $table->integer('grandeArea_id'); + // $table->integer('area'); + // $table->integer('subArea'); + // $table->integer('eventoId'); + // $table->integer('proponente_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('trabalhos', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_05_23_182520_create_trabalhos_participantes_table.php b/database/migrations/2020_05_23_182520_create_trabalhos_participantes_table.php new file mode 100644 index 0000000000000000000000000000000000000000..8f37ce99aa2aac917ee217dba5969c977fb4f0b0 --- /dev/null +++ b/database/migrations/2020_05_23_182520_create_trabalhos_participantes_table.php @@ -0,0 +1,34 @@ +unsignedBigInteger('trabalho_id'); + $table->unsignedBigInteger('participante_id'); + + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + $table->foreign('participante_id')->references('id')->on('participantes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('trabalho_participante'); + } +} diff --git a/database/migrations/2020_05_23_182551_create_trabalhos_proponentes_table.php b/database/migrations/2020_05_23_182551_create_trabalhos_proponentes_table.php new file mode 100644 index 0000000000000000000000000000000000000000..abceca4fa5c23cf1b219359fa10146f20624cc6c --- /dev/null +++ b/database/migrations/2020_05_23_182551_create_trabalhos_proponentes_table.php @@ -0,0 +1,34 @@ +unsignedBigInteger('trabalho_id'); + $table->unsignedBigInteger('proponente_id'); + + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + $table->foreign('proponente_id')->references('id')->on('proponentes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('trabalho_proponente'); + } +} diff --git a/database/migrations/2020_05_25_193809_add_grande_areas_area_table.php b/database/migrations/2020_05_25_193809_add_grande_areas_area_table.php new file mode 100644 index 0000000000000000000000000000000000000000..ed7da9a7e6c94397d4a4f3485824b040f2df2a12 --- /dev/null +++ b/database/migrations/2020_05_25_193809_add_grande_areas_area_table.php @@ -0,0 +1,32 @@ +foreign('grande_area_id')->references('id')->on('grande_areas'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('areas', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_05_26_223341_create_avaliadors_trabalhos_table.php b/database/migrations/2020_05_26_223341_create_avaliadors_trabalhos_table.php new file mode 100644 index 0000000000000000000000000000000000000000..34b43cbdfbd6e8c9e2c92ebd4972128d6913c2f5 --- /dev/null +++ b/database/migrations/2020_05_26_223341_create_avaliadors_trabalhos_table.php @@ -0,0 +1,34 @@ +unsignedBigInteger('trabalho_id'); + $table->unsignedBigInteger('avaliador_id'); + + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + $table->foreign('avaliador_id')->references('id')->on('avaliadors'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('avaliador_trabalho'); + } +} diff --git a/database/seeds/AdministradorResponsavelSeeder.php b/database/seeds/AdministradorResponsavelSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..aaeff51430ad51b0706a21eaad518a26bc57d5ca --- /dev/null +++ b/database/seeds/AdministradorResponsavelSeeder.php @@ -0,0 +1,29 @@ +where('name','AdministradorResponsavel1')->pluck('id'); + + DB::table('administrador_responsavels')->insert([ + 'user_id' => $user_id[0], + + ]); + + $user_id = DB::table('users')->where('name','AdministradorResponsavel2')->pluck('id'); + + DB::table('administrador_responsavels')->insert([ + 'user_id' => $user_id[0], + + ]); + } +} diff --git a/database/seeds/AdministradorSeeder.php b/database/seeds/AdministradorSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..231de224150d104c69f8c8e849b2fba795ac0ae5 --- /dev/null +++ b/database/seeds/AdministradorSeeder.php @@ -0,0 +1,22 @@ +where('name','Administrador')->pluck('id'); + + DB::table('administradors')->insert([ + 'matricula'=>'123456789', + 'user_id' => $user_id[0], + ]); + } +} diff --git a/database/seeds/AreaSeeder.php b/database/seeds/AreaSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..2a4f93429ebdcf6155a9de7d81f9f8adeefc9112 --- /dev/null +++ b/database/seeds/AreaSeeder.php @@ -0,0 +1,166 @@ +insert([ + 'nome'=>'Matemática', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Probabilidade e Estatística', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Ciência da Computação', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Astronomia', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Física', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Química', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'GeoCiências', + 'grande_area_id' => '1' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Oceanografia', + 'grande_area_id' => '1' + ]); + + // Ciências Biológicas ---------------------- + + DB::table('areas')->insert([ + 'nome'=>'Biologia Geral', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Genética', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Botânica', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Zoologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Ecologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Morfologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Bioquímica', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Fisiologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Biofísica', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Farmacologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Imunologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Microbiologia', + 'grande_area_id' => '2' + ]); + + DB::table('areas')->insert([ + 'nome'=>'Parasitologia', + 'grande_area_id' => '2' + ]); + + //Engenharias -------------------- + + DB::table('areas')->insert([ + 'nome'=>'Engenharia Civil', + 'grande_area_id' => '3' + ]); + + // Ciências da Saúde ----------------- + + DB::table('areas')->insert([ + 'nome'=>'Medicina', + 'grande_area_id' => '4' + ]); + + //Ciências Agrárias ------------------ + + DB::table('areas')->insert([ + 'nome'=>'Agronomia', + 'grande_area_id' => '5' + ]); + + //Ciências Sociais Aplicadas ---------- + + DB::table('areas')->insert([ + 'nome'=>'Direito', + 'grande_area_id' => '6' + ]); + + //Ciências Humanas ---------------------- + + DB::table('areas')->insert([ + 'nome'=>'Filosofia', + 'grande_area_id' => '7' + ]); + + //Lingüística, Letras e Artes----------- + + DB::table('areas')->insert([ + 'nome'=>'Lingüística', + 'grande_area_id' => '8' + ]); + + + + } +} diff --git a/database/seeds/CoordenadorComissaoSeeder.php b/database/seeds/CoordenadorComissaoSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..41e36523d0d5685fabb31fa80dcb1463dbf26659 --- /dev/null +++ b/database/seeds/CoordenadorComissaoSeeder.php @@ -0,0 +1,26 @@ +where('name','Coordenador1')->pluck('id'); + + DB::table('coordenador_comissaos')->insert([ + 'user_id' => $user_id[0], + ]); + + $user_id = DB::table('users')->where('name','Coordenador2')->pluck('id'); + + DB::table('coordenador_comissaos')->insert([ + 'user_id' => $user_id[0], + ]); + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 9e8e0212e939ef8a91ae32cfe738cebaa2a9d547..fadd488d58bb92e5f86dc4c1d15f7b841e66c794 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,166 +11,129 @@ class DatabaseSeeder extends Seeder */ public function run() { + + $this->call(UsuarioSeeder::class); + $this->call(AdministradorSeeder::class); + $this->call(AdministradorResponsavelSeeder::class); + $this->call(ProponenteSeeder::class); + $this->call(GrandeAreaSeeder::class); + $this->call(AreaSeeder::class); + $this->call(SubAreaSeeder::class); + $this->call(FuncaoParticipanteSeeder::class); + $this->call(CoordenadorComissaoSeeder::class); + $this->call(ParticipanteSeeder::class); // $this->call(UsersTableSeeder::class); - DB::table('enderecos')->insert([ // 1 - 'rua' => 'a', - 'numero' => 1, - 'bairro' => 'b', - 'cidade' => 'c', - 'uf' => 'd', - 'cep' => 2, - ]); - DB::table('enderecos')->insert([ // 1 - 'rua' => 'R. Manoel Clemente', - 'numero' => '161', - 'bairro' => 'Santo Antônio', - 'cidade' => 'Garanhuns', - 'uf' => 'PE', - 'cep' => '55293-040', - ]); +// DB::table('enderecos')->insert([ // 1 +// 'rua' => 'a', +// 'numero' => 1, +// 'bairro' => 'b', +// 'cidade' => 'c', +// 'uf' => 'd', +// 'cep' => 2, +// ]); - DB::table('users')->insert([ // - 'name' => 'coord', - 'email' => 'teste@teste', - 'password' => bcrypt('12345678'), - 'cpf' => 123132131, - 'instituicao' => 'd', - 'celular' => 2, - 'especProfissional' => 'e', - 'enderecoId' => 1, - 'email_verified_at' => '2020-02-15', - ]); +// DB::table('enderecos')->insert([ // 1 +// 'rua' => 'R. Manoel Clemente', +// 'numero' => '161', +// 'bairro' => 'Santo Antônio', +// 'cidade' => 'Garanhuns', +// 'uf' => 'PE', +// 'cep' => '55293-040', +// ]); - DB::table('users')->insert([ // - 'name' => 'Felipe', - 'email' => 'felipeaquac@yahoo.com.br', - 'password' => bcrypt('guedes80'), - 'cpf' => '999.999.999-99', - 'instituicao' => 'UFAPE', - 'celular' => '(99) 99999-9999', - 'especProfissional' => ' ', - 'enderecoId' => 1, - 'email_verified_at' => '2020-02-15', +// DB::table('users')->insert([ // +// 'name' => 'coord', +// 'email' => 'teste@teste', +// 'password' => bcrypt('12345678'), +// 'cpf' => 123132131, +// 'instituicao' => 'd', +// 'celular' => 2, +// 'especProfissional' => 'e', +// 'enderecoId' => 1, +// 'email_verified_at' => '2020-02-15', +// ]); + +// DB::table('users')->insert([ // +// 'name' => 'Felipe', +// 'email' => 'felipeaquac@yahoo.com.br', +// 'password' => bcrypt('guedes80'), +// 'cpf' => '999.999.999-99', +// 'instituicao' => 'UFAPE', +// 'celular' => '(99) 99999-9999', +// 'especProfissional' => ' ', +// 'enderecoId' => 1, +// 'email_verified_at' => '2020-02-15', +// ]); + + DB::table('eventos')->insert([ + 'nome'=>'I CONGRESSO REGIONAL DE ZOOTECNIA', + // 'numeroParticipantes'=>60, + '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'=>'PIBIC', + 'inicioSubmissao'=>'2020-03-30', + 'fimSubmissao'=>'2020-09-20', + 'inicioRevisao'=>'2020-04-21', + 'fimRevisao'=>'2020-05-21', + 'resultado'=>'2020-05-22', + 'numMaxTrabalhos' => 2, + 'numMaxCoautores' => 5, + 'coordenadorId'=>1, + 'criador_id'=>1, ]); DB::table('eventos')->insert([ 'nome'=>'II CONGRESSO REGIONAL DE ZOOTECNIA', // 'numeroParticipantes'=>60, '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', - 'dataInicio'=>'2020-07-01', - 'dataFim'=>'2020-07-03', + 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'=>'PIBIC', 'inicioSubmissao'=>'2020-03-30', - 'fimSubmissao'=>'2020-04-20', + 'fimSubmissao'=>'2020-09-20', 'inicioRevisao'=>'2020-04-21', 'fimRevisao'=>'2020-05-21', - 'inicioResultado'=>'2020-05-22', - 'fimResultado'=>'2020-05-23', + 'resultado'=>'2020-05-22', 'numMaxTrabalhos' => 2, 'numMaxCoautores' => 5, - // 'possuiTaxa'=>true, - // 'valorTaxa'=>10, - 'enderecoId'=>2, 'coordenadorId'=>1, - 'hasResumo'=>false, + 'criador_id'=>2, ]); - $areasEventoZoo = [ - 'Produção e nutrição de ruminantes', - 'Produção e nutrição de não-ruminantes', - 'Reprodução e melhoramento de ruminantes', - 'Reprodução e melhoramento de não-ruminantes', - 'Tecnologia de produtos de origem animal', - 'Nutrição e Criação de Animais Pet', - 'Apicultura e Meliponicultura', - 'Animais Silvestres', - 'Extensão rural e Desenvolvimento Sustentável', - 'Forragicultura' - ]; - - for($i = 0; $i < sizeof($areasEventoZoo); $i++){ - DB::table('areas')->insert([ - 'nome' => $areasEventoZoo[$i], - 'eventoId' => 1, - ]); - } - - DB::table('modalidades')->insert([ - 'nome' => 'Resumo' + DB::table('eventos')->insert([ + 'nome'=>'III CONGRESSO REGIONAL DE ZOOTECNIA', + // 'numeroParticipantes'=>60, + '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'=>'PIBIC', + 'inicioSubmissao'=>'2020-03-30', + 'fimSubmissao'=>'2020-09-20', + 'inicioRevisao'=>'2020-04-21', + 'fimRevisao'=>'2020-05-21', + 'resultado'=>'2020-05-22', + 'numMaxTrabalhos' => 2, + 'numMaxCoautores' => 5, + 'coordenadorId'=>1, + 'criador_id'=>3, ]); - for($i = 0; $i < sizeof($areasEventoZoo); $i++){ - DB::table('area_modalidades')->insert([ - 'areaId' => $i + 1, - 'modalidadeId' => 1, - ]); - } +// $areasEventoZoo = [ +// 'Produção e nutrição de ruminantes', +// 'Produção e nutrição de não-ruminantes', +// 'Reprodução e melhoramento de ruminantes', +// 'Reprodução e melhoramento de não-ruminantes', +// 'Tecnologia de produtos de origem animal', +// 'Nutrição e Criação de Animais Pet', +// 'Apicultura e Meliponicultura', +// 'Animais Silvestres', +// 'Extensão rural e Desenvolvimento Sustentável', +// 'Forragicultura' +// ]; - for($i = 0; $i < 40; $i++){ - DB::table('users')->insert([ // - 'name' => 'teste', - 'email' => 'teste@teste'.$i, - 'password' => bcrypt('12345678'), - 'cpf' => ''.$i, - 'instituicao' => 'd', - 'celular' => 2, - 'especProfissional' => 'e', - 'enderecoId' => 1, - ]); - if($i < 20){ - DB::table('trabalhos')->insert([ - 'titulo' => 'trabalho' . $i, - 'autores' => '-', - 'data' => '2020-02-15', - 'modalidadeId' => 1, - 'areaId' => 1, - 'autorId' => $i+2, - 'eventoId' => 1, - 'avaliado' => 'nao' - ]); - } - if($i >= 20 && $i < 30){ - DB::table('trabalhos')->insert([ - 'titulo' => 'trabalho' . $i, - 'autores' => '-', - 'data' => '2020-02-15', - 'modalidadeId' => 1, - 'areaId' => 2, - 'eventoId' => 1, - 'autorId' => $i+2, - 'avaliado' => 'nao' - ]); - } - if($i >= 30){ - DB::table('trabalhos')->insert([ - 'titulo' => 'trabalho' . $i, - 'autores' => '-', - 'data' => '2020-02-15', - 'modalidadeId' => 1, - 'areaId' => 3, - 'eventoId' => 1, - 'autorId' => $i+2, - 'avaliado' => 'nao' - ]); - } - - } - - DB::table('users')->insert([ // - 'name' => 'eu', - 'email' => 'asd@asd', - 'password' => bcrypt('12345678'), - 'cpf' => 123132131, - 'instituicao' => 'd', - 'celular' => 2, - 'especProfissional' => 'e', - 'email_verified_at' => '2020-02-15', - 'enderecoId' => 1, - ]); } } diff --git a/database/seeds/FuncaoParticipanteSeeder.php b/database/seeds/FuncaoParticipanteSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..252de374e258a0fe0f12c73b7cf8a7420e0dda58 --- /dev/null +++ b/database/seeds/FuncaoParticipanteSeeder.php @@ -0,0 +1,43 @@ +insert([ + 'nome'=>'Vice-coordenador', + + ]); + + DB::table('funcao_participantes')->insert([ + 'nome'=>'Colaborador', + + ]); + + DB::table('funcao_participantes')->insert([ + 'nome'=>'Consultor', + + ]); + + DB::table('funcao_participantes')->insert([ + 'nome'=>'Bolsista', + + ]); + + DB::table('funcao_participantes')->insert([ + 'nome'=>'Estudante', + + ]); + DB::table('funcao_participantes')->insert([ + 'nome'=>'Voluntário', + + ]); + } +} diff --git a/database/seeds/GrandeAreaSeeder.php b/database/seeds/GrandeAreaSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..7e32bee7281d181a983e6e8999af4ad1b7845bd0 --- /dev/null +++ b/database/seeds/GrandeAreaSeeder.php @@ -0,0 +1,40 @@ +insert([ + 'nome'=>'Ciências Exatas e da Terra', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Ciências Biológicas', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Engenharias', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Ciências da Saúde ', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Ciências Agrárias', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Ciências Sociais Aplicadas', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Ciências Humanas', + ]); + DB::table('grande_areas')->insert([ + 'nome'=>'Lingüística, Letras e Artes', + ]); + + } +} diff --git a/database/seeds/ParticipanteSeeder.php b/database/seeds/ParticipanteSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..6b10b0d242292bab4a17957834ee238534554fa0 --- /dev/null +++ b/database/seeds/ParticipanteSeeder.php @@ -0,0 +1,28 @@ +where('name','Participante1')->pluck('id'); + + DB::table('participantes')->insert([ + 'user_id' => $user_id[0], + + ]); + + $user_id = DB::table('users')->where('name','Participante2')->pluck('id'); + + DB::table('participantes')->insert([ + 'user_id' => $user_id[0], + + ]); + } +} diff --git a/database/seeds/ProponenteSeeder.php b/database/seeds/ProponenteSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..69615fb25dbf5cec62ecb0014465605bc0f63000 --- /dev/null +++ b/database/seeds/ProponenteSeeder.php @@ -0,0 +1,37 @@ +where('name','Proponente')->pluck('id'); + + DB::table('proponentes')->insert([ + 'user_id' => $user_id[0], + //'CPF' => '123123123', + 'SIAPE' => '123123123', + //'email' => '123123123', + //'email' => '123123123', + 'cargo' => '123123123', + 'vinculo' => '123123123', + 'titulacaoMaxima' => '123123123', + 'anoTitulacao' => '123123123', + 'grandeArea' => '123123123', + 'area' => '123123123', + 'subArea' => '123123123', + 'bolsistaProdutividade' => '123123123', + 'nivel' => '123123123', + 'linkLattes' => '123123123', + 'created_at' => '2020-01-01 00:00:00' + + ]); + } +} \ No newline at end of file diff --git a/database/seeds/SubAreaSeeder.php b/database/seeds/SubAreaSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..51d47d85290a2d1b76377ba40cbf0423b1e2ef88 --- /dev/null +++ b/database/seeds/SubAreaSeeder.php @@ -0,0 +1,77 @@ +insert([ + 'nome'=>'Álgebra', + 'area_id' => '1' + ]); + + //------------------ Ciências Biológicas ---------------- + //Genética -------------------- + + DB::table('sub_areas')->insert([ + 'nome'=>'Genética Quantitativa', + 'area_id' => '2' + ]); + + //------------------ Engenharias ---------------- + //Engenharia Civil -------------- + + DB::table('sub_areas')->insert([ + 'nome'=>'Álgebra', + 'area_id' => '3' + ]); + + //------------------ Ciências da Saúde ---------------- + //Medicina-------------- + + DB::table('sub_areas')->insert([ + 'nome'=>'Clínica Médica', + 'area_id' => '4' + ]); + + //------------------ Ciências Agrárias ---------------- + //Agronomia -------------- + + DB::table('sub_areas')->insert([ + 'nome'=>'Ciência do Solo', + 'area_id' => '5' + ]); + + //------------------ Ciências Sociais Aplicadas ---------------- + //Direito -------------- + + DB::table('sub_areas')->insert([ + 'nome'=>'Teoria do Direito', + 'area_id' => '6' + ]); + + //------------------ Ciências Humanas ---------------- + //Filosofia -------------- + + DB::table('sub_areas')->insert([ + 'nome'=>' História da Filosofia', + 'area_id' => '7' + ]); + + //------------------ Lingüística, Letras e Artes ---------------- + //Lingüística ------------------ + + DB::table('sub_areas')->insert([ + 'nome'=>'Teoria e Análise Lingüística', + 'area_id' => '8' + ]); + } +} diff --git a/database/seeds/UsuarioSeeder.php b/database/seeds/UsuarioSeeder.php new file mode 100644 index 0000000000000000000000000000000000000000..8902037a4c7e5aad4246cc7db7a0986fa999668a --- /dev/null +++ b/database/seeds/UsuarioSeeder.php @@ -0,0 +1,88 @@ +insert([ + + 'name'=>'Administrador', + 'email'=>'admin@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'administrador', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'AdministradorResponsavel1', + 'email'=>'adminResp1@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'administradorResponsavel', + 'email_verified_at'=>'2020-01-01' + ]); + DB::table('users')->insert([ + + 'name'=>'AdministradorResponsavel2', + 'email'=>'adminResp2@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'administradorResponsavel', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'Proponente', + 'email'=>'usuario@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'proponente', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'Coordenador1', + 'email'=>'coordenador1@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'coordenador', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'Coordenador2', + 'email'=>'coordenador2@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'coordenador', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'Participante1', + 'email'=>'part1@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'participante', + 'email_verified_at'=>'2020-01-01' + ]); + + DB::table('users')->insert([ + + 'name'=>'Participante2', + 'email'=>'part2@ufrpe.br', + 'password'=>Hash::make('12345678'), + 'tipo'=>'participante', + 'email_verified_at'=>'2020-01-01' + ]); + + } +} diff --git a/resources/lang/pt-BR/validation.php b/resources/lang/pt-BR/validation.php index 3210d11592b9b162b42b267924a4a8b1e04c62f9..9f4e343090835f4350e12d20157cd359d5956f58 100644 --- a/resources/lang/pt-BR/validation.php +++ b/resources/lang/pt-BR/validation.php @@ -27,6 +27,7 @@ return [ ], 'boolean' => ':Attribute deve ser verdadeiro ou falso.', 'confirmed' => 'A confirmação de :attribute não confere.', + 'cpf' => 'CPF invlálido', 'date' => ':Attribute não é uma data válida.', 'date_format' => ':Attribute não confere com o formato :format.', 'different' => ':Attribute e :other devem ser diferentes.', diff --git a/resources/views/administrador/editais.blade.php b/resources/views/administrador/editais.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..d896b9e26767197810f0f21e66e25d2e1601bdf9 --- /dev/null +++ b/resources/views/administrador/editais.blade.php @@ -0,0 +1,73 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Meus Editais

+
+ +
+
+
+ + + + + + + + + + @foreach ($eventos as $evento) + + + + + + @endforeach + +
Nome do EditalData de CriaçãoOpção
+ + {{ $evento->nome }} + + 10/05/2020 + +
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/administrador/editar_user.blade.php b/resources/views/administrador/editar_user.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..a81dc6b9c12c2109ed28ebeaad0edbdfe68e8568 --- /dev/null +++ b/resources/views/administrador/editar_user.blade.php @@ -0,0 +1,198 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+

{{ __('Editar um usuário') }}

+
+
+
+
+ @csrf +
+ + + + + + @error('nome') + + {{ $message }} + + @enderror + + + + + @error('email') + + {{ $message }} + + @enderror + + + + + @error('cpf') + + {{ $message }} + + @enderror + + + +
+ +
+ + {{-- + + + @error('senha_atual') + + {{ $message }} + + @enderror + + + + + @error('nova_senha') + + {{ $message }} + + @enderror + + + + + @error('confirmar_senha') + + {{ $message }} + + @enderror --}} + + @if ($user->tipo == "proponente") + + @else + + @endif +
+ + +
+
+
+
+ +@endsection + +@section('javascript') + +@endsection \ No newline at end of file diff --git a/resources/views/administrador/index.blade.php b/resources/views/administrador/index.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..196d7905f53c3edefa09b7d8101c3d5ebe0cbca5 --- /dev/null +++ b/resources/views/administrador/index.blade.php @@ -0,0 +1,46 @@ +@extends('layouts.app') + +@section('content') + +
+ +

{{ Auth()->user()->name }}

+ +
+ + + + +
+ + + + +
+ +@endsection diff --git a/resources/views/administrador/novo_user.blade.php b/resources/views/administrador/novo_user.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..e0ce3b1486f2c6d6cc4c822c6ddc1d77806cf7f7 --- /dev/null +++ b/resources/views/administrador/novo_user.blade.php @@ -0,0 +1,188 @@ +@extends('layouts.app') + +@section('content') + +
+
+
+

{{ __('Criar um usuário') }}

+
+ +
+
+
+ @csrf +
+
+
+

Dados do usuário

+
+
+ + + + @error('nome') + + {{ $message }} + + @enderror + + + + + @error('email') + + {{ $message }} + + @enderror + + + + + @error('cpf') + + {{ $message }} + + @enderror + +
+ + +
+ + + + + @error('senha') + + {{ $message }} + + @enderror + + + +
+
+
+ + +
+
+
+ +@endsection + +@section('javascript') + +@endsection \ No newline at end of file diff --git a/resources/views/administrador/usersAdmin.blade.php b/resources/views/administrador/usersAdmin.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..90ea9cdbd3be89a532243d325ca4c90944665572 --- /dev/null +++ b/resources/views/administrador/usersAdmin.blade.php @@ -0,0 +1,112 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Editais

+
+ +
+
+ @if(session('mensagem')) +
+
+

{{session('mensagem')}}

+
+
+ @endif +
+
+
+ + + + + + + + + + + @foreach ($users as $user) + @if (auth()->user()->id != $user->id) + @can('isAdministrador', auth()->user()) + + + + + + + @else + @if ($user->tipo != "administrador" && $user->tipo != "administradorResponsavel") + + + + + + + @endif + @endcan + @endif + @endforeach + +
NomeTipoData de CriaçãoOpções
+ {{ $user->name }} + {{ $user->tipo }}{{ $user->creaet_at }} + +
+ {{ $user->name }} + {{ $user->tipo }}{{ $user->creaet_at }} + +
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/administrador/usuarios.blade.php b/resources/views/administrador/usuarios.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..34e60dd1fd72acda6242dd5c7f0df2f6a90b5dd8 --- /dev/null +++ b/resources/views/administrador/usuarios.blade.php @@ -0,0 +1,64 @@ +@extends('layouts.app') + +@section('content') + +
+ +

Administrador

+ +
+ + + + + + +
+ + + + +
+ +@endsection diff --git a/resources/views/administradorResponsavel/editais.blade.php b/resources/views/administradorResponsavel/editais.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..d896b9e26767197810f0f21e66e25d2e1601bdf9 --- /dev/null +++ b/resources/views/administradorResponsavel/editais.blade.php @@ -0,0 +1,73 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Meus Editais

+
+ +
+
+
+ + + + + + + + + + @foreach ($eventos as $evento) + + + + + + @endforeach + +
Nome do EditalData de CriaçãoOpção
+ + {{ $evento->nome }} + + 10/05/2020 + +
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/administradorResponsavel/index.blade.php b/resources/views/administradorResponsavel/index.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..63a91702268b4674c97bbe87ed70e5b0cfa36f23 --- /dev/null +++ b/resources/views/administradorResponsavel/index.blade.php @@ -0,0 +1,32 @@ +@extends('layouts.app') + +@section('content') + +
+ +

{{ Auth()->user()->name }}

+
+ + + +
+
+ +@endsection diff --git a/resources/views/administradorResponsavel/listarUsuarios.blade.php b/resources/views/administradorResponsavel/listarUsuarios.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..13711d9f21136c1842209e0ca9bee7767779d50a --- /dev/null +++ b/resources/views/administradorResponsavel/listarUsuarios.blade.php @@ -0,0 +1,41 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Usuarios

+
+
+
+
+ + + + + + + + + + @foreach ($usuarios as $usuario) + + + + + + @endforeach + +
Nome do UsuárioData de CriaçãoOpção
{{ $usuario->user->name }}{{ $usuario->user->email }}3
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/administradorResponsavel/usuarios.blade.php b/resources/views/administradorResponsavel/usuarios.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..28c97a9065b44b4177bbe1ca601aa8724c65ae17 --- /dev/null +++ b/resources/views/administradorResponsavel/usuarios.blade.php @@ -0,0 +1,55 @@ +@extends('layouts.app') + +@section('content') + +
+ +

{{ Auth()->user()->name }}

+ +
+ + + + + + +
+ + + + +
+ +@endsection diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 1dc6793c4decbb44e20e9e0aa956157bdbffe7e6..66d55384cbc962fe9420093f74ccb6b4d604ecb9 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -210,7 +210,7 @@
- Cancelar Cadastro + Cancelar Cadastro

Visualizar Evento

diff --git a/resources/views/coordenadorComissao/editais.blade.php b/resources/views/coordenadorComissao/editais.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..4fded1c3c72774b2821697cdc67f5e2948cdc6fb --- /dev/null +++ b/resources/views/coordenadorComissao/editais.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Meus Editais

+
+
+
+
+ + + + + + + + + + @foreach ($eventos as $evento) + + + + + + @endforeach + +
Nome do EditalData de CriaçãoOpção
+ + {{ $evento->nome }} + + 10/05/2020 + +
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/coordenadorComissao/index.blade.php b/resources/views/coordenadorComissao/index.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..5251517fa7955184ac5dff6f0e565e2233c71553 --- /dev/null +++ b/resources/views/coordenadorComissao/index.blade.php @@ -0,0 +1,37 @@ +@extends('layouts.app') + +@section('content') + +
+ +

{{ Auth()->user()->name }}

+ +
+ + + +
+ + + + +
+ +@endsection diff --git a/resources/views/coordenadorComissao/listarUsuarios.blade.php b/resources/views/coordenadorComissao/listarUsuarios.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..faaae4763ae96fd3ea58d39258d4a75ac57df8ae --- /dev/null +++ b/resources/views/coordenadorComissao/listarUsuarios.blade.php @@ -0,0 +1,136 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Usuarios

+
+
+
+
+ + + + + + + + + + @foreach ($usuarios as $usuario) + + + + + + @endforeach + +
Nome do UsuárioE-mailOpção
{{ $usuario->user->name }}{{ $usuario->user->email }} +
+ @csrf + + + + + + +
+
+
+ + + + +@endsection + +@section('javascript') + +@endsection + + diff --git a/resources/views/coordenadorComissao/usuarios.blade.php b/resources/views/coordenadorComissao/usuarios.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..28c97a9065b44b4177bbe1ca601aa8724c65ae17 --- /dev/null +++ b/resources/views/coordenadorComissao/usuarios.blade.php @@ -0,0 +1,55 @@ +@extends('layouts.app') + +@section('content') + +
+ +

{{ Auth()->user()->name }}

+ +
+ + + + + + +
+ + + + +
+ +@endsection diff --git a/resources/views/evento/criarEvento.blade.php b/resources/views/evento/criarEvento.blade.php index 520564879672696bdd66d4fc184b9958a1d1c4a3..c095428ec460439b1a6841515a050b9e645b8fa1 100644 --- a/resources/views/evento/criarEvento.blade.php +++ b/resources/views/evento/criarEvento.blade.php @@ -3,7 +3,7 @@ @section('content')
-

Novo Evento

+

Novo Edital

@@ -25,34 +25,13 @@ @enderror
- - {{--
- - - - @error('numeroParticipantes') - - {{ $message }} - - @enderror -
--}} - +
@error('tipo') @@ -63,7 +42,7 @@
{{-- end nome | Participantes | Tipo--}} - {{-- Descricao Evento --}} + {{-- Descricao Edital --}}
@@ -77,52 +56,23 @@
-
-
- - - - @error('dataInicio') - - {{ $message }} - - @enderror -
-
- - - - @error('dataFim') - - {{ $message }} - - @enderror +
+ +
-
- - {{-- Foto Evento --}} -
-
-
- - - @error('fotoEvento') - - {{ $message }} - - @enderror -
-
-
-

Trabalhos

+

Projetos

- {{-- dataInicio | dataFim | inicioSubmissao | fimSubmissao --}}
@@ -150,7 +100,7 @@
- + @error('inicioRevisao') @@ -160,7 +110,7 @@ @enderror
- + @error('fimRevisao') @@ -171,144 +121,62 @@
- {{-- inicioRevisao | fimRevisao | inicioResultado | fimResultado--}} -
- -
- - - - @error('inicioResultado') - - {{ $message }} - - @enderror -
-
- - +
+
+ + - @error('fimResultado') - - {{ $message }} - - @enderror -
-
{{-- end inicioRevisao | fimRevisao | inicioResultado | fimResultado--}} + @error('resultado') + + {{ $message }} + + @enderror +
+
-
+
-

Endereço

+

Documentos

- {{-- Rua | Número | Bairro --}} -
-
- - - @error('cep') - - {{ $message }} - - @enderror -
+ {{-- Pdf Edital --}} +
- - - - @error('rua') - - {{ $message }} - - @enderror -
-
- - - - @error('numero') - - {{ $message }} - - @enderror -
- - -
{{--end Rua | Número | Bairro --}} - -
-
- - - - @error('bairro') - - {{ $message }} - - @enderror -
-
- - - - @error('cidade') - - {{ $message }} - - @enderror +
+ + + O arquivo selecionado deve ser no formato PDF de até xmb. + @error('pdfEdital') + + {{ $message }} + + @enderror +
-
- - {{-- --}} - - - @error('uf') - - {{ $message }} - - @enderror + +
+
+ + + O arquivo selecionado deve ter até xmb. + @error('modeloDocumento') + + {{ $message }} + + @enderror +
- -
+
diff --git a/resources/views/evento/editarEvento.blade.php b/resources/views/evento/editarEvento.blade.php index c172875604665a2c806fdd5687f4a3afa885191d..99e29b7bdba034a8c68d4c8ba78af93eeca5eb42 100644 --- a/resources/views/evento/editarEvento.blade.php +++ b/resources/views/evento/editarEvento.blade.php @@ -6,7 +6,7 @@

{{$evento->nome}}

- + @csrf
@@ -25,35 +25,15 @@ @enderror
{{--End Nome do evento--}} - {{--Número de Participantes--}} - {{--
- - - - @error('numeroParticipantes') - - {{ $message }} - - @enderror -
--}} + {{-- Tipo do evento --}}
- + + + @error('tipo') @@ -68,7 +48,7 @@
- + @error('descricao') {{ $message }} @@ -78,49 +58,9 @@
-
- {{-- Início do Evento --}} -
- - - - @error('dataInicio') - - {{ $message }} - - @enderror -
{{--End Início do Evento --}} - {{-- Fim do Evento --}} -
- - - - @error('dataFim') - - {{ $message }} - - @enderror -
{{-- end Fim do Evento --}} -
- - {{-- Foto Evento --}} -
-
-
- - - @error('fotoEvento') - - {{ $message }} - - @enderror -
-
-
-
-

Trabalhos

+

Projetos

{{-- dataInicio | dataFim | inicioSubmissao | fimSubmissao --}} @@ -171,24 +111,15 @@ @enderror
+ {{-- inicioRevisao | fimRevisao | inicioResultado | fimResultado--}} -
- -
- - +
- @error('inicioResultado') - - {{ $message }} - - @enderror -
- - + + - @error('fimResultado') + @error('resultado') {{ $message }} @@ -196,112 +127,47 @@
{{-- end inicioRevisao | fimRevisao | inicioResultado | fimResultado--}} - -
+
-

Endereço

+

Documentos

- - {{-- Rua | Número | Bairro --}} -
-
- - - - @error('cep') - - {{ $message }} - - @enderror -
+ + {{-- Pdf Edital --}} +
- - - - @error('rua') - - {{ $message }} - - @enderror -
-
- - - - @error('numero') - - {{ $message }} - - @enderror -
- - -
{{--end Rua | Número | Bairro --}} - -
-
- - - - @error('bairro') - - {{ $message }} - - @enderror -
-
- - - - @error('cidade') - - {{ $message }} - - @enderror +
+ + + + + + O arquivo selecionado deve ser no formato PDF de até xmb. + @error('pdfEdital') + + {{ $message }} + + @enderror +
-
- - {{-- --}} - - - @error('uf') - - {{ $message }} - - @enderror + +
+
+ + + + + + O arquivo selecionado deve ter até xmb. + @error('modeloDocumento') + + {{ $message }} + + @enderror +
-
+
@@ -309,7 +175,7 @@
diff --git a/resources/views/evento/listarEvento.blade.php b/resources/views/evento/listarEvento.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..5f4e01eb1f267cce2a9e739969181aa5d6dee8b6 --- /dev/null +++ b/resources/views/evento/listarEvento.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') + +
+ +
+
+
+

Editais

+
+
+
+
+ + + + + + + + + + @foreach ($eventos as $evento) + + + + + + @endforeach + +
Nome do EditalData de CriaçãoOpção
+ + {{ $evento->nome }} + + 10/05/2020 + +
+
+ +@endsection + +@section('javascript') + +@endsection diff --git a/resources/views/evento/submeterTrabalho.blade.php b/resources/views/evento/submeterTrabalho.blade.php index bbffe7921b4138f9139ad3caa8f4bbd0d0b77b8d..eadb0246af76f9a12385fa2bd7b3e3d1d364f6c0 100644 --- a/resources/views/evento/submeterTrabalho.blade.php +++ b/resources/views/evento/submeterTrabalho.blade.php @@ -4,25 +4,20 @@
-
+
-
Enviar Trabalho
+
Enviar Projeto

@csrf - -
- @error('numeroMax') - @include('componentes.mensagens') - @enderror -
- + + + {{-- Nome do Projeto --}}
- {{-- Nome Trabalho --}}
- - + + @error('nomeTrabalho') @@ -31,48 +26,29 @@ @enderror
- + + {{-- Grande Area --}}
- {{-- Nome Trabalho --}} -
- - -
-
- -
-
-
+
+ + + @error('grandeAreaId') + + {{ $message }} + + @enderror
- Coautor + -
-
- - - @if($evento->hasResumo) -
-
- - - - @error('resumo') - - {{ $message }} - - @enderror - - -
-
- @endif - -
-
+
@@ -83,32 +59,146 @@ @enderror
-
- - -
-
- - + + @foreach($subAreas as $subArea) + + @endforeach - @error('modalidadeId') + @error('subAreaId') {{ $message }} @enderror
+ + + + + + + + + +
+

Coordenador

+ + {{-- Coordenador --}} +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + {{-- Pontuação da Planilha de Pontuação --}} +
+ {{-- Nome Trabalho --}} + +
+ + + + {{-- Link do grupo de pesquisa --}} +
+ +
+ + {{-- Link do grupo de pesquisa --}} +
+ +
+ +
+

Anexos

+ + {{-- Anexo do Projeto --}}
{{-- Arquivo --}} -
- +
+ -
- +
+ +
+ + +
+
+ @error('anexoProjeto') + + {{ $message }} + + @enderror +
+ +
+ + +
+ +
+ + +
+
+ @error('arquivo') + + {{ $message }} + + @enderror +
+ +
+ + +
+ +
+ + +
+
+ @error('arquivo') + + {{ $message }} + + @enderror +
+ +
+ + +
+ +
+ + +
- O arquivo Selecionado deve ser no formato PDF de até 2mb. @error('arquivo') {{ $message }} @@ -117,12 +207,142 @@
+ + + @if($edital->tipo == 'PIBIC' || $edital->tipo == 'PIBIC-EM') + {{-- Decisão do CONSU --}} +
+ {{-- Arquivo --}} +
+ + +
+ +
+ + +
+
+ @error('arquivo') + + {{ $message }} + + @enderror +
+
+ @endif + + +
+

Participantes

+ + {{-- Participantes --}} +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+
+ +
+ Participantes + +
+
+ {{-- Plano de Trabalho --}} +

Plano de Trabalho

+
+
+
+
+
+ + +
+ {{-- Arquivo --}} +
+ +
+
+ Selecione um arquivo: +
+
+ + +
+
+ @error('anexoPlanoTrabalho') + + {{ $message }} + + @enderror +
+
+ + + +
+ + +
+
+ Plano de Trabalho + +
+

@@ -100,16 +100,7 @@
-

Realização do Evento

-

- - {{date('d/m/Y',strtotime($evento->dataInicio))}} - {{date('d/m/Y',strtotime($evento->dataFim))}} -

-
-
-
-
-

Submissão de Trabalhos

+

Submissão de Projetos

{{date('d/m/Y',strtotime($evento->inicioSubmissao))}} - {{date('d/m/Y',strtotime($evento->fimSubmissao))}} @@ -118,35 +109,38 @@

-

Revisão de Trabalhos

+ +

Revisão de Projetos

{{date('d/m/Y',strtotime($evento->inicioRevisao))}} - {{date('d/m/Y',strtotime($evento->fimRevisao))}} -

+

--}}
-
-

Endereço

+ +

Data do resultado

- - {{$evento->endereco->rua}}, {{$evento->endereco->numero}} - {{$evento->endereco->cidade}} / {{$evento->endereco->uf}}. + + {{date('d/m/Y',strtotime($evento->resultado))}}

+
+ @if($hasFile == true)

- Meus Trabalhos + Meus Projetos

@if($hasTrabalho)
-

Como Autor

+

Como Proponente

@@ -197,7 +191,7 @@
@endif - @if($hasTrabalhoCoautor) +{{-- @if($hasTrabalhoCoautor)

Como Coautor

@@ -237,19 +231,19 @@
- @endif + @endif --}} @endif
@if($evento->inicioSubmissao <= $mytime) @if($mytime < $evento->fimSubmissao) @endif @endif diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 7eb6bedb32921e707a221a6845d584964a9fe80d..8cb708cc0401879a815ff8efacdec999c8add960 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -102,7 +102,7 @@
-

Eventos em curso

+

Editais em curso

@@ -156,21 +156,22 @@

- Realização: {{date('d/m/Y',strtotime($evento->dataInicio))}} - {{date('d/m/Y',strtotime($evento->dataFim))}}
Submissão: {{date('d/m/Y',strtotime($evento->inicioSubmissao))}} - {{date('d/m/Y',strtotime($evento->fimSubmissao))}}
Revisão: {{date('d/m/Y',strtotime($evento->inicioRevisao))}} - {{date('d/m/Y',strtotime($evento->fimRevisao))}}
+ Resultado: {{date('d/m/Y',strtotime($evento->resultado))}}

+

- Visualizar Evento + Visualizar Edital

@@ -180,7 +181,7 @@
Mais Eventos + style="margin-bottom:10px;" role="button">Mais Editais
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 5d11af54ab2843fa187787ac59763f70e2d5472c..d2721ac0a41ee22a5775d8eb4db8dea119f69d29 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -28,7 +28,7 @@ {{-- Navbar --}}
-

Como Autor

+

Como Proponente

@@ -82,7 +80,7 @@ - {{-- @foreach($trabalhos as $trabalho) + @foreach($trabalhos as $trabalho) {{$trabalho->titulo}} @@ -104,7 +102,7 @@ - @endforeach --}} + @endforeach
diff --git a/resources/views/user/perfilUser.blade.php b/resources/views/user/perfilUser.blade.php index bf20e0cc359adb009d6815fa57c138937ac91c0e..451cf74c25fac8d46417735b01d19304d428a41e 100644 --- a/resources/views/user/perfilUser.blade.php +++ b/resources/views/user/perfilUser.blade.php @@ -67,14 +67,123 @@
+
+ +
+ + + + @error('instituicao') + + {{ $message }} + + @enderror +
+ +
+
-

Endereço

+

Permissões

- {{-- Endereço --}} + @if (!(is_null($adminResp))) +
+
+ Tem pemissão de Administrador Responsável +
+
+ @else +
+
+ Não tem pemissão de Administrador Responsável +
+
+ @endif + + @if (!(is_null($avaliador))) +
+
+ Tem pemissão de Aváliador +
+
+ @else +
+
+ Não tem pemissão de Aváliador +
+
+ @endif + + @if (!(is_null($proponente))) +
+
+ Tem pemissão de proponente +
+
+
+
+

Dados de proponente

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ @else +
+
+ Não tem pemissão de proponente +
+
+ @endif + + @if (!(is_null($participante))) +
+
+ Tem pemissão de participante +
+
+ @else
+
+ Não tem pemissão de participante +
+
+ @endif + {{--
+
+

Endereço

+
+
--}} + + {{-- Endereço --}} + {{--
@@ -133,7 +242,7 @@
- {{-- --}} + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ @else
+
+ Não tem pemissão de proponente +
+
+ @endif + + @if (!(is_null($participante))) +
+
+ Tem pemissão de participante +
+
+ @else +
+
+ Não tem pemissão de participante +
+
+ @endif + + {{--
+
+

Endereço

+
+
--}} + + {{-- Endereço --}} + {{--
@@ -320,7 +525,6 @@
- {{-- --}}