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
e3e9b55f
Unverified
Commit
e3e9b55f
authored
Aug 19, 2022
by
GuilhermeGz
Committed by
GitHub
Aug 19, 2022
Browse files
Merge pull request #562 from S-Nathalia/master
Resolucao das rotas para proponente
parents
747135ac
deee6a98
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
e3e9b55f
...
@@ -574,9 +574,13 @@ class AdministradorController extends Controller
...
@@ -574,9 +574,13 @@ class AdministradorController extends Controller
return
redirect
(
route
(
'admin.usuarios'
)
)
->
with
([
'mensagem'
=>
'Usuário atualizado com sucesso'
]);
return
redirect
(
route
(
'admin.usuarios'
)
)
->
with
([
'mensagem'
=>
'Usuário atualizado com sucesso'
]);
}
}
public
function
destroy
(
$id
)
{
public
function
verify_correlations
(
$id
){
$user
=
User
::
find
(
$id
);
$user
=
User
::
find
(
$id
);
}
public
function
destroy
(
$id
)
{
$user
=
User
::
find
(
$id
);
$adminResp
=
AdministradorResponsavel
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$adminResp
=
AdministradorResponsavel
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
...
...
app/Http/Controllers/ArquivoController.php
View file @
e3e9b55f
...
@@ -132,6 +132,11 @@ class ArquivoController extends Controller
...
@@ -132,6 +132,11 @@ class ArquivoController extends Controller
}
}
$arquivos
=
[];
$arquivos
=
[];
if
(
Auth
::
user
()
->
id
!=
$trabalho
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
foreach
(
$participantes
as
$participante
){
foreach
(
$participantes
as
$participante
){
array_push
(
$arquivos
,
$participante
->
planoTrabalho
);
array_push
(
$arquivos
,
$participante
->
planoTrabalho
);
}
}
...
...
app/Http/Controllers/ParticipanteController.php
View file @
e3e9b55f
...
@@ -96,6 +96,10 @@ class ParticipanteController extends Controller
...
@@ -96,6 +96,10 @@ class ParticipanteController extends Controller
$trabalho
=
Trabalho
::
find
(
$request
->
projeto_id
);
$trabalho
=
Trabalho
::
find
(
$request
->
projeto_id
);
$participantes
=
$trabalho
->
participantes
;
$participantes
=
$trabalho
->
participantes
;
if
(
Auth
::
user
()
->
id
!=
$trabalho
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
return
view
(
'documentacaoComplementar.listar'
)
->
with
([
'participantes'
=>
$participantes
,
'trabalho'
=>
$trabalho
]);
return
view
(
'documentacaoComplementar.listar'
)
->
with
([
'participantes'
=>
$participantes
,
'trabalho'
=>
$trabalho
]);
}
}
...
...
app/Http/Controllers/ProponenteController.php
View file @
e3e9b55f
...
@@ -110,7 +110,8 @@ class ProponenteController extends Controller
...
@@ -110,7 +110,8 @@ class ProponenteController extends Controller
}
}
public
function
projetosEdital
(
$id
)
{
public
function
projetosEdital
(
$id
)
{
$edital
=
Evento
::
find
(
$id
);
$edital
=
Evento
::
find
(
$id
);
if
(
Auth
::
user
()
->
proponentes
!=
null
){
if
(
Auth
::
user
()
->
proponentes
!=
null
){
$projetos
=
Trabalho
::
where
(
'evento_id'
,
'='
,
$id
)
->
where
(
'proponente_id'
,
Auth
::
user
()
->
proponentes
->
id
)
->
orderBy
(
'titulo'
)
->
paginate
(
10
);
$projetos
=
Trabalho
::
where
(
'evento_id'
,
'='
,
$id
)
->
where
(
'proponente_id'
,
Auth
::
user
()
->
proponentes
->
id
)
->
orderBy
(
'titulo'
)
->
paginate
(
10
);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
...
...
app/Http/Controllers/TrabalhoController.php
View file @
e3e9b55f
...
@@ -371,16 +371,6 @@ class TrabalhoController extends Controller
...
@@ -371,16 +371,6 @@ class TrabalhoController extends Controller
public
function
show
(
$id
)
public
function
show
(
$id
)
{
{
// $projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
// if(Auth::user()->tipo == 'administrador'){
// $projeto = Trabalho::find($id);
// }
// if(!$projeto){
// // $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
// return back()->withErrors(['Proposta não encontrada!']);
// }
$projeto
=
Trabalho
::
find
(
$id
);
$projeto
=
Trabalho
::
find
(
$id
);
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
return
redirect
()
->
back
();
...
@@ -1564,6 +1554,10 @@ class TrabalhoController extends Controller
...
@@ -1564,6 +1554,10 @@ class TrabalhoController extends Controller
$projeto
=
Trabalho
::
find
(
$request
->
projeto_id
);
$projeto
=
Trabalho
::
find
(
$request
->
projeto_id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
$participantes
=
$projeto
->
participantes
;
$participantes
=
$projeto
->
participantes
;
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$desligamentosProjeto
=
Desligamento
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$desligamentosProjeto
=
Desligamento
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
...
...
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