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
"database/seeders/DatabaseSeeder.php" did not exist on "fb5175510a5a00d072a395c12a190713b78d479f"
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
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
c09236c1
...
@@ -391,6 +391,7 @@ class TrabalhoController extends Controller
...
@@ -391,6 +391,7 @@ class TrabalhoController extends Controller
$participantesUsersIds
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
select
(
'user_id'
)
->
get
();
$participantesUsersIds
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
select
(
'user_id'
)
->
get
();
$users
=
User
::
whereIn
(
'id'
,
$participantesUsersIds
)
->
get
();
$users
=
User
::
whereIn
(
'id'
,
$participantesUsersIds
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
$proponente
=
Proponente
::
where
(
'user_id'
,
$projeto
->
proponente
->
user_id
)
->
first
();
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participanteSubstituido_id'
,
$projeto
->
participantes
->
pluck
(
'id'
))
->
get
());
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participanteSubstituido_id'
,
$projeto
->
participantes
->
pluck
(
'id'
))
->
get
());
...
@@ -413,6 +414,7 @@ class TrabalhoController extends Controller
...
@@ -413,6 +414,7 @@ class TrabalhoController extends Controller
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'areasTematicas'
=>
$areasTematicas
,
'areasTematicas'
=>
$areasTematicas
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'proponente'
=>
$proponente
,
]);
]);
}
}
...
@@ -480,6 +482,7 @@ class TrabalhoController extends Controller
...
@@ -480,6 +482,7 @@ class TrabalhoController extends Controller
'estados'
=>
$this
->
estados
,
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
'areaTematicas'
=>
$areaTematicas
,
'listaOds'
=>
$ODS
,
'listaOds'
=>
$ODS
,
'proponente'
=>
$proponente
,
]);
]);
}
}
...
...
app/Http/Requests/UpdateTrabalho.php
View file @
c09236c1
...
@@ -6,6 +6,7 @@ use App\Arquivo;
...
@@ -6,6 +6,7 @@ use App\Arquivo;
use
App\Evento
;
use
App\Evento
;
use
App\Participante
;
use
App\Participante
;
use
App\Trabalho
;
use
App\Trabalho
;
use
App\Proponente
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Foundation\Http\FormRequest
;
use
Illuminate\Foundation\Http\FormRequest
;
...
@@ -64,14 +65,15 @@ class UpdateTrabalho extends FormRequest
...
@@ -64,14 +65,15 @@ class UpdateTrabalho extends FormRequest
if
(
$evento
->
tipo
!=
"PIBEX"
)
{
if
(
$evento
->
tipo
!=
"PIBEX"
)
{
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
$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'
];
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
}
}
}
}
}
else
{
}
else
{
$rules
[
'anexoPlanoTrabalho'
]
=
[
'required'
];
$proponente
=
Proponente
::
find
(
$projeto
->
proponente_id
);
$rules
[
'nomePlanoTrabalho'
]
=
[
'required'
,
'string'
];
$rules
[
'anexoPlanoTrabalho'
]
=
[
Rule
::
requiredIf
(
$proponente
->
planoTrabalho
==
null
)];
$rules
[
'nomePlanoTrabalho'
]
=
[
Rule
::
requiredIf
(
$proponente
->
planoTrabalho
->
titulo
==
null
),
'string'
];
}
}
// dd($this->all());
// 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