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
84e19071
Unverified
Commit
84e19071
authored
Jun 06, 2023
by
Antônio Durval
Committed by
GitHub
Jun 06, 2023
Browse files
Merge pull request #905 from antonioDurval/master
Adição de restrição de datas para poder add integrantes aos editais P…
parents
1a5fa378
66556b90
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
84e19071
...
...
@@ -459,6 +459,9 @@ class TrabalhoController extends Controller
}
}
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
$hoje
->
toDateString
();
return
view
(
'projeto.visualizar'
)
->
with
([
'projeto'
=>
$projeto
,
...
...
@@ -478,7 +481,8 @@ class TrabalhoController extends Controller
'trabalhos_user'
=>
$trabalhos_user
,
'AvalRelatParcial'
=>
$AvalRelatParcial
,
'AvalRelatFinal'
=>
$AvalRelatFinal
,
'proponente'
=>
$proponente
'proponente'
=>
$proponente
,
'hoje'
=>
$hoje
]);
}
...
...
@@ -1215,6 +1219,10 @@ class TrabalhoController extends Controller
return
redirect
(
route
(
'trabalho.show'
,
[
'id'
=>
$id
]))
->
with
([
'mensagem'
=>
"Já existe um Integrante com esse CPF."
]);
}
if
(
!
$this
->
validarDataResultadoFinalPibex
(
$id
))
{
return
redirect
(
route
(
'trabalho.show'
,
[
'id'
=>
$id
]))
->
with
([
'mensagem'
=>
"Só é possivel adicionar integrantes após a data do Resultado final"
]);
}
$atributos
=
[
'user_id'
=>
$usuario
->
id
,
'funcao_participante_id'
=>
$request
->
funcao_participante
,
...
...
@@ -1275,6 +1283,19 @@ class TrabalhoController extends Controller
return
true
;
}
private
function
validarDataResultadoFinalPibex
(
$id
)
{
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
$hoje
->
toDateString
();
$edital
=
Trabalho
::
where
(
'id'
,
$id
)
->
first
()
->
evento
;
if
(
$edital
->
tipo
==
"PIBEX"
&&
$hoje
<=
$edital
->
resultado_final
){
return
false
;
}
return
true
;
}
public
function
buscarUsuario
(
Request
$request
)
{
$usuario
=
User
::
where
(
'cpf'
,
$request
->
cpf_consulta
)
->
first
();
$funcao
=
FuncaoParticipantes
::
where
(
'id'
,
$request
->
funcao
)
->
first
();
...
...
resources/views/projeto/formularioVisualizar/integrantes.blade.php
View file @
84e19071
...
...
@@ -9,9 +9,11 @@
<a
href=
"{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}"
class=
"button"
>
Solicitar Substituições/Desligamentos
</a>
</div>
<div
class=
"col-sm-3 text-sm-right"
>
<a
href=
""
data-toggle=
"modal"
data-target=
"#modalAdicionarParticipante"
class=
"button"
>
Adicionar Participante
</a>
</div>
@if(($projeto->evento->tipo == "PIBEX"
&&
$hoje > $projeto->evento->resultado_final) || $projeto->evento->tipo == "CONTINUO")
<div
class=
"col-sm-3 text-sm-right"
>
<a
href=
""
data-toggle=
"modal"
data-target=
"#modalAdicionarParticipante"
class=
"button"
>
Adicionar Participante
</a>
</div>
@endif
</div>
<hr
style=
"border-top: 1px solid#1492E6"
>
...
...
resources/views/projeto/visualizar.blade.php
View file @
84e19071
...
...
@@ -38,7 +38,7 @@
@
endif
@
if
(
$edital
->
natureza_id
==
3
)
@
component
(
'projeto.formularioVisualizar.integrantes'
,
[
'projeto'
=>
$projeto
,
'edital'
=>
$edital
,
'trabalhos_user'
=>
$trabalhos_user
,
'funcaoParticipantes'
=>
$funcaoParticipantes
])
@
component
(
'projeto.formularioVisualizar.integrantes'
,
[
'projeto'
=>
$projeto
,
'edital'
=>
$edital
,
'trabalhos_user'
=>
$trabalhos_user
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'hoje'
=>
$hoje
])
@
endcomponent
@
endif
...
...
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