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
11f257bb
Commit
11f257bb
authored
Jun 16, 2020
by
Gabriel-31415
Browse files
ajuste na mensagem de e-mail de submissão de projeto
parent
40ad49dd
Changes
8
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
11f257bb
...
...
@@ -99,7 +99,7 @@ class EventoController extends Controller
'fimRevisao'
=>
[
'required'
,
'date'
],
'resultado'
=>
[
'required'
,
'date'
],
'pdfEdital'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'modeloDocumento'
=>
[
'required'
,
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2000000'
],
'modeloDocumento'
=>
[
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2000000'
],
]);
}
...
...
@@ -116,7 +116,7 @@ class EventoController extends Controller
'fimRevisao'
=>
[
'required'
,
'date'
,
'after:'
.
$request
->
inicioRevisao
],
'resultado'
=>
[
'required'
,
'date'
,
'after:'
.
$yesterday
],
'pdfEdital'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'modeloDocumento'
=>
[
'required'
,
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2000000'
],
'modeloDocumento'
=>
[
'file'
,
'mimes:zip,doc,docx,odt,pdf'
,
'max:2000000'
],
]);
$evento
=
Evento
::
create
([
...
...
@@ -151,6 +151,7 @@ class EventoController extends Controller
Storage
::
putFileAs
(
$path
,
$pdfEdital
,
$nome
);
$evento
->
pdfEdital
=
$path
.
$nome
;
if
(
isset
(
$request
->
modeloDocumento
)){
$modeloDocumento
=
$request
->
modeloDocumento
;
$extension
=
$modeloDocumento
->
extension
();
$path
=
'modeloDocumento/'
.
$evento
->
id
.
'/'
;
...
...
@@ -158,6 +159,8 @@ class EventoController extends Controller
Storage
::
putFileAs
(
$path
,
$modeloDocumento
,
$nome
);
$evento
->
modeloDocumento
=
$path
.
$nome
;
}
$evento
->
save
();
...
...
app/Http/Controllers/TrabalhoController.php
View file @
11f257bb
...
...
@@ -215,7 +215,7 @@ class TrabalhoController extends Controller
$subject
=
"Participante de Projeto"
;
$email
=
$value
;
Mail
::
to
(
$email
)
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
));
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
,
$evento
,
$trabalho
));
}
$usuario
=
User
::
where
(
'email'
,
$value
)
->
first
();
...
...
@@ -257,8 +257,10 @@ class TrabalhoController extends Controller
$subject
=
"Submissão de Trabalho"
;
$autor
=
Auth
()
->
user
();
$evento
=
$evento
;
$trabalho
=
$trabalho
;
Mail
::
to
(
$autor
->
email
)
->
send
(
new
SubmissaoTrabalho
(
$autor
,
$subject
));
->
send
(
new
SubmissaoTrabalho
(
$autor
,
$subject
,
$evento
,
$trabalho
));
return
redirect
()
->
route
(
'evento.visualizar'
,[
'id'
=>
$request
->
editalId
]);
}
...
...
app/Mail/SubmissaoTrabalho.php
View file @
11f257bb
...
...
@@ -13,18 +13,20 @@ class SubmissaoTrabalho extends Mailable
public
$user
;
public
$subject
;
public
$evento
;
public
$trabalho
;
/**
* Create a new message instance.
*
* @return void
*/
public
function
__construct
(
$user
,
$subject
)
public
function
__construct
(
$user
,
$subject
,
$evento
,
$trabalho
)
{
$this
->
user
=
$user
;
$this
->
subject
=
$subject
;
$this
->
evento
=
$evento
;
$this
->
trabalho
=
$trabalho
;
}
/**
...
...
@@ -37,6 +39,12 @@ class SubmissaoTrabalho extends Mailable
return
$this
->
from
(
'lmtsteste@gmail.com'
,
'Submeta - LMTS'
)
->
subject
(
$this
->
subject
)
->
view
(
'emails.submissaoTrabalho'
);
->
view
(
'emails.submissaoTrabalho'
)
->
with
([
'user'
=>
$this
->
user
,
'evento'
=>
$this
->
evento
,
'trabalho'
=>
$this
->
trabalho
,
]);
}
}
database/seeds/ProponenteSeeder.php
View file @
11f257bb
...
...
@@ -14,6 +14,25 @@ class ProponenteSeeder extends Seeder
{
$user_id
=
DB
::
table
(
'users'
)
->
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'
=>
'Mestrado'
,
'anoTitulacao'
=>
'123123123'
,
'areaFormacao'
=>
'123123123'
,
'bolsistaProdutividade'
=>
'123123123'
,
'nivel'
=>
'123123123'
,
'linkLattes'
=>
'123123123'
,
'created_at'
=>
'2020-01-01 00:00:00'
]);
$user_id
=
DB
::
table
(
'users'
)
->
where
(
'name'
,
'Gabriel'
)
->
pluck
(
'id'
);
DB
::
table
(
'proponentes'
)
->
insert
([
'user_id'
=>
$user_id
[
0
],
//'CPF' => '123123123',
...
...
database/seeds/UsuarioSeeder.php
View file @
11f257bb
...
...
@@ -48,6 +48,15 @@ class UsuarioSeeder extends Seeder
'email_verified_at'
=>
'2020-01-01'
]);
DB
::
table
(
'users'
)
->
insert
([
'name'
=>
'Gabriel'
,
'email'
=>
'gabriel.uag.ufrpe@gmail.com'
,
'password'
=>
Hash
::
make
(
'12345678'
),
'tipo'
=>
'proponente'
,
'email_verified_at'
=>
'2020-01-01'
]);
DB
::
table
(
'users'
)
->
insert
([
'name'
=>
'Coordenador1'
,
...
...
resources/views/emails/submissaoTrabalho.blade.php
View file @
11f257bb
...
...
@@ -4,6 +4,18 @@
</head>
<body>
<h4>
Seu trabalho foi recebido com sucesso.
</h4>
@if(isset($user->proponentes))
@if($user->proponentes->id == $trabalho->proponente_id)
{{-- Usuario proponente--}}
<h2>
Olá, {{ $user->name }}
</h2>
<h4>
Seu trabalho {{ $trabalho->titulo }} foi submetido com sucesso no Edital {{ $evento->nome }}
</h4>
@endif
@else
{{-- Usuario participante--}}
<h2>
Olá, {{ $user->name }}
</h2>
<h4>
Você é participante no Projeto {{ $trabalho->titulo }} que foi submetido no Edital {{ $evento->nome }}.
</h4>
@endif
</body>
</html>
\ No newline at end of file
resources/views/evento/criarEvento.blade.php
View file @
11f257bb
...
...
@@ -16,7 +16,7 @@
{{
--
nome
|
Participantes
|
Tipo
--
}}
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-6"
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome'
)
}}
</
label
>
<
label
for
=
"nome"
class
=
"col-form-label"
>
{{
__
(
'Nome
*:
'
)
}}
</
label
>
<
input
id
=
"nome"
type
=
"text"
class
=
"form-control @error('nome') is-invalid @enderror"
name
=
"nome"
value
=
"{{ old('nome') }}"
required
autocomplete
=
"nome"
autofocus
>
@
error
(
'nome'
)
...
...
@@ -27,7 +27,7 @@
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"tipo"
class
=
"col-form-label"
>
{{
__
(
'Tipo'
)
}}
</
label
>
<
label
for
=
"tipo"
class
=
"col-form-label"
>
{{
__
(
'Tipo
*:
'
)
}}
</
label
>
<
select
id
=
"tipo"
type
=
"text"
class
=
"form-control @error('tipo') is-invalid @enderror"
name
=
"tipo"
value
=
"{{ old('tipo') }}"
required
>
<
option
value
=
"PIBIC"
>
PIBIC
</
option
>
<
option
value
=
"PIBIC-EM"
>
PIBIC
-
EM
</
option
>
...
...
@@ -42,7 +42,7 @@
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"natureza"
class
=
"col-form-label"
>
{{
__
(
'Natureza'
)
}}
</
label
>
<
label
for
=
"natureza"
class
=
"col-form-label"
>
{{
__
(
'Natureza
*:
'
)
}}
</
label
>
<
select
id
=
"natureza"
type
=
"text"
class
=
"form-control @error('natureza') is-invalid @enderror"
name
=
"natureza"
value
=
"{{ old('natureza') }}"
required
>
@
foreach
(
$naturezas
as
$natureza
)
<
option
value
=
"{{
$natureza->id
}}"
>
{{
$natureza
->
nome
}}
</
option
>
...
...
@@ -61,7 +61,7 @@
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleFormControlTextarea1"
>
Descrição
</
label
>
<
label
for
=
"exampleFormControlTextarea1"
>
Descrição
*:
</
label
>
<
textarea
class
=
"form-control @error('descricao') is-invalid @enderror"
value
=
"{{ old('descricao') }}"
required
autocomplete
=
"descricao"
autofocus
id
=
"descricao"
name
=
"descricao"
rows
=
"3"
></
textarea
>
@
error
(
'descricao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
...
...
@@ -73,7 +73,7 @@
</
div
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
<
label
for
=
"coordenador_id"
class
=
"col-form-label"
>
{{
__
(
'Coordenador:'
)
}}
</
label
>
<
label
for
=
"coordenador_id"
class
=
"col-form-label"
>
{{
__
(
'Coordenador
*
:'
)
}}
</
label
>
<
select
class
=
"form-control @error('funcaoParticipante') is-invalid @enderror"
id
=
"coordenador_id"
name
=
"coordenador_id"
>
<
option
value
=
""
disabled
selected
hidden
>--
Coordenador
da
Comissão
Avaliadora
--</
option
>
@
foreach
(
$coordenadors
as
$coordenador
)
...
...
@@ -92,7 +92,7 @@
<div class="
row
justify
-
content
-
center
">
<div class="
col
-
sm
-
6
">
<label for="
inicioSubmissao
" class="
col
-
form
-
label
">{{ __('Início da Submissão') }}</label>
<label for="
inicioSubmissao
" class="
col
-
form
-
label
">{{ __('Início da Submissão
*:
') }}</label>
<input id="
inicioSubmissao
" type="
date
" class="
form
-
control
@
error
(
'inicioSubmissao'
)
is
-
invalid
@
enderror
" name="
inicioSubmissao
" value="
{{
old
(
'inicioSubmissao'
)
}}
" required autocomplete="
inicioSubmissao
" autofocus>
@error('inicioSubmissao')
...
...
@@ -102,7 +102,7 @@
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
fimSubmissao
" class="
col
-
form
-
label
">{{ __('Fim da Submissão') }}</label>
<label for="
fimSubmissao
" class="
col
-
form
-
label
">{{ __('Fim da Submissão
*:
') }}</label>
<input id="
fimSubmissao
" type="
date
" class="
form
-
control
@
error
(
'fimSubmissao'
)
is
-
invalid
@
enderror
" name="
fimSubmissao
" value="
{{
old
(
'fimSubmissao'
)
}}
" required autocomplete="
fimSubmissao
" autofocus>
@error('fimSubmissao')
...
...
@@ -115,7 +115,7 @@
<div class="
row
justify
-
content
-
center
">
<div class="
col
-
sm
-
6
">
<label for="
inicioRevisao
" class="
col
-
form
-
label
">{{ __('Início da Avaliação') }}</label>
<label for="
inicioRevisao
" class="
col
-
form
-
label
">{{ __('Início da Avaliação
*:
') }}</label>
<input id="
inicioRevisao
" type="
date
" class="
form
-
control
@
error
(
'inicioRevisao'
)
is
-
invalid
@
enderror
" name="
inicioRevisao
" value="
{{
old
(
'inicioRevisao'
)
}}
" required autocomplete="
inicioRevisao
" autofocus>
@error('inicioRevisao')
...
...
@@ -125,7 +125,7 @@
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
fimRevisao
" class="
col
-
form
-
label
">{{ __('Fim da Avaliação') }}</label>
<label for="
fimRevisao
" class="
col
-
form
-
label
">{{ __('Fim da Avaliação
*:
') }}</label>
<input id="
fimRevisao
" type="
date
" class="
form
-
control
@
error
(
'fimRevisao'
)
is
-
invalid
@
enderror
" name="
fimRevisao
" value="
{{
old
(
'fimRevisao'
)
}}
" required autocomplete="
fimRevisao
" autofocus>
@error('fimRevisao')
...
...
@@ -138,7 +138,7 @@
<div class="
row
justify
-
content
-
left
">
<div class="
col
-
sm
-
6
">
<label for="
resultado
" class="
col
-
form
-
label
">{{ __('Data do Resultado') }}</label>
<label for="
resultado
" class="
col
-
form
-
label
">{{ __('Data do Resultado
*:
') }}</label>
<input id="
resultado
" type="
date
" class="
form
-
control
@
error
(
'resultado'
)
is
-
invalid
@
enderror
" name="
resultado
" value="
{{
old
(
'resultado'
)
}}
" required autocomplete="
resultado
" autofocus>
@error('resultado')
...
...
@@ -159,7 +159,7 @@
<div class="
row
justify
-
content
-
center
" style="
margin
-
top
:
10
px
">
<div class="
col
-
sm
-
6
">
<div class="
form
-
group
">
<label for="
pdfEdital
">Anexar edital</label>
<label for="
pdfEdital
">Anexar edital
*:
</label>
<input type="
file
" class="
form
-
control
-
file
@
error
(
'pdfEdital'
)
is
-
invalid
@
enderror
" name="
pdfEdital
" value="
{{
old
(
'pdfEdital'
)
}}
" id="
pdfEdital
">
<small>O arquivo selecionado deve ser no formato PDF de até 2mb.</small>
@error('pdfEdital')
...
...
@@ -172,7 +172,7 @@
<div class="
col
-
sm
-
6
">
<div class="
form
-
group
">
<label for="
modeloDocumento
">Arquivo com os modelos de documentos do edital</label>
<label for="
modeloDocumento
">A
nexar a
rquivo com os modelos de documentos do edital
:
</label>
<input type="
file
" class="
form
-
control
-
file
@
error
(
'modeloDocumento'
)
is
-
invalid
@
enderror
" name="
modeloDocumento
" value="
{{
old
(
'modeloDocumento'
)
}}
" id="
modeloDocumento
">
<small>O arquivo selecionado deve ter até 2mb.</small>
@error('modeloDocumento')
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
11f257bb
...
...
@@ -610,38 +610,38 @@
// "</div>";
// }
//
function areas() {
//
var grandeArea = $('#grandeArea').val();
//
$.getJSON("
{{ config('app.url') }}
/naturezas/areas/" + grandeArea,
//
function (dados){
//
if (dados.length > 0){
//
var option = '<option>-- Área --</option>';
//
$.each(dados, function(i, obj){
//
option += '<option value="'+obj.id+'">'+obj.nome+'</option>';
//
})
//
} else {
//
var option = "<option>-- Área --</option>";
//
}
//
$('#area').html(option).show();
//
})
//
}
function
areas
()
{
var
grandeArea
=
$
(
'#grandeArea'
)
.
val
();
$
.
getJSON
(
"
http://submeta.test
/naturezas/areas/"
+
grandeArea
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
'<option>-- Área --</option>'
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Área --</option>"
;
}
$
(
'#area'
)
.
html
(
option
)
.
show
();
})
}
//
function subareas() {
//
var area = $('#area').val();
//
$.getJSON("
{{ config('app.url') }}
/naturezas/subarea/" + area,
//
function (dados){
//
if (dados.length > 0){
//
var option = '<option>-- Sub Área --</option>';
//
$.each(dados, function(i, obj){
//
option += '<option value="'+obj.id+'">'+obj.nome+'</option>';
//
})
//
} else {
//
var option = "<option>-- Sub Área --</option>";
//
}
//
$('#subArea').html(option).show();
//
})
//
}
function
subareas
()
{
var
area
=
$
(
'#area'
)
.
val
();
$
.
getJSON
(
"
http://submeta.test
/naturezas/subarea/"
+
area
,
function
(
dados
){
if
(
dados
.
length
>
0
){
var
option
=
'<option>-- Sub Área --</option>'
;
$
.
each
(
dados
,
function
(
i
,
obj
){
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
})
}
else
{
var
option
=
"<option>-- Sub Área --</option>"
;
}
$
(
'#subArea'
)
.
html
(
option
)
.
show
();
})
}
//
window.onload = areas();
window
.
onload
=
areas
();
</
script
>
@
endsection
\ No newline at end of file
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