diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index 4aaa7e50fd4a2a219e9e9c6c583c9c4ccd02ba26..1cc311ed85bdf96de529c726c472e9e94f059ea6 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -93,8 +93,8 @@ class TrabalhoController extends Controller 'area' => ['required', 'string'], 'subArea' => ['required', 'string'], 'pontuacaoPlanilha' => ['required', 'string'], - 'linkGrupo' => ['required', 'string'], - 'linkLattesEstudante' => ['required', 'string'], + 'linkGrupo' => ['required', 'string', 'link_grupo'], + 'linkLattesEstudante' => ['required', 'string', 'link_lattes'], 'nomeParticipante.*' => ['required', 'string'], 'emailParticipante.*' => ['required', 'string'], 'funcaoParticipante.*' => ['required', 'string'], @@ -142,8 +142,8 @@ class TrabalhoController extends Controller 'area' => ['required', 'string'], 'subArea' => ['required', 'string'], 'pontuacaoPlanilha' => ['required', 'string'], - 'linkGrupo' => ['required', 'string'], - 'linkLattesEstudante' => ['required', 'string'], + 'linkGrupo' => ['required', 'string', 'link_grupo'], + 'linkLattesEstudante' => ['required', 'string', 'link_lattes'], 'nomeParticipante.*' => ['required', 'string'], 'emailParticipante.*' => ['required', 'string'], 'funcaoParticipante.*' => ['required', 'string'], diff --git a/app/Mail/EmailLembrete.php b/app/Mail/EmailLembrete.php index bb0376698d0e3a7b274617c6f231280575306a32..7faf6f728855d83d6f0a79bcea15f45275bc470c 100644 --- a/app/Mail/EmailLembrete.php +++ b/app/Mail/EmailLembrete.php @@ -36,8 +36,8 @@ class EmailLembrete extends Mailable */ public function build() { - $subject = 'Eventos - Lembrete de Evento'; - return $this->from('lmtsteste@gmail.com', 'Eventos - LMTS') + $subject = 'Submeta - Lembrete de Edital'; + return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') ->subject($this->subject) ->view('emails.emailLembreteRevisor') ->with([ diff --git a/app/Mail/EventoCriado.php b/app/Mail/EventoCriado.php index c37e768454b517956eb5e1f307e53474b0308ab7..a0a0d5b2a190cfdaf634e55d3b35a2e7a2b7ac98 100644 --- a/app/Mail/EventoCriado.php +++ b/app/Mail/EventoCriado.php @@ -37,7 +37,7 @@ class EventoCriado extends Mailable public function build() { - return $this->from('lmtsteste@gmail.com', 'Eventos - LMTS') + return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') ->subject($this->subject) ->view('emails.emailEventoCriado') ->with([ diff --git a/app/Mail/SubmissaoTrabalho.php b/app/Mail/SubmissaoTrabalho.php index a0fbef9baa661c5d877d78a2cee65ae067f934ce..f8ea1cf00c826bc45d224026495ccc8c6128d125 100644 --- a/app/Mail/SubmissaoTrabalho.php +++ b/app/Mail/SubmissaoTrabalho.php @@ -35,7 +35,7 @@ class SubmissaoTrabalho extends Mailable public function build() { - return $this->from('lmtsteste@gmail.com', 'Eventos - LMTS') + return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') ->subject($this->subject) ->view('emails.submissaoTrabalho'); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index a9f3552931f3003e096152f5889db1bcc814fda8..8065fc36ea9ae9045fb1b00fc8033029ee1514f0 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -26,5 +26,6 @@ class AppServiceProvider extends ServiceProvider { Validator::extend('cpf', '\App\Utils\CpfValidation@validate'); Validator::extend('link_lattes', '\App\Utils\LattesValidation@validate', 'Link inválido'); + Validator::extend('link_grupo', '\App\Utils\GrupoPesquisaValidation@validate', 'Link inválido'); } } diff --git a/app/Utils/GrupoPesquisaValidation.php b/app/Utils/GrupoPesquisaValidation.php new file mode 100644 index 0000000000000000000000000000000000000000..0685205e67f92bceab4071ad1cd54c76ed319d8e --- /dev/null +++ b/app/Utils/GrupoPesquisaValidation.php @@ -0,0 +1,55 @@ +isValidUrl($value); + } + + function isValidUrl($url) + { + // first do some quick sanity checks: + if (!$url || !is_string($url)) { + return false; + } + + $url = filter_var($url, FILTER_SANITIZE_URL); + + // Validate url + if (!filter_var($url, FILTER_VALIDATE_URL)) { + return false; + } + + // if(parse_url($url)['host'] != 'dgp.cnpq.br'){ + // return false; + // } + + if($this->getHttpResponseCode_using_getheaders($url) != 200){ + return false; + } + + return true; + } + + function getHttpResponseCode_using_getheaders($url, $followredirects = true) + { + if (!$url || !is_string($url)) { + return false; + } + $headers = @get_headers($url); + if ($headers && is_array($headers)) { + if ($followredirects) { + $headers = array_reverse($headers); + } + foreach ($headers as $hline) { + if (preg_match('/^HTTP\/\S+\s+([1-9][0-9][0-9])\s+.*/', $hline, $matches)) { + $code = $matches[1]; + return $code; + } + } + return false; + } + return false; + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index e1996fe8adc447136dde612900cfdaf41f1b9b67..ddf6993c436b4604e88c7ec78b34890701ff4fa9 100644 --- a/composer.lock +++ b/composer.lock @@ -1831,7 +1831,7 @@ }, { "name": "symfony/console", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1908,7 +1908,7 @@ }, { "name": "symfony/css-selector", - "version": "v5.1.0", + "version": "v5.1.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -1961,7 +1961,7 @@ }, { "name": "symfony/debug", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -2018,7 +2018,7 @@ }, { "name": "symfony/error-handler", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", @@ -2075,7 +2075,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2203,7 +2203,7 @@ }, { "name": "symfony/finder", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2252,7 +2252,7 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", @@ -2307,16 +2307,16 @@ }, { "name": "symfony/http-kernel", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "54526b598d7fc86a67850488b194a88a79ab8467" + "reference": "81d42148474e1852a333ed7a732f2a014af75430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/54526b598d7fc86a67850488b194a88a79ab8467", - "reference": "54526b598d7fc86a67850488b194a88a79ab8467", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/81d42148474e1852a333ed7a732f2a014af75430", + "reference": "81d42148474e1852a333ed7a732f2a014af75430", "shasum": "" }, "require": { @@ -2394,20 +2394,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2020-05-31T05:25:51+00:00" + "time": "2020-06-12T11:15:37+00:00" }, { "name": "symfony/mime", - "version": "v5.1.0", + "version": "v5.1.1", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "56261f89385f9d13cf843a5101ac72131190bc91" + "reference": "c0c418f05e727606e85b482a8591519c4712cf45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/56261f89385f9d13cf843a5101ac72131190bc91", - "reference": "56261f89385f9d13cf843a5101ac72131190bc91", + "url": "https://api.github.com/repos/symfony/mime/zipball/c0c418f05e727606e85b482a8591519c4712cf45", + "reference": "c0c418f05e727606e85b482a8591519c4712cf45", "shasum": "" }, "require": { @@ -2457,7 +2457,7 @@ "mime", "mime-type" ], - "time": "2020-05-25T12:33:44+00:00" + "time": "2020-06-09T15:07:35+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2874,7 +2874,7 @@ }, { "name": "symfony/process", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2923,7 +2923,7 @@ }, { "name": "symfony/routing", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", @@ -3057,7 +3057,7 @@ }, { "name": "symfony/translation", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -3190,7 +3190,7 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.9", + "version": "v4.4.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", diff --git a/config/app.php b/config/app.php index c9960cde592486d47266cbf812fc89d5cea81493..3c45c548564ea1343c1ddd482d018c948e4d98ab 100644 --- a/config/app.php +++ b/config/app.php @@ -67,7 +67,7 @@ return [ | */ - 'timezone' => 'UTC', + 'timezone' => 'America/Recife', /* |-------------------------------------------------------------------------- @@ -80,7 +80,7 @@ return [ | */ - 'locale' => 'en', + 'locale' => 'pt-BR', /* |-------------------------------------------------------------------------- @@ -93,7 +93,7 @@ return [ | */ - 'fallback_locale' => 'en', + 'fallback_locale' => 'pt-BR', /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2020_05_23_054945_create_participantes_table.php b/database/migrations/2020_05_23_054945_create_participantes_table.php index b944cc5724483c807065b3500707f6ee55633d37..88cb893ff61c5d5f086e3be0dff4660c5268b021 100644 --- a/database/migrations/2020_05_23_054945_create_participantes_table.php +++ b/database/migrations/2020_05_23_054945_create_participantes_table.php @@ -24,7 +24,7 @@ class CreateParticipantesTable extends Migration $table->foreign('trabalho_id')->references('id')->on('trabalhos'); $table->unsignedBigInteger('funcao_participante_id')->nullable(); - $table->foreign('funcao_participante_id')->references('id')->on('funcao_participantes'); + $table->foreign('funcao_participante_id')->references('id')->on('funcao_participantes')->onDelete('cascade'); $table->softDeletes(); }); diff --git a/database/seeds/FuncaoParticipanteSeeder.php b/database/seeds/FuncaoParticipanteSeeder.php index 252de374e258a0fe0f12c73b7cf8a7420e0dda58..9fd486b63f53f4256c83e18eee4c28eb16a216b2 100644 --- a/database/seeds/FuncaoParticipanteSeeder.php +++ b/database/seeds/FuncaoParticipanteSeeder.php @@ -31,10 +31,6 @@ class FuncaoParticipanteSeeder extends Seeder ]); - DB::table('funcao_participantes')->insert([ - 'nome'=>'Estudante', - - ]); DB::table('funcao_participantes')->insert([ 'nome'=>'Voluntário', diff --git a/database/seeds/SubAreaSeeder.php b/database/seeds/SubAreaSeeder.php index 1ed04116dd18dc6ab1ad2dad41d3a3f50d8eb12e..349438bfb7bc0162fb602b4d5c17ec0c1ba0b07c 100644 --- a/database/seeds/SubAreaSeeder.php +++ b/database/seeds/SubAreaSeeder.php @@ -46,15 +46,7 @@ class SubAreaSeeder extends Seeder DB::table('sub_areas')->insert([ 'nome'=>'Teoria da Computação', 'area_id' => '1' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Matemática Aplicada', - 'area_id' => '1' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Matemática Aplicada', - 'area_id' => '1' - ]); + ]); DB::table('sub_areas')->insert([ 'nome'=>'Matemática da Computação', 'area_id' => '1' @@ -195,11 +187,7 @@ class SubAreaSeeder extends Seeder DB::table('sub_areas')->insert([ 'nome'=>'Morfologia Vegetal', 'area_id' => '2' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Morfologia Vegetal', - 'area_id' => '2' - ]); + ]); DB::table('sub_areas')->insert([ 'nome'=>'Fisiologia Vegetal', 'area_id' => '2' @@ -333,11 +321,7 @@ class SubAreaSeeder extends Seeder DB::table('sub_areas')->insert([ 'nome'=>'Neuropsicofarmacologia', 'area_id' => '2' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Farmacologia Cardiorenal', - 'area_id' => '2' - ]); + ]); DB::table('sub_areas')->insert([ 'nome'=>'Farmacologia Cardiorenal', 'area_id' => '2' @@ -434,11 +418,7 @@ class SubAreaSeeder extends Seeder DB::table('sub_areas')->insert([ 'nome'=>'Instalações e Equipamentos Metalúrgicos', 'area_id' => '3' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Instalações e Equipamentos Metalúrgicos', - 'area_id' => '3' - ]); + ]); DB::table('sub_areas')->insert([ 'nome'=>'Metalurgia de Transformação', 'area_id' => '3' @@ -1357,11 +1337,7 @@ class SubAreaSeeder extends Seeder DB::table('sub_areas')->insert([ 'nome'=>'Literaturas Estrangeiras Modernas', 'area_id' => '8' - ]); - DB::table('sub_areas')->insert([ - 'nome'=>'Literaturas Estrangeiras Modernas', - 'area_id' => '8' - ]); + ]); DB::table('sub_areas')->insert([ 'nome'=>'Literaturas Clássicas', 'area_id' => '8' diff --git a/resources/views/administrador/editar_user.blade.php b/resources/views/administrador/editar_user.blade.php index 4610305b452280e522707d0ae93276c074a22ee2..a096a8505893aef66648eca7b0218d893a6907ac 100644 --- a/resources/views/administrador/editar_user.blade.php +++ b/resources/views/administrador/editar_user.blade.php @@ -104,7 +104,7 @@ @enderror --}} - @if ($user->tipo == "proponente") + @if ($user->tipo == "proponente" && !(is_null($proponente)))
-Projetos
@@ -148,7 +148,7 @@ @enderrorDocumentos
@@ -159,9 +159,9 @@