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
6ee26c41
Unverified
Commit
6ee26c41
authored
Aug 20, 2022
by
GuilhermeGz
Committed by
GitHub
Aug 20, 2022
Browse files
Merge pull request #565 from S-Nathalia/master
Resolucao de acesso a rotas para coordenador e admin
parents
2e3ac861
a69adb0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
6ee26c41
...
...
@@ -10,3 +10,4 @@ Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
submeta.code-workspace
app/Http/Controllers/AdministradorController.php
View file @
6ee26c41
...
...
@@ -67,8 +67,15 @@ class AdministradorController extends Controller
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
=
$evento
->
trabalhos
->
whereNotIn
(
'status'
,
'rascunho'
);
// $trabalhosAvaliados = $evento->trabalhos->Where('status', 'avaliado');
// $trabalhos = $trabalhosSubmetidos->merge($trabalhosAvaliados);
$coordenador_id_evento
=
$evento
->
coordenadorId
;
$coordenador_id
=
CoordenadorComissao
::
find
(
$coordenador_id_evento
);
$user
=
Auth
::
user
();
if
((
Auth
::
user
()
->
id
!=
$coordenador_id
->
user_id
)
&&
(
$user
->
tipo
!=
'administrador'
)){
return
redirect
()
->
back
();
}
return
view
(
'administrador.projetos'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
]);
}
...
...
@@ -166,6 +173,14 @@ class AdministradorController extends Controller
public
function
showResultados
(
Request
$request
){
//dd($request);
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$coordenador_id_evento
=
$evento
->
coordenadorId
;
$coordenador_id
=
CoordenadorComissao
::
find
(
$coordenador_id_evento
);
$user
=
Auth
::
user
();
if
((
Auth
::
user
()
->
id
!=
$coordenador_id
->
user_id
)
&&
(
$user
->
tipo
!=
'administrador'
)){
return
redirect
()
->
back
();
}
// Com cotas
if
(
$evento
->
cotaDoutor
)
{
// Ampla Concorrencia
...
...
@@ -574,10 +589,6 @@ class AdministradorController extends Controller
return
redirect
(
route
(
'admin.usuarios'
)
)
->
with
([
'mensagem'
=>
'Usuário atualizado com sucesso'
]);
}
public
function
verify_correlations
(
$id
){
$user
=
User
::
find
(
$id
);
}
public
function
destroy
(
$id
)
{
$user
=
User
::
find
(
$id
);
...
...
@@ -603,19 +614,32 @@ class AdministradorController extends Controller
public
function
atribuir
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
//dd($request->all());
$coordenador_id_evento
=
$evento
->
coordenadorId
;
$coordenador_id
=
CoordenadorComissao
::
find
(
$coordenador_id_evento
);
$user
=
Auth
::
user
();
if
((
Auth
::
user
()
->
id
!=
$coordenador_id
->
user_id
)
&&
(
$user
->
tipo
!=
'administrador'
)){
return
redirect
()
->
back
();
}
return
view
(
'administrador.atribuirAvaliadores'
,
[
'evento'
=>
$evento
]);
}
public
function
selecionar
(
Request
$request
){
$user
=
Auth
::
user
();
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$coordenador_id_evento
=
$evento
->
coordenadorId
;
$coordenador_id
=
CoordenadorComissao
::
find
(
$coordenador_id_evento
);
$grandeAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$avalSelecionados
=
$evento
->
avaliadors
;
$avalNaoSelecionadosId
=
$evento
->
avaliadors
->
pluck
(
'id'
);
$avaliadores
=
Avaliador
::
whereNotIn
(
'id'
,
$avalNaoSelecionadosId
)
->
get
();
$trabalhos
=
$evento
->
trabalhos
->
whereNotIn
(
'status'
,
'rascunho'
);
//dd($avaliadores);
if
((
Auth
::
user
()
->
id
!=
$coordenador_id
->
user_id
)
&&
(
$user
->
tipo
!=
'administrador'
)){
return
redirect
()
->
back
();
}
return
view
(
'administrador.selecionarAvaliadores'
,
[
'evento'
=>
$evento
,
...
...
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