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
6b5e5824
"app/Curso.php" did not exist on "3bc67fa99eb68bef2c89b18b6b83326b60a38ecf"
Commit
6b5e5824
authored
Aug 22, 2022
by
GuilhermeGz
Browse files
Tela de atribuição de avaliador: alterado modo de adicionar avaliador, listagem, remoção e acesso
parent
43ca658e
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
6b5e5824
...
@@ -652,12 +652,11 @@ class AdministradorController extends Controller
...
@@ -652,12 +652,11 @@ class AdministradorController extends Controller
public
function
projetos
(
Request
$request
){
public
function
projetos
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
=
$evento
->
trabalhos
->
where
(
'status'
,
'submetido'
)
;
$trabalhos
=
$evento
->
trabalhos
;
$grandesAreas
=
GrandeArea
::
orderBy
(
'nome'
)
->
get
();
$avaliadores
=
$evento
->
avaliadors
;
$avaliadores
=
$evento
->
avaliadors
;
foreach
(
$trabalhos
as
$key
=>
$trabalho
)
{
foreach
(
$trabalhos
as
$key
=>
$trabalho
)
{
$avalSelecionadosId
=
$trabalho
->
avaliadors
->
pluck
(
'id'
);
$avalSelecionadosId
=
$trabalho
->
avaliadors
->
pluck
(
'id'
);
$avalProjeto
=
Avaliador
::
whereNotIn
(
'id'
,
$avalSelecionadosId
)
->
get
();
$avalProjeto
=
Avaliador
::
whereNotIn
(
'id'
,
$avalSelecionadosId
)
->
get
();
$trabalho
->
aval
=
$avalProjeto
;
$trabalho
->
aval
=
$avalProjeto
;
...
@@ -670,7 +669,8 @@ class AdministradorController extends Controller
...
@@ -670,7 +669,8 @@ class AdministradorController extends Controller
return
view
(
'administrador.selecionarProjetos'
,
[
return
view
(
'administrador.selecionarProjetos'
,
[
'evento'
=>
$evento
,
'evento'
=>
$evento
,
'trabalhos'
=>
$trabalhos
,
'trabalhos'
=>
$trabalhos
,
'avaliadores'
=>
$avaliadores
'avaliadores'
=>
$avaliadores
,
'grandesAreas'
=>
$grandesAreas
]);
]);
}
}
...
...
resources/views/administrador/analisarProposta.blade.php
View file @
6b5e5824
...
@@ -871,7 +871,7 @@
...
@@ -871,7 +871,7 @@
@
csrf
@
csrf
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
div
class
=
"form-group"
>
<
div
class
=
"form-group
align-items-start
"
>
<
div
class
=
"row"
style
=
"margin-left: 2px;margin-bottom: 1px"
>
<
div
class
=
"row"
style
=
"margin-left: 2px;margin-bottom: 1px"
>
<
div
class
=
"col-md-4"
>
<
div
class
=
"col-md-4"
>
...
...
resources/views/administrador/selecionarProjetos.blade.php
View file @
6b5e5824
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<
tbody
id
=
"projetos"
>
<
tbody
id
=
"projetos"
>
@
foreach
(
$trabalhos
as
$trabalho
)
@
foreach
(
$trabalhos
as
$trabalho
)
<
tr
>
<
tr
>
<
td
style
=
"max-width:100px; overflow-x:
scroll
; text-overflow:ellipsis"
>
{{
$trabalho
->
titulo
}}
</
td
>
<
td
style
=
"max-width:100px; overflow-x:
auto
; text-overflow:ellipsis"
>
{{
$trabalho
->
titulo
}}
</
td
>
<
td
>
{{
App\Area
::
find
(
$trabalho
->
area_id
)
->
nome
}}
</
td
>
<
td
>
{{
App\Area
::
find
(
$trabalho
->
area_id
)
->
nome
}}
</
td
>
<
td
>
{{
$trabalho
->
proponente
->
user
->
name
}}
</
td
>
<
td
>
{{
$trabalho
->
proponente
->
user
->
name
}}
</
td
>
<
td
style
=
"text-align:center"
>
<
td
style
=
"text-align:center"
>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</
button
>
</
button
>
<!--
Modal
-->
<!--
Modal
-->
<
div
class
=
"modal fade"
id
=
"exampleModalCenter{{
$trabalho->id
}}"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal fade"
id
=
"exampleModalCenter{{
$trabalho->id
}}"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalCenterTitle"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-dialog modal-dialog-centered
modal-xl
"
role
=
"document"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-content modal-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
div
class
=
"modal-header modal-header-submeta"
>
<
h5
class
=
"modal-title titulo-table"
id
=
"exampleModalLongTitle"
>
Selecione
o
(
s
)
avaliador
(
es
)
</
h5
>
<
h5
class
=
"modal-title titulo-table"
id
=
"exampleModalLongTitle"
>
Selecione
o
(
s
)
avaliador
(
es
)
</
h5
>
...
@@ -73,18 +73,111 @@
...
@@ -73,18 +73,111 @@
@
csrf
@
csrf
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"trabalho_id"
value
=
"{{
$trabalho->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
input
type
=
"hidden"
name
=
"evento_id"
value
=
"{{
$evento->id
}}"
>
<
div
class
=
"form-group"
>
<
div
class
=
"form-group text-left"
>
<
label
for
=
"exampleFormControlSelect2"
>
Selecione
o
(
s
)
avaliador
(
es
)
para
esse
projeto
</
label
>
<
div
class
=
"row"
style
=
"margin-left: 2px;margin-bottom: 1px"
>
<
select
name
=
"avaliadores_id[]"
multiple
class
=
"form-control"
id
=
"exampleFormControlSelect2"
required
>
<
div
class
=
"col-md-4"
>
<
label
for
=
"exampleFormControlSelect2"
style
=
"font-size: 16px;"
>
Selecione
o
(
s
)
avaliador
(
es
)
para
esse
projeto
</
label
>
</
div
>
<
div
class
=
"col-md-3"
style
=
"text-align: center;overflow-y: auto;overflow-x: auto"
>
<
select
class
=
"form-control"
id
=
"grandeArea"
name
=
"grande_area_id"
onchange
=
"areasFiltro()"
>
<
option
value
=
""
disabled
selected
hidden
>--
Grande
Área
--
</
option
>
@
foreach
(
$grandesAreas
as
$grandeArea
)
<
option
title
=
"
{
{$grandeArea->nome}
}
"
value
=
"
{
{$grandeArea->id}}">{{$grandeArea->nome}
}
</option>
@endforeach
</select>
</div>
<div class="
col
-
md
-
2
"
style="
text
-
align
:
center
;
overflow
-
y
:
auto
;
overflow
-
x
:
auto
">
<input type="
hidden
" id="
oldArea
" value="
{{
old
(
'area'
)
}}
">
<select class="
form
-
control
@
error
(
'area'
)
is
-
invalid
@
enderror
"
id="
area
" name="
area_id
"
onchange="
(
consultaExterno
(),
consultaInterno
())
">
<option value="" disabled selected hidden>-- Área --
</option>
</select>
</div>
<div class="
col
-
sm
-
3
" style="
display
:
flex
;
align
-
items
:
end
;
">
<input type="
text
" class="
form
-
control
form
-
control
-
edit
" placeholder="
Nome
do
avaliador
" onkeyup="
buscar
(
this
)
" style="
max
-
width
:
200
px
;
"> <img src="
{{
asset
(
'img/icons/logo_lupa.png'
)}}
" alt="">
</div>
</div>
<div class="
col
-
md
-
6
">
<label style="
font
-
weight
:
bold
;
font
-
size
:
18
px
">Internos</label>
</div>
<input type="
hidden
" id="
oldAvalInterno
"
value="
{{
old
(
'exampleFormControlSelect2'
)
}}
">
<select name="
avaliadores_internos_id
[]
" multiple
class="
form
-
control
" id="
exampleFormControlSelect2
"
style="
height
:
200
px
;
font
-
size
:
15
px
">
@foreach (
$trabalho->avaliadors
as
$avaliador
)
@if((
$avaliador->tipo
== "
Interno
" &&
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == 1) ||
((
$avaliador->user
->instituicao == "
UFAPE
" ||
$avaliador->user
->instituicao == "
Universidade
Federal
do
Agreste
de
Pernambuco
") && (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null ||
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == 1) ))
<option value="
{{
$avaliador
->
id
}}
">{{
$avaliador->user
->name }}
> {{$avaliador->user->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->area->nome ?? 'Indefinida'}}
>
{
{$avaliador->user->email}
}
</option>
@endif
@endforeach
@foreach (
$trabalho->aval
as
$avaliador
)
@if(
$avaliador->tipo
== "
Interno
" ||
$avaliador->user
->instituicao == "
UFAPE
" ||
$avaliador->user
->instituicao == "
Universidade
Federal
do
Agreste
de
Pernambuco
")
<option value="
{{
$avaliador
->
id
}}
"> {{
$avaliador->user
->name }}
> {{$avaliador->user->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->area->nome ?? 'Indefinida'}}
>
{
{$avaliador->user->email}
}
</option>
@endif
@endforeach
</select>
<div class="
col
-
md
-
6
">
<label style="
font
-
weight
:
bold
;
font
-
size
:
18
px
"><i>Ad Hoc</i></label>
</div>
<input type="
hidden
" id="
trab
" value="
{{
$trabalho
->
id
}}
">
<input type="
hidden
" id="
oldAvalExterno
"
value="
{{
old
(
'exampleFormControlSelect3'
)
}}
">
<select name="
avaliadores_externos_id
[]
" multiple
class="
form
-
control
" id="
exampleFormControlSelect3
"
style="
height
:
200
px
;
font
-
size
:
15
px
">
@foreach (
$trabalho->avaliadors
as
$avaliador
)
@if(
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == 2 || (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null &&
$avaliador->tipo
== "
Interno
"))
<option value="
{{
$avaliador
->
id
}}
">{{
$avaliador->user
->name }}
> {{$avaliador->user->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->area->nome ?? 'Indefinida'}}
>
{
{$avaliador->user->email}
}
</option>
@endif
@endforeach
@foreach (
$trabalho->aval
as
$avaliador
)
@foreach (
$trabalho->aval
as
$avaliador
)
<
option
value
=
"{{
$avaliador->id
}}"
>
{{
$avaliador
->
user
->
name
}}
({{
$avaliador
->
area
->
nome
??
'Indefinida'
}})
</
option
>
<option value="
{{
$avaliador
->
id
}}
"> {{
$avaliador->user
->name }}
> {{$avaliador->user->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->area->nome ?? 'Indefinida'}}
>
{
{$avaliador->user->email}
}
</option>
@endforeach
@endforeach
</select>
</select>
<
small
id
=
"emailHelp"
class
=
"form-text text-muted"
>
Segure
SHIFT
do
teclado
para
selecionar
mais
de
um
.
</
small
>
<small id="
emailHelp
" class="
form
-
text
text
-
muted
">Segure SHIFT do
teclado para selecionar mais de um.</small>
</div>
</div>
<div>
<div>
<
button
type
=
"submit"
class
=
"btn btn-info"
style
=
"width: 100%"
>
Atribuir
</
button
>
<button type="
submit
" class="
btn
btn
-
info
" style="
width
:
100
%
">
Atribuir
</button>
</div>
</div>
</form>
</form>
...
@@ -111,7 +204,7 @@
...
@@ -111,7 +204,7 @@
<thead>
<thead>
<tr>
<tr>
<th scope="
col
">Nome do Usuário</th>
<th scope="
col
">Nome do Usuário</th>
<
th
scope
=
"col"
>
Tipo
</
th
>
<th scope="
col
">Tipo
de Avaliação
</th>
<th scope="
col
">E-mail</th>
<th scope="
col
">E-mail</th>
<th scope="
col
">Titulo do projeto</th>
<th scope="
col
">Titulo do projeto</th>
<th scope="
col
">Status avaliação</th>
<th scope="
col
">Status avaliação</th>
...
@@ -119,67 +212,73 @@
...
@@ -119,67 +212,73 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@
foreach
(
$avaliadores
as
$avaliador
)
@foreach(
$trabalho->avaliadors
as
$avaliador
)
@
php
$contador
=
0
;
@
endphp
{{-- Avaliação Interna --}}
@
foreach
(
$avaliador
->
trabalhos
->
where
(
'evento_id'
,
$evento
->
id
)
as
$trabalho
)
@if((
$avaliador->tipo
== 'Interno' && (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null ||
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso != 1))
@
if
(
$trabalho
->
pivot
->
status
==
true
)
|| ((
$avaliador->user
->instituicao == "
UFAPE
" ||
$avaliador->user
->instituicao == "
Universidade
Federal
do
Agreste
de
Pernambuco
") &&
$avaliador->tipo
== null && (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null ||
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso != 1)))
@
php
$contador
++
;
@
endphp
@
endif
<tr>
<tr>
<
td
>
{{
$avaliador
->
user
->
name
}}
</
td
>
<td>{{
$avaliador->user
->name }}</td>
<
td
>
{{
$avaliador
->
tipo
}}
</
td
>
<td> Interno </td>
<
td
>
{{
$avaliador
->
user
->
email
}}
</
td
>
<td>{{
$avaliador->user
->email }}</td>
<
td
style
=
"max-width:100px; overflow-x:hidden; text-overflow:ellipsis"
>
{{
$trabalho
->
titulo
}}
</
td
>
<td style="
max
-
width
:
100
px
;
overflow
-
x
:
hidden
;
text
-
overflow
:
ellipsis
">{{
$trabalho->titulo
}}</td>
{{
--
<
td
>
{{
$contador
}}
/
{{
$avaliador
->
trabalhos
->
where
(
'evento_id'
,
$evento
->
id
)
->
count
()
}}
</
td
>
--
}}
@php
@
if
(
$avaliador
->
tipo
==
"Externo"
||
$avaliador
->
tipo
=
null
)
$parecerInterno
= App\ParecerInterno::where([['avaliador_id',
$avaliador->id
],['trabalho_id',
$trabalho->id
]])->first();
<
td
>@
if
(
$trabalho
->
pivot
->
parecer
==
null
)
Pendente
@
else
Avaliado
@
endif
</
td
>
@endphp
<td>@if(
$parecerInterno
== null) Pendente @else Avaliado @endif</td>
<td>
<td>
<
div
class
=
"btn-group dropright dropdown-options"
>
<div class="
btn
-
group
dropright
dropdown
-
options
">
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<a id="
options
" class="
dropdown
-
toggle
" data-toggle="
dropdown
" aria-haspopup="
true
" aria-expanded="
false
">
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
<img src="
{{
asset
(
'img/icons/ellipsis-v-solid.svg'
)}}
" style="
width
:
8
px
">
</
a
>
</a>
<
div
class
=
"dropdown-menu"
>
<div class="
dropdown
-
menu
">
@
if
(
$trabalho
->
pivot
->
parecer
!=
null
)
@if(
$parecerInterno
!= null)
<
a
href
=
"{{ route('admin.visualizarParecer', ['trabalho_id' =>
$trabalho->id
, 'avaliador_id' =>
$avaliador->id
]) }}"
class
=
"dropdown-item text-center"
>
<a href="
{{
route
(
'admin.visualizarParecer
Interno
'
,
[
'trabalho_id'
=>
$trabalho
->
id
,
'avaliador_id'
=>
$avaliador
->
id
])
}}
" class="
dropdown
-
item
text
-
center
">
Vizualizar
Parecer
Vizualizar Parecer
</
a
>
</a>
@
endif
@endif
<
a
href
=
"{{ route('admin.removerProjAval', ['trabalho_id' =>
$trabalho->id
, 'avaliador_id' =>
$avaliador->id
]) }}"
class
=
"dropdown-item text-center"
>
<a href="
{{
route
(
'admin.removerProjAval'
,
[
'trabalho_id'
=>
$trabalho
->
id
,
'avaliador_id'
=>
$avaliador
->
id
,
'flag'
=>
1
])
}}
" class="
dropdown
-
item
text
-
center
">
Desatribuir
Avaliador
Desatribuir Avaliador
</
a
>
</a>
</
div
>
</div>
</
div
>
</div>
</td>
</td>
@
else
</tr>
@
php
@endif
$parecer
=
App\ParecerInterno
::
where
([[
'avaliador_id'
,
$avaliador
->
id
],[
'trabalho_id'
,
$trabalho
->
id
]])
->
first
();
@
endphp
{{-- Avaliação Ad Hoc --}}
<
td
>
@if( (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null &&
$avaliador->tipo
== "
Externo
") ||
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso != 2
@
if
(
$parecer
==
null
)
Pendente
@
else
Avaliado
@
endif
|| ((
$avaliador->user
->instituicao != "
UFAPE
" &&
$avaliador->user
->instituicao != "
Universidade
Federal
do
Agreste
de
Pernambuco
") &&
$avaliador->tipo
== null && (
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso == null ||
$avaliador->trabalhos
()->where("
trabalho_id
",
$trabalho->id
)->first()->pivot->acesso != 2)))
</
td
>
<tr>
<
td
>
<td>{{
$avaliador->user
->name }}</td>
<
div
class
=
"btn-group dropright dropdown-options"
>
<td> Ad Hoc </td>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<td>{{
$avaliador->user
->email }}</td>
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
<td style="
max
-
width
:
100
px
;
overflow
-
x
:
hidden
;
text
-
overflow
:
ellipsis
">{{
$trabalho->titulo
}}</td>
</
a
>
<td>@if(
$avaliador->trabalhos
->where('id',
$trabalho->id
)->first()->pivot->status == false) Pendente @else Avaliado @endif</td>
<
div
class
=
"dropdown-menu"
>
<td>
@
if
(
$parecer
!=
null
)
<div class="
btn
-
group
dropright
dropdown
-
options
">
<
a
href
=
"{{ route('admin.visualizarParecerInterno', ['trabalho_id' =>
$trabalho->id
, 'avaliador_id' =>
$avaliador->id
]) }}"
class
=
"dropdown-item text-center"
>
<a id="
options
" class="
dropdown
-
toggle
" data-toggle="
dropdown
" aria-haspopup="
true
" aria-expanded="
false
">
Vizualizar
Parecer
<img src="
{{
asset
(
'img/icons/ellipsis-v-solid.svg'
)}}
" style="
width
:
8
px
">
</
a
>
</a>
@
endif
<div class="
dropdown
-
menu
">
<
a
href
=
"{{ route('admin.removerProjAval', ['trabalho_id' =>
$trabalho->id
, 'avaliador_id' =>
$avaliador->id
]) }}"
class
=
"dropdown-item text-center"
>
@if(
$avaliador->trabalhos
->where('id',
$trabalho->id
)->first()->pivot->status == true)
Desatribuir
Avaliador
<a href="
{{
route
(
'admin.visualizarParecer'
,
[
'trabalho_id'
=>
$trabalho
->
id
,
'avaliador_id'
=>
$avaliador
->
id
])
}}
" class="
dropdown
-
item
text
-
center
">
Vizualizar Parecer
</a>
</a>
@endif
<a href="
{{
route
(
'admin.removerProjAval'
,
[
'trabalho_id'
=>
$trabalho
->
id
,
'avaliador_id'
=>
$avaliador
->
id
,
'flag'
=>
0
])
}}
" class="
dropdown
-
item
text
-
center
">
Desatribuir Avaliador
</a>
</
div
>
</div>
</div>
</
td
>
</div>
@
endif
</td>
</
tr
>
</tr>
@
endforeach
@endif
@endforeach
@endforeach
</tbody>
</tbody>
</table>
</table>
...
...
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