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
b2c6b081
Commit
b2c6b081
authored
Jun 17, 2020
by
carlos
Browse files
bug do plano de trabalho em editar projeto
parent
1333df16
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
b2c6b081
...
...
@@ -537,7 +537,6 @@ class TrabalhoController extends Controller
foreach
(
$users
as
$user
)
{
array_push
(
$emailParticipantes
,
$user
->
email
);
}
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
// criando novos participantes que podem ter sido adicionados
if
(
!
(
in_array
(
$request
->
emailParticipante
[
$key
],
$emailParticipantes
,
false
)))
{
...
...
@@ -603,25 +602,27 @@ class TrabalhoController extends Controller
$participante
->
update
();
//atualizando planos de trabalho
if
(
array_key_exists
(
$key
,
$request
->
anexoPlanoTrabalho
))
{
if
(
!
(
is_null
(
$request
->
anexoPlanoTrabalho
[
$key
])))
{
$arquivo
=
Arquivo
::
where
(
'participanteId'
,
$participante
->
id
)
->
first
();
Storage
::
delete
(
$arquivo
->
nome
);
$arquivo
->
delete
();
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$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
();
if
(
$request
->
anexoPlanoTrabalho
!=
null
)
{
if
(
array_key_exists
(
$key
,
$request
->
anexoPlanoTrabalho
))
{
if
(
!
(
is_null
(
$request
->
anexoPlanoTrabalho
[
$key
])))
{
$arquivo
=
Arquivo
::
where
(
'participanteId'
,
$participante
->
id
)
->
first
();
Storage
::
delete
(
$arquivo
->
nome
);
$arquivo
->
delete
();
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$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
();
}
}
}
}
...
...
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