diff --git a/app/Avaliador.php b/app/Avaliador.php index a286af9017ed53781f9c1f81786a12a668707f87..b1c813708bfb0208d9fd7c374d3a9ef3695ad6b4 100755 --- a/app/Avaliador.php +++ b/app/Avaliador.php @@ -19,7 +19,7 @@ class Avaliador extends Model return $this->belongsTo('App\User'); } public function trabalhos(){ - return $this->belongsToMany('App\Trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at'); + return $this->belongsToMany('App\Trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at','pontuacao'); } public function planoTrabalhos(){ return $this->belongsToMany('App\Arquivo', 'avaliadors_plano_trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at'); diff --git a/app/Evento.php b/app/Evento.php index 6724cead2789545c6203062b89eae8191b0b9e7d..2970de0d2425967dbe237333c367375c6a6f541a 100755 --- a/app/Evento.php +++ b/app/Evento.php @@ -17,7 +17,8 @@ class Evento extends Model 'resultado_final','resultado_preliminar', 'coordenadorId', 'numMaxTrabalhos', 'numMaxCoautores', 'hasResumo', 'criador_id', 'numParticipantes', 'dt_inicioRelatorioParcial', 'dt_fimRelatorioParcial', 'dt_inicioRelatorioFinal', 'dt_fimRelatorioFinal', - 'formAvaliacaoExterno', 'formAvaliacaoInterno' + 'formAvaliacaoExterno', 'formAvaliacaoInterno', + 'cotaDoutor' ]; public function endereco(){ diff --git a/app/Http/Controllers/AdministradorController.php b/app/Http/Controllers/AdministradorController.php index 0faab693b5daebbd63c65c4ad8556283c0408679..345537c69d1b1479cd7f891d6acbf44070e5f358 100755 --- a/app/Http/Controllers/AdministradorController.php +++ b/app/Http/Controllers/AdministradorController.php @@ -32,6 +32,8 @@ use App\Mail\EmailLembrete; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; use Illuminate\Pagination\LengthAwarePaginator; +use Illuminate\Support\Facades\Notification; +use App\Notifications\AtribuicaoAvaliadorExternoNotification; class AdministradorController extends Controller { @@ -147,8 +149,6 @@ class AdministradorController extends Controller $trabalhos = $trabalhos->sort(function ($item, $next) { return $item->pontuacao >= $next->pontuacao ? -1 : 1; }); - $trabalhos = $this->paginate($trabalhos) - ->withPath('/usuarios/showResultados?evento_id='.$evento->id);; return view('administrador.resultadosProjetos')->with(['evento' => $evento, 'trabalhos' => $trabalhos]); } @@ -575,6 +575,9 @@ class AdministradorController extends Controller $trabalho->save(); foreach ($avaliadores as $avaliador){ + + $userTemp = User::find($avaliador->user->id); + $notificacao = Notificacao::create([ 'remetente_id' => Auth::user()->id, 'destinatario_id' => $avaliador->user_id, @@ -583,6 +586,9 @@ class AdministradorController extends Controller 'tipo' => 5, ]); $notificacao->save(); + if($avaliador->tipo == "Externo"){ + Notification::send($userTemp, new AtribuicaoAvaliadorExternoNotification($userTemp,$trabalho)); + } } diff --git a/app/Http/Controllers/AvaliadorController.php b/app/Http/Controllers/AvaliadorController.php index 6e47480dda9583d1d5e0c9ec9b5c5e7ea22b359f..ba9e4a334328a21c432fce377f57081a0b9338cb 100755 --- a/app/Http/Controllers/AvaliadorController.php +++ b/app/Http/Controllers/AvaliadorController.php @@ -194,18 +194,27 @@ class AvaliadorController extends Controller $trabalho->save(); $data = Carbon::now('America/Recife'); if($request->anexoParecer == ''){ - + if($evento->tipo == "PIBEX"){ + $avaliador->trabalhos() + ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data, 'pontuacao' => $request->pontuacao]); + }else{ $avaliador->trabalhos() - ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]); + ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]); + } }else{ $anexoParecer = $request->anexoParecer; $path = 'anexoParecer/' . $avaliador->id . $trabalho->id . '/'; $nome = $anexoParecer->getClientOriginalName(); - Storage::putFileAs($path, $anexoParecer, $nome); - $anexoParecer = $path . $nome; - - $avaliador->trabalhos() - ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer,'AnexoParecer'=> $anexoParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]); + Storage::putFileAs($path, $anexoParecer, $nome); + $anexoParecer = $path . $nome; + + if($evento->tipo == "PIBEX"){ + $avaliador->trabalhos() + ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer,'AnexoParecer'=> $anexoParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data, 'pontuacao' => $request->pontuacao]); + }else{ + $avaliador->trabalhos() + ->updateExistingPivot($trabalho->id,['status'=> 1,'parecer'=>$request->textParecer,'AnexoParecer'=> $anexoParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]); + } } diff --git a/app/Http/Controllers/EventoController.php b/app/Http/Controllers/EventoController.php index d0b26c3e35879ee671398ab77abd2817fbee88d9..dd6620fe58397014d678753d441cf67c35b9f7b2 100755 --- a/app/Http/Controllers/EventoController.php +++ b/app/Http/Controllers/EventoController.php @@ -181,6 +181,7 @@ class EventoController extends Controller $evento['criador_id'] = $user_id; $evento['numParticipantes'] = $request->numParticipantes; $evento['consu'] = $request->has('consu'); + $evento['cotaDoutor'] = $request->has('cotaDoutor'); $evento['anexosStatus'] = 'final'; //dd($evento); @@ -441,6 +442,7 @@ class EventoController extends Controller $evento->dt_fimRelatorioFinal = $request->dt_fimRelatorioFinal; $evento->coordenadorId = $request->coordenador_id; $evento->consu = $request->has('consu'); + $evento->cotaDoutor = $request->has('cotaDoutor'); if($request->pdfEdital != null){ $pdfEdital = $request->pdfEdital; $path = 'pdfEdital/' . $evento->id . '/'; diff --git a/app/Http/Controllers/ParticipanteController.php b/app/Http/Controllers/ParticipanteController.php index a228e1fe750653882059caecdf576e0df5d1c369..e2c4b5cc76453a1bd3d6269c45a06e581ed1289d 100755 --- a/app/Http/Controllers/ParticipanteController.php +++ b/app/Http/Controllers/ParticipanteController.php @@ -99,23 +99,11 @@ class ParticipanteController extends Controller return view('documentacaoComplementar.listar')->with(['participantes' => $participantes, 'trabalho' => $trabalho]); } - public function alterarBolsa($id,$tipo){ - $participante = Participante::find($id); - if($participante->tipoBolsa ==null){ - if($tipo==1){ - $participante->tipoBolsa = "Voluntario"; - }else{ - $participante->tipoBolsa = "Bolsista"; - } - }else{ - if($participante->tipoBolsa == "Bolsista"){ - $participante->tipoBolsa = "Voluntario"; - }else{ - $participante->tipoBolsa = "Bolsista"; - } - } + public function alterarBolsa(Request $request){ + $participante = Participante::find($request->id); + $participante->tipoBolsa = $request->tipo; $participante->save(); - return redirect()->back()->with(['mensagem' => 'Alteração da bolsa realizada com sucesso!']); + return redirect()->back()->with(['sucesso' => 'Definição da bolsa realizada com sucesso!']); } public function atualizarDocComplementar(Request $request){ diff --git a/app/Http/Controllers/ProponenteController.php b/app/Http/Controllers/ProponenteController.php index b6a3f8d83fe453fe52c2863afce9864793ba8290..97c05ff530c524b04c37e693eccbfc7403895940 100755 --- a/app/Http/Controllers/ProponenteController.php +++ b/app/Http/Controllers/ProponenteController.php @@ -92,7 +92,7 @@ class ProponenteController extends Controller if($request->buscar == null){ $proponente = Proponente::where('user_id', Auth()->user()->id)->first(); - $projetos = Trabalho::where('proponente_id', $proponente->id)->get(); + $projetos = Trabalho::where('proponente_id', $proponente->id)->paginate(10); $hoje = Carbon::today('America/Recife'); $hoje = $hoje->toDateString(); @@ -100,7 +100,7 @@ class ProponenteController extends Controller }else{ $proponente = Proponente::where('user_id', Auth()->user()->id)->first(); - $projetos = Trabalho::where('proponente_id','=',$proponente->id)->where('titulo','ilike','%'.$request->buscar.'%')->get(); + $projetos = Trabalho::where('proponente_id','=',$proponente->id)->where('titulo','ilike','%'.$request->buscar.'%')->paginate(10); $hoje = Carbon::today('America/Recife'); $hoje = $hoje->toDateString(); @@ -111,7 +111,7 @@ class ProponenteController extends Controller } public function projetosEdital($id) { $edital = Evento::find($id); - $projetos = Trabalho::where('evento_id', '=', $id)->orderBy('titulo')->get(); + $projetos = Trabalho::where('evento_id', '=', $id)->orderBy('titulo')->paginate(10); $hoje = Carbon::today('America/Recife'); $hoje = $hoje->toDateString(); diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index acf915e0512a7327ace298809db7f8d057577c80..400941430fcc3dc36752ec5a9decadc74d1b846d 100755 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -234,14 +234,15 @@ class TrabalhoController extends Controller } //Anexo Decisão CONSU - if ($evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { + // if ($evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { if (isset($request->anexoDecisaoCONSU)) { + dd($request->anexoDecisaoCONSU); if (Storage::disk()->exists($trabalho->anexoDecisaoCONSU)) { Storage::delete($trabalho->anexoDecisaoCONSU); } $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf'); } - } + // } //Autorização ou Justificativa if (isset($request->anexoAutorizacaoComiteEtica)) { @@ -293,11 +294,11 @@ class TrabalhoController extends Controller } //Anexo Decisão CONSU - if ($evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { + //if ($evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { if (isset($request->anexoDecisaoCONSU)) { $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf'); } - } + //} //Autorização ou Justificativa if (isset($request->anexoAutorizacaoComiteEtica)) { @@ -924,7 +925,7 @@ class TrabalhoController extends Controller DB::commit(); if (!$request->has('rascunho')) { - Notification::send(Auth::user(), new SubmissaoNotification($id)); + Notification::send(Auth::user(), new SubmissaoNotification($id,$trabalho->titulo)); } else { } @@ -954,12 +955,21 @@ class TrabalhoController extends Controller DB::beginTransaction(); - $trabalho = Auth::user()->proponentes->trabalhos() + if($evento->tipo=="PIBEX"){ + $trabalho = Auth::user()->proponentes->trabalhos() + ->create($request->except([ + 'anexoProjeto', 'anexoDecisaoCONSU','modalidade' + ])); + }else{ + $trabalho = Auth::user()->proponentes->trabalhos() ->create($request->except([ 'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', 'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica', - 'justificativaAutorizacaoEtica' + 'justificativaAutorizacaoEtica','modalidade' ])); + } + + if ($request->has('marcado')) { foreach ($request->marcado as $key => $part) { $part = intval($part); @@ -999,7 +1009,9 @@ class TrabalhoController extends Controller $data['turno'] = $request->turno[$part]; $data['periodo_atual'] = $request->periodo_atual[$part]; $data['ordem_prioridade'] = $request->ordem_prioridade[$part]; - $data['media_do_curso'] = $request->media_do_curso[$part]; + if($evento->tipo!="PIBEX") { + $data['media_do_curso'] = $request->media_do_curso[$part]; + } $data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part]; $user = User::where('email', $data['email'])->first(); @@ -1043,6 +1055,7 @@ class TrabalhoController extends Controller $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); + $trabalho->modalidade = $request->modalidade; $trabalho->save(); DB::commit(); @@ -1058,7 +1071,7 @@ class TrabalhoController extends Controller 'tipo' => 1, ]); $notificacao->save(); - Notification::send($userTemp, new SubmissaoRecebidaNotification($trabalho->id,$evento->nome,$userTemp)); + Notification::send($userTemp, new SubmissaoRecebidaNotification($trabalho->id,$trabalho->titulo,$userTemp)); //Proponente $notificacao = App\Notificacao::create([ 'remetente_id' => Auth::user()->id, @@ -1068,7 +1081,7 @@ class TrabalhoController extends Controller 'tipo' => 1, ]); $notificacao->save(); - Notification::send(Auth::user(), new SubmissaoNotification($trabalho->id)); + Notification::send(Auth::user(), new SubmissaoNotification($trabalho->id,$trabalho->titulo)); //Admins $admins = App\Administrador::all(); foreach ($admins as $admin) { @@ -1081,7 +1094,7 @@ class TrabalhoController extends Controller 'tipo' => 1, ]); $notificacao->save(); - Notification::send($userTemp, new SubmissaoRecebidaNotification($trabalho->id,$evento->nome,$userTemp)); + Notification::send($userTemp, new SubmissaoRecebidaNotification($trabalho->id,$trabalho->titulo,$userTemp)); } @@ -1643,7 +1656,7 @@ class TrabalhoController extends Controller DB::commit(); - Mail::to($evento->coordenadorComissao->user->email)->send(new SolicitacaoSubstituicao($evento, $trabalho)); + Mail::to($evento->coordenadorComissao->user->email)->send(new SolicitacaoSubstituicao($evento, $trabalho,'',$substituicao->tipo,$substituicao->status)); return redirect(route('trabalho.trocaParticipante', ['evento_id' => $evento->id, 'projeto_id' => $trabalho->id]))->with(['sucesso' => 'Pedido de substituição enviado com sucesso!']); } catch (\App\Validator\ValidationException $th) { DB::rollback(); @@ -1695,7 +1708,7 @@ class TrabalhoController extends Controller $substituicao->save(); } - Mail::to($trabalho->proponente->user->email)->send(new SolicitacaoSubstituicao($trabalho->evento, $trabalho, 'resultado')); + Mail::to($trabalho->proponente->user->email)->send(new SolicitacaoSubstituicao($trabalho->evento, $trabalho, 'resultado',$substituicao->tipo,$substituicao->status)); return redirect()->back()->with(['sucesso' => 'Substituição concluida!']); } catch (\Throwable $th) { return redirect()->back()->with(['erro' => $th->getMessage()]); @@ -1739,7 +1752,7 @@ class TrabalhoController extends Controller } $trabalho = Trabalho::find($substituicao->trabalho->id); - Mail::to($trabalho->proponente->user->email)->send(new SolicitacaoSubstituicao($trabalho->evento, $trabalho, 'resultado')); + Mail::to($trabalho->proponente->user->email)->send(new SolicitacaoSubstituicao($trabalho->evento, $trabalho, 'resultado',$substituicao->tipo,$substituicao->status)); return redirect()->back()->with(['sucesso' => 'Substituição cancelada com sucesso!']); } catch (\Throwable $th) { diff --git a/app/Http/Requests/StoreTrabalho.php b/app/Http/Requests/StoreTrabalho.php index 8ce6ae50934d08ffb40aebff2a04a792933c339e..2405ddbc28429af38d821032a0657f607d491013 100755 --- a/app/Http/Requests/StoreTrabalho.php +++ b/app/Http/Requests/StoreTrabalho.php @@ -52,7 +52,7 @@ class StoreTrabalho extends FormRequest $rules['ordem_prioridade.'.$value] = ['required', 'string']; $rules['periodo_atual.'.$value] = ['required', 'string']; $rules['total_periodos.'.$value] = ['required', 'string']; - $rules['media_do_curso.'.$value] = ['required', 'string']; + $rules['media_do_curso.'.$value] = ['string']; $rules['anexoPlanoTrabalho.'.$value] = ['required']; $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; @@ -65,21 +65,24 @@ class StoreTrabalho extends FormRequest return $rules; }else{ $evento = Evento::find($this->editalId); + if($evento->tipo!="PIBEX"){ + $rules['anexoPlanilhaPontuacao'] = ['required']; + $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; + $rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf']; + $rules['anexoAutorizacaoComiteEtica'] = [Rule::requiredIf($this->justificativaAutorizacaoEtica == null)]; + $rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->anexoAutorizacaoComiteEtica == null)]; + $rules['pontuacaoPlanilha'] = ['required', 'string']; + $rules['linkGrupoPesquisa'] = ['required', 'string']; + } $rules['editalId'] = ['required', 'string']; $rules['marcado.*'] = ['required']; $rules['titulo'] = ['required', 'string']; $rules['grande_area_id'] = ['required', 'string']; $rules['area_id'] = ['required', 'string']; $rules['linkLattesEstudante'] = ['required', 'string']; - $rules['pontuacaoPlanilha'] = ['required', 'string']; - $rules['linkGrupoPesquisa'] = ['required', 'string']; + $rules['anexoProjeto'] = ['required', 'mimes:pdf']; $rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf']; - $rules['anexoPlanilhaPontuacao'] = ['required']; - $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; - $rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf']; - $rules['anexoAutorizacaoComiteEtica'] = [Rule::requiredIf($this->justificativaAutorizacaoEtica == null)]; - $rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->anexoAutorizacaoComiteEtica == null)]; return $rules; } diff --git a/app/Mail/SolicitacaoSubstituicao.php b/app/Mail/SolicitacaoSubstituicao.php index cc4fc0b1777fc35c7224d52d02b982996bf4948c..dd3f03b99c13196370e4fc03466b1b3de74c953d 100644 --- a/app/Mail/SolicitacaoSubstituicao.php +++ b/app/Mail/SolicitacaoSubstituicao.php @@ -14,22 +14,40 @@ class SolicitacaoSubstituicao extends Mailable{ public $projeto; public $tipo; - public function __construct($edital, $projeto, $tipo = '') + public function __construct($edital, $projeto, $tipo = '',$sub, $status = '') { $this->edital = $edital; $this->projeto = $projeto; $this->tipo = $tipo; + $this->sub = $sub; + $this->status = $status; } public function build(){ - - return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') - ->subject('Solicitação de Substituição') - ->view('emails.solicitacaoSubstituicao') - ->with([ - 'edital' => $this->edital, - 'projeto' => $this->projeto, - 'tipo' => $this->tipo - ]); + + if($this->tipo==null){ + return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') + ->subject('Sistema Submeta - Solicitação de substituição') + ->view('emails.solicitacaoSubstituicao') + ->with([ + 'edital' => $this->edital, + 'projeto' => $this->projeto, + 'tipo' => $this->tipo, + 'sub' => $this->sub, + 'status' => $this->status + ]); + }else{ + return $this->from('lmtsteste@gmail.com', 'Submeta - LMTS') + ->subject('Sistema Submeta - Resultado da avaliação de pedido de substituição de estudante') + ->view('emails.solicitacaoSubstituicao') + ->with([ + 'edital' => $this->edital, + 'projeto' => $this->projeto, + 'tipo' => $this->tipo, + 'sub' => $this->sub, + 'status' => $this->status + ]); + } + } } \ No newline at end of file diff --git a/app/Notifications/AtribuicaoAvaliadorExternoNotification.php b/app/Notifications/AtribuicaoAvaliadorExternoNotification.php new file mode 100644 index 0000000000000000000000000000000000000000..f4ef25141fc916d900c4c096ef9166142895eae7 --- /dev/null +++ b/app/Notifications/AtribuicaoAvaliadorExternoNotification.php @@ -0,0 +1,72 @@ +data = date('d/m/Y \à\s H:i\h', strtotime(now())); + $url = "/avaliador/editais"; + $this->url = url($url); + $this->user = $usuario; + $this->titulo = $trabalho->titulo; + $this->trabalho = $trabalho; + } + + /** + * Get the notification's delivery channels. + * + * @param mixed $notifiable + * @return array + */ + public function via($notifiable) + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + * + * @param mixed $notifiable + * @return \Illuminate\Notifications\Messages\MailMessage + */ + public function toMail($notifiable) + { + return (new MailMessage) + ->subject('Sistema Submeta - Avaliar proposta / projeto') + ->greeting("Saudações!") + ->line("Prezado avaliador, você foi convidado a avaliar a proposta / projeto intitulada(o) {$this->titulo}.") + ->action('Acessar', $this->url ) + ->attach(storage_path() . "/app/pdfFormAvalExterno/{$this->trabalho->evento_id}/formulario de avaliação externo.pdf") + ->markdown('vendor.notifications.email'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } +} diff --git a/app/Notifications/RelatorioRecebimentoNotification.php b/app/Notifications/RelatorioRecebimentoNotification.php index 4de5a0f944e7af7230b7699b280726867b9820c5..287a1cc6344f1ab50c2def74ee430db4da664b8e 100644 --- a/app/Notifications/RelatorioRecebimentoNotification.php +++ b/app/Notifications/RelatorioRecebimentoNotification.php @@ -28,7 +28,7 @@ class RelatorioRecebimentoNotification extends Notification $this->trabalhoNome = $trabalhoTitulo; $this->user = $usuario; $this->tipo = $tipoRelatorio; - $this->subject ="Recebimento de Relatório {$this->tipo}"; + $this->subject ="Sistema Submeta - Recebimento de Relatório {$this->tipo}"; } @@ -53,10 +53,10 @@ class RelatorioRecebimentoNotification extends Notification { return (new MailMessage) ->subject($this->subject) - ->greeting("Olá, {$this->user->name}!") - ->action('Acessar Relatórios', $this->url ) - ->line("O projeto {$this->trabalhoNome} pertencente ao edital {$this->editalNome} do Submeta, registrou um novo envio de Relatório {$this->tipo} em {$this->data}.") - ->line('Obrigado por usar o nosso sistema.') + ->greeting("Saudações!") + ->line("O(A) proponente / coordenador(a) do projeto {$this->trabalhoNome} vinculado ao edital {$this->editalNome} do Submeta submeteu Relatório {$this->tipo} para avaliação.") + ->line("Solicitamos gentilmente que acesse o sistema Submeta para avaliar o documento.") + ->action('Acessar Relatório', $this->url ) ->markdown('vendor.notifications.email'); } diff --git a/app/Notifications/SubmissaoNotification.php b/app/Notifications/SubmissaoNotification.php index a867e1d2bef659cb3aab7c7968217e8aa4328e93..5b6115bc65e11dd21d52873c627e51cc5ae88a69 100755 --- a/app/Notifications/SubmissaoNotification.php +++ b/app/Notifications/SubmissaoNotification.php @@ -19,11 +19,12 @@ class SubmissaoNotification extends Notification * * @return void */ - public function __construct($id) + public function __construct($id,$titulo) { $this->data = date('d/m/Y \à\s H:i\h', strtotime(now())); $url = "/projeto/visualizar/".$id; $this->url = url($url); + $this->titulo = $titulo; } /** @@ -47,11 +48,10 @@ class SubmissaoNotification extends Notification { $user = Auth::user(); return (new MailMessage) - ->subject('Submissão de Proposta') - ->greeting("Olá, {$user->name}!") - ->action('Acessar Formulário', $this->url ) - ->line("O sistema de recepção de formulários eletrônicos do Submeta registra que em {$this->data}, o formulário identificado acima foi recebido e reconhecido no Submeta") - ->line('Obrigado por usar o nosso sistema.') + ->subject('Sistema Submeta - Submissão de proposta / projeto') + ->greeting("Saudações!") + ->line("O sistema Submeta recebeu o envio de sua proposta / projeto intitulada(o) {$this->titulo}.") + ->action('Acessar Proposta', $this->url ) ->markdown('vendor.notifications.email'); } diff --git a/app/Notifications/SubmissaoRecebidaNotification.php b/app/Notifications/SubmissaoRecebidaNotification.php index 925f6b51bef046efbfd900f397ec1ac966b108e9..a8d46d9d09fb3f3eac0c736e2fe3a48009205365 100644 --- a/app/Notifications/SubmissaoRecebidaNotification.php +++ b/app/Notifications/SubmissaoRecebidaNotification.php @@ -24,7 +24,7 @@ class SubmissaoRecebidaNotification extends Notification $this->data = date('d/m/Y \à\s H:i\h', strtotime(now())); $url = "/usuarios/analisarProposta?id=".$id; $this->url = url($url); - $this->editalNome = $titulo; + $this->titulo = $titulo; $this->user = $usuario; } @@ -48,11 +48,10 @@ class SubmissaoRecebidaNotification extends Notification public function toMail($notifiable) { return (new MailMessage) - ->subject('Recebimento de Submissão de Proposta') - ->greeting("Olá, {$this->user->name}!") + ->subject('Sistema Submeta - Submissão de proposta / projeto') + ->greeting("Saudações!") + ->line("O sistema Submeta recebeu o envio de sua proposta / projeto intitulada(o) {$this->titulo}.") ->action('Acessar Formulário', $this->url ) - ->line("O edital {$this->editalNome} do Submeta registrou uma nova submissão em {$this->data}.") - ->line('Obrigado por usar o nosso sistema.') ->markdown('vendor.notifications.email'); } diff --git a/app/Parecer.php b/app/Parecer.php index c4c3895dcdfa6fca44a200fa5795fba9a9a3f4ea..ed0c51e3a362812c4d6a5bcd8de32b9da858d0bd 100755 --- a/app/Parecer.php +++ b/app/Parecer.php @@ -12,7 +12,7 @@ class Parecer extends Model * @var array */ protected $fillable = [ - 'resultado', 'revisorId', 'trabalhoId', + 'resultado', 'revisorId', 'trabalhoId' ]; public function user(){ diff --git a/app/Trabalho.php b/app/Trabalho.php index 63f5953e4d392011d7f1c3bbfd76149bbc2abf61..15092d67f88c8db8377296d1420cdd7b720e882b 100755 --- a/app/Trabalho.php +++ b/app/Trabalho.php @@ -20,6 +20,7 @@ class Trabalho extends Model 'linkGrupoPesquisa', 'linkLattesEstudante', 'comentario', + 'modalidade', 'anexoDecisaoCONSU', 'anexoAutorizacaoComiteEtica', @@ -96,7 +97,7 @@ class Trabalho extends Model return $this->belongsTo('App\CoordenadorComissao'); } public function avaliadors(){ - return $this->belongsToMany('App\Avaliador')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at'); + return $this->belongsToMany('App\Avaliador')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at','pontuacao'); } public function substituicaos(){ diff --git a/database/migrations/2022_04_05_031447_add_pontuacao_parecer.php b/database/migrations/2022_04_05_031447_add_pontuacao_parecer.php new file mode 100644 index 0000000000000000000000000000000000000000..b40c99a4c6fdb6aeee25c703b836a45e7635d332 --- /dev/null +++ b/database/migrations/2022_04_05_031447_add_pontuacao_parecer.php @@ -0,0 +1,32 @@ +integer('pontuacao')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('avaliador_trabalho', function (Blueprint $table) { + $table->dropColumn('pontuacao'); + }); + } +} diff --git a/database/migrations/2022_04_05_123239_add_cota_doutor_evento.php b/database/migrations/2022_04_05_123239_add_cota_doutor_evento.php new file mode 100644 index 0000000000000000000000000000000000000000..82cf3190f98324b74add544e460ffe7c6c5fe022 --- /dev/null +++ b/database/migrations/2022_04_05_123239_add_cota_doutor_evento.php @@ -0,0 +1,32 @@ +boolean('cotaDoutor')->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('eventos', function (Blueprint $table) { + $table->dropColumn('cotaDoutor'); + }); + } +} diff --git a/database/migrations/2022_04_05_125626_add_modalidade_trabalho.php b/database/migrations/2022_04_05_125626_add_modalidade_trabalho.php new file mode 100644 index 0000000000000000000000000000000000000000..d80b085494ab36e5a661cd2877a0a92025c340eb --- /dev/null +++ b/database/migrations/2022_04_05_125626_add_modalidade_trabalho.php @@ -0,0 +1,32 @@ +string('modalidade')->nullable();; + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('trabalhos', function (Blueprint $table) { + $table->dropColumn('modalidade'); + }); + } +} diff --git a/resources/views/administrador/analisarProposta.blade.php b/resources/views/administrador/analisarProposta.blade.php index 8a7a0ba4b06e8ab2a3f4049b06d6ee64d79c059f..555e079631dab7645f4d3ef07f55a8be458189ac 100644 --- a/resources/views/administrador/analisarProposta.blade.php +++ b/resources/views/administrador/analisarProposta.blade.php @@ -285,7 +285,7 @@