Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
e6cb54b7
Unverified
Commit
e6cb54b7
authored
Jun 01, 2021
by
Gabriel Antônio da Silva
Committed by
GitHub
Jun 01, 2021
Browse files
Merge pull request #101 from Gabriel-31415/master
Ajuste
parents
fb8522b3
4b55bc4e
Changes
4
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
e6cb54b7
...
...
@@ -94,207 +94,7 @@ class TrabalhoController extends Controller
]);
}
// public function store(Request $request){
// $mytime = Carbon::now('America/Recife');
// $mytime = $mytime->toDateString();
// $evento = Evento::find($request->editalId);
// $coordenador = CoordenadorComissao::find($evento->coordenadorId);
// //Relaciona o projeto criado com o proponente que criou o projeto
// $proponente = Proponente::where('user_id', Auth::user()->id)->first();
// // if($proponente == null){
// // return view('proponente.cadastro');
// // }
// //$trabalho->proponentes()->save($proponente);
// //dd($proponente);
// $trabalho = "trabalho";
// if($evento->inicioSubmissao > $mytime){
// if($mytime >= $evento->fimSubmissao){
// return redirect()->route('home');
// }
// }
// //--Salvando os dados da submissão temporariamente
// // $trabalho = $this->armazenarInfoTemp($request, $proponente);
// //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', 'string'],
// 'nomeProjeto' => ['required', 'string'],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string', 'link_grupo'],
// 'linkLattesEstudante' => ['required', 'string', 'link_lattes'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante' => ['required', 'array', 'size:'.$request->countParticipante],
// 'funcaoParticipante.*' => ['required', 'string'],
// 'nomePlanoTrabalho.*' => ['nullable', 'string'],
// //--Verificando se anexos já foram submetidos
// 'anexoProjeto' => [($request->anexoProjetoPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
// 'anexoCONSU' => [($request->anexoConsuPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
// 'botao' => ['required'],
// 'anexoComiteEtica' => [($request->anexoComitePreenchido!=='sim'&&$request->anexoJustificativaPreenchido!=='sim'?'required_without:justificativaAutorizacaoEtica':''), 'file', 'mimes:pdf', 'max:2048'],
// 'justificativaAutorizacaoEtica' => [($request->anexoJustificativaPreenchido!=='sim'&&$request->anexoComitePreenchido!=='sim'?'required_without:anexoComiteEtica':''), 'file', 'mimes:pdf', 'max:2048'],
// 'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required': ''), 'file', 'mimes:pdf', 'max:2048'],
// 'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:xls,xlsx,ods', 'max:2048'],
// 'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'],
// ]);
// // if(gettype($this->validarAnexosRascunho($request, $trabalho)) != 'integer'){
// // return $this->validarAnexosRascunho($request, $trabalho);
// // }
// //$trabalho = Trabalho::create([
// $trabalho['titulo'] = $request->nomeProjeto;
// $trabalho['coordenador_id'] = $coordenador->id;
// $trabalho['grande_area_id'] = $request->grandeArea;
// $trabalho['area_id'] = $request->area;
// $trabalho['sub_area_id'] = $request->subArea;
// $trabalho['pontuacaoPlanilha'] = $request->pontuacaoPlanilha;
// $trabalho['linkGrupoPesquisa'] = $request->linkGrupo;
// $trabalho['linkLattesEstudante'] = $request->linkLattesEstudante;
// $trabalho['data'] = $mytime;
// $trabalho['evento_id'] = $request->editalId;
// $trabalho['status'] = 'Submetido';
// $trabalho['proponente_id'] = $proponente->id;
// //Anexos
// $trabalho['anexoDecisaoCONSU'] = $request->anexoCONSU != null ? $request->anexoCONSU : $trabalho->anexoDecisaoCONSU;
// $trabalho['anexoProjeto'] = $request->anexoProjeto != null ? $request->anexoProjeto : $trabalho->anexoProjeto;
// $trabalho['anexoAutorizacaoComiteEtica'] = $request->anexoComiteEtica != null ? $request->anexoComiteEtica : $trabalho->anexoAutorizacaoComiteEtica;
// $trabalho['justificativaAutorizacaoEtica'] = $request->justificativaAutorizacaoEtica != null ? $request->justificativaAutorizacaoEtica : $trabalho->justificativaAutorizacaoEtica;
// $trabalho['anexoLattesCoordenador'] = $request->anexoLattesCoordenador != null ? $request->anexoLattesCoordenador : $trabalho->anexoLattesCoordenador;
// $trabalho['anexoPlanilhaPontuacao'] = $request->anexoPlanilha != null ? $request->anexoPlanilha : $trabalho->anexoPlanilhaPontuacao;
// //dd($trabalho);
// } else {
// //Caso em que o anexo da Decisão do CONSU não necessário
// $validatedData = $request->validate([
// 'editalId' => ['required', 'string'],
// 'nomeProjeto' => ['required', 'string',],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string', 'link_grupo'],
// 'linkLattesEstudante' => ['required', 'string', 'link_lattes'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante.*' => ['required', 'string'],
// 'nomePlanoTrabalho.*' => ['nullable', 'string'],
// 'anexoProjeto' => [($request->anexoProjetoPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
// 'anexoLattesCoordenador' => [($request->anexoLattesPreenchido!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
// 'anexoPlanilha' => [($request->anexoPlanilhaPreenchido!=='sim'?'required':''), 'file', 'mimes:xls,xlsx,ods', 'max:2048'],
// 'anexoPlanoTrabalho.*' => ['nullable', 'file', 'mimes:pdf', 'max:2048'],
// ]);
// // if(gettype($this->validarAnexosRascunho($request, $trabalho)) != 'integer'){
// // return $this->validarAnexosRascunho($request, $trabalho);
// // }
// //$trabalho = Trabalho::create([
// $trabalho['titulo'] = $request->nomeProjeto;
// $trabalho['coordenador_id'] = $coordenador->id;
// $trabalho['grande_area_id'] = $request->grandeArea;
// $trabalho['area_id'] = $request->area;
// $trabalho['sub_area_id'] = $request->subArea;
// $trabalho['pontuacaoPlanilha'] = $request->pontuacaoPlanilha;
// $trabalho['linkGrupoPesquisa'] = $request->linkGrupo;
// $trabalho['linkLattesEstudante'] = $request->linkLattesEstudante;
// $trabalho['data'] = $mytime;
// $trabalho['evento_id'] = $request->editalId;
// $trabalho['status'] = 'Submetido';
// $trabalho['proponente_id'] = $proponente->id;
// //Anexos
// $trabalho['anexoProjeto'] = $request->anexoProjeto;
// $trabalho['anexoAutorizacaoComiteEtica'] = $request->anexoComiteEtica;
// $trabalho['justificativaAutorizacaoEtica'] = $request->justificativaAutorizacaoEtica;
// $trabalho['anexoLattesCoordenador'] = $request->anexoLattesCoordenador;
// $trabalho['anexoPlanilhaPontuacao'] = $request->anexoPlanilha;
// }
// //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();
// $participante = new Participante();
// if($userParticipante == null){
// $passwordTemporario = Str::random(8);
// $subject = "Participante de Projeto";
// Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $request->nomeProjeto, 'Participante', $evento->nome, $passwordTemporario, $subject));
// $usuario = User::create([
// 'email' => $value,
// 'password' => bcrypt($passwordTemporario),
// 'usuarioTemp' => true,
// 'name' => $request->nomeParticipante[$key],
// 'tipo' => 'participante',
// ]);
// $participante->user_id = $usuario->id;
// $participante->trabalho_id = $trabalho->id;
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->save();
// $usuario->participantes()->save($participante);
// $usuario->save();
// $participante->trabalhos()->save($trabalho);
// }else{
// $participante->user_id = $userParticipante->id;
// $participante->trabalho_id = $trabalho->id;
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->save();
// $userParticipante->participantes()->save($participante);
// $userParticipante->save();
// $participante->trabalhos()->save($trabalho);
// $subject = "Participante de Projeto";
// $email = $value;
// Mail::to($email)
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
// }
// if($request->nomePlanoTrabalho[$key] != null){
// $usuario = User::where('email', $value)->first();
// $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $trabalho->id]])->first();
// $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
// $nome = $request->nomePlanoTrabalho[$key] .".pdf";
// $file = $request->anexoPlanoTrabalho[$key];
// Storage::putFileAs($path, $file, $nome);
// $mytime = Carbon::now('America/Recife');
// $mytime = $mytime->toDateString();
// $arquivo = new Arquivo();
// $arquivo->titulo = $request->nomePlanoTrabalho[$key];
// $arquivo->nome = $path . $nome;
// $arquivo->trabalhoId = $trabalho->id;
// $arquivo->data = $mytime;
// $arquivo->participanteId = $participante->id;
// $arquivo->versaoFinal = true;
// $arquivo->save();
// }
// }
// }
// //-- Salvando anexos no storage ---//
// $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
// $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
// $subject = "Submissão de Trabalho";
// $autor = Auth()->user();
// $evento = $evento;
// $trabalho = $trabalho;
// Mail::to($autor->email)
// ->send(new SubmissaoTrabalho($autor, $subject, $evento, $trabalho));
// return redirect()->route('evento.visualizar',['id'=>$request->editalId]);
// }
public
function
storeParcial
(
Request
$request
){
$mytime
=
Carbon
::
now
(
'America/Recife'
);
...
...
@@ -459,11 +259,11 @@ class TrabalhoController extends Controller
}
// Anexo grupo pesquisa
if
(
isset
(
$request
->
g
rupoPesquisa
)){
if
(
isset
(
$request
->
anexoG
rupoPesquisa
)){
if
(
Storage
::
disk
()
->
exists
(
$trabalho
->
anexoGrupoPesquisa
))
{
Storage
::
delete
(
$trabalho
->
anexoGrupoPesquisa
);
}
$trabalho
->
anexoGrupoPesquisa
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Grupo_de_pesquisa."
.
$request
->
file
(
'
g
rupoPesquisa'
)
->
extension
());
$trabalho
->
anexoGrupoPesquisa
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Grupo_de_pesquisa."
.
$request
->
file
(
'
anexoG
rupoPesquisa'
)
->
extension
());
}
return
$trabalho
;
...
...
@@ -500,8 +300,8 @@ class TrabalhoController extends Controller
}
// Anexo grupo pesquisa
if
(
isset
(
$request
->
g
rupoPesquisa
)){
$trabalho
->
anexoGrupoPesquisa
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Grupo_de_pesquisa."
.
$request
->
file
(
'
g
rupoPesquisa'
)
->
extension
());
if
(
isset
(
$request
->
anexoG
rupoPesquisa
)){
$trabalho
->
anexoGrupoPesquisa
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Grupo_de_pesquisa."
.
$request
->
file
(
'
anexoG
rupoPesquisa'
)
->
extension
());
}
return
$trabalho
;
...
...
resources/views/evento/formulario/anexos.blade.php
View file @
e6cb54b7
...
...
@@ -22,7 +22,7 @@
@endcomponent
</div>
<div
class=
"form-group col-md-6"
>
@component('componentes.input', ['label' => 'Anexo da Planilha de Pontuação(.
ods
,.xls,.ods)'])
@component('componentes.input', ['label' => 'Anexo da Planilha de Pontuação(.
xlsx
,.xls,.ods)'])
<input
type=
"file"
class=
"input-group-text"
name=
"anexoPlanilha"
placeholder=
"anexoPlanoTrabalho"
accept=
".xlsx, .xls, .ods"
required
/>
@endcomponent
</div>
...
...
@@ -31,6 +31,13 @@
<input
type=
"file"
class=
"input-group-text"
name=
"anexoConsuPreenchido"
placeholder=
"anexoConsuPreenchido"
accept=
".pdf"
required
/>
@endcomponent
</div>
<div
class=
"form-group col-md-6"
style=
"margin-top: 10px"
>
@component('componentes.input', ['label' => 'Anexo do Grupo de Pesquisa(.pdf)'])
<input
type=
"file"
class=
"input-group-text"
name=
"anexoGrupoPesquisa"
placeholder=
"Anexo do Grupo de Pesquisa"
accept=
"application/pdf"
required
/>
@endcomponent
</div>
<div
class=
"col-md-6"
></div>
<div
class=
"form-group col-md-6"
>
<label
for=
"botao"
class=
"col-form-label @error('botao') is-invalid @enderror"
data-toggle=
"tooltip"
data-placement=
"bottom"
title=
"Se possuir, coloque todas em único arquivo pdf."
style=
"margin-right: 15px;"
>
{{ __('Possui autorizações especiais?') }}
<span
style=
"color: red; font-weight:bold"
>
*
</span></label>
<input
type=
"radio"
checked
id=
"radioSim"
onchange=
"displayAutorizacoesEspeciais('sim')"
>
...
...
@@ -54,6 +61,7 @@
</div>
</div>
</div>
</div>
</div>
...
...
resources/views/evento/formulario/participantes.blade.php
View file @
e6cb54b7
...
...
@@ -25,7 +25,7 @@
<div
class=
"col-md-12"
>
<a
class=
"btn btn-light"
data-toggle=
"collapse"
id=
"idCollapseParticipante"
href=
"#collapseParticipante"
role=
"button"
aria-expanded=
"false"
aria-controls=
"collapseParticipante"
style=
"width: 100%; text-align:left"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<h4
id=
"tituloParticipante"
style=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<span
style=
"display: none;"
id=
"display"
>
:
</span>
</h4>
<h4
id=
"tituloParticipante"
style=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<span
id=
"pontos"
style=
"display: none;"
>
:
</span>
<span
style=
"display: none;"
id=
"display"
></span>
</h4>
</div>
</a>
</div>
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
e6cb54b7
...
...
@@ -179,10 +179,12 @@
$
(
'#nomeParticipante'
)
.
keyup
(
function
()
{
$
(
'#display'
)
.
text
(
$
(
this
)
.
val
());
if
(
$
(
'#
display'
)
.
text
(
$
(
this
)
.
val
()
)
==
""
){
if
(
$
(
'#
nomeParticipante'
)
.
val
()
==
""
){
$
(
'#display'
)
.
hide
();
$
(
'#pontos'
)
.
hide
();
}
else
{
$
(
'#display'
)
.
show
();
$
(
'#pontos'
)
.
show
();
}
});
...
...
@@ -217,8 +219,8 @@
$
.
validator
.
setDefaults
(
{
submitHandler
:
function
()
{
alert
(
"submitted!"
);
submitHandler
:
function
(
form
)
{
form
.
submit
(
);
}
}
);
$
(
"#criarProjetoForm"
)
.
validate
(
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment