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
1a944ec7
Commit
1a944ec7
authored
Jun 20, 2021
by
Gabriel-31415
Browse files
editar projeto
parent
c70a7e66
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
1a944ec7
...
...
@@ -41,6 +41,36 @@ use Illuminate\Support\Facades\Notification;
class
TrabalhoController
extends
Controller
{
public
$estados
=
array
(
'AC'
=>
'Acre'
,
'AL'
=>
'Alagoas'
,
'AP'
=>
'Amapá'
,
'AM'
=>
'Amazonas'
,
'BA'
=>
'Bahia'
,
'CE'
=>
'Ceará'
,
'DF'
=>
'Distrito Federal'
,
'ES'
=>
'Espirito Santo'
,
'GO'
=>
'Goiás'
,
'MA'
=>
'Maranhão'
,
'MS'
=>
'Mato Grosso do Sul'
,
'MT'
=>
'Mato Grosso'
,
'MG'
=>
'Minas Gerais'
,
'PA'
=>
'Pará'
,
'PB'
=>
'Paraíba'
,
'PR'
=>
'Paraná'
,
'PE'
=>
'Pernambuco'
,
'PI'
=>
'Piauí'
,
'RJ'
=>
'Rio de Janeiro'
,
'RN'
=>
'Rio Grande do Norte'
,
'RS'
=>
'Rio Grande do Sul'
,
'RO'
=>
'Rondônia'
,
'RR'
=>
'Roraima'
,
'SC'
=>
'Santa Catarina'
,
'SP'
=>
'São Paulo'
,
'SE'
=>
'Sergipe'
,
'TO'
=>
'Tocantins'
,
);
public
function
index
(
$id
)
{
...
...
@@ -52,35 +82,7 @@ class TrabalhoController extends Controller
if
(
$proponente
==
null
){
return
view
(
'proponente.cadastro'
)
->
with
([
'mensagem'
=>
'Você não possui perfil de Proponente, para submeter algum projeto preencha o formulário.'
]);;
}
$estados
=
array
(
'AC'
=>
'Acre'
,
'AL'
=>
'Alagoas'
,
'AP'
=>
'Amapá'
,
'AM'
=>
'Amazonas'
,
'BA'
=>
'Bahia'
,
'CE'
=>
'Ceará'
,
'DF'
=>
'Distrito Federal'
,
'ES'
=>
'Espirito Santo'
,
'GO'
=>
'Goiás'
,
'MA'
=>
'Maranhão'
,
'MS'
=>
'Mato Grosso do Sul'
,
'MT'
=>
'Mato Grosso'
,
'MG'
=>
'Minas Gerais'
,
'PA'
=>
'Pará'
,
'PB'
=>
'Paraíba'
,
'PR'
=>
'Paraná'
,
'PE'
=>
'Pernambuco'
,
'PI'
=>
'Piauí'
,
'RJ'
=>
'Rio de Janeiro'
,
'RN'
=>
'Rio Grande do Norte'
,
'RS'
=>
'Rio Grande do Sul'
,
'RO'
=>
'Rondônia'
,
'RR'
=>
'Roraima'
,
'SC'
=>
'Santa Catarina'
,
'SP'
=>
'São Paulo'
,
'SE'
=>
'Sergipe'
,
'TO'
=>
'Tocantins'
,
);
$rascunho
=
Trabalho
::
where
(
'proponente_id'
,
$proponente
->
id
)
->
where
(
'evento_id'
,
$edital
->
id
)
->
where
(
'status'
,
'Rascunho'
)
->
orderByDesc
(
'updated_at'
)
->
first
();
...
...
@@ -93,7 +95,7 @@ class TrabalhoController extends Controller
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'rascunho'
=>
$rascunho
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'estados'
=>
$estados
,
'estados'
=>
$
this
->
estados
,
]);
}
...
...
@@ -194,7 +196,6 @@ class TrabalhoController extends Controller
}
public
function
validarAnexosRascunho
(
Request
$request
,
$trabalho
){
//dd($trabalho->getAttributes());
$validator
=
Validator
::
make
(
$trabalho
->
getAttributes
(),[
'anexoPlanilhaPontuacao'
=>
$request
->
anexoPlanilha
==
null
?
[
'planilha'
]
:
[],
]);
...
...
@@ -321,7 +322,7 @@ class TrabalhoController extends Controller
$participantesUsersIds
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
select
(
'user_id'
)
->
get
();
$users
=
User
::
whereIn
(
'id'
,
$participantesUsersIds
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
return
view
(
'projeto.visualizar'
)
->
with
([
'projeto'
=>
$projeto
,
return
view
(
'projeto.visualizar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'subAreas'
=>
$subareas
,
...
...
@@ -357,6 +358,7 @@ class TrabalhoController extends Controller
public
function
edit
(
$id
)
{
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$projeto
=
Trabalho
::
find
(
$id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
all
();
...
...
@@ -368,6 +370,9 @@ class TrabalhoController extends Controller
$users
=
User
::
whereIn
(
'id'
,
$participantesUsersIds
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
//dd(Participante::all());
$rascunho
=
Trabalho
::
where
(
'proponente_id'
,
$proponente
->
id
)
->
where
(
'evento_id'
,
$edital
->
id
)
->
where
(
'status'
,
'Rascunho'
)
->
orderByDesc
(
'updated_at'
)
->
first
();
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
...
...
@@ -378,6 +383,7 @@ class TrabalhoController extends Controller
'participantes'
=>
$participantes
,
'arquivos'
=>
$arquivos
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'estados'
=>
$this
->
estados
,
]);
}
...
...
@@ -786,6 +792,13 @@ class TrabalhoController extends Controller
}
return
abort
(
404
);
}
public
function
baixarAnexoGrupoPesquisa
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
if
(
Storage
::
disk
()
->
exists
(
$projeto
->
anexoProjeto
))
{
return
Storage
::
download
(
$projeto
->
anexoProjeto
);
}
return
abort
(
404
);
}
public
function
baixarAnexoConsu
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
...
...
@@ -920,10 +933,10 @@ class TrabalhoController extends Controller
$participantes
=
$projeto
->
participantes
;
$participantesPermanecem
=
collect
();
// dd($request->all());
foreach
(
$request
->
participante_id
as
$key
=>
$id
)
{
// Novo participante
if
(
$id
==
0
)
{
if
(
$id
==
0
||
$id
==
null
)
{
$userParticipante
=
User
::
where
(
'email'
,
$request
->
emailParticipante
[
$key
])
->
first
();
$participante
=
new
Participante
();
...
...
@@ -1196,6 +1209,7 @@ class TrabalhoController extends Controller
$projeto
->
update
();
// Salvando participantes
// dd($request->all());
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
,
true
);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto atualizado com sucesso!'
]);
...
...
app/Trabalho.php
View file @
1a944ec7
...
...
@@ -55,6 +55,12 @@ class Trabalho extends Model
public
function
area
(){
return
$this
->
belongsTo
(
'App\Area'
);
}
public
function
grandeArea
(){
return
$this
->
belongsTo
(
'App\GrandeArea'
);
}
public
function
subArea
(){
return
$this
->
belongsTo
(
'App\SubArea'
);
}
public
function
autor
(){
return
$this
->
belongsTo
(
'App\User'
,
'autorId'
);
...
...
@@ -79,6 +85,7 @@ class Trabalho extends Model
return
$this
->
hasMany
(
'App\PlanoTrabalho'
);
}
public
function
participantes
(){
// return $this->belongsToMany('App\Trabalho', 'trabalho_participante');
return
$this
->
hasMany
(
'App\Participante'
,
'trabalho_id'
);
}
public
function
proponente
(){
...
...
resources/views/componentes/participante.blade.php
View file @
1a944ec7
...
...
@@ -14,6 +14,7 @@
<div
class=
"container"
>
<div
class=
"row"
>
<input
type=
"hidden"
name=
"funcaoParticipante[]"
value=
"4"
>
<input
type=
"hidden"
name=
"participante_id[]"
>
<div
class=
"col-md-12 mt-3"
><h5>
Dados do discente
</h5></div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Nome completo'])
...
...
resources/views/layouts/app.blade.php
View file @
1a944ec7
...
...
@@ -15,7 +15,7 @@
<!-- Styles -->
<link
rel=
"stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"
integrity=
"sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk"
crossorigin=
"anonymous"
>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity=
"sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
crossorigin=
"anonymous"
referrerpolicy=
"no-referrer"
/>
<script
src=
"{{ asset('js/jquery-3.4.1.min.js')}}"
></script>
<script
src=
"{{ asset('js/jquery-mask-plugin.js')}}"
></script>
{{--
<script
src=
"https://cdn.jsdelivr.net/npm/jquery-mask-plugin@1.14.16/dist/jquery.mask.min.js"
></script>
--}}
...
...
resources/views/projeto/Backupeditar.blade.php
0 → 100644
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/editar.blade.php
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/formulario/anexos.blade.php
0 → 100644
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/formulario/finalizar.blade.php
0 → 100644
View file @
1a944ec7
<!-- Finalizar -->
<div
class=
"col-md-10"
style=
"text-align: center; margin-top:2rem"
><h4
style=
"margin-top: 1rem;"
>
5º Passo
</h4></div>
<div
class=
"col-md-10"
style=
"text-align: center;"
><h5
style=
"margin-bottom:1rem;color:#909090"
>
Finalizar
</h5></div>
<div
class=
"col-md-10"
>
<div
class=
"card"
style=
"border-radius: 12px"
>
<div
class=
"card-body"
>
<div
class=
"container"
>
<div
class=
"form-row mt-3"
>
<div
class=
"col-md-12"
><h5
style=
"color: #1492E6; margin-bottom:-0.4rem"
>
Finalizar
</h5></div>
<div
class=
"col-md-12"
style=
"margin-bottom: -0.8rem;"
><hr
style=
"border-top: 1px solid#1492E6"
></div>
</div>
<div
class=
" d-flex justify-content-between align-items-center"
style=
"margin-top: 15px; margin-bottom:18px"
>
<h6
style=
"font-family:Arial, Helvetica, sans-serif; margin-right:15px"
><span
style=
"color: red; font-weight:bold"
>
*
</span>
Campos obrigatórios
</h6>
<button
id=
"submeterFormProposta"
type=
"submit"
style=
"display: none;"
></button>
<button
type=
"button"
class=
"btn btn-success"
id=
"idButtonSubmitProjeto"
onclick=
"submeterProposta()"
>
{{ __('Atualizar Projeto') }}
</button>
</div>
</div>
</div>
</div>
</div>
<!--X Finalizar X-->
\ No newline at end of file
resources/views/projeto/formulario/participantes.blade.php
0 → 100644
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/formulario/projeto.blade.php
0 → 100644
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/formulario/proponente.blade.php
0 → 100644
View file @
1a944ec7
This diff is collapsed.
Click to expand it.
resources/views/projeto/visualizar.blade.php
View file @
1a944ec7
...
...
@@ -1155,6 +1155,9 @@
</div>
</div>
</div>
<div>
<button type="
button
" class="
btn
btn
-
success
mt
-
4
" id="
exportarPDF
">Imprimir proposta</button>
</div>
</div>
</div>
...
...
@@ -1181,10 +1184,7 @@
</
div
>
</
div
>
--
}}
<!--
X
Finalizar
X
-->
</
div
>
<
div
>
<
a
class
=
"btn btn-success mt-4"
href
=
"{{ route('exportar.projeto', ['id' =>
$projeto->id
]) }}"
target
=
"_blank"
rel
=
"noopener noreferrer"
>
Baixar
PDF
</
a
>
<
button
type
=
"button"
class
=
"btn btn-success mt-4"
id
=
"exportarPDF"
>
Imprimir
proposta
</
button
>
</
div
>
</
div
>
{{
--
</
form
>
--
}}
...
...
routes/web.php
View file @
1a944ec7
...
...
@@ -144,11 +144,12 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
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-justificativa/{id}'
,
'TrabalhoController@baixarAnexoJustificativa'
)
->
name
(
'baixar.anexo.justificativa'
);
Route
::
get
(
'/baixar/anexo-justificativa/{id}'
,
'TrabalhoController@baixarAnexoJustificativa'
)
->
name
(
'baixar.anexo.justificativa'
);
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/plano-de-trabalho/{id}'
,
'ArquivoController@baixarPlano'
)
->
name
(
'baixar.plano'
);
Route
::
get
(
'/baixar/anexo-temp/{eventoId}/{nomeAnexo}'
,
'TrabalhoController@baixarAnexoTemp'
)
->
name
(
'baixar.anexo.temp'
);
Route
::
get
(
'/baixar/anexoGrupoPesquisa/{id}'
,
'ArquivoController@baixarAnexoGrupoPesquisa'
)
->
name
(
'baixar.anexoGrupoPesquisa'
);
Route
::
get
(
'/baixar/anexo-temp/{eventoId}/{nomeAnexo}'
,
'TrabalhoController@baixarAnexoTemp'
)
->
name
(
'baixar.anexo.temp'
);
Route
::
get
(
'/baixar/evento-temp/{nomeAnexo}'
,
'TrabalhoController@baixarEventoTemp'
)
->
name
(
'baixar.evento.temp'
);
});
...
...
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