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
c09236c1
Commit
c09236c1
authored
Nov 25, 2022
by
Lucas Henrique
Browse files
Adicionando proponente no redirecionamento dos métodos de exibir e editar um projeto
parent
852f83f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
c09236c1
...
...
@@ -391,6 +391,7 @@ class TrabalhoController extends Controller
$participantesUsersIds
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
select
(
'user_id'
)
->
get
();
$users
=
User
::
whereIn
(
'id'
,
$participantesUsersIds
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
$proponente
=
Proponente
::
where
(
'user_id'
,
$projeto
->
proponente
->
user_id
)
->
first
();
// Verficação de pendencia de substituição
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participanteSubstituido_id'
,
$projeto
->
participantes
->
pluck
(
'id'
))
->
get
());
...
...
@@ -413,6 +414,7 @@ class TrabalhoController extends Controller
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'areasTematicas'
=>
$areasTematicas
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'proponente'
=>
$proponente
,
]);
}
...
...
@@ -480,6 +482,7 @@ class TrabalhoController extends Controller
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
'listaOds'
=>
$ODS
,
'proponente'
=>
$proponente
,
]);
}
...
...
app/Http/Requests/UpdateTrabalho.php
View file @
c09236c1
...
...
@@ -6,6 +6,7 @@ use App\Arquivo;
use
App\Evento
;
use
App\Participante
;
use
App\Trabalho
;
use
App\Proponente
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Foundation\Http\FormRequest
;
...
...
@@ -64,14 +65,15 @@ class UpdateTrabalho extends FormRequest
if
(
$evento
->
tipo
!=
"PIBEX"
)
{
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
}
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
'
required
'
];
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
Rule
::
required
If
(
$participante
->
planoTrabalho
==
null
)
];
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
}
}
}
else
{
$rules
[
'anexoPlanoTrabalho'
]
=
[
'required'
];
$rules
[
'nomePlanoTrabalho'
]
=
[
'required'
,
'string'
];
$proponente
=
Proponente
::
find
(
$projeto
->
proponente_id
);
$rules
[
'anexoPlanoTrabalho'
]
=
[
Rule
::
requiredIf
(
$proponente
->
planoTrabalho
==
null
)];
$rules
[
'nomePlanoTrabalho'
]
=
[
Rule
::
requiredIf
(
$proponente
->
planoTrabalho
->
titulo
==
null
),
'string'
];
}
// dd($this->all());
...
...
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