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
84a74fb6
Commit
84a74fb6
authored
Jun 05, 2020
by
carlos
Browse files
correcao de erros e continuacao de editar projeto
parent
c76b836e
Changes
7
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/ArquivoController.php
View file @
84a74fb6
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Arquivo
;
use
App\Arquivo
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
class
ArquivoController
extends
Controller
class
ArquivoController
extends
Controller
...
@@ -82,4 +83,9 @@ class ArquivoController extends Controller
...
@@ -82,4 +83,9 @@ class ArquivoController extends Controller
{
{
//
//
}
}
public
function
baixarPlano
(
$id
)
{
$arquivo
=
Arquivo
::
find
(
$id
);
return
Storage
::
download
(
$arquivo
->
nome
);
}
}
}
app/Http/Controllers/TrabalhoController.php
View file @
84a74fb6
...
@@ -185,7 +185,7 @@ class TrabalhoController extends Controller
...
@@ -185,7 +185,7 @@ class TrabalhoController extends Controller
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
$userParticipante
=
User
::
where
(
'email'
,
$value
)
->
first
();
$userParticipante
=
User
::
where
(
'email'
,
$value
)
->
first
();
$participante
=
new
Participante
();
if
(
$userParticipante
==
null
){
if
(
$userParticipante
==
null
){
$passwordTemporario
=
Str
::
random
(
8
);
$passwordTemporario
=
Str
::
random
(
8
);
...
@@ -197,19 +197,34 @@ class TrabalhoController extends Controller
...
@@ -197,19 +197,34 @@ class TrabalhoController extends Controller
'name'
=>
$request
->
nomeParticipante
[
$key
],
'name'
=>
$request
->
nomeParticipante
[
$key
],
'tipo'
=>
'participante'
,
'tipo'
=>
'participante'
,
]);
]);
$participante
=
$usuario
->
participantes
()
->
create
([
'trabalho_id'
=>
$trabalho
->
id
,
$participante
->
user_id
=
$usuario
->
id
;
'funcao_participante_id'
=>
$request
->
funcaoParticipante
[
$key
],
$participante
->
trabalho_id
=
$trabalho
->
id
;
]);
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
save
();
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
}
else
{
}
else
{
$subject
=
"Participante de Projeto"
;
$subject
=
"Participante de Projeto"
;
$email
=
$value
;
$email
=
$value
;
Mail
::
to
(
$email
)
Mail
::
to
(
$email
)
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
));
->
send
(
new
SubmissaoTrabalho
(
$userParticipante
,
$subject
));
}
}
$usuario
=
User
::
where
(
'email'
,
$value
)
->
first
();
$participante
=
Participante
::
where
([[
'user_id'
,
'='
,
$usuario
->
id
],
[
'trabalho_id'
,
'='
,
$trabalho
->
id
]])
->
first
();
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
}
}
}
...
@@ -222,24 +237,6 @@ class TrabalhoController extends Controller
...
@@ -222,24 +237,6 @@ class TrabalhoController extends Controller
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
$trabalho
->
update
();
$trabalho
->
update
();
if
(
$request
->
anexoPlanoTrabalho
!=
null
){
foreach
(
$request
->
anexoPlanoTrabalho
as
$key
=>
$value
)
{
$file
=
$value
;
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
Arquivo
::
create
([
'nome'
=>
$path
.
$nome
,
'trabalhoId'
=>
$trabalho
->
id
,
'data'
=>
$mytime
,
'versaoFinal'
=>
true
,
]);
}
}
//dd($trabalho);
//dd($trabalho);
$subject
=
"Submissão de Trabalho"
;
$subject
=
"Submissão de Trabalho"
;
...
@@ -276,6 +273,7 @@ class TrabalhoController extends Controller
...
@@ -276,6 +273,7 @@ class TrabalhoController extends Controller
$subareas
=
Subarea
::
all
();
$subareas
=
Subarea
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
get
();
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'grandeAreas'
=>
$grandeAreas
,
...
@@ -283,7 +281,8 @@ class TrabalhoController extends Controller
...
@@ -283,7 +281,8 @@ class TrabalhoController extends Controller
'subAreas'
=>
$subareas
,
'subAreas'
=>
$subareas
,
'edital'
=>
$edital
,
'edital'
=>
$edital
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'participantes'
=>
$participantes
]);
'participantes'
=>
$participantes
,
'arquivos'
=>
$arquivos
,]);
}
}
/**
/**
...
@@ -293,9 +292,187 @@ class TrabalhoController extends Controller
...
@@ -293,9 +292,187 @@ class TrabalhoController extends Controller
* @param \App\Trabalho $trabalho
* @param \App\Trabalho $trabalho
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
update
(
Request
$request
,
Trabalho
$trabalho
)
public
function
update
(
Request
$request
,
$id
)
{
{
//
$mytime
=
Carbon
::
now
(
'America/Recife'
);
$mytime
=
$mytime
->
toDateString
();
$evento
=
Evento
::
find
(
$request
->
editalId
);
$coordenador
=
CoordenadorComissao
::
find
(
$evento
->
coordenadorId
);
//Relaciona o projeto criado com o proponente que criou o projeto
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
//$trabalho->proponentes()->save($proponente);
//dd($coordenador->id);
$trabalho
=
"trabalho"
;
if
(
$evento
->
inicioSubmissao
>
$mytime
){
if
(
$mytime
>=
$evento
->
fimSubmissao
){
return
redirect
()
->
route
(
'home'
);
}
}
//O anexo de Decisão do CONSU dependo do tipo de edital
if
(
$evento
->
tipo
==
'PIBIC'
||
$evento
->
tipo
==
'PIBIC-EM'
){
$validatedData
=
$request
->
validate
([
'editalId'
=>
[
'required'
,
'string'
],
'nomeProjeto'
=>
[
'required'
,
'string'
],
'grandeArea'
=>
[
'required'
,
'string'
],
'area'
=>
[
'required'
,
'string'
],
'subArea'
=>
[
'required'
,
'string'
],
'pontuacaoPlanilha'
=>
[
'required'
,
'string'
],
'linkGrupo'
=>
[
'required'
,
'string'
],
'linkLattesEstudante'
=>
[
'required'
,
'string'
],
'nomeParticipante.*'
=>
[
'required'
,
'string'
],
'emailParticipante.*'
=>
[
'required'
,
'string'
],
'funcaoParticipante.*'
=>
[
'required'
,
'string'
],
]);
}
else
{
//Caso em que o anexo da Decisão do CONSU não necessário
$validatedData
=
$request
->
validate
([
'editalId'
=>
[
'required'
,
'string'
],
'nomeProjeto'
=>
[
'required'
,
'string'
,],
'grandeArea'
=>
[
'required'
,
'string'
],
'area'
=>
[
'required'
,
'string'
],
'subArea'
=>
[
'required'
,
'string'
],
'pontuacaoPlanilha'
=>
[
'required'
,
'string'
],
'linkGrupo'
=>
[
'required'
,
'string'
],
'linkLattesEstudante'
=>
[
'required'
,
'string'
],
'nomeCoordenador'
=>
[
'required'
,
'string'
],
'nomeParticipante.*'
=>
[
'required'
,
'string'
],
'emailParticipante.*'
=>
[
'required'
,
'string'
],
'funcaoParticipante.*'
=>
[
'required'
,
'string'
],
]);
}
$trabalho
=
Trabalho
::
find
(
$id
);
$trabalho
->
titulo
=
$request
->
nomeProjeto
;
$trabalho
->
coordenador_id
=
$coordenador
->
id
;
$trabalho
->
grande_area_id
=
$request
->
grandeArea
;
$trabalho
->
area_id
=
$request
->
area
;
$trabalho
->
sub_area_id
=
$request
->
subArea
;
$trabalho
->
pontuacaoPlanilha
=
$request
->
pontuacaoPlanilha
;
$trabalho
->
linkGrupoPesquisa
=
$request
->
linkGrupo
;
$trabalho
->
linkLattesEstudante
=
$request
->
linkLattesEstudante
;
$trabalho
->
data
=
$mytime
;
$trabalho
->
evento_id
=
$request
->
editalId
;
$trabalho
->
proponente_id
=
$proponente
->
id
;
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
if
(
!
(
is_null
(
$request
->
anexoCONSU
)))
{
Storage
::
delete
(
$trabalho
->
anexoDecisaoCONSU
);
$trabalho
->
anexoDecisaoCONSU
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoCONSU
,
"CONSU.pdf"
);
}
if
(
!
(
is_null
(
$request
->
anexoProjeto
)))
{
Storage
::
delete
(
$trabalho
->
anexoProjeto
);
$trabalho
->
anexoProjeto
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
"Projeto.pdf"
);
}
if
(
!
(
is_null
(
$request
->
anexoComiteEtica
)))
{
Storage
::
delete
(
$trabalho
->
anexoComiteEtica
);
$trabalho
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoComiteEtica
,
"Comite_de_etica.pdf"
);
}
if
(
!
(
is_null
(
$request
->
anexoLatterCoordenador
)))
{
Storage
::
delete
(
$trabalho
->
anexoLattesCoordenador
);
$trabalho
->
anexoLattesCoordenador
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoLatterCoordenador
,
"Latter_Coordenador.pdf"
);
}
if
(
!
(
is_null
(
$request
->
anexoPlanilha
)))
{
Storage
::
delete
(
$trabalho
->
anexoLattesCoordenador
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
}
//atualizando projeto
$trabalho
->
update
();
// criando novos participantes que podem ter sido adicionados
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
get
();
$emailParticipantes
=
[];
foreach
(
$participantes
as
$participante
)
{
array_push
(
$emailParticipantes
,
$participante
->
user
->
email
);
}
foreach
(
$request
->
emailParticipante
as
$key
=>
$value
)
{
// criando novos participantes que podem ter sido adicionados
if
(
!
(
in_array
(
$request
->
emailParticipante
[
$key
],
$emailParticipantes
,
false
)))
{
$passwordTemporario
=
Str
::
random
(
8
);
Mail
::
to
(
$value
)
->
send
(
new
EmailParaUsuarioNaoCadastrado
(
Auth
()
->
user
()
->
name
,
' '
,
'Participante'
,
$evento
->
nome
,
$passwordTemporario
));
$usuario
=
User
::
create
([
'email'
=>
$value
,
'password'
=>
bcrypt
(
$passwordTemporario
),
'usuarioTemp'
=>
true
,
'name'
=>
$request
->
nomeParticipante
[
$key
],
'tipo'
=>
'participante'
,
]);
$participante
=
new
Participante
();
$participante
->
user_id
=
$usuario
->
id
;
$participante
->
trabalho_id
=
$trabalho
->
id
;
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
save
();
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$request
->
nomePlanoTrabalho
[
$key
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
[
$key
];
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
$arquivo
->
participanteId
=
$participante
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
//atualizando os participantes que já estão no projeto e planos de trabalho se enviados
if
(
in_array
(
$request
->
emailParticipante
[
$key
],
$emailParticipantes
,
false
))
{
$user
=
User
::
where
(
'email'
,
$request
->
emailParticipante
[
$key
])
->
first
();
$participante
::
where
([[
'user_id'
,
'='
,
$user
->
id
],
[
'trabalho_id'
,
'='
,
$trabalho
->
id
]]);
$user
->
name
=
$request
->
nomeParticipante
[
$key
];
$user
->
update
();
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
update
();
// //atualizando planos de trabalho incompleto
// dd($request);
// if (!(is_null($request->anexoPlanoTrabalho[1]))) {
// $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->nome = $path . $nome;
// $arquivo->trabalhoId = $trabalho->id;
// $arquivo->data = $mytime;
// $arquivo->participanteId = $participante->id;
// $arquivo->versaoFinal = true;
// $arquivo->save();
// }
}
}
// Atualizando possiveis usuários removidos
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
get
();
foreach
(
$participantes
as
$participante
)
{
if
(
!
(
in_array
(
$participante
->
user
->
email
,
$request
->
emailParticipante
,
false
)))
{
$arquivo
=
Arquivo
::
where
(
'participanteId'
,
$participante
->
id
);
Storage
::
delete
(
$arquivo
->
nome
);
$arquivo
->
delete
();
$participante
->
delete
();
}
}
return
redirect
()
->
route
(
'evento.visualizar'
,[
'id'
=>
$request
->
editalId
]);
}
}
/**
/**
...
...
database/migrations/2020_02_05_123115_create_arquivos_table.php
View file @
84a74fb6
...
@@ -22,6 +22,7 @@ class CreateArquivosTable extends Migration
...
@@ -22,6 +22,7 @@ class CreateArquivosTable extends Migration
$table
->
date
(
'data'
)
->
nullable
();
$table
->
date
(
'data'
)
->
nullable
();
$table
->
integer
(
'trabalhoId'
);
$table
->
integer
(
'trabalhoId'
);
$table
->
integer
(
'participanteId'
);
});
});
}
}
...
...
database/migrations/2020_06_05_173701_add_partipante_arquivo.php
0 → 100644
View file @
84a74fb6
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddPartipanteArquivo
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'arquivos'
,
function
(
Blueprint
$table
)
{
$table
->
foreign
(
'participanteId'
)
->
references
(
'id'
)
->
on
(
'participantes'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
//
}
}
resources/views/evento/submeterTrabalho.blade.php
View file @
84a74fb6
...
@@ -274,7 +274,7 @@
...
@@ -274,7 +274,7 @@
</div>
</div>
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label>E-mail</label>
<label>E-mail</label>
<input type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
E
-
mail
" required>
<input type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
e
mail
" required>
@error('emailParticipante')
@error('emailParticipante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
<strong>{{
$message
}}</strong>
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
</div>
</div>
<div class="
col
-
sm
-
3
">
<div class="
col
-
sm
-
3
">
<label>Função:</label>
<label>Função:</label>
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
"
id="
funcaoParticipante
"
name="
funcaoParticipante
[]
">
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
" name="
funcaoParticipante
[]
"
id="
funcaoParticipante
"
>
<option value="" disabled selected hidden>-- Função --</option>
<option value="" disabled selected hidden>-- Função --</option>
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
<option value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
<option value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
...
@@ -456,7 +456,7 @@
...
@@ -456,7 +456,7 @@
"</div>"
+
"</div>"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<label>E-mail</label>"
+
"<label>E-mail</label>"
+
"<input
"
+
"
type=
"
+
'email'
+
" style=
"
+
"
margin-bottom:10px
"
+
"
class="
+
'
form-control
'
+
"
@error('emailParticipante') is-invalid @enderror
'
"
+
"name=
"
+
'emailParticipante[]'
+
" placeholder=
"
+
"E-
mail
"
+
"
required>"
+
"<input type='email'"
+
"
style=
'
margin-bottom:10px
'"
+
"
class="
+
"
form-control @error('emailParticipante') is-invalid @enderror"
+
"name='emailParticipante[]'"
+
"
placeholder=
'e
mail
'
required>"
+
"@error('emailParticipante')"
+
"@error('emailParticipante')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"<strong>{{
$message
}}</strong>"
+
...
@@ -465,7 +465,7 @@
...
@@ -465,7 +465,7 @@
"</div>"
+
"</div>"
+
"<div class='col-sm-3'>"
+
"<div class='col-sm-3'>"
+
"<label>Função:</label>"
+
"<label>Função:</label>"
+
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
" id="
+
"
funcaoParticipante
"
+
"name="
+
"
funcaoParticipante
[]"
+
">"
+
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
"name='
funcaoParticipante
[]'"
+
"id='
funcaoParticipante
'> "
+
"<option value='' disabled selected hidden> Função </option>"
+
"<option value='' disabled selected hidden> Função </option>"
+
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
...
...
resources/views/projeto/editar.blade.php
View file @
84a74fb6
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
<
div
class
=
"card-body"
>
<
div
class
=
"card-body"
>
<
h5
class
=
"card-title"
>
Editar
Projeto
</
h5
>
<
h5
class
=
"card-title"
>
Editar
Projeto
</
h5
>
<
p
class
=
"card-text"
>
<
p
class
=
"card-text"
>
<
form
method
=
"POST"
action
=
""
enctype
=
"multipart/form-data"
>
<
form
method
=
"POST"
action
=
"
{{ route('trabalho.update', ['id' =>
$projeto->id
]) }}
"
enctype
=
"multipart/form-data"
>
@
csrf
@
csrf
<
input
type
=
"hidden"
name
=
"editalId"
value
=
""
>
<
input
type
=
"hidden"
name
=
"editalId"
value
=
"
{{
$edital->id
}}
"
>
{{
--
Nome
do
Projeto
--
}}
{{
--
Nome
do
Projeto
--
}}
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"row justify-content-center"
>
...
@@ -288,7 +288,7 @@
...
@@ -288,7 +288,7 @@
</div>
</div>
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label>E-mail</label>
<label>E-mail</label>
<input value="
{{
$participante
->
user
->
name
}}
" type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
E
-
mail
" required>
<input value="
{{
$participante
->
user
->
email
}}
" type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
e
mail
" required>
@error('emailParticipante')
@error('emailParticipante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
<strong>{{
$message
}}</strong>
...
@@ -297,10 +297,14 @@
...
@@ -297,10 +297,14 @@
</div>
</div>
<div class="
col
-
sm
-
3
">
<div class="
col
-
sm
-
3
">
<label>Função:</label>
<label>Função:</label>
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
"
id="
funcaoParticipante
"
name="
funcaoParticipante
[]
">
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
" name="
funcaoParticipante
[]
"
id="
funcaoParticipante
"
>
<option value="" disabled selected hidden>-- Função --</option>
<option value="" disabled selected hidden>-- Função --</option>
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
@if(
$funcaoParticipante->id
===
$participante->funcao_participante_id
)
<option value="
{{
$funcaoParticipante
->
id
}}
" selected>
{
{$funcaoParticipante->nome}
}
</option>
@else
<option value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
<option value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
@endif
@endforeach
@endforeach
@error('funcaoParticipante')
@error('funcaoParticipante')
...
@@ -312,13 +316,18 @@
...
@@ -312,13 +316,18 @@
</div>
</div>
</div>
</div>
<h5>Dados do plano de trabalho</h5>
<h5>Dados do plano de trabalho</h5>
@foreach (
$arquivos
as
$arquivo
)
@if(
$arquivo->participanteId
===
$participante->id
)
<a href="
{{
route
(
'baixar.plano'
,
[
'id'
=>
$arquivo
->
id
])
}}
">Plano de trabalho atual</a>
@endif
@endforeach
<div class="
row
">
<div class="
row
">
<div class="
col
-
sm
-
12
">
<div class="
col
-
sm
-
12
">
<div id="
planoTrabalho
">
<div id="
planoTrabalho
">
<div class="
row
">
<div class="
row
">
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label>Titulo </label>
<label>Titulo </label>
<input type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomePlanoTrabalho'
)
is
-
invalid
@
enderror
" name="
nomePlanoTrabalho
[]
" placeholder="
Nome
"
required
>
<input type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomePlanoTrabalho'
)
is
-
invalid
@
enderror
" name="
nomePlanoTrabalho
[]
" placeholder="
Nome
">
@error('nomePlanoTrabalho')
@error('nomePlanoTrabalho')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
...
@@ -384,7 +393,7 @@
...
@@ -384,7 +393,7 @@
<
script
type
=
"text/javascript"
>
<
script
type
=
"text/javascript"
>
$
(
function
()
{
$
(
function
()
{
var
qtdLinhas
=
1
;
var
qtdLinhas
=
1
;
var
qtdParticipantes
=
2
;
var
qtdParticipantes
=
1
;
// Coautores
// Coautores
$
(
'#addCoautor'
)
.
click
(
function
(
e
)
{
$
(
'#addCoautor'
)
.
click
(
function
(
e
)
{
if
(
qtdParticipantes
<
100
)
{
if
(
qtdParticipantes
<
100
)
{
...
@@ -471,7 +480,7 @@
...
@@ -471,7 +480,7 @@
"</div>"
+
"</div>"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<label>E-mail</label>"
+
"<label>E-mail</label>"
+
"<input
"
+
"
type=
"
+
'email'
+
" style=
"
+
"
margin-bottom:10px
"
+
"
class="
+
'
form-control
'
+
"
@error('emailParticipante') is-invalid @enderror
'
"
+
"name=
"
+
'emailParticipante[]'
+
" placeholder=
"
+
"E-
mail
"
+
"
required>"
+
"<input type='email'"
+
"
style=
'
margin-bottom:10px
'"
+
"
class="
+
"
form-control @error('emailParticipante') is-invalid @enderror"
+
"name='emailParticipante[]'"
+
"
placeholder=
'e
mail
'
required>"
+
"@error('emailParticipante')"
+
"@error('emailParticipante')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"<strong>{{
$message
}}</strong>"
+
...
@@ -480,7 +489,7 @@
...
@@ -480,7 +489,7 @@
"</div>"
+
"</div>"
+
"<div class='col-sm-3'>"
+
"<div class='col-sm-3'>"
+
"<label>Função:</label>"
+
"<label>Função:</label>"
+
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
" id="
+
"
funcaoParticipante
"
+
"name="
+
"
funcaoParticipante
[]"
+
">"
+
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
"name='
funcaoParticipante
[]'"
+
"id='
funcaoParticipante
'> "
+
"<option value='' disabled selected hidden> Função </option>"
+
"<option value='' disabled selected hidden> Função </option>"
+
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
...
@@ -512,8 +521,8 @@
...
@@ -512,8 +521,8 @@
"<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"
+
"<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"
+
"</div>"
+
"</div>"
+
"<div class='custom-file'>"
+
"<div class='custom-file'>"
+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror"
+
"id='
inputGroupFile01'
"
+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror"
+
"id='
anexoPlanoTrabalho'"
+
"aria-describedby='anexoPlanoTrabalho'"
+
"name='anexoPlanoTrabalho[]' required
"
+
"aria-describedby='inputGroupFileAddon01'
name='anexoPlanoTrabalho[]'
>"
+
"aria-describedby='inputGroupFileAddon01'>"
+
"<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"
+
"<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"
+
"</div>"
+
"</div>"
+
"</div>"
+
"</div>"
+
...
...
routes/web.php
View file @
84a74fb6
...
@@ -90,6 +90,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -90,6 +90,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
//######### Atribuição #######################################
//######### Atribuição #######################################
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
...
@@ -110,6 +111,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -110,6 +111,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
get
(
'/baixar/anexo-comite/{id}'
,
'TrabalhoController@baixarAnexoComite'
)
->
name
(
'baixar.anexo.comite'
);
Route
::
get
(
'/baixar/anexo-comite/{id}'
,
'TrabalhoController@baixarAnexoComite'
)
->
name
(
'baixar.anexo.comite'
);
Route
::
get
(
'/baixar/anexo-lattes/{id}'
,
'TrabalhoController@baixarAnexoLattes'
)
->
name
(
'baixar.anexo.lattes'
);
Route
::
get
(
'/baixar/anexo-lattes/{id}'
,
'TrabalhoController@baixarAnexoLattes'
)
->
name
(
'baixar.anexo.lattes'
);
Route
::
get
(
'/baixar/anexo-planilha/{id}'
,
'TrabalhoController@baixarAnexoPlanilha'
)
->
name
(
'baixar.anexo.planilha'
);
Route
::
get
(
'/baixar/anexo-planilha/{id}'
,
'TrabalhoController@baixarAnexoPlanilha'
)
->
name
(
'baixar.anexo.planilha'
);
Route
::
get
(
'/baixar/plano-de-trabalho/{id}'
,
'ArquivoController@baixarPlano'
)
->
name
(
'baixar.plano'
);
});
});
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
...
...
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