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
ef18bc0a
Commit
ef18bc0a
authored
Sep 09, 2024
by
Gabriel Alves
Browse files
ajuste notificacao e parametrizacao ODS
parent
16fc0a38
Changes
8
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
ef18bc0a
...
...
@@ -932,15 +932,25 @@ class AdministradorController extends Controller
public
function
adicionar
(
Request
$request
)
{
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$aval
=
Avaliador
::
where
(
'id'
,
$request
->
avaliador_id
)
->
first
();
$aval
->
eventos
()
->
attach
(
$evento
);
$aval
->
save
();
$user
=
$aval
->
user
()
->
first
();
$aval
iador
=
Avaliador
::
where
(
'id'
,
$request
->
avaliador_id
)
->
first
();
$aval
iador
->
eventos
()
->
attach
(
$evento
);
$aval
iador
->
save
();
$user
=
$aval
iador
->
user
()
->
first
();
$subject
=
'Convite para avaliar projetos da UPE'
;
Mail
::
to
(
$user
->
email
)
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
$user
->
name
,
' '
,
'Avaliador-Cadastrado'
,
$evento
->
nome
,
' '
,
$subject
,
$evento
->
tipo
,
$evento
->
natureza_id
));
$notificacao
=
Notificacao
::
create
([
'remetente_id'
=>
Auth
::
user
()
->
id
,
'destinatario_id'
=>
$avaliador
->
user_id
,
'trabalho_id'
=>
$evento
->
id
,
'lido'
=>
false
,
'tipo'
=>
5
,
]);
$notificacao
->
save
();
return
redirect
()
->
back
();
}
...
...
app/Http/Controllers/EventoController.php
View file @
ef18bc0a
...
...
@@ -170,7 +170,7 @@ class EventoController extends Controller
$evento
->
fim_recurso
=
$request
->
fim_recurso
;
$evento
->
resultado_preliminar
=
$request
->
resultado_preliminar
;
$evento
->
resultado_final
=
$request
->
resultado_final
;
$evento
->
quantidade_ods
=
$request
->
quantidade_ods
;
if
(
$request
->
dt_inicioRelatorioParcial
)
{
$evento
->
dt_inicioRelatorioParcial
=
$request
->
dt_inicioRelatorioParcial
;
}
...
...
app/Http/Controllers/NotificacaoController.php
View file @
ef18bc0a
...
...
@@ -8,6 +8,7 @@ use App\SolicitacaoCertificado;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Mail
;
use
App\Evento
;
class
NotificacaoController
extends
Controller
...
...
@@ -97,7 +98,6 @@ class NotificacaoController extends Controller
public
function
listarTrab
()
{
$notificacoes
=
Notificacao
::
where
(
'destinatario_id'
,
Auth
()
->
user
()
->
id
)
->
get
()
->
sortByDesc
(
'created_at'
);
return
view
(
'notificacao.listar'
,
[
'notificacoes'
=>
$notificacoes
]);
}
...
...
@@ -122,13 +122,6 @@ class NotificacaoController extends Controller
}
}
elseif
(
$notificacao
->
tipo
==
3
||
$notificacao
->
tipo
==
4
)
{
return
redirect
()
->
route
(
'planos.listar'
,
[
'id'
=>
$notificacao
->
trabalho
->
id
]);
}
elseif
(
$notificacao
->
tipo
==
5
)
{
if
(
!
is_null
(
Auth
::
user
()
->
avaliadors
->
eventos
->
where
(
'id'
,
$notificacao
->
trabalho
->
evento
->
id
)
->
first
()
->
pivot
->
convite
)
&&
Auth
::
user
()
->
avaliadors
->
eventos
->
where
(
'id'
,
$notificacao
->
trabalho
->
evento
->
id
)
->
first
()
->
pivot
->
convite
==
true
)
{
return
redirect
()
->
route
(
'avaliador.visualizarTrabalho'
,
[
'evento_id'
=>
$notificacao
->
trabalho
->
evento
->
id
]);
}
else
{
return
redirect
()
->
route
(
'avaliador.editais'
);
}
}
elseif
(
$notificacao
->
tipo
==
7
)
{
if
(
$notificacao
->
destinatario_id
==
Auth
()
->
user
()
->
id
&&
Auth
()
->
user
()
->
tipo
!=
'proponente'
)
{
return
redirect
()
->
route
(
'admin.analisarProposta'
,
[
'id'
=>
$notificacao
->
trabalho
->
id
]);
...
...
@@ -136,6 +129,13 @@ class NotificacaoController extends Controller
}
elseif
(
$notificacao
->
tipo
==
6
)
{
return
redirect
()
->
route
(
'trabalho.show'
,
[
'id'
=>
$notificacao
->
trabalho
->
id
]);
}
$avaliadorEvento
=
Auth
::
user
()
->
avaliadors
->
eventos
->
where
(
'id'
,
$notificacao
->
trabalho
->
evento
->
id
)
->
first
();
if
(
$avaliadorEvento
&&
!
is_null
(
$avaliadorEvento
->
pivot
)
&&
$avaliadorEvento
->
pivot
->
convite
==
true
)
{
return
redirect
()
->
route
(
'avaliador.visualizarTrabalho'
,
[
'evento_id'
=>
$notificacao
->
trabalho
->
evento
->
id
]);
}
else
{
return
redirect
()
->
route
(
'avaliador.editais'
);
}
}
...
...
app/Http/Controllers/TrabalhoController.php
View file @
ef18bc0a
...
...
@@ -95,6 +95,7 @@ class TrabalhoController extends Controller
public
function
index
(
$id
)
{
$edital
=
Evento
::
find
(
$id
);
$quantidade_ods
=
$edital
->
quantidade_ods
;
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$areaTematicas
=
AreaTematica
::
orderBy
(
'nome'
)
->
get
();
$ODS
=
ObjetivoDeDesenvolvimentoSustentavel
::
with
(
'metas'
)
->
get
();
...
...
@@ -119,6 +120,7 @@ class TrabalhoController extends Controller
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
'ods'
=>
$ODS
,
'quantidade_ods'
=>
$quantidade_ods
]);
}
...
...
@@ -2263,6 +2265,8 @@ class TrabalhoController extends Controller
}
}
}
\ No newline at end of file
database/migrations/2020_02_05_123153_create_eventos_table.php
View file @
ef18bc0a
...
...
@@ -19,6 +19,7 @@ class CreateEventosTable extends Migration
$table
->
string
(
'nome'
)
->
nullable
();
$table
->
text
(
'descricao'
)
->
nullable
();
$table
->
string
(
'tipo'
)
->
nullable
();
$table
->
unsignedBigInteger
(
'quantidade_ods'
)
->
nullable
();
$table
->
unsignedBigInteger
(
'natureza_id'
)
->
nullable
();
$table
->
date
(
'inicioSubmissao'
)
->
nullable
();
$table
->
date
(
'fimSubmissao'
)
->
nullable
();
...
...
resources/views/evento/criarEvento.blade.php
View file @
ef18bc0a
...
...
@@ -59,6 +59,15 @@
@
enderror
</
div
>
<
div
class
=
"col-sm-2"
>
<
label
for
=
"quantidade_ods"
class
=
"col-form-label"
>
{{
__
(
'Quantidade de ODS\'s:'
)
}}
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
label
>
<
select
id
=
"quantidade_ods"
class
=
"form-control"
name
=
"quantidade_ods"
required
>
@
for
(
$i
=
1
;
$i
<=
5
;
$i
++
)
<
option
value
=
"{{
$i
}}"
@
if
(
old
(
'quantidade_ods'
)
==
$i
)
selected
@
endif
>
{{
$i
}}
</
option
>
@
endfor
</
select
>
</
div
>
<
div
class
=
"col-sm-3"
>
<
label
for
=
"natureza"
class
=
"col-form-label"
>
{{
__
(
'Natureza:'
)
}}
<
span
style
=
"color:red; font-weight:bold;"
>*</
span
></
label
>
<
select
onchange
=
"selecionar_decisao_camara()"
id
=
"natureza"
type
=
"text"
class
=
"form-control @error('natureza') is-invalid @enderror"
name
=
"natureza"
value
=
"{{ old('natureza') }}"
>
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
ef18bc0a
...
...
@@ -108,7 +108,7 @@
const
participante
=
partsFirst
.
firstElementChild
;
@
endif
let
contador
=
0
;
var
quantidadeOds
=
"{{
$quantidade_ods
}}"
buttonSubmit
.
addEventListener
(
'click'
,
(
e
)
=>
{
$
(
'.collapse'
)
.
addClass
(
'show'
)
...
...
@@ -823,8 +823,8 @@
selectedOds
.
push
(
$
(
this
).
val
());
});
if
(
selectedOds
.
length
>
3
){
showAlert
(
'
#notificacao-erro
'
,
'
Você atingiu o limite maximo de ODS selecionadas(
3 ODS)
'
)
if
(
selectedOds
.
length
>
quantidadeOds
){
showAlert
(
'
#notificacao-erro
'
,
`
Você atingiu o limite maximo de ODS
\'s
selecionadas(
${
quantidadeOds
}
)`
)
$
(
this
).
prop
(
'
checked
'
,
false
);
selectedOds
.
pop
()
}
...
...
@@ -857,8 +857,8 @@
$
(
document
).
on
(
'
change
'
,
'
.meta-checkbox
'
,
function
()
{
totalSelectedMetas
=
$
(
'
.meta-checkbox:checked
'
).
length
;
if
(
totalSelectedMetas
>
3
)
{
showAlert
(
'
#notificacao-erro
'
,
'
Você atingiu o limite maximo de metas selecionadas(
3 metas
)
'
)
if
(
totalSelectedMetas
>
5
)
{
showAlert
(
'
#notificacao-erro
'
,
'
Você atingiu o limite maximo de metas selecionadas(
5
)
'
)
$
(
this
).
prop
(
'
checked
'
,
false
);
return
;
}
...
...
resources/views/notificacao/listar.blade.php
View file @
ef18bc0a
@
extends
(
'layouts.app'
)
@
php
use
App\Evento
;
@
endphp
@
section
(
'content'
)
<
div
class
=
"row justify-content-center"
...
...
@@ -104,7 +107,8 @@
@
if
(
$notificacao
->
destinatario_id
==
Auth
::
user
()
->
id
)
<
div
class
=
"col-sm-11"
>
<
h6
style
=
"font-size: 18px"
>
Avaliação
para
{{
$notificacao
->
trabalho
->
titulo
}}
</
h6
>
para
{{
Evento
::
where
(
'id'
,
$notificacao
->
trabalho_id
)
->
first
()
->
nome
}}
</
h6
>
</
div
>
@
if
(
!
$notificacao
->
lido
)
<
div
class
=
"col-sm-1"
>
...
...
@@ -138,7 +142,7 @@
</
div
>
@
endif
<
p
style
=
"font-size: 14px; margin-bottom: 0;"
>
Projeto
:
{{
$notificacao
->
trabalho
->
titulo
}}
</
p
>
Projeto
:
{{
Evento
::
where
(
'id'
,
$notificacao
->
trabalho
_id
)
->
first
()
->
nome
}}
</
p
>
<
div
style
=
"text-align: right"
>
<
a
href
=
"{{ route('notificacao.ler', ['id' =>
$notificacao->id
]) }}"
>
Visualizar
</
a
>
</
div
>
...
...
@@ -159,4 +163,5 @@
margin
:
auto
;
}
</
style
>
@
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