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
c5ba1744
Commit
c5ba1744
authored
Jul 04, 2022
by
GuilhermeGz
Browse files
Adição de arquivo tutorial para avaliadores na criação/edição do edital
parent
efc95cd6
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Evento.php
View file @
c5ba1744
...
@@ -19,7 +19,7 @@ class Evento extends Model
...
@@ -19,7 +19,7 @@ class Evento extends Model
'dt_inicioRelatorioParcial'
,
'dt_fimRelatorioParcial'
,
'dt_inicioRelatorioFinal'
,
'dt_fimRelatorioFinal'
,
'dt_inicioRelatorioParcial'
,
'dt_fimRelatorioParcial'
,
'dt_inicioRelatorioFinal'
,
'dt_fimRelatorioFinal'
,
'formAvaliacaoExterno'
,
'formAvaliacaoInterno'
,
'formAvaliacaoExterno'
,
'formAvaliacaoInterno'
,
'cotaDoutor'
,
'inicioProjeto'
,
'fimProjeto'
,
'cotaDoutor'
,
'inicioProjeto'
,
'fimProjeto'
,
'formAvaliacaoRelatorio'
'formAvaliacaoRelatorio'
,
'docTutorial'
];
];
public
function
endereco
(){
public
function
endereco
(){
...
...
app/Http/Controllers/EventoController.php
View file @
c5ba1744
...
@@ -94,6 +94,11 @@ class EventoController extends Controller
...
@@ -94,6 +94,11 @@ class EventoController extends Controller
'modeloDocumento'
=>
[
'file'
,
'max:2048'
,
new
ExcelRule
(
$request
->
file
(
'modeloDocumento'
))],
'modeloDocumento'
=>
[
'file'
,
'max:2048'
,
new
ExcelRule
(
$request
->
file
(
'modeloDocumento'
))],
]);
]);
}
}
if
(
isset
(
$request
->
docTutorial
)){
$request
->
validate
([
'docTutorial'
=>
[
'file'
,
'max:2048'
,
new
ExcelRule
(
$request
->
file
(
'docTutorial'
))],
]);
}
//--Salvando os anexos da submissão temporariamente
//--Salvando os anexos da submissão temporariamente
$evento
=
$this
->
armazenarAnexosTemp
(
$request
);
$evento
=
$this
->
armazenarAnexosTemp
(
$request
);
...
@@ -245,6 +250,15 @@ class EventoController extends Controller
...
@@ -245,6 +250,15 @@ class EventoController extends Controller
$evento
->
formAvaliacaoRelatorio
=
$path
.
$nome
;
$evento
->
formAvaliacaoRelatorio
=
$path
.
$nome
;
}
}
if
(
isset
(
$request
->
docTutorial
)){
$docTutorial
=
$request
->
docTutorial
;
$extension
=
$docTutorial
->
extension
();
$path
=
'docTutorial/'
.
$evento
->
id
.
'/'
;
$nome
=
"documento tutorial"
.
"."
.
$extension
;
Storage
::
putFileAs
(
$path
,
$docTutorial
,
$nome
);
$evento
->
docTutorial
=
$path
.
$nome
;
}
$evento
->
update
();
$evento
->
update
();
...
@@ -290,6 +304,12 @@ class EventoController extends Controller
...
@@ -290,6 +304,12 @@ class EventoController extends Controller
$eventoTemp
->
formAvaliacaoRelatorio
=
Storage
::
putFileAs
(
$pasta
,
$request
->
pdfFormAvalRelatorio
,
'formulario de avaliação do relatorio.pdf'
);
$eventoTemp
->
formAvaliacaoRelatorio
=
Storage
::
putFileAs
(
$pasta
,
$request
->
pdfFormAvalRelatorio
,
'formulario de avaliação do relatorio.pdf'
);
}
}
if
(
!
(
is_null
(
$request
->
docTutorial
))
)
{
$extension
=
$request
->
docTutorial
->
extension
();
$pasta
=
'docTutorial/'
.
$eventoTemp
->
id
;
$nome
=
"documento tutorial"
.
"."
.
$extension
;
$eventoTemp
->
docTutorial
=
Storage
::
putFileAs
(
$pasta
,
$request
->
docTutorial
,
$nome
);
}
$eventoTemp
->
update
();
$eventoTemp
->
update
();
...
@@ -434,6 +454,7 @@ class EventoController extends Controller
...
@@ -434,6 +454,7 @@ class EventoController extends Controller
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'inicioProjeto'
=>
[
'required'
,
'date'
],
'inicioProjeto'
=>
[
'required'
,
'date'
],
'fimProjeto'
=>
[
'required'
,
'date'
],
'fimProjeto'
=>
[
'required'
,
'date'
],
'docTutorial'
=>
[
'file'
,
'mimes:zip,doc,docx,pdf'
,
'max:2048'
],
]);
]);
}
}
...
@@ -460,6 +481,7 @@ class EventoController extends Controller
...
@@ -460,6 +481,7 @@ class EventoController extends Controller
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'pdfFormAvalRelatorio'
=>
[
'file'
,
'mimes:pdf'
,
'max:2048'
],
'inicioProjeto'
=>
[
'required'
,
'date'
,
'after:resultado_final'
],
'inicioProjeto'
=>
[
'required'
,
'date'
,
'after:resultado_final'
],
'fimProjeto'
=>
[
'required'
,
'date'
,
'after:inicioProjeto'
],
'fimProjeto'
=>
[
'required'
,
'date'
,
'after:inicioProjeto'
],
'docTutorial'
=>
[
'file'
,
'mimes:zip,doc,docx,pdf'
,
'max:2048'
],
]);
]);
$evento
->
nome
=
$request
->
nome
;
$evento
->
nome
=
$request
->
nome
;
...
@@ -511,6 +533,15 @@ class EventoController extends Controller
...
@@ -511,6 +533,15 @@ class EventoController extends Controller
$evento
->
formAvaliacaoExterno
=
$path
.
$nome
;
$evento
->
formAvaliacaoExterno
=
$path
.
$nome
;
}
}
if
(
$request
->
docTutorial
!=
null
){
$docTutorial
=
$request
->
docTutorial
;
$extension
=
$docTutorial
->
extension
();
$path
=
'docTutorial/'
.
$evento
->
id
.
'/'
;
$nome
=
"documento tutorial"
.
"."
.
$extension
;
Storage
::
putFileAs
(
$path
,
$docTutorial
,
$nome
);
$evento
->
docTutorial
=
$path
.
$nome
;
}
if
(
isset
(
$request
->
pdfFormAvalRelatorio
)){
if
(
isset
(
$request
->
pdfFormAvalRelatorio
)){
$pdfFormAvalRelatorio
=
$request
->
pdfFormAvalRelatorio
;
$pdfFormAvalRelatorio
=
$request
->
pdfFormAvalRelatorio
;
$extension
=
$pdfFormAvalRelatorio
->
extension
();
$extension
=
$pdfFormAvalRelatorio
->
extension
();
...
...
database/migrations/2022_07_04_163438_add_doc_tutorial_to_eventos_table.php
0 → 100644
View file @
c5ba1744
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddDocTutorialToEventosTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'eventos'
,
function
(
Blueprint
$table
)
{
Schema
::
table
(
'eventos'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'docTutorial'
)
->
nullable
();
});
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'eventos'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'docTutorial'
);
});
}
}
resources/views/evento/criarEvento.blade.php
View file @
c5ba1744
...
@@ -452,6 +452,22 @@
...
@@ -452,6 +452,22 @@
@
enderror
@
enderror
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"form-group"
>
<
label
for
=
"docTutorial"
>
Documento
auxiliar
para
Avaliador
:</
label
>
@
if
(
old
(
'docTutorialPreenchido'
)
!=
null
)
<
a
id
=
"docTutorialTemp"
href
=
"{{ route('baixar.evento.temp', ['nomeAnexo' => 'docTutorial' ])}}"
>
Arquivo
atual
</
a
>
@
endif
<
input
type
=
"hidden"
id
=
"docTutorialPreenchido"
name
=
"docTutorialPreenchido"
value
=
"{{ old('docTutorialPreenchido') }}"
>
<
input
type
=
"file"
accept
=
".pdf,.docx,.doc,.zip"
class
=
"form-control-file pdf @error('docTutorial') is-invalid @enderror"
name
=
"docTutorial"
value
=
"{{ old('docTutorial') }}"
id
=
"docTutorial"
onchange
=
"exibirAnexoTemp(this)"
>
<
small
>
O
arquivo
selecionado
deve
ser
de
atÃ
©
2
mb
.
</
small
>
@
error
(
'docTutorial'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
...
...
resources/views/evento/editarEvento.blade.php
View file @
c5ba1744
...
@@ -429,6 +429,27 @@
...
@@ -429,6 +429,27 @@
@
enderror
@
enderror
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"col-sm-12"
>
<
div
class
=
"form-group"
>
<
label
for
=
"pdfEdital"
>
Documento
auxiliar
para
Avaliador
:</
label
>
@
if
(
$evento
->
docTutorial
!=
null
)
<
a
href
=
"{{route('download', ['file' =>
$evento->docTutorial
])}}"
target
=
"_new"
style
=
"font-size: 20px; color: #114048ff;"
>
<
img
class
=
""
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
style
=
"width:20px"
>
</
a
>
@
else
<
a
>
<
i
class
=
"fas fa-times-circle fa-2x"
style
=
"color:red; font-size:25px"
></
i
>
</
a
>
@
endif
<
input
type
=
"file"
class
=
"form-control-file @error('docTutorial') is-invalid @enderror"
name
=
"docTutorial"
value
=
"{{ old('docTutorial') }}"
id
=
"docTutorial"
>
<
small
>
O
arquivo
selecionado
deve
ser
no
formato
PDF
de
até
2
mb
.
</
small
>
@
error
(
'docTutorial'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
<
div
class
=
"row justify-content-center"
style
=
"margin: 20px 0 20px 0"
>
...
...
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