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
45d6dbb9
Commit
45d6dbb9
authored
Jun 29, 2021
by
Gabriel-31415
Browse files
ajuste
parent
bdcd27f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
45d6dbb9
...
...
@@ -987,7 +987,7 @@ class TrabalhoController extends Controller
$subject
=
"Participante de Projeto"
;
//
Mail::to($request->emailParticipante[$key])->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
Mail
::
to
(
$request
->
emailParticipante
[
$key
])
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
Auth
()
->
user
()
->
name
,
$projeto
->
titulo
,
'Participante'
,
$edital
->
nome
,
$passwordTemporario
,
$subject
));
}
else
{
$participante
->
user_id
=
$userParticipante
->
id
;
...
...
@@ -1005,11 +1005,11 @@ class TrabalhoController extends Controller
$participante
->
save
();
$subject
=
"Participante de Projeto"
;
//
Mail::to($request->emailParticipante[$key])
//
->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
Mail
::
to
(
$request
->
emailParticipante
[
$key
])
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
,
$edital
,
$projeto
));
}
if
(
$request
->
nomePlanoTrabalho
[
$key
]
!=
null
){
$usuario
=
User
::
where
(
'email'
,
$request
->
emailParticipante
[
$key
])
->
first
();
$participante
=
Participante
::
where
([[
'user_id'
,
'='
,
$usuario
->
id
],
[
'trabalho_id'
,
'='
,
$projeto
->
id
]])
->
first
();
...
...
@@ -1028,7 +1028,7 @@ class TrabalhoController extends Controller
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
// dd($arquivo);
}
// Editado
}
elseif
(
$id
>
0
)
{
...
...
@@ -1148,9 +1148,25 @@ class TrabalhoController extends Controller
$participante
->
media_do_curso
=
$request
->
media_geral_curso
[
$key
];
$participante
->
save
();
$usuario
=
User
::
where
(
'email'
,
$email
)
->
first
();
$participante
=
Participante
::
where
([[
'user_id'
,
'='
,
$usuario
->
id
],
[
'trabalho_id'
,
'='
,
$projeto
->
id
]])
->
first
();
$path
=
'trabalhos/'
.
$edital
->
id
.
'/'
.
$projeto
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$agora
=
now
();
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$projeto
->
id
;
$arquivo
->
data
=
$agora
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
$subject
=
"Participante de Projeto"
;
//
Mail::to($email)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
Mail
::
to
(
$email
)
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
Auth
()
->
user
()
->
name
,
$projeto
->
titulo
,
'Participante'
,
$edital
->
nome
,
$passwordTemporario
,
$subject
));
}
else
{
$participante
->
user_id
=
$userParticipante
->
id
;
...
...
@@ -1167,31 +1183,51 @@ class TrabalhoController extends Controller
$participante
->
media_do_curso
=
$request
->
media_geral_curso
[
$key
];
$participante
->
save
();
if
(
$request
->
anexoPlanoTrabalho
[
$key
])
{
$path
=
'trabalhos/'
.
$edital
->
id
.
'/'
.
$projeto
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$agora
=
now
();
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$projeto
->
id
;
$arquivo
->
data
=
$agora
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
$subject
=
"Participante de Projeto"
;
//
Mail::to($email)
//
->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
Mail
::
to
(
$email
)
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
,
$edital
,
$projeto
));
}
if
(
$request
->
nomePlanoTrabalho
[
$key
]
!=
null
){
$usuario
=
User
::
where
(
'email'
,
$email
)
->
first
();
$participante
=
Participante
::
where
([[
'user_id'
,
'='
,
$usuario
->
id
],
[
'trabalho_id'
,
'='
,
$projeto
->
id
]])
->
first
();
$path
=
'trabalhos/'
.
$edital
->
id
.
'/'
.
$projeto
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$agora
=
now
();
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$projeto
->
id
;
$arquivo
->
data
=
$agora
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
//
if($request->nomePlanoTrabalho[$key] != null){
//
$usuario = User::where('email', $email)->first();
//
$participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first();
//
$path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/';
//
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
//
$file = $request->anexoPlanoTrabalho[$key];
//
Storage::putFileAs($path, $file, $nome);
//
$agora = now();
//
$arquivo = new Arquivo();
//
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
//
$arquivo->nome = $path . $nome;
//
$arquivo->trabalhoId = $projeto->id;
//
$arquivo->data = $agora;
//
$arquivo->participanteId = $participante->id;
//
$arquivo->versaoFinal = true;
//
$arquivo->save();
//
}
}
}
...
...
@@ -1211,8 +1247,8 @@ class TrabalhoController extends Controller
$projeto
=
$this
->
atribuirDados
(
$request
,
$edital
,
$projeto
);
$projeto
->
update
();
// Salvando participantes
// dd($request->all());
// Salvando participantes
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
,
true
);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto atualizado com sucesso!'
]);
...
...
resources/views/projeto/editar.blade.php
View file @
45d6dbb9
...
...
@@ -148,13 +148,13 @@
let
input
=
cln
.
children
[
i
]
.
querySelectorAll
(
'input'
)[
index
];
let
name
=
input
.
getAttributeNode
(
"name"
)
.
value
;
name
=
name
.
replace
(
"[]"
,
""
);
input
.
getAttributeNode
(
"name"
)
.
value
=
name
+
'['
+
contador
+
']'
;
//
input.getAttributeNode("name").value = name + '['+ contador +']';
let
select
=
cln
.
children
[
i
]
.
querySelectorAll
(
'select'
)[
index
];
if
(
select
){
let
selectName
=
select
.
getAttributeNode
(
"name"
)
.
value
;
selectName
=
selectName
.
replace
(
"["
,
""
);
selectName
=
selectName
.
replace
(
"]"
,
""
);
select
.
getAttributeNode
(
"name"
)
.
value
=
selectName
+
'['
+
contador
+
']'
;
//
select.getAttributeNode("name").value = selectName + '['+ contador +']';
}
}
...
...
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