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
ff06a2da
Commit
ff06a2da
authored
Apr 10, 2023
by
Yuri Resende
Browse files
Permitindo a submissão de projetos para editais de fluxo continuo
parent
37084fbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
ff06a2da
...
...
@@ -327,6 +327,14 @@ class TrabalhoController extends Controller
$trabalho
->
anexo_docExtra
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexo_docExtra
,
"Documento_Extra."
.
$request
->
file
(
'anexo_docExtra'
)
->
extension
());
}
//Anexo SIPAC
if
(
isset
(
$request
->
anexo_SIPAC
))
{
if
(
Storage
::
disk
()
->
exists
(
$trabalho
->
anexo_SIPAC
))
{
Storage
::
delete
(
$trabalho
->
anexo_SIPAC
);
}
$trabalho
->
anexo_SIPAC
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexo_SIPAC
,
"Anexo_SIPAC."
.
$request
->
file
(
'anexo_SIPAC'
)
->
extension
());
}
$trabalho
->
save
();
return
$trabalho
;
}
...
...
@@ -1145,7 +1153,6 @@ class TrabalhoController extends Controller
public
function
salvar
(
StoreTrabalho
$request
)
{
try
{
if
(
!
$request
->
has
(
'rascunho'
))
{
$request
->
merge
([
...
...
@@ -1163,14 +1170,21 @@ class TrabalhoController extends Controller
if
(
$evento
->
tipo
==
"PIBEX"
){
$trabalho
=
Auth
::
user
()
->
proponentes
->
trabalhos
()
->
create
(
$request
->
except
([
'anexoProjeto'
,
'anexoDecisaoCONSU'
,
'modalidade'
,
'anexo_docExtra'
'anexoProjeto'
,
'anexoDecisaoCONSU'
,
'modalidade'
,
'anexo_docExtra'
,
'anexo_SIPAC'
]));
}
else
{
}
else
if
(
$evento
->
tipo
==
"CONTINUO"
){
$trabalho
=
Auth
::
user
()
->
proponentes
->
trabalhos
()
->
create
(
$request
->
except
([
'anexoProjeto'
,
'anexoDecisaoCONSU'
,
'anexoPlanilhaPontuacao'
,
'anexoLattesCoordenador'
,
'anexoGrupoPesquisa'
,
'anexoAutorizacaoComiteEtica'
,
'justificativaAutorizacaoEtica'
,
'modalidade'
,
'anexo_docExtra'
,
]));
}
else
{
$trabalho
=
Auth
::
user
()
->
proponentes
->
trabalhos
()
->
create
(
$request
->
except
([
'anexoProjeto'
,
'anexoDecisaoCONSU'
,
'anexoPlanilhaPontuacao'
,
'anexoLattesCoordenador'
,
'anexoGrupoPesquisa'
,
'anexoAutorizacaoComiteEtica'
,
'justificativaAutorizacaoEtica'
,
'modalidade'
,
'anexo_docExtra'
'justificativaAutorizacaoEtica'
,
'modalidade'
,
'anexo_docExtra'
,
'anexo_SIPAC'
]));
}
...
...
app/Http/Requests/StoreTrabalho.php
View file @
ff06a2da
...
...
@@ -76,7 +76,7 @@ class StoreTrabalho extends FormRequest
if
(
$evento
->
nome_docExtra
!=
null
){
$rules
[
'anexo_docExtra'
]
=
[
Rule
::
requiredIf
(
$evento
->
obrigatoriedade_docExtra
==
true
),
'file'
,
'mimes:zip,doc,docx,pdf'
,
'max:2048'
];
}
if
(
$evento
->
tipo
!=
"PIBEX"
){
if
(
$evento
->
tipo
!=
"PIBEX"
&&
$evento
->
tipo
!=
"CONTINUO"
){
$rules
[
'anexoPlanilhaPontuacao'
]
=
[
'required'
];
$rules
[
'anexoLattesCoordenador'
]
=
[
'required'
,
'mimes:pdf'
];
$rules
[
'anexoGrupoPesquisa'
]
=
[
'required'
,
'mimes:pdf'
];
...
...
@@ -98,9 +98,12 @@ class StoreTrabalho extends FormRequest
}
$rules
[
'linkLattesEstudante'
]
=
[
'required'
,
'string'
];
$rules
[
'anexoProjeto'
]
=
[
'required'
,
'mimes:pdf'
];
$rules
[
'anexoDecisaoCONSU'
]
=
[
Rule
::
requiredIf
(
$evento
->
consu
),
'mimes:pdf'
];
if
(
$evento
->
tipo
!=
"CONTINUO"
){
$rules
[
'anexoProjeto'
]
=
[
'required'
,
'mimes:pdf'
];
}
return
$rules
;
}
...
...
database/migrations/2023_04_10_170619_add_anexo_sipac_to_trabalhos_table.php
0 → 100644
View file @
ff06a2da
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddAnexoSipacToTrabalhosTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'trabalhos'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'anexo_SIPAC'
)
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'trabalhos'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'anexo_SIPAC'
);
});
}
}
resources/views/evento/formulario/anexos.blade.php
View file @
ff06a2da
...
...
@@ -13,9 +13,9 @@
@if($edital->tipo == "CONTINUO")
<div
class=
"form-group col-md-6"
style=
"margin-top: 10px"
>
<label
for=
"anexoSIPAC"
class=
"col-form-label font-tam"
style=
"font-weight: bold"
>
{{ __('Processo SIPAC: ') }}
<span
style=
"color: red; font-weight:bold"
>
*
</span></label>
<input
type=
"file"
class=
"input-group-text"
name=
"SIPAC"
placeholder=
"PDF do processo SIPAC"
accept=
".pdf"
/>
@error('anexoSIPAC')
<label
for=
"anexo
_
SIPAC"
class=
"col-form-label font-tam"
style=
"font-weight: bold"
>
{{ __('Processo SIPAC: ') }}
<span
style=
"color: red; font-weight:bold"
>
*
</span></label>
<input
type=
"file"
class=
"input-group-text"
name=
"
anexo_
SIPAC"
placeholder=
"PDF do processo SIPAC"
accept=
".pdf"
/>
@error('anexo
_
SIPAC')
<span
class=
"invalid-feedback"
role=
"alert"
style=
"overflow: visible; display:block"
>
<strong>
{{ $message }}
</strong>
</span>
...
...
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