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
e845ab51
Commit
e845ab51
authored
Jun 04, 2020
by
carlos
Browse files
atualizando criar e editar projeto
parent
ae44f10e
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
e845ab51
...
@@ -80,7 +80,7 @@ class TrabalhoController extends Controller
...
@@ -80,7 +80,7 @@ class TrabalhoController extends Controller
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
//$trabalho->proponentes()->save($proponente);
//$trabalho->proponentes()->save($proponente);
//dd($coordenador->id);
//dd($coordenador->id);
$trabalho
=
"trabalho"
;
if
(
$evento
->
inicioSubmissao
>
$mytime
){
if
(
$evento
->
inicioSubmissao
>
$mytime
){
if
(
$mytime
>=
$evento
->
fimSubmissao
){
if
(
$mytime
>=
$evento
->
fimSubmissao
){
return
redirect
()
->
route
(
'home'
);
return
redirect
()
->
route
(
'home'
);
...
@@ -179,8 +179,6 @@ class TrabalhoController extends Controller
...
@@ -179,8 +179,6 @@ class TrabalhoController extends Controller
}
}
//Envia email com senha temp para cada participante do projeto
//Envia email com senha temp para cada participante do projeto
if
(
$request
->
emailParticipante
!=
null
){
if
(
$request
->
emailParticipante
!=
null
){
...
@@ -198,11 +196,10 @@ class TrabalhoController extends Controller
...
@@ -198,11 +196,10 @@ class TrabalhoController extends Controller
'usuarioTemp'
=>
true
,
'usuarioTemp'
=>
true
,
'name'
=>
$request
->
nomeParticipante
[
$key
],
'name'
=>
$request
->
nomeParticipante
[
$key
],
'tipo'
=>
'participante'
,
'tipo'
=>
'participante'
,
'funcao_participante_id'
=>
$request
->
funcaoParticipante
[
$key
],
]);
]);
$participante
=
$usuario
->
participantes
()
->
create
([
$participante
=
$usuario
->
participantes
()
->
create
([
'trabalho_id'
=>
$trabalho
->
id
,
'trabalho_id'
=>
$trabalho
->
id
,
'funcao_participante_id'
=>
$request
->
funcaoParticipante
[
$key
],
]);
]);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
...
@@ -216,30 +213,15 @@ class TrabalhoController extends Controller
...
@@ -216,30 +213,15 @@ class TrabalhoController extends Controller
}
}
}
}
$anexos
=
array
(
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
$request
->
anexoCONSU
,
$request
->
anexoProjeto
,
$trabalho
->
anexoDecisaoCONSU
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoCONSU
,
"CONSU.pdf"
);
$request
->
anexoComiteEtica
,
$trabalho
->
anexoProjeto
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
"Projeto.pdf"
);
$request
->
anexoLatterCoordenador
,
$trabalho
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoComiteEtica
,
"Comite_de_etica.pdf"
);
$request
->
anexoPlanilha
,
$trabalho
->
anexoLattesCoordenador
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoLatterCoordenador
,
"Latter_Coordenador.pdf"
);
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
$trabalho
->
update
();
foreach
(
$anexos
as
$key
=>
$value
)
{
$file
=
$value
;
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
"1.pdf"
;
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
Arquivo
::
create
([
'nome'
=>
$path
.
$nome
,
'trabalhoId'
=>
$trabalho
->
id
,
'data'
=>
$mytime
,
'versaoFinal'
=>
true
,
]);
}
if
(
$request
->
anexoPlanoTrabalho
!=
null
){
if
(
$request
->
anexoPlanoTrabalho
!=
null
){
foreach
(
$request
->
anexoPlanoTrabalho
as
$key
=>
$value
)
{
foreach
(
$request
->
anexoPlanoTrabalho
as
$key
=>
$value
)
{
...
@@ -285,9 +267,23 @@ class TrabalhoController extends Controller
...
@@ -285,9 +267,23 @@ class TrabalhoController extends Controller
* @param \App\Trabalho $trabalho
* @param \App\Trabalho $trabalho
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
edit
(
Trabalho
$trabalho
)
public
function
edit
(
$id
)
{
{
//
$projeto
=
Trabalho
::
find
(
$id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
all
();
$areas
=
Area
::
all
();
$subareas
=
Subarea
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
get
();
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'subAreas'
=>
$subareas
,
'edital'
=>
$edital
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'participantes'
=>
$participantes
]);
}
}
/**
/**
...
@@ -451,4 +447,29 @@ class TrabalhoController extends Controller
...
@@ -451,4 +447,29 @@ class TrabalhoController extends Controller
return
view
(
'projeto.index'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
return
view
(
'projeto.index'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
}
}
public
function
baixarAnexoProjeto
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoProjeto
);
}
public
function
baixarAnexoConsu
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoDecisaoCONSU
);
}
public
function
baixarAnexoComite
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoAutorizacaoComiteEtica
);
}
public
function
baixarAnexoLattes
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoLattesCoordenador
);
}
public
function
baixarAnexoPlanilha
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoPlanilhaPontuacao
);
}
}
}
app/Participante.php
View file @
e845ab51
...
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
...
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class
Participante
extends
Model
class
Participante
extends
Model
{
{
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
];
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
public
function
user
(){
return
$this
->
belongsTo
(
'App\User'
);
return
$this
->
belongsTo
(
'App\User'
);
...
...
resources/views/projeto/editar.blade.php
0 → 100644
View file @
e845ab51
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container content"
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"card"
style
=
"margin-top:50px"
>
<
div
class
=
"card-body"
>
<
h5
class
=
"card-title"
>
Editar
Projeto
</
h5
>
<
p
class
=
"card-text"
>
<
form
method
=
"POST"
action
=
""
enctype
=
"multipart/form-data"
>
@
csrf
<
input
type
=
"hidden"
name
=
"editalId"
value
=
""
>
{{
--
Nome
do
Projeto
--
}}
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-12"
>
<
label
for
=
"nomeTrabalho"
class
=
"col-form-label"
>
{{
__
(
'Nome do Projeto:'
)
}}
</
label
>
<
input
id
=
"nomeTrabalho"
value
=
"{{
$projeto->titulo
}}"
type
=
"text"
class
=
"form-control @error('nomeTrabalho') is-invalid @enderror"
name
=
"nomeProjeto"
value
=
"{{ old('nomeTrabalho') }}"
required
autocomplete
=
"nomeTrabalho"
autofocus
>
@
error
(
'nomeTrabalho'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
{{
--
Grande
Area
--
}}
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-sm-4"
>
<
label
for
=
"grandeArea"
class
=
"col-form-label"
>
{{
__
(
'Grande Área:'
)
}}
</
label
>
<
select
class
=
"form-control @error('grandeArea') is-invalid @enderror"
id
=
"grandeArea"
name
=
"grandeArea"
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--</
option
>
@
foreach
(
$grandeAreas
as
$grandeArea
)
@
if
(
$grandeArea
->
id
===
$projeto
->
grande_area_id
)
<
option
value
=
"
{
{$grandeArea->id}
}
"
selected
>
{{
$grandeArea
->
nome
}}
</
option
>
@
else
<
option
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
@endif
@endforeach
</select>
@error('grandeArea')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
4
">
<label for="
area
" class="
col
-
form
-
label
">{{ __('Área:') }}</label>
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
" id="
area
" name="
area
">
<option value="" disabled selected hidden>-- Área --</option>
@foreach(
$areas
as
$area
)
@if(
$area->id
===
$projeto->area_id
)
<option value="
{{
$area
->
id
}}
" selected>
{
{$area->nome}
}
</option>
@else
<option value="
{{
$area
->
id
}}
">
{
{$area->nome}
}
</option>
@endif
@endforeach
</select>
@error('area')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
4
">
<label for="
subArea
" class="
col
-
form
-
label
">{{ __('Sub Área:') }}</label>
<select class="
form
-
control
@
error
(
'subArea'
)
is
-
invalid
@
enderror
" id="
subArea
" name="
subArea
">
<option value="" disabled selected hidden>-- Sub Área --</option>
@foreach(
$subAreas
as
$subArea
)
@if(
$subArea->id
===
$projeto->sub_area_id
)
<option value="
{{
$subArea
->
id
}}
" selected>
{
{$subArea->nome}
}
</option>
@else
<option value="
{{
$subArea
->
id
}}
">
{
{$subArea->nome}
}
</option>
@endif
@endforeach
</select>
@error('subArea')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
</div>
<hr>
<h3>Coordenador</h3>
{{-- Coordenador --}}
<div class="
row
justify
-
content
-
center
">
<div class="
col
-
sm
-
6
">
<label for="
nomeCoordenador
" class="
col
-
form
-
label
">{{ __('Coordenador:') }}</label>
<input class="
form
-
control
" value="
{{
auth
()
->
user
()
->
name
}}
" type="
text
" id="
nomeCoordenador
" name="
nomeCoordenador
" disabled="
disabled
" value="
{{
Auth
()
->
user
()
->
name
}}
">
</div>
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalho
" class="
col
-
form
-
label
">Link Lattes do Proponente</label>
<input class="
form
-
control
@
error
(
'linkLattesEstudante'
)
is
-
invalid
@
enderror
" type="
text
" name="
linkLattesEstudante
"
@if(Auth()->user()->proponentes->linkLattes != null)
value="
{{
Auth
()
->
user
()
->
proponentes
->
linkLattes
}}
"
@else
value=""
@endif >
@error('linkLattesEstudante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalho
" class="
col
-
form
-
label
">{{ __('Pontuação da Planilha de Pontuação :') }}</label>
<input value="
{{
$projeto
->
pontuacaoPlanilha
}}
" class="
form
-
control
@
error
(
'pontuacaoPlanilha'
)
is
-
invalid
@
enderror
" type="
text
" name="
pontuacaoPlanilha
">
@error('pontuacaoPlanilha')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalho
" class="
col
-
form
-
label
">{{ __('Link do grupo de pesquisa:') }}</label>
<input value="
{{
$projeto
->
linkGrupoPesquisa
}}
" class="
form
-
control
@
error
(
'linkGrupo'
)
is
-
invalid
@
enderror
" type="
text
" name="
linkGrupo
">
@error('linkGrupo')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
</div>
<hr>
<h3>Anexos</h3>
{{-- Anexo do Projeto --}}
<div class="
row
justify
-
content
-
center
">
{{-- Arquivo --}}
<div class="
col
-
sm
-
6
">
<label for="
anexoProjeto
" class="
col
-
form
-
label
">{{ __('Anexo Projeto: ') }}</label> <a href="
{{
route
(
'baixar.anexo.projeto'
,
[
'id'
=>
$projeto
->
id
])}}
">Arquivo atual</a>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoProjeto'
)
is
-
invalid
@
enderror
" id="
anexoProjeto
" aria-describedby="
inputGroupFileAddon01
" name="
anexoProjeto
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
anexoProjeto
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoProjeto')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
anexoLatterCoordenador
" class="
col
-
form
-
label
">{{ __('Anexo do Lattes do Coordenador: ') }}</label><a href="
{{
route
(
'baixar.anexo.lattes'
,
[
'id'
=>
$projeto
->
id
])
}}
"> Arquivo atual</a>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoLatterCoordenador'
)
is
-
invalid
@
enderror
" id="
inputGroupFile01
" aria-describedby="
anexoLatterCoordenador
" name="
anexoLatterCoordenador
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
inputGroupFile01
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoLatterCoordenador')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalho
" class="
col
-
form
-
label
">{{ __('Possui autorização do Comitê de Ética: ') }}</label><a href="
{{
route
(
'baixar.anexo.comite'
,
[
'id'
=>
$projeto
->
id
])
}}
"> Arquivo atual</a>
<br>
<button id="
buttonSim
" class="
btn
btn
-
primary
mt
-
2
mb
-
2
">Sim</button>
<button id="
buttonNao
" class="
btn
btn
-
primary
mt
-
2
mb
-
2
">Não</button>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoComiteEtica'
)
is
-
invalid
@
enderror
" id="
inputEtica
" aria-describedby="
inputGroupFileAddon01
" name="
anexoComiteEtica
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
inputGroupFile01
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoComiteEtica')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
mt
-
3
">
<label for="
anexoPlanilha
" class="
col
-
form
-
label
">{{ __('Anexo do Planilha de Pontuação: ') }}</label><a href="
{{
route
(
'baixar.anexo.planilha'
,
[
'id'
=>
$projeto
->
id
])
}}
"> Arquivo atual</a>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoPlanilha'
)
is
-
invalid
@
enderror
" id="
anexoPlanilha
" aria-describedby="
anexoPlanilhaDescribe
" name="
anexoPlanilha
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
anexoPlanilha
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoPlanilha')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalho
" class="
col
-
form
-
label
">{{ __('Justificativa: ') }}</label>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'justificativaAutorizacaoEtica'
)
is
-
invalid
@
enderror
" id="
inputJustificativa
" aria-describedby="
inputGroupFileAddon01
" disabled="
disabled
" name="
justificativaAutorizacaoEtica
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
inputGroupFile01
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('justificativaAutorizacaoEtica')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
@if(
$edital->tipo
== 'PIBIC' ||
$edital->tipo
== 'PIBIC-EM')
{{-- Decisão do CONSU --}}
<div class="
col
-
sm
-
6
">
<label for="
anexoCONSU
" class="
col
-
form
-
label
">{{ __('Decisão do CONSU: ') }}</label><a href="
{{
route
(
'baixar.anexo.consu'
,
[
'id'
=>
$projeto
->
id
])
}}
"> Arquivo atual</a>
<div class="
input
-
group
">
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoCONSU'
)
is
-
invalid
@
enderror
" id="
anexoCONSU
" aria-describedby="
inputGroupFileAddon01
" name="
anexoCONSU
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
inputGroupFile01
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoCONSU')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
@endif
</div>
<hr>
<h4>Participantes</h4>
{{-- Participantes --}}
<div class="
row
" style="
margin
-
top
:
20
px
">
<div class="
col
-
sm
-
12
">
<div id="
participantes
">
@foreach(
$participantes
as
$participante
)
<div id="
novoParticipante
">
<br>
<h5>Dados do participante</h5>
<div class="
row
">
<div class="
col
-
sm
-
5
">
<label>Nome Completo</label>
<input value="
{{
$participante
->
user
->
name
}}
" type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomeParticipante'
)
is
-
invalid
@
enderror
" name="
nomeParticipante
[]
" placeholder="
Nome
" required>
@error('nomeParticipante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
4
">
<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>
@error('emailParticipante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
3
">
<label>Função:</label>
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
" id="
funcaoParticipante
" name="
funcaoParticipante
[]
">
<option value="" disabled selected hidden>-- Função --</option>
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
<option value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
@endforeach
@error('funcaoParticipante')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</select>
</div>
</div>
<h5>Dados do plano de trabalho</h5>
<div class="
row
">
<div class="
col
-
sm
-
12
">
<div id="
planoTrabalho
">
<div class="
row
">
<div class="
col
-
sm
-
4
">
<label>Titulo </label>
<input type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomePlanoTrabalho'
)
is
-
invalid
@
enderror
" name="
nomePlanoTrabalho
[]
" placeholder="
Nome
" required>
@error('nomePlanoTrabalho')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
{{-- Arquivo --}}
<div class="
col
-
sm
-
7
">
<label for="
nomeTrabalho
">Anexo</label>
<div class="
input
-
group
">
<div class="
input
-
group
-
prepend
">
<span class="
input
-
group
-
text
" id="
anexoPlanoTrabalho
">Selecione um arquivo:</span>
</div>
<div class="
custom
-
file
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'anexoPlanoTrabalho'
)
is
-
invalid
@
enderror
" id="
anexoPlanoTrabalho
" aria-describedby="
anexoPlanoTrabalho
" name="
anexoPlanoTrabalho
[]
">
<label class="
custom
-
file
-
label
" id="
custom
-
file
-
label
" for="
inputGroupFile01
">O arquivo deve ser no formato PDF de até 2mb.</label>
</div>
</div>
@error('anexoPlanoTrabalho')
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
</span>
@enderror
</div>
<div class="
col
-
sm
-
1
">
<a class="
delete
">
<img src="
/
img
/
icons
/
user
-
times
-
solid
.
svg
" style="
width
:
25
px
;
margin
-
top
:
35
px
">
</a>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
</div>
<a href="
#" class="btn btn-primary" id="addCoautor" style="width:100%;margin-top:10px">Participantes +</a>
</
div
>
</
div
>
</
p
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-md-6"
>
<
a
href
=
"
{
{route('evento.visualizar',['id'=>$edital->id])}
}
"
class
=
"btn btn-secondary"
style
=
"width:100%"
>
Cancelar
</
a
>
</
div
>
<
div
class
=
"col-md-6"
>
<
button
type
=
"submit"
class
=
"btn btn-primary"
style
=
"width:100%"
>
{{
__
(
'Enviar'
)
}}
</
button
>
</
div
>
</
div
>
</
form
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endsection
@
section
(
'javascript'
)
<
script
type
=
"text/javascript"
>
$
(
function
()
{
var
qtdLinhas
=
1
;
var
qtdParticipantes
=
2
;
// Coautores
$
(
'#addCoautor'
)
.
click
(
function
(
e
)
{
if
(
qtdParticipantes
<
100
)
{
e
.
preventDefault
();
linha
=
montarLinhaInput
();
$
(
'#participantes'
)
.
append
(
linha
);
qtdParticipantes
++
}
});
$
(
'#addPlanoTrabalho'
)
.
click
(
function
(
e
)
{
e
.
preventDefault
();
if
(
qtdLinhas
<
4
)
{
linha
=
montarLinhaInputPlanoTrabalho
();
$
(
'#planoTrabalho'
)
.
append
(
linha
);
qtdLinhas
++
;
}
});
// Exibir modalidade de acordo com a área
$
(
"#area"
)
.
change
(
function
()
{
console
.
log
(
$
(
this
)
.
val
());
addModalidade
(
$
(
this
)
.
val
());
});
$
(
document
)
.
on
(
'click'
,
'.delete'
,
function
()
{
if
(
qtdParticipantes
>
2
)
{
qtdParticipantes
--
;
$
(
this
)
.
closest
(
'#novoParticipante'
)
.
remove
();
return
false
;
}
});
$
(
document
)
.
on
(
'click'
,
'.deletePlano'
,
function
()
{
if
(
qtdLinhas
>
1
)
{
qtdLinhas
--
;
$
(
"#planoTrabalho div.row:last"
)
.
remove
();
return
false
;
}
});
$
(
'#anexoProjeto'
)
.
on
(
'change'
,
function
()
{
//get the file name
var
fileName
=
$
(
this
)
.
val
();
//replace the "Choose a file" label
$
(
this
)
.
next
(
'#custom-file-label'
)
.
html
(
fileName
);
})
// F
$
(
'#buttonSim'
)
.
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'#inputEtica'
)
.
prop
(
'disabled'
,
false
);
$
(
'#inputJustificativa'
)
.
prop
(
'disabled'
,
true
);
});
$
(
'#buttonNao'
)
.
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'#inputEtica'
)
.
prop
(
'disabled'
,
true
);
$
(
'#inputJustificativa'
)
.
prop
(
'disabled'
,
false
);
console
.
log
(
'button nao'
);
});
});
// Remover Coautor
function
addModalidade
(
areaId
)
{
console
.
log
(
modalidades
)
$
(
"#modalidade"
)
.
empty
();
for
(
let
i
=
0
;
i
<
modalidades
.
length
;
i
++
)
{
if
(
modalidades
[
i
]
.
areaId
==
areaId
)
{
console
.
log
(
modalidades
[
i
]);
$
(
"#modalidade"
)
.
append
(
"<option value="
+
modalidades
[
i
]
.
modalidadeId
+
">"
+
modalidades
[
i
]
.
modalidadeNome
+
"</option>"
)
}
}
}
function
montarLinhaInput
()
{
return
"<div id="
+
"novoParticipante"
+
">"
+
"<br><h5>Dados do participante</h5>"
+
"<div class="
+
"row"
+
">"
+
"<div class="
+
"col-sm-5"
+
">"
+
"<label>Nome Completo</label>"
+
"<input"
+
" type="
+
'text'
+
" style="
+
"margin-bottom:10px"
+
" class="
+
'form-control'
+
" @error('nomeParticipante') is-invalid @enderror"
+
"name="
+
'nomeParticipante[]'
+
" placeholder="
+
"Nome"
+
" required>"
+
"@error('nomeParticipante')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"</span>"
+
"@enderror"
+
"</div>"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<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>"
+
"@error('emailParticipante')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"</span>"
+
"@enderror"
+
"</div>"
+
"<div class='col-sm-3'>"
+
"<label>Função:</label>"
+
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
" id="
+
"funcaoParticipante"
+
"name="
+
"funcaoParticipante[]"
+
">"
+
"<option value='' disabled selected hidden> Função </option>"
+
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
"@endforeach"
+
"@error('funcaoParticipante')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"</span>"
+
"@enderror"
+
"</select>"
+
"</div>"
+
"</div>"
+
"<h5>Dados do plano de trabalho</h5>"
+
"<div class="
+
"row"
+
">"
+
"<div class="
+
"col-sm-4"
+
">"
+
"<label>Titulo</label>"
+
"<input"
+
" type="
+
'text'
+
" style="
+
"margin-bottom:10px"
+
" class="
+
"form-control @error('nomePlanoTrabalho') is-invalid @enderror"
+
" name="
+
'nomePlanoTrabalho[]'
+
" placeholder="
+
"Nome"
+
" required>"
+
"@error('nomePlanoTrabalho')"
+
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"</span>"
+
"@enderror"
+
"</div>"
+
"<div class="
+
"col-sm-7"
+
">"
+
"<label for="
+
"nomeTrabalho"
+
">Anexo </label>"
+
"<div class="
+
"input-group"
+
">"
+
"<div class='input-group-prepend'>"
+
"<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"
+
"</div>"
+
"<div class='custom-file'>"
+
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror"
+
"id='inputGroupFile01'"
+
"aria-describedby='inputGroupFileAddon01' name='anexoPlanoTrabalho[]'>"
+
"<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"
+
"</div>"
+
"</div>"
+
"@error('anexoPlanoTrabalho')"
+
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"
+
"<strong>{{
$message
}}</strong>"
+
"</span>"
+
"@enderror"
+
"</div>"
+
"<div class="
+
"col-sm-1"
+
">"
+
"<a class="
+
"delete"
+
">"
+
"<img src="
+
"/img/icons/user-times-solid.svg"
+
" style="
+
"width:25px;margin-top:35px"
+
">"
+
"</a>"
+
"</div>"
+
"</div>"
+
"</div>"
;
}
// function montarLinhaInputPlanoTrabalho(){
// return "<div class="+"row"+">"+
// "<div class="+"col-sm-4"+">"+
// "<label>Nome Completo</label>"+
// "<input"+" type="+'text'+" style="+"margin-bottom:10px"+" class="+'form-control emailCoautor'+" name="+'nomePlanoTrabalho[]'+" placeholder="+"Nome"+" required>"+
// "</div>"+
// "<div class="+"col-sm-7" +">"+
// "<label for="+"nomeTrabalho"+">Anexo </label>"+
// "<div class="+"input-group"+">"+
// "<div class='input-group-prepend'>"+
// "<span class='input-group-text' id='inputGroupFileAddon01'>Selecione um arquivo:</span>"+
// "</div>"+
// "<div class='custom-file'>"+
// "<input type='file' class='custom-file-input' id='inputGroupFile01'"+
// "aria-describedby='inputGroupFileAddon01' name='anexoPlanoTrabalho[]'>"+
// "<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2mb.</label>"+
// "</div>"+
// "</div>"+
// "@error('arquivo')"+
// "<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"+
// "<strong>{{ $message }}</strong>"+
// "</span>"+
// "@enderror"+
// "</div>"+
// "<div class="+"col-sm-1"+">"+
// "<a class="+"deletePlano"+">"+
// "<img src="+"/img/icons/user-times-solid.svg"+" style="+"width:25px;margin-top:35px"+">"+
// "</a>"+
// "</div>"+
// "</div>";
// }
</
script
>
@
endsection
\ No newline at end of file
resources/views/projeto/index.blade.php
View file @
e845ab51
...
@@ -35,14 +35,14 @@
...
@@ -35,14 +35,14 @@
@
else
@
else
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
@
endif
@
endif
<
td
>
{{
$projeto
->
update
}}
</
td
>
<
td
>
{{
date
(
'd-m-Y'
,
strtotime
(
$projeto
->
update
d_at
))
}}
</
td
>
<
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
{{
--
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
--
}}
{{
--
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
--
}}
</
a
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center;"
>
<
a
href
=
"
{{ route('trabalho.editar', ['id' =>
$projeto->id
]) }}
"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
Editar
projeto
Editar
projeto
</
a
>
</
a
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
...
...
routes/web.php
View file @
e845ab51
...
@@ -88,6 +88,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -88,6 +88,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
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'
);
//######### Atribuição #######################################
//######### Atribuição #######################################
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
...
@@ -101,7 +102,13 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -101,7 +102,13 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/revisor/email'
,
'RevisorController@enviarEmailRevisor'
)
->
name
(
'revisor.email'
);
Route
::
post
(
'/revisor/email'
,
'RevisorController@enviarEmailRevisor'
)
->
name
(
'revisor.email'
);
Route
::
post
(
'/revisor/emailTodos'
,
'RevisorController@enviarEmailTodosRevisores'
)
->
name
(
'revisor.emailTodos'
);
Route
::
post
(
'/revisor/emailTodos'
,
'RevisorController@enviarEmailTodosRevisores'
)
->
name
(
'revisor.emailTodos'
);
//########## Rotas de download de documentos ###########################
Route
::
get
(
'/baixar/edital/{id}'
,
'EventoController@baixarEdital'
)
->
name
(
'baixar.edital'
);
Route
::
get
(
'/baixar/anexo-projeto/{id}'
,
'TrabalhoController@baixarAnexoProjeto'
)
->
name
(
'baixar.anexo.projeto'
);
Route
::
get
(
'/baixar/anexo-consu/{id}'
,
'TrabalhoController@baixarAnexoConsu'
)
->
name
(
'baixar.anexo.consu'
);
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-planilha/{id}'
,
'TrabalhoController@baixarAnexoPlanilha'
)
->
name
(
'baixar.anexo.planilha'
);
});
});
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
...
@@ -180,8 +187,6 @@ Route::prefix('evento')->name('evento.')->group(function(){
...
@@ -180,8 +187,6 @@ Route::prefix('evento')->name('evento.')->group(function(){
});
});
Route
::
get
(
'/baixar/edital/{id}'
,
'EventoController@baixarEdital'
)
->
name
(
'baixar.edital'
);
//########## Rotas de administrador responsavel (Reitor ou pro-reitor)########
//########## Rotas de administrador responsavel (Reitor ou pro-reitor)########
Route
::
prefix
(
'adminResp'
)
->
name
(
'adminResp.'
)
->
group
(
function
(){
Route
::
prefix
(
'adminResp'
)
->
name
(
'adminResp.'
)
->
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