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
82c0b1e1
Commit
82c0b1e1
authored
Aug 15, 2022
by
GuilhermeGz
Browse files
Merge branch 'master' of
https://github.com/GuilhermeGz/submeta
parents
b8a5b964
e14bff58
Changes
6
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
82c0b1e1
...
@@ -130,9 +130,9 @@ class AdministradorController extends Controller
...
@@ -130,9 +130,9 @@ class AdministradorController extends Controller
}
}
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
$aux
=
count
(
Arquivo
::
whereIn
(
'participante
I
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participante
Substituido_i
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
$flagSubstituicao
=
1
;
$flagSubstituicao
=
1
;
if
(
$aux
!=
count
(
$trabalho
->
participantes
->
pluck
(
'id'
))
){
if
(
$aux
!=
0
){
$flagSubstituicao
=
-
1
;
$flagSubstituicao
=
-
1
;
}
}
...
...
app/Http/Controllers/ArquivoController.php
View file @
82c0b1e1
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Arquivo
;
use
App\Arquivo
;
use
App\Notificacao
;
use
App\Notificacao
;
use
App\Substituicao
;
use
App\Trabalho
;
use
App\Trabalho
;
use
App\User
;
use
App\User
;
use
Auth
;
use
Auth
;
...
@@ -125,8 +126,8 @@ class ArquivoController extends Controller
...
@@ -125,8 +126,8 @@ class ArquivoController extends Controller
$participantes
=
$trabalho
->
participantes
;
$participantes
=
$trabalho
->
participantes
;
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
$aux
=
count
(
Arquivo
::
whereIn
(
'participante
I
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participante
Substituido_i
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
if
(
$aux
!=
count
(
$trabalho
->
participantes
->
pluck
(
'id'
))
){
if
(
$aux
!=
0
){
return
redirect
()
->
back
()
->
withErrors
(
"A proposta "
.
$trabalho
->
titulo
.
" possui substituições pendentes"
);
return
redirect
()
->
back
()
->
withErrors
(
"A proposta "
.
$trabalho
->
titulo
.
" possui substituições pendentes"
);
}
}
...
...
app/Http/Controllers/AvaliadorController.php
View file @
82c0b1e1
...
@@ -9,6 +9,7 @@ use App\GrandeArea;
...
@@ -9,6 +9,7 @@ use App\GrandeArea;
use
App\ParecerInterno
;
use
App\ParecerInterno
;
use
App\Participante
;
use
App\Participante
;
use
App\SubArea
;
use
App\SubArea
;
use
App\Substituicao
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Auth
;
use
App\Trabalho
;
use
App\Trabalho
;
...
@@ -109,8 +110,8 @@ class AvaliadorController extends Controller
...
@@ -109,8 +110,8 @@ class AvaliadorController extends Controller
$evento
=
Evento
::
find
(
$request
->
evento
);
$evento
=
Evento
::
find
(
$request
->
evento
);
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
$aux
=
count
(
Arquivo
::
whereIn
(
'participante
I
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participante
Substituido_i
d'
,
$trabalho
->
participantes
->
pluck
(
'id'
))
->
get
());
if
(
$aux
!=
count
(
$trabalho
->
participantes
->
pluck
(
'id'
))
){
if
(
$aux
!=
0
){
return
redirect
()
->
back
()
->
withErrors
(
"A proposta "
.
$trabalho
->
titulo
.
" possui substituições pendentes"
);
return
redirect
()
->
back
()
->
withErrors
(
"A proposta "
.
$trabalho
->
titulo
.
" possui substituições pendentes"
);
}
}
...
...
app/Http/Controllers/TrabalhoController.php
View file @
82c0b1e1
...
@@ -52,6 +52,7 @@ use App\SolicitacaoCertificado;
...
@@ -52,6 +52,7 @@ use App\SolicitacaoCertificado;
use
App\SolicitacaoParticipante
;
use
App\SolicitacaoParticipante
;
use
App\Substituicao
;
use
App\Substituicao
;
use
Illuminate\Support\Facades\Notification
;
use
Illuminate\Support\Facades\Notification
;
use
App\Desligamento
;
class
TrabalhoController
extends
Controller
class
TrabalhoController
extends
Controller
{
{
...
@@ -396,9 +397,9 @@ class TrabalhoController extends Controller
...
@@ -396,9 +397,9 @@ class TrabalhoController extends Controller
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
$arquivos
=
Arquivo
::
where
(
'trabalhoId'
,
$id
)
->
get
();
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
$aux
=
count
(
Arquivo
::
whereIn
(
'participante
I
d'
,
$projeto
->
participantes
->
pluck
(
'id'
))
->
get
());
$aux
=
count
(
Substituicao
::
where
(
'status'
,
'Em Aguardo'
)
->
whereIn
(
'participante
Substituido_i
d'
,
$projeto
->
participantes
->
pluck
(
'id'
))
->
get
());
$flagSubstituicao
=
1
;
$flagSubstituicao
=
1
;
if
(
$aux
!=
count
(
$projeto
->
participantes
->
pluck
(
'id'
))
){
if
(
$aux
!=
0
){
$flagSubstituicao
=
-
1
;
$flagSubstituicao
=
-
1
;
}
}
...
@@ -1565,6 +1566,7 @@ class TrabalhoController extends Controller
...
@@ -1565,6 +1566,7 @@ class TrabalhoController extends Controller
$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
();
return
view
(
'administrador.substituirParticipante'
)
->
with
([
'projeto'
=>
$projeto
,
return
view
(
'administrador.substituirParticipante'
)
->
with
([
'projeto'
=>
$projeto
,
'edital'
=>
$edital
,
'edital'
=>
$edital
,
...
@@ -1572,6 +1574,7 @@ class TrabalhoController extends Controller
...
@@ -1572,6 +1574,7 @@ class TrabalhoController extends Controller
'substituicoesProjeto'
=>
$substituicoesProjeto
,
'substituicoesProjeto'
=>
$substituicoesProjeto
,
'estados'
=>
$this
->
estados
,
'estados'
=>
$this
->
estados
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'desligamentosProjeto'
=>
$desligamentosProjeto
,
]);
]);
}
}
...
...
app/Http/Requests/UpdateTrabalho.php
View file @
82c0b1e1
...
@@ -2,8 +2,11 @@
...
@@ -2,8 +2,11 @@
namespace
App\Http\Requests
;
namespace
App\Http\Requests
;
use
App\Arquivo
;
use
App\Evento
;
use
App\Evento
;
use
App\Participante
;
use
App\Trabalho
;
use
App\Trabalho
;
use
App\User
;
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
;
...
@@ -33,6 +36,14 @@ class UpdateTrabalho extends FormRequest
...
@@ -33,6 +36,14 @@ class UpdateTrabalho extends FormRequest
if
(
$this
->
has
(
'marcado'
)){
if
(
$this
->
has
(
'marcado'
)){
foreach
(
$this
->
get
(
'marcado'
)
as
$key
=>
$value
)
{
foreach
(
$this
->
get
(
'marcado'
)
as
$key
=>
$value
)
{
if
(
intval
(
$value
)
==
$key
){
if
(
intval
(
$value
)
==
$key
){
$usuario
=
User
::
where
(
'email'
,
$this
->
email
[
$value
])
->
first
();
// if(isset($usuario)){
// $participante = Participante::where('user_id', $usuario->id)->where('trabalho_id', $projeto->id)->first();
// $arquivo = Arquivo::where('trabalhoId', $projeto->id)->where('participanteId', $participante->id)->first();
// }
//user
//user
$rules
[
'name.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'name.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'email.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'email.'
.
$value
]
=
[
'required'
,
'string'
];
...
@@ -58,8 +69,14 @@ class UpdateTrabalho extends FormRequest
...
@@ -58,8 +69,14 @@ class UpdateTrabalho extends FormRequest
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
}
}
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
'required'
,
'mimes:pdf'
];
if
(
isset
(
$usuario
)){
$participante
=
Participante
::
where
(
'user_id'
,
$usuario
->
id
)
->
where
(
'trabalho_id'
,
$projeto
->
id
)
->
first
();
$arquivo
=
Arquivo
::
where
(
'trabalhoId'
,
$projeto
->
id
)
->
where
(
'participanteId'
,
$participante
->
id
)
->
first
();
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
Rule
::
requiredIf
(
$arquivo
==
null
),
'mimes:pdf'
];
}
else
{
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
'required'
,
'mimes:pdf'
];
}
}
}
}
}
...
...
resources/views/administrador/substituirParticipante.blade.php
View file @
82c0b1e1
...
@@ -39,10 +39,11 @@
...
@@ -39,10 +39,11 @@
<
div
class
=
"col-2 align-self-center"
>
<
div
class
=
"col-2 align-self-center"
>
<
div
class
=
"row justify-content-around"
>
<
div
class
=
"row justify-content-around"
>
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalTestSubParticipante
{
{$participante->id}
}
"
class
=
"button"
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalTestSubParticipante
{
{$participante->id}
}
"
class
=
"button"
@
if
((
$substituicoesProjeto
->
first
()
!=
null
)
&&
(
$substituicoesProjeto
->
first
()
->
status
==
'Em Aguardo'
))
style
=
"pointer-events: none; cursor: default;"
@
endif
>
@
if
((
$substituicoesProjeto
->
first
()
!=
null
)
&&
(
(
$substituicoesProjeto
->
first
()
->
status
==
'Em Aguardo'
)
||
(
$desligamentosProjeto
->
first
()
->
status
==
1
))
)
style
=
"pointer-events: none; cursor: default;"
@
endif
>
<
i
class
=
"fas fa-exchange-alt fa-2x"
></
i
></
a
>
<
i
class
=
"fas fa-exchange-alt fa-2x"
></
i
></
a
>
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalVizuParticipante
{
{$participante->id}
}
"
class
=
"button"
><
i
class
=
"far fa-eye fa-2x"
></
i
></
a
>
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalVizuParticipante
{
{$participante->id}
}
"
class
=
"button"
><
i
class
=
"far fa-eye fa-2x"
></
i
></
a
>
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalSolicitarDesligamentoParticipante
{
{$participante->id}
}
"
class
=
"button"
>
Solicitar
desligamento
</
a
>
<
a
href
=
""
data
-
toggle
=
"modal"
data
-
target
=
"#modalSolicitarDesligamentoParticipante
{
{$participante->id}
}
"
class
=
"button"
@
if
((
$substituicoesProjeto
->
first
()
!=
null
)
&&
((
$substituicoesProjeto
->
first
()
->
status
==
'Em Aguardo'
)
||
(
$desligamentosProjeto
->
first
()
->
status
==
1
)))
style
=
"pointer-events: none; cursor: default;"
@
endif
>
Solicitar
desligamento
</
a
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
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