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
56f62ac9
Commit
56f62ac9
authored
Jun 12, 2020
by
alinetenorio
Browse files
Merge branch 'master' into carlos
parents
d65577db
5af65369
Changes
22
Expand all
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/Auth/RegisterController.php
View file @
56f62ac9
...
...
@@ -12,6 +12,7 @@ use Illuminate\Validation\Rule;
use
App\User
;
use
App\Participante
;
use
App\Proponente
;
use
App\Rules\UrlValidacao
;
class
RegisterController
extends
Controller
{
...
...
@@ -54,29 +55,30 @@ class RegisterController extends Controller
protected
function
validator
(
array
$data
)
{
return
Validator
::
make
(
$data
,
[
'name'
=>
[
'required'
,
'string'
,
'max:255'
],
'email'
=>
[
'required'
,
'string'
,
'email'
,
'max:255'
,
'unique:users'
],
'password'
=>
[
'required'
,
'string'
,
'min:8'
,
'confirmed'
],
'cpf'
=>
[
'required'
,
'cpf'
],
'celular'
=>
[
'required'
,
'string'
],
'instituicao'
=>
[
'required'
,
'string'
,
'max:255'
],
'cpf'
=>
[
'required'
,
'cpf'
,
'unique:users'
],
'celular'
=>
[
'required'
,
'string'
],
'instituicao'
=>
[
'required_if:instituicaoSelect,Outra'
,
'max:255'
],
'instituicaoSelect'
=>
[
'required_without:instituicao'
],
'cargo'
=>
[
'required'
],
'vinculo'
=>
[
'required'
],
'outro'
=>
[
'required_if:vinculo,Outro'
],
'titulacaoMaxima'
=>
[
'required_with:anoTitulacao,areaFormacao,bolsistaProdutividade
,linkLattes
'
],
'titulacaoMaxima'
=>
Rule
::
requiredIf
(
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'anoTitulacao'
=>
[
'required_with:titulacaoMaxima,areaFormacao,bolsistaProdutividade,linkLattes'
],
'anoTitulacao'
=>
Rule
::
requiredIf
(
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'areaFormacao'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,bolsistaProdutividade,linkLattes'
],
'areaFormacao'
=>
Rule
::
requiredIf
(
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'bolsistaProdutividade'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,linkLattes'
],
'bolsistaProdutividade'
=>
Rule
::
requiredIf
(
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'titulacaoMaxima'
=>
[
'required_with:anoTitulacao,areaFormacao,bolsistaProdutividade'
],
'titulacaoMaxima'
=>
Rule
::
requiredIf
((
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'anoTitulacao'
=>
[
'required_with:titulacaoMaxima,areaFormacao,bolsistaProdutividade,linkLattes'
],
'anoTitulacao'
=>
Rule
::
requiredIf
((
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'areaFormacao'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,bolsistaProdutividade,linkLattes'
],
'areaFormacao'
=>
Rule
::
requiredIf
((
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'bolsistaProdutividade'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,linkLattes'
],
'bolsistaProdutividade'
=>
Rule
::
requiredIf
((
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'nivel'
=>
[
'required_if:bolsistaProdutividade,sim'
],
'linkLattes'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'
],
'linkLattes'
=>
Rule
::
requiredIf
(
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)),
'nivel'
=>
[(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'required'
:
''
],
'linkLattes'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'
],
'linkLattes'
=>
[(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'required'
:
''
],
'linkLattes'
=>
[(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$data
[
'cargo'
])
&&
$data
[
'cargo'
]
===
'Estudante'
&&
isset
(
$data
[
'vinculo'
])
&&
$data
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'link_lattes'
:
''
],
]);
}
...
...
@@ -96,27 +98,31 @@ class RegisterController extends Controller
$user
->
password
=
bcrypt
(
$data
[
'password'
]);
$user
->
cpf
=
$data
[
'cpf'
];
$user
->
celular
=
$data
[
'celular'
];
if
(
$data
[
'instituicao'
]
!=
null
)
{
$user
->
instituicao
=
$data
[
'instituicao'
];
}
else
if
(
isset
(
$data
[
'instituicaoSelect'
])
&&
$data
[
'instituicaoSelect'
]
!=
"Outra"
)
{
$user
->
instituicao
=
$data
[
'instituicaoSelect'
];
}
if
(
$data
[
'cargo'
]
===
"Estudante"
&&
$data
[
'vinculo'
]
!==
"Pós-doutorando"
){
if
(
$data
[
'cargo'
]
===
"Estudante"
&&
$data
[
'vinculo'
]
!==
"Pós-doutorando"
)
{
$user
->
tipo
=
'participante'
;
$user
->
save
();
$participante
=
new
Participante
();
$user
->
participantes
()
->
save
(
$participante
);
}
else
{
}
else
{
$user
->
tipo
=
'proponente'
;
$user
->
save
();
$proponente
=
new
Proponente
();
if
(
$data
[
'SIAPE'
]
!=
null
){
if
(
$data
[
'SIAPE'
]
!=
null
)
{
$proponente
->
SIAPE
=
$data
[
'SIAPE'
];
}
$proponente
->
cargo
=
$data
[
'cargo'
];
if
(
$data
[
'vinculo'
]
!=
'Outro'
){
if
(
$data
[
'vinculo'
]
!=
'Outro'
)
{
$proponente
->
vinculo
=
$data
[
'vinculo'
];
}
else
{
}
else
{
$proponente
->
vinculo
=
$data
[
'outro'
];
}
...
...
@@ -124,7 +130,7 @@ class RegisterController extends Controller
$proponente
->
anoTitulacao
=
$data
[
'anoTitulacao'
];
$proponente
->
areaFormacao
=
$data
[
'areaFormacao'
];
$proponente
->
bolsistaProdutividade
=
$data
[
'bolsistaProdutividade'
];
if
(
$data
[
'bolsistaProdutividade'
]
==
'sim'
){
if
(
$data
[
'bolsistaProdutividade'
]
==
'sim'
)
{
$proponente
->
nivel
=
$data
[
'nivel'
];
}
$proponente
->
linkLattes
=
$data
[
'linkLattes'
];
...
...
@@ -136,7 +142,8 @@ class RegisterController extends Controller
return
$user
;
}
public
function
showRegistrationForm
(){
public
function
showRegistrationForm
()
{
return
view
(
'auth.register'
);
}
}
app/Http/Controllers/ParticipanteController.php
View file @
56f62ac9
...
...
@@ -3,6 +3,9 @@
namespace
App\Http\Controllers
;
use
Illuminate\Http\Request
;
use
App\Evento
;
use
App\Trabalho
;
use
App\Participante
;
class
ParticipanteController
extends
Controller
{
...
...
@@ -10,4 +13,16 @@ class ParticipanteController extends Controller
return
view
(
'participante.index'
);
}
public
function
edital
(
$id
){
$edital
=
Evento
::
find
(
$id
);
$trabalhosId
=
Trabalho
::
where
(
'evento_id'
,
'='
,
$id
)
->
select
(
'id'
)
->
get
();
$meusTrabalhosId
=
Participante
::
where
(
'user_id'
,
'='
,
Auth
()
->
user
()
->
id
)
->
whereIn
(
'trabalho_id'
,
$trabalhosId
)
->
select
(
'trabalho_id'
)
->
get
();
$projetos
=
Trabalho
::
whereIn
(
'id'
,
$meusTrabalhosId
)
->
get
();
//dd($projetos);
return
view
(
'participante.projetos'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
}
}
app/Http/Controllers/ProponenteController.php
View file @
56f62ac9
...
...
@@ -37,8 +37,10 @@ class ProponenteController extends Controller
'bolsistaProdutividade'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,linkLattes'
],
'bolsistaProdutividade'
=>
Rule
::
requiredIf
(
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
===
'Estudante'
&&
isset
(
$request
[
'vinculo'
])
&&
$request
[
'vinculo'
]
===
'Pós-doutorando'
)),
'nivel'
=>
[
'required_if:bolsistaProdutividade,sim'
],
'nivel'
=>
[(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
===
'Estudante'
&&
isset
(
$request
[
'vinculo'
])
&&
$request
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'required'
:
''
],
'linkLattes'
=>
[
'required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'
],
'linkLattes'
=>
Rule
::
requiredIf
(
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
===
'Estudante'
&&
isset
(
$request
[
'vinculo'
])
&&
$request
[
'vinculo'
]
===
'Pós-doutorando'
)),
'linkLattes'
=>
[(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
===
'Estudante'
&&
isset
(
$request
[
'vinculo'
])
&&
$request
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'required'
:
''
],
'linkLattes'
=>
[(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
!==
'Estudante'
)
||
(
isset
(
$request
[
'cargo'
])
&&
$request
[
'cargo'
]
===
'Estudante'
&&
isset
(
$request
[
'vinculo'
])
&&
$request
[
'vinculo'
]
===
'Pós-doutorando'
)
?
'link_lattes'
:
''
],
]);
if
(
$request
[
'cargo'
]
===
"Estudante"
&&
$request
[
'vinculo'
]
!==
"Pós-doutorando"
){
...
...
app/Http/Controllers/TrabalhoController.php
View file @
56f62ac9
...
...
@@ -101,7 +101,9 @@ class TrabalhoController extends Controller
'nomePlanoTrabalho.*'
=>
[
'required'
,
'string'
],
'anexoProjeto'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoCONSU'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoComiteEtica'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'botao'
=>
[
'required'
],
'anexoComiteEtica'
=>
[
'required_without:justificativaAutorizacaoEtica'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'justificativaAutorizacaoEtica'
=>
[
'required_without:anexoComiteEtica'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoLatterCoordenador'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoPlanilha'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
'anexoPlanoTrabalho.*'
=>
[
'required'
,
'file'
,
'mimes:pdf'
,
'max:2000000'
],
...
...
@@ -224,6 +226,7 @@ class TrabalhoController extends Controller
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
...
...
@@ -268,21 +271,23 @@ class TrabalhoController extends Controller
*/
public
function
show
(
$id
)
{
//
$projeto
=
Trabalho
::
find
(
$id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$areas
=
Area
::
orderBy
(
'nome'
)
->
get
();
$subareas
=
Subarea
::
orderBy
(
'nome'
)
->
get
();
$grandeArea
=
GrandeArea
::
where
(
'id'
,
$projeto
->
grande_area_id
)
->
select
(
'nome'
)
->
first
();
$area
=
Area
::
where
(
'id'
,
$projeto
->
area_id
)
->
select
(
'nome'
)
->
first
();
$subarea
=
Subarea
::
where
(
'id'
,
$projeto
->
sub_area_id
)
->
select
(
'nome'
)
->
first
();
$proponente
=
Proponente
::
find
(
$projeto
->
proponente_id
);
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
get
();
$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
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'subAreas'
=>
$subareas
,
'grandeArea'
=>
$grandeArea
,
'area'
=>
$area
,
'subArea'
=>
$subarea
,
'proponente'
=>
$proponente
,
'edital'
=>
$edital
,
'users'
=>
$users
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
...
...
@@ -454,6 +459,7 @@ class TrabalhoController extends Controller
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
...
...
@@ -486,6 +492,7 @@ class TrabalhoController extends Controller
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$request
->
nomePlanoTrabalho
[
$key
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
$mytime
;
...
...
@@ -528,6 +535,16 @@ class TrabalhoController extends Controller
return
redirect
()
->
back
();
}
public
function
excluirParticipante
(
$id
){
$participante
=
Participante
::
where
(
'user_id'
,
Auth
()
->
user
()
->
id
)
->
where
(
'trabalho_id'
,
$id
)
->
first
();
$participante
->
trabalhos
()
->
detach
(
$id
);
$participante
->
delete
();
return
redirect
()
->
back
();
}
public
function
novaVersao
(
Request
$request
){
$mytime
=
Carbon
::
now
(
'America/Recife'
);
$mytime
=
$mytime
->
toDateString
();
...
...
@@ -710,4 +727,9 @@ class TrabalhoController extends Controller
}
return
abort
(
404
);
}
public
function
baixarAnexoJustificativa
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
justificativaAutorizacaoEtica
);
}
}
app/Participante.php
View file @
56f62ac9
...
...
@@ -3,9 +3,12 @@
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
class
Participante
extends
Model
{
use
SoftDeletes
;
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
...
...
app/Providers/AppServiceProvider.php
View file @
56f62ac9
...
...
@@ -25,5 +25,6 @@ class AppServiceProvider extends ServiceProvider
public
function
boot
()
{
Validator
::
extend
(
'cpf'
,
'\App\Utils\CpfValidation@validate'
);
Validator
::
extend
(
'link_lattes'
,
'\App\Utils\LattesValidation@validate'
,
'Link inválido'
);
}
}
app/Utils/LattesValidation.php
0 → 100644
View file @
56f62ac9
<?php
namespace
App\Utils
;
class
LattesValidation
{
public
function
validate
(
$attribute
,
$value
,
$parameters
,
$validator
)
{
return
$this
->
isValidUrl
(
$value
);
}
function
isValidUrl
(
$url
)
{
// first do some quick sanity checks:
if
(
!
$url
||
!
is_string
(
$url
))
{
return
false
;
}
$url
=
filter_var
(
$url
,
FILTER_SANITIZE_URL
);
// Validate url
if
(
!
filter_var
(
$url
,
FILTER_VALIDATE_URL
))
{
return
false
;
}
if
(
parse_url
(
$url
)[
'host'
]
!=
'buscatextual.cnpq.br'
&&
parse_url
(
$url
)[
'host'
]
!=
'lattes.cnpq.br'
){
return
false
;
}
if
(
$this
->
getHttpResponseCode_using_getheaders
(
$url
)
!=
200
){
return
false
;
}
return
true
;
}
function
getHttpResponseCode_using_getheaders
(
$url
,
$followredirects
=
true
)
{
if
(
!
$url
||
!
is_string
(
$url
))
{
return
false
;
}
$headers
=
@
get_headers
(
$url
);
if
(
$headers
&&
is_array
(
$headers
))
{
if
(
$followredirects
)
{
$headers
=
array_reverse
(
$headers
);
}
foreach
(
$headers
as
$hline
)
{
if
(
preg_match
(
'/^HTTP\/\S+\s+([1-9][0-9][0-9])\s+.*/'
,
$hline
,
$matches
))
{
$code
=
$matches
[
1
];
return
$code
;
}
}
return
false
;
}
return
false
;
}
}
\ No newline at end of file
config/mail.php
View file @
56f62ac9
...
...
@@ -57,7 +57,7 @@ return [
'from'
=>
[
'address'
=>
env
(
'MAIL_FROM_ADDRESS'
,
'hello@example.com'
),
'name'
=>
env
(
'MAIL_FROM_NAME'
,
'
Example
'
),
'name'
=>
env
(
'MAIL_FROM_NAME'
,
'
Submeta
'
),
],
/*
...
...
database/migrations/2020_02_05_123115_create_arquivos_table.php
View file @
56f62ac9
...
...
@@ -17,6 +17,7 @@ class CreateArquivosTable extends Migration
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
$table
->
string
(
'nome'
);
$table
->
string
(
'titulo'
);
$table
->
integer
(
'versao'
)
->
nullable
();
$table
->
boolean
(
'versaoFinal'
)
->
nullable
();
$table
->
date
(
'data'
)
->
nullable
();
...
...
database/migrations/2020_05_21_020029_create_plano_trabalhos_table.php
deleted
100644 → 0
View file @
d65577db
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreatePlanoTrabalhosTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'plano_trabalhos'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'titulo'
);
$table
->
string
(
'anexoPlanoTrabalho'
);
$table
->
timestamps
();
$table
->
unsignedBigInteger
(
'trabalho_id'
);
$table
->
foreign
(
'trabalho_id'
)
->
references
(
'id'
)
->
on
(
'trabalhos'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'plano_trabalhos'
);
}
}
database/migrations/2020_05_23_054945_create_participantes_table.php
View file @
56f62ac9
...
...
@@ -25,6 +25,8 @@ class CreateParticipantesTable extends Migration
$table
->
unsignedBigInteger
(
'funcao_participante_id'
)
->
nullable
();
$table
->
foreign
(
'funcao_participante_id'
)
->
references
(
'id'
)
->
on
(
'funcao_participantes'
);
$table
->
softDeletes
();
});
}
...
...
resources/lang/en/validation.php
View file @
56f62ac9
...
...
@@ -61,7 +61,7 @@ return [
'required_unless'
=>
'O :attribute é necessário a menos que :other esteja em :values.'
,
'required_with'
=>
'O campo é obrigatório.'
,
'required_with_all'
=>
'O campo :attribute é obrigatório quando :values estão presentes.'
,
'required_without'
=>
'O campo
:attribute
é obrigatório
quando :values não está presente
.'
,
'required_without'
=>
'O campo é obrigatório.'
,
'required_without_all'
=>
'O campo :attribute é obrigatório quando nenhum destes estão presentes: :values.'
,
'same'
=>
':Attribute e :other devem ser iguais.'
,
'size'
=>
[
...
...
resources/views/administrador/editais.blade.php
View file @
56f62ac9
...
...
@@ -167,8 +167,8 @@
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('p
rojetos
.edital', ['id' =>
$evento->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Projetos
submetid
os
<
a
href
=
"{{ route('p
articipante
.edital', ['id' =>
$evento->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Meus
projet
os
</
a
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Visualizar
resultado
...
...
resources/views/auth/register.blade.php
View file @
56f62ac9
...
...
@@ -43,13 +43,23 @@
<
div
class
=
"form-group row"
>
<
div
class
=
"col-md-8"
>
<
label
for
=
"instituicao"
class
=
"col-form-label"
>
{{
__
(
'Instituição de Vínculo*'
)
}}
</
label
>
<
input
id
=
"instituicao"
type
=
"text"
class
=
"form-control @error('instituicao') is-invalid @enderror"
name
=
"instituicao"
value
=
"{{ old('instituicao') }}"
required
autocomplete
=
"instituicao"
autofocus
>
<
input
style
=
"display: none;"
id
=
"instituicao"
type
=
"text"
class
=
"form-control @error('instituicao') is-invalid @enderror"
name
=
"instituicao"
value
=
"{{ old('instituicao') }}"
placeholder
=
"Digite o nome da Instituição"
autocomplete
=
"instituicao"
autofocus
>
<
select
style
=
"display: inline"
onchange
=
"showInstituicao()"
class
=
"form-control @error('instituicaoSelect') is-invalid @enderror"
name
=
"instituicaoSelect"
id
=
"instituicaoSelect"
>
<
option
value
=
""
disabled
selected
hidden
>--
Instituição
--</
option
>
<
option
value
=
"UFAPE"
>
Universidade
Federal
do
Agreste
de
Pernambuco
-
UFAPE
</
option
>
<
option
>
Outra
</
option
>
</
select
>
@
error
(
'instituicao'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
@
error
(
'instituicaoSelect'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
<
strong
>
{{
$message
}}
</
strong
>
</
span
>
@
enderror
</
div
>
<
div
class
=
"col-md-4"
>
<
label
for
=
"celular"
class
=
"col-form-label"
>
{{
__
(
'Celular*'
)
}}
</
label
>
...
...
@@ -227,11 +237,11 @@
<
label
for
=
"nivel"
class
=
"col-form-label"
>
{{
__
(
'Nível*'
)
}}
</
label
>
<
select
name
=
"nivel"
id
=
"nivel"
class
=
"form-control @error('nivel') is-invalid @enderror"
>
<
option
value
=
""
disabled
selected
hidden
></
option
>
<
option
value
=
"2"
>
2
</
option
>
<
option
value
=
"1D"
>
1
D
</
option
>
<
option
value
=
"1A"
>
1
A
</
option
>
<
option
value
=
"1B"
>
1
B
</
option
>
<
option
value
=
"1C"
>
1
C
</
option
>
<
option
value
=
"1A"
>
1
A
</
option
>
<
option
value
=
"1D"
>
1
D
</
option
>
<
option
value
=
"2"
>
2
</
option
>
</
select
>
@
error
(
'nivel'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
...
...
@@ -299,10 +309,6 @@
}
}
window
.
onload
=
mudarNivel
();
window
.
onload
=
outroVinculo
();
window
.
onload
=
mudar
();
function
mudarNivel
()
{
var
bolsista
=
document
.
getElementById
(
'bolsistaProdutividade'
);
var
nivel
=
document
.
getElementById
(
'nivelInput'
);
...
...
@@ -313,5 +319,24 @@
nivel
.
style
.
display
=
"none"
;
}
}
function
showInstituicao
(){
var
instituicao
=
document
.
getElementById
(
'instituicao'
);
var
instituicaoSelect
=
document
.
getElementById
(
'instituicaoSelect'
);
if
(
instituicaoSelect
.
value
===
"Outra"
){
instituicaoSelect
.
style
.
display
=
"none"
;
instituicao
.
style
.
display
=
"inline"
;
}
}
function
onload
(){
mudarNivel
();
outroVinculo
();
mudar
();
showInstituicao
();
}
window
.
onload
=
onload
();
</
script
>
@
endsection
\ No newline at end of file
resources/views/evento/submeterTrabalho.blade.php
View file @
56f62ac9
...
...
@@ -177,19 +177,26 @@
<div class="
col
-
sm
-
6
">
<label for="
nomeTrabalh
o
" class="
col
-
form
-
label
">{{ __('Possui autorização do Comitê de Ética*:') }}</label>
<label for="
bota
o
" class="
col
-
form
-
label
@
error
(
'botao'
)
is
-
invalid
@
enderror
">{{ __('Possui autorização do Comitê de Ética*:') }}</label>
<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
">
<input type="
hidden
" id="
botao
" name="
botao
" value="">
@error('botao')
<span id="
botao
" class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
inline
">
<strong>{{
$message
}}</strong>
</span>
@enderror
<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
">
<input
disabled
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
">
<span
id="
comiteErro
"
class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
none
">
<strong>{{
$message
}}</strong>
</span>
@enderror
...
...
@@ -219,12 +226,12 @@
<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
">
<input type="
file
" class="
custom
-
file
-
input
@
error
(
'justificativaAutorizacaoEtica'
)
is
-
invalid
@
enderror
" id="
inputJustificativa
" aria-describedby="
inputGroupFileAddon01
" 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
">
<span
id="
justificativaErro
"
class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
none
">
<strong>{{
$message
}}</strong>
</span>
@enderror
...
...
@@ -424,14 +431,32 @@
e
.
preventDefault
();
$
(
'#inputEtica'
)
.
prop
(
'disabled'
,
false
);
$
(
'#inputJustificativa'
)
.
prop
(
'disabled'
,
true
);
exibirErro
(
'comite'
);
});
$
(
'#buttonNao'
)
.
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
'#inputEtica'
)
.
prop
(
'disabled'
,
true
);
$
(
'#inputJustificativa'
)
.
prop
(
'disabled'
,
false
);
console
.
log
(
'button nao'
);
exibirErro
(
'justificativa'
);
});
});
function
exibirErro
(
campo
){
console
.
log
(
"o campo "
+
campo
);
var
botao
=
document
.
getElementById
(
'botao'
);
botao
.
value
=
"sim"
;
var
comiteErro
=
document
.
getElementById
(
'comiteErro'
);
var
justificativaErro
=
document
.
getElementById
(
'justificativaErro'
);
if
(
campo
===
'comite'
){
comiteErro
.
style
.
display
=
"block"
;
justificativaErro
.
style
.
display
=
"none"
;
}
else
if
(
campo
===
'justificativa'
){
comiteErro
.
style
.
display
=
"none"
;
justificativaErro
.
style
.
display
=
"block"
;
}
}
// Remover Coautor
// function addModalidade(areaId) {
...
...
resources/views/layouts/app.blade.php
View file @
56f62ac9
...
...
@@ -115,6 +115,7 @@
{{ __('Perfil Coordenador') }}
</a>
@endif
@if(Auth::user()->avaliadors != null)
<a
class=
"dropdown-item"
href=
"{{ route('avaliador.index') }}"
>
<img
src=
"{{asset('img/icons/file-alt-regular-black.svg')}}"
alt=
""
>
...
...
resources/views/participante/editais.blade.php
deleted
100644 → 0
View file @
d65577db
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
style
=
"margin-top: 100px;"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
h3
>
Meus
Editais
</
h3
>
</
div
>
</
div
>
</
div
>
<
hr
>
@
if
(
auth
()
->
user
()
->
tipo
===
"participante"
)
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
do
Edital
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
Data
de
Criação
</
th
>
<
th
scope
=
"col"
>
Baixar
edital
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$eventos
as
$evento
)
<
tr
>
<
td
>
<
a
href
=
"{{ route('evento.visualizar',['id'=>
$evento->id
]) }}"
class
=
"visualizarEvento"
>
{{
$evento
->
nome
}}
</
a
>
</
td
>
<
td
></
td
>
<
td
>
{{
$evento
->
created_at
}}
</
td
>
<
td
style
=
"text-align: center"
>
<
a
href
=
"{{ route('baixar.edital', ['id' =>
$evento->id
]) }}"
>
<
img
src
=
"
{
{asset('img/icons/file-download-solid.svg')}
}
"
width
=
"15px"
>
</
a
>
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
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"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('projetos.edital', ['id' =>
$evento->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Projetos
submetidos
</
a
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Visualizar
resultado
</
a
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Resultado
preeliminar
</
a
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
Resultado
final
</
a
>
--
}}
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
@
endif
</
div
>
\ No newline at end of file
resources/views/participante/projetos.blade.php
0 → 100644
View file @
56f62ac9
@
extends
(
'layouts.app'
)
@
section
(
'content'
)
<
div
class
=
"container"
style
=
"margin-top: 100px;"
>
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
h3
>
Projetos
do
edital
{{
$edital
->
nome
}}
</
h3
>
<
h6
style
=
"color: rgb(4, 78, 4);"
>
Submissão
irá
até
o
dia
{{
date
(
'd-m-Y'
,
strtotime
(
$edital
->
fimSubmissao
))
}}
</
h6
>
</
div
>
<
div
class
=
"col-sm-2"
>
<!--
Se
usuário
não
é
proponente
,
redirecionar
para
view
de
cadastro
-->
@
if
(
Auth
::
user
()
->
proponentes
==
null
)
<
a
href
=
"{{ route('proponente.create' )}}"
class
=
"btn btn-primary"
>
Criar
projeto
</
a
>
@
else
<
a
href
=
"{{ route('trabalho.index', ['id' =>
$edital->id
] )}}"
class
=
"btn btn-primary"
>
Criar
projeto
</
a
>
@
endif
</
div
>
</
div
>
</
div
>
<
hr
>
<
table
class
=
"table table-bordered"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Nome
do
projeto
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
Data
de
Criação
</
th
>
<
th
scope
=
"col"
>
Opção
</
th
>
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$projetos
as
$projeto
)
<
tr
>
<
td
>
{{
$projeto
->
titulo
}}
</
td
>
@
if
(
$projeto
->
status
==
'Avaliado'
)
<
td
style
=
"color: rgb(6, 85, 6)"
>
Avaliado
</
td
>
@
elseif
(
$projeto
->
status
==
'Submetido'
)
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
@
endif
<
td
>
{{
date
(
'd-m-Y'
,
strtotime
(
$projeto
->
updated_at
))
}}
</
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
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"
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
"{{ route('trabalho.show', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
Visualizar
projeto
</
a
>
@
if
(
$projeto
->
status
==
'Submetido'
)
<
a
href
=
"{{ route('trabalho.excluirParticipante', ['id' =>
$projeto->id
]) }}"
class
=
"dropdown-item"
style
=
"text-align: center"
>
Sair
do
projeto
</
a
>
@
endif
</
div
>
</
div
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
endsection
@
section
(
'javascript'
)
<
script
>
</
script
>
@
endsection
\ No newline at end of file
resources/views/projeto/visualizar.blade.php
View file @
56f62ac9
This diff is collapsed.
Click to expand it.
resources/views/proponente/cadastro.blade.php
View file @
56f62ac9
...
...
@@ -154,11 +154,11 @@
<
label
for
=
"nivel"
class
=
"col-form-label"
>
{{
__
(
'Nível*'
)
}}
</
label
>
<
select
name
=
"nivel"
id
=
"nivel"
class
=
"form-control @error('nivel') is-invalid @enderror"
>
<
option
value
=
""
disabled
selected
hidden
></
option
>
<
option
value
=
"2"
>
2
</
option
>
<
option
value
=
"1D"
>
1
D
</
option
>
<
option
value
=
"1A"
>
1
A
</
option
>
<
option
value
=
"1B"
>
1
B
</
option
>
<
option
value
=
"1C"
>
1
C
</
option
>
<
option
value
=
"1A"
>
1
A
</
option
>
<
option
value
=
"1D"
>
1
D
</
option
>
<
option
value
=
"2"
>
2
</
option
>
</
select
>
@
error
(
'nivel'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
>
...
...
@@ -236,10 +236,13 @@
}
else
{
nivel
.
style
.
display
=
"none"
;
}
console
.
log
(
"a"
);
}
window
.
onload
=
mudarNivel
();
window
.
onload
=
outroVinculo
();
function
onload
(){
mudarNivel
();
outroVinculo
();
}
window
.
onload
=
onload
();
</
script
>
@
endsection
\ No newline at end of file
Prev
1
2
Next
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