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
92b0234e
Commit
92b0234e
authored
Mar 22, 2022
by
KelwinJonas
Browse files
enviar convite de avaliador e atribuir ao trabalho
parent
cc2c32fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
92b0234e
...
...
@@ -109,13 +109,15 @@ class AdministradorController extends Controller
$avalProjeto
=
Avaliador
::
whereNotIn
(
'id'
,
$avalSelecionadosId
)
->
get
();
$trabalho
->
aval
=
$avalProjeto
;
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
return
view
(
'administrador.analisarProposta'
)
->
with
(
[
'trabalho'
=>
$trabalho
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'evento'
=>
$evento
,
'substituicoesPendentes'
=>
$substituicoesPendentes
,
'substituicoesProjeto'
=>
$substituicoesProjeto
,]);
'substituicoesProjeto'
=>
$substituicoesProjeto
,
'grandeAreas'
=>
$grandeAreas
,]);
}
public
function
showProjetos
(
Request
$request
){
...
...
@@ -570,6 +572,78 @@ class AdministradorController extends Controller
}
public
function
enviarConviteEAtribuir
(
Request
$request
)
{
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$nomeAvaliador
=
$request
->
nomeAvaliador
;
$emailAvaliador
=
$request
->
emailAvaliador
;
$area
=
Area
::
where
(
'id'
,
$request
->
area_id
)
->
first
();
$user
=
User
::
where
(
'email'
,
$emailAvaliador
)
->
first
();
if
(
$request
->
instituicao
==
"ufape"
){
$nomeInstituicao
=
"Universidade Federal do Agreste de Pernambuco"
;
$externoInterno
=
"Interno"
;
}
else
{
$nomeInstituicao
=
$request
->
outra
;
$externoInterno
=
"Externo"
;
}
if
(
isset
(
$user
)){
$passwordTemporario
=
Str
::
random
(
8
);
$subject
=
"Convite para avaliar projetos da UFAPE"
;
Mail
::
to
(
$emailAvaliador
)
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
$nomeAvaliador
,
' '
,
'Avaliador-Cadastrado'
,
$evento
->
nome
,
$passwordTemporario
,
$subject
,
$evento
->
tipo
));
}
else
{
$passwordTemporario
=
Str
::
random
(
8
);
$subject
=
"Convite para avaliar projetos da UFAPE"
;
Mail
::
to
(
$emailAvaliador
)
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
$nomeAvaliador
,
' '
,
'Avaliador'
,
$evento
->
nome
,
$passwordTemporario
,
$subject
,
$evento
->
tipo
));
$user
=
User
::
create
([
'email'
=>
$emailAvaliador
,
'password'
=>
bcrypt
(
$passwordTemporario
),
'usuarioTemp'
=>
false
,
'name'
=>
$nomeAvaliador
,
'tipo'
=>
'avaliador'
,
'instituicao'
=>
$nomeInstituicao
,
]);
$user
->
markEmailAsVerified
();
}
if
(
$user
->
avaliadors
==
null
){
$avaliador
=
new
Avaliador
();
$avaliador
->
tipo
=
$externoInterno
;
$avaliador
->
save
();
$avaliador
->
area
()
->
associate
(
$area
);
$avaliador
->
user
()
->
associate
(
$user
);
$avaliador
->
eventos
()
->
attach
(
$evento
);
$user
->
save
();
$avaliador
->
save
();
}
else
{
$avaliador
=
$user
->
avaliadors
;
$avaliador
->
eventos
()
->
attach
(
$evento
);
$user
->
save
();
$avaliador
->
save
();
}
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
trabalho_id
)
->
first
();
$trabalho
->
avaliadors
()
->
attach
(
$avaliador
);
$evento
->
avaliadors
()
->
syncWithoutDetaching
(
$avaliador
);
$trabalho
->
save
();
$notificacao
=
Notificacao
::
create
([
'remetente_id'
=>
Auth
::
user
()
->
id
,
'destinatario_id'
=>
$avaliador
->
user_id
,
'trabalho_id'
=>
$request
->
trabalho_id
,
'lido'
=>
false
,
'tipo'
=>
5
,
]);
$notificacao
->
save
();
return
redirect
()
->
back
();
}
public
function
reenviarConviteAtribuicaoProjeto
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'id'
,
$request
->
avaliador_id
)
->
first
();
...
...
resources/views/administrador/analisarProposta.blade.php
View file @
92b0234e
...
...
@@ -398,10 +398,17 @@
<
div
class
=
"modal-dialog modal-dialog-centered modal-lg"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"avaliadorModalLongTitle"
>
Selecione
o
(
s
)
avaliador
(
es
)
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
style
=
"color: rgb(182, 182, 182)"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
<
div
class
=
"col-md-8"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"avaliadorModalLongTitle"
>
Selecione
o
(
s
)
avaliador
(
es
)
</
h5
>
</
div
>
<
div
class
=
"col-md-4"
style
=
"text-align: right"
>
<
button
type
=
"button"
id
=
"enviarConviteButton"
class
=
"btn btn-info"
data
-
toggle
=
"modal"
onclick
=
"abrirModalConvite()"
>
Enviar
Convite
</
button
>
<
button
type
=
"button"
class
=
"close"
aria
-
label
=
"Close"
data
-
dismiss
=
"modal"
style
=
"color: rgb(182, 182, 182)"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
</
div
>
<
div
class
=
"modal-body"
>
@
if
(
session
(
'error'
))
...
...
@@ -882,6 +889,83 @@
</
div
>
</
div
>
<!--
Modal
enviar
convite
e
atribuir
-->
<
div
class
=
"modal fade"
id
=
"exampleModalCenter"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"exampleModalLongTitle"
style
=
"font-size: 20px;"
>
Enviar
Convite
</
h5
>
<
button
type
=
"button"
class
=
"close"
onclick
=
"fecharModalConvite()"
aria
-
label
=
"Close"
style
=
"color: rgb(182, 182, 182)"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
style
=
"margin-left: 20px; margin-right: 20px;"
>
<
form
action
=
"{{ route('admin.convite.atribuicao.projeto') }}"
method
=
"POST"
class
=
"labels-blue"
>
@
csrf
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputEmail1"
>
Nome
Completo
<
span
style
=
"color: red;"
>*</
span
></
label
>
<
input
type
=
"text"
class
=
"form-control"
name
=
"nomeAvaliador"
id
=
"exampleInputNome1"
required
>
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"exampleInputEmail1"
>
Email
<
span
style
=
"color: red;"
>*</
span
></
label
>
<
input
type
=
"email"
class
=
"form-control"
name
=
"emailAvaliador"
id
=
"exampleInputEmail1"
required
>
</
div
>
<
div
class
=
"form-group"
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área'
)
}}
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
<
select
class
=
"form-control"
id
=
"grandeAreaConvite"
name
=
"grande_area_id"
onchange
=
"areas()"
required
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
@
foreach
(
$grandeAreas
as
$grandeArea
)
<
option
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
@endforeach
</select>
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área') }} <span style="
color
:
red
;
font
-
weight
:
bold
">*</span></label>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
areaConvite
" name="
area_id
" required>
<option value="" disabled selected hidden>-- Área --</option>
</select>
</div>
<div class="
form
-
group
">
<label for="
exampleFormControlSelect1
">Tipo</label>
<select class="
form
-
control
" name="
tipo
" id="
exampleFormControlSelect1
" disabled>
<option value="
avaliador
" >Avaliador</option>
</select>
</div>
<div class="
form
-
group
">
<label for="
exampleFormControlSelect1
">Instituição <span style="
color
:
red
;
font
-
weight
:
bold
">*</span></label>
<select class="
form
-
control
" name="
instituicao
" id="
membro
" required onchange="
mostrarDiv
(
this
)
">
<option value="" disabled>-- Selecione a instituição --</option>
<option value="
ufape
" >Universidade Federal do Agreste de Pernambuco</option>
<option value="
outra
" >Outra</option>
</select>
</div>
<div class="
form
-
group
" id="
div
-
outra
" style="
@
if
(
old
(
'instituicao'
)
!=
null
&&
old
(
'instituicao'
)
==
"outra"
)
display
:
block
;
@
else
display
:
none
;
@
endif
">
<label for="
outra
">{{ __('Digite o nome da instituição') }}<span style="
color
:
red
;
font
-
weight
:
bold
;
"> *</span></label>
<input id="
outra
" class="
form
-
control
@
error
(
'outra'
)
is
-
invalid
@
enderror
" type="
text
" name="
outra
" value="
{{
old
(
'outra'
)}}
" autocomplete="
outra
" placeholder="
Universidade
Federal
...
">
@error('outra')
<div id="
validationServer03Feedback
" class="
invalid
-
feedback
">
{{
$message
}}
</div>
@enderror
</div>
<div class="
form
-
group
" style="
margin
-
top
:
40
px
;
margin
-
bottom
:
40
px
;
">
<button type="
submit
" class="
btn
btn
-
info
" style="
width
:
100
%
">Enviar</button>
</div>
<div class="
form
-
group
texto
-
info
">
O convite será enviador por e-mail e o preenchimento dos dados será de inteira responsabilidade do usuário convidado.
</div>
</form>
</div>
</div>
</div>
</div>
<style>
body{font-family:Calibri, Tahoma, Arial}
...
...
@@ -1092,4 +1176,62 @@
setTimeout
(()
=>
{
$
(
"#modalVizuSubstituicao"
)
.
modal
();
},
500
);
}
</
script
>
<
script
>
function
abrirModalConvite
(){
$
(
"#avaliadorModalCenter"
)
.
modal
(
'toggle'
);
setTimeout
(()
=>
{
$
(
"#exampleModalCenter"
)
.
modal
();
},
500
);
$
(
'#exampleModalCenter'
)
.
focus
();
}
function
fecharModalConvite
(){
$
(
'#exampleModalCenter'
)
.
modal
(
'toggle'
);
setTimeout
(()
=>
{
$
(
"#avaliadorModalCenter"
)
.
modal
();
},
500
);
$
(
'#avaliadorModalCenter'
)
.
focus
();
}
function
areas
()
{
var
grandeArea
=
$
(
'#grandeAreaConvite'
)
.
val
();
$
.
ajax
({
type
:
'POST'
,
url
:
'{{ route('
area
.
consulta
') }}'
,
data
:
'id='
+
grandeArea
,
headers
:
{
'X-CSRF-TOKEN'
:
$
(
'meta[name="csrf-token"]'
)
.
attr
(
'content'
)
},
success
:
(
dados
)
=>
{
if
(
dados
.
length
>
0
)
{
if
(
$
(
'#oldArea'
)
.
val
()
==
null
||
$
(
'#oldArea'
)
.
val
()
==
""
){
var
option
=
'<option selected disabled>-- Área --</option>'
;
}
$
.
each
(
dados
,
function
(
i
,
obj
)
{
if
(
$
(
'#oldArea'
)
.
val
()
!=
null
&&
$
(
'#oldArea'
)
.
val
()
==
obj
.
id
){
option
+=
'<option selected value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
}
else
{
option
+=
'<option value="'
+
obj
.
id
+
'">'
+
obj
.
nome
+
'</option>'
;
}
})
}
else
{
var
option
=
"<option selected disabled>-- Área --</option>"
;
}
$
(
'#areaConvite'
)
.
html
(
option
)
.
show
();
},
error
:
(
data
)
=>
{
console
.
log
(
data
);
}
})
}
function
mostrarDiv
(
select
)
{
if
(
select
.
value
==
"outra"
)
{
document
.
getElementById
(
'div-outra'
)
.
style
.
display
=
"block"
;
$
(
"#outra"
)
.
prop
(
'required'
,
true
);
}
else
if
(
select
.
value
==
"ufape"
){
document
.
getElementById
(
'div-outra'
)
.
style
.
display
=
"none"
;
$
(
"#outra"
)
.
prop
(
'required'
,
false
);
}
}
</
script
>
@
endsection
resources/views/projeto/formularioVisualizar/participantes2.blade.php
View file @
92b0234e
...
...
@@ -4,11 +4,11 @@
<div
class=
"card-body"
style=
"padding-top: 0.2rem;"
>
<div
class=
"container"
>
<div
class=
"form-row mt-3"
>
<div
class=
"col-sm-
6
"
><h5
style=
"color: #234B8B; font-weight: bold"
>
Discentes
</h5></div>
<div
class=
"col-sm-
4
"
><h5
style=
"color: #234B8B; font-weight: bold"
>
Discentes
</h5></div>
<div
class=
"col-sm-4 text-sm-right"
>
<a
href=
""
data-toggle=
"modal"
data-target=
"#modalSelecionarDiscentes"
class=
"button"
>
Solicitar certificado/declaração
</a>
</div>
<div
class=
"col-sm-
2
text-sm-right"
>
<div
class=
"col-sm-
4
text-sm-right"
>
<a
href=
"{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}"
class=
"button"
>
Solicitar Substituições/Desligamentos
</a>
</div>
...
...
routes/web.php
View file @
92b0234e
...
...
@@ -205,6 +205,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){
Route
::
post
(
'/removerAvalEvento'
,
'AdministradorController@remover'
)
->
name
(
'remover'
);
Route
::
get
(
'/removerProjAval'
,
'AdministradorController@removerProjAval'
)
->
name
(
'removerProjAval'
);
Route
::
post
(
'/atribuirAvaliadorProjeto'
,
'AdministradorController@atribuicaoProjeto'
)
->
name
(
'atribuicao.projeto'
);
Route
::
post
(
'/enviarConviteEAtribuirProjeto'
,
'AdministradorController@enviarConviteEAtribuir'
)
->
name
(
'convite.atribuicao.projeto'
);
Route
::
get
(
'/reenviarConviteAtribuicaoProjeto'
,
'AdministradorController@reenviarConviteAtribuicaoProjeto'
)
->
name
(
'reenviar.atribuicao.projeto'
);
Route
::
post
(
'/enviarConviteAvaliador'
,
'AdministradorController@enviarConvite'
)
->
name
(
'enviarConvite'
);
Route
::
post
(
'/reenviarConviteAvaliador'
,
'AdministradorController@reenviarConvite'
)
->
name
(
'reenviarConvite'
);
...
...
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