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
c57f3a05
Unverified
Commit
c57f3a05
authored
Mar 18, 2022
by
GuilhermeGz
Committed by
GitHub
Mar 18, 2022
Browse files
Merge pull request #187 from GuilhermeGz/master
Mudanças na documentação complementar
parents
ec1f7916
be29a9dc
Changes
6
Show whitespace changes
Inline
Side-by-side
app/DocumentacaoComplementar.php
deleted
100644 → 0
View file @
ec1f7916
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
DocumentacaoComplementar
extends
Model
{
protected
$fillable
=
[
'termoCompromisso'
,
'comprovanteMatricula'
,
'linkLattes'
,
'pdfLattes'
,
'participante_id'
,
];
public
function
participante
(){
return
$this
->
belongsTo
(
Participante
::
class
,
'participante_id'
,
'id'
);
}
}
app/Http/Controllers/ParticipanteController.php
View file @
c57f3a05
...
...
@@ -117,4 +117,16 @@ class ParticipanteController extends Controller
$participante
->
save
();
return
redirect
()
->
back
()
->
with
([
'mensagem'
=>
'Alteração da bolsa realizada com sucesso!'
]);
}
public
function
atualizarDocComplementar
(
Request
$request
){
$participante
=
Participante
::
find
(
$request
->
partcipanteId
);
$pasta
=
'participantes/'
.
$participante
->
id
;
$participante
->
anexoTermoCompromisso
=
Storage
::
putFileAs
(
$pasta
,
$request
->
termoCompromisso
,
"Termo_de_Compromisso.pdf"
);
$participante
->
anexoComprovanteMatricula
=
Storage
::
putFileAs
(
$pasta
,
$request
->
comprovanteMatricula
,
"Comprovante_de_Matricula.pdf"
);
$participante
->
anexoLattes
=
Storage
::
putFileAs
(
$pasta
,
$request
->
pdfLattes
,
"Curriculo_Lattes.pdf"
);
$participante
->
linkLattes
=
$request
->
linkLattes
;
$participante
->
update
();
return
redirect
()
->
back
()
->
with
([
'sucesso'
=>
"Documentação complementar enviada com sucesso"
]);
}
}
app/Participante.php
View file @
c57f3a05
...
...
@@ -34,7 +34,4 @@ class Participante extends Model
return
$this
->
hasOne
(
'App\Arquivo'
,
'participanteId'
);
}
public
function
documentacaoComplementar
()
{
return
$this
->
hasOne
(
'App\DocumentacaoComplementar'
,
'participante_id'
);
}
}
database/migrations/2022_02_22_094237_create_documentacao_complementars_table.php
deleted
100644 → 0
View file @
ec1f7916
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateDocumentacaoComplementarsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'documentacao_complementars'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'termoCompromisso'
)
->
nullable
();
$table
->
string
(
'comprovanteMatricula'
)
->
nullable
();
$table
->
string
(
'pdfLattes'
)
->
nullable
();
$table
->
string
(
'linkLattes'
)
->
nullable
();
$table
->
integer
(
'participante_id'
)
->
nullable
();
$table
->
foreign
(
'participante_id'
)
->
references
(
'id'
)
->
on
(
'participantes'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'documentacao_complementars'
);
}
}
resources/views/documentacaoComplementar/listar.blade.php
View file @
c57f3a05
...
...
@@ -34,7 +34,9 @@
<td style="
text
-
align
:
center
;
" title="
{{
$participante
->
user
->
name
}}
">
{
{$participante->user->name}
}
</td>
<td style="
text
-
align
:
center
;
">
<button type="
button
" class="
btn
btn
-
primary
" data-toggle="
modal
" data-target="
#modalConfirm{{$participante->id}}" @if($trabalho->status!="aprovado")disabled="disabled" @endif>
@
if
(
$participante
->
documentacaoComplementar
==
null
)
@
if
(
$participante
->
anexoComprovanteMatricula
==
null
||
$participante
->
anexoTermoCompromisso
==
null
||
$participante
->
anexoLattes
==
null
||
$participante
->
linkLattes
==
null
)
Pendente
@
else
Visualizar
...
...
@@ -43,7 +45,7 @@
</
td
>
</
tbody
>
<
div
class
=
"modal fade"
id
=
"modalConfirm
{
{$participante->id}
}
"
tabindex
=
"-1"
role
=
"dial
o
g"
<
div
class
=
"modal fade"
id
=
"modalConfirm
{
{$participante->id}
}
"
tabindex
=
"-1"
role
=
"
o
dialg"
aria
-
labelledby
=
"modalConfirmLabel"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-lg"
role
=
"document"
>
<
div
class
=
"modal-content"
>
...
...
@@ -57,7 +59,11 @@
<
input
type
=
"hidden"
value
=
"
{
{$participante->id}
}
"
name
=
"partcipanteId"
>
<
div
class
=
"row col-md-12"
>
<
div
class
=
"col-md-6"
>
<
label
class
=
"control-label "
>
Termo
de
Compromisso
</
label
>
<
label
class
=
"control-label "
>
Termo
de
Compromisso
@
if
(
$participante
->
anexoTermoCompromisso
)
:
<
a
id
=
"modeloDocumentoTemp"
href
=
"{{ route('baixar.documentosParticipante', ['pathDocumento' =>
$participante->anexoTermoCompromisso
]) }}"
>
Arquivo
atual
</
a
>
@
endif
</
label
>
<
br
>
<
input
type
=
"file"
class
=
"input-group-text"
value
=
""
name
=
"termoCompromisso"
accept
=
".pdf"
id
=
"termoCompromisso
{
{$participante->id}
}
"
required
/>
...
...
@@ -69,7 +75,11 @@
<
br
>
</
div
>
<
div
class
=
"col-md-6"
>
<
label
class
=
"control-label "
>
Comprovante
de
Matricula
</
label
>
<
label
class
=
"control-label "
>
Comprovante
de
Matricula
@
if
(
$participante
->
anexoComprovanteMatricula
)
:
<
a
id
=
"modeloDocumentoTemp"
href
=
"{{ route('baixar.documentosParticipante', ['pathDocumento' =>
$participante->anexoComprovanteMatricula
]) }}"
>
Arquivo
atual
</
a
>
@
endif
</
label
>
<
br
>
<
input
type
=
"file"
class
=
"input-group-text"
value
=
""
name
=
"comprovanteMatricula"
accept
=
".pdf"
id
=
"comprovanteMatricula
{
{$participante->id}
}
"
required
/>
@
error
(
'comprovanteMatricula'
)
...
...
@@ -81,7 +91,10 @@
</
div
>
<
div
class
=
"col-md-6"
>
<
label
class
=
"control-label "
>
PDF
Lattes
</
label
>
<
label
class
=
"control-label "
>
PDF
Lattes
@
if
(
$participante
->
anexoLattes
)
:
<
a
id
=
"modeloDocumentoTemp"
href
=
"{{ route('baixar.documentosParticipante', ['pathDocumento' =>
$participante->anexoLattes
]) }}"
>
Arquivo
atual
</
a
>
@
endif
</
label
>
<
br
>
<
input
type
=
"file"
class
=
"input-group-text"
value
=
""
name
=
"pdfLattes"
accept
=
".pdf"
id
=
"pdfLattes
{
{$participante->id}
}
"
required
/>
...
...
@@ -92,10 +105,10 @@
@
enderror
</
div
>
<
div
class
=
"col-md-6"
>
<
label
class
=
"control-label "
>
Link
Lattes
</
label
>
<
label
class
=
"control-label "
>
Link
Lattes
</
label
>
<
br
>
<
input
type
=
"text"
class
=
"input-group-text col-md-12"
name
=
"linkLattes"
placeholder
=
"Link Lattes"
id
=
"linkLattes
{
{$participante->id}
}
"
required
/>
required
@
if
(
$participante
->
linkLattes
)
value
=
"
{
{$participante->linkLattes}
}
"
@
endif
/>
@
error
(
'linkLattes'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
<
strong
>
{{
$message
}}
</
strong
>
...
...
routes/web.php
View file @
c57f3a05
...
...
@@ -152,7 +152,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
//########## Documentação Complementar
Route
::
get
(
'/documentacaoComplementar'
,
'ParticipanteController@listarParticipanteProjeto'
)
->
name
(
'docComplementar.listar'
);
Route
::
post
(
'/documentacaoComplementar/enviar'
,
'
DocumentacaoComplementarController@cri
ar'
)
->
name
(
'docComplementar.enviar'
);
Route
::
post
(
'/documentacaoComplementar/enviar'
,
'
ParticipanteController@atualizarDocComplement
ar'
)
->
name
(
'docComplementar.enviar'
);
//######### Atribuição #######################################
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
...
...
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