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
b99dd529
Commit
b99dd529
authored
Jan 23, 2023
by
unknown
Browse files
Adição de integrantes no Edital de extensão
parent
571219f9
Changes
11
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
b99dd529
...
@@ -13,6 +13,7 @@ use App\AreaTematica;
...
@@ -13,6 +13,7 @@ use App\AreaTematica;
use
App\Arquivo
;
use
App\Arquivo
;
use
App\Coautor
;
use
App\Coautor
;
use
App\Revisor
;
use
App\Revisor
;
use
App\TrabalhoUser
;
use
App\SubArea
;
use
App\SubArea
;
use
App\Endereco
;
use
App\Endereco
;
use
App\Trabalho
;
use
App\Trabalho
;
...
@@ -399,6 +400,8 @@ class TrabalhoController extends Controller
...
@@ -399,6 +400,8 @@ class TrabalhoController extends Controller
$flagSubstituicao
=
-
1
;
$flagSubstituicao
=
-
1
;
}
}
$trabalhos_user
=
TrabalhoUser
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
get
();
return
view
(
'projeto.visualizar'
)
->
with
([
'projeto'
=>
$projeto
,
return
view
(
'projeto.visualizar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'areas'
=>
$areas
,
...
@@ -413,6 +416,7 @@ class TrabalhoController extends Controller
...
@@ -413,6 +416,7 @@ class TrabalhoController extends Controller
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'enum_turno'
=>
Participante
::
ENUM_TURNO
,
'areasTematicas'
=>
$areasTematicas
,
'areasTematicas'
=>
$areasTematicas
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'trabalhos_user'
=>
$trabalhos_user
]);
]);
}
}
...
@@ -467,6 +471,8 @@ class TrabalhoController extends Controller
...
@@ -467,6 +471,8 @@ class TrabalhoController extends Controller
$rascunho
=
Trabalho
::
where
(
'proponente_id'
,
$proponente
->
id
)
->
where
(
'evento_id'
,
$edital
->
id
)
->
where
(
'status'
,
'Rascunho'
)
$rascunho
=
Trabalho
::
where
(
'proponente_id'
,
$proponente
->
id
)
->
where
(
'evento_id'
,
$edital
->
id
)
->
where
(
'status'
,
'Rascunho'
)
->
orderByDesc
(
'updated_at'
)
->
first
();
->
orderByDesc
(
'updated_at'
)
->
first
();
$trabalhos_user
=
TrabalhoUser
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
get
();
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'areas'
=>
$areas
,
...
@@ -480,6 +486,7 @@ class TrabalhoController extends Controller
...
@@ -480,6 +486,7 @@ class TrabalhoController extends Controller
'estados'
=>
$this
->
estados
,
'estados'
=>
$this
->
estados
,
'areaTematicas'
=>
$areaTematicas
,
'areaTematicas'
=>
$areaTematicas
,
'listaOds'
=>
$ODS
,
'listaOds'
=>
$ODS
,
'trabalhos_user'
=>
$trabalhos_user
]);
]);
}
}
...
@@ -873,6 +880,29 @@ class TrabalhoController extends Controller
...
@@ -873,6 +880,29 @@ class TrabalhoController extends Controller
$trabalho
=
$this
->
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
);
$trabalho
=
$this
->
armazenarAnexosFinais
(
$request
,
$pasta
,
$trabalho
,
$evento
);
$trabalho
->
save
();
$trabalho
->
save
();
if
(
$request
->
integrantesExistentes
==
null
){
$request
->
integrantesExistentes
=
[];
}
$usuariosRemovidos
=
TrabalhoUser
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
whereNotIn
(
'user_id'
,
$request
->
integrantesExistentes
)
->
get
();
if
(
$usuariosRemovidos
->
first
()
!=
null
)
{
foreach
(
$usuariosRemovidos
as
$usuarioRemovido
){
$usuarioRemovido
->
delete
();
}
}
if
(
$evento
->
natureza_id
==
3
&&
$request
->
integrantes
!=
null
){
foreach
(
$request
->
integrantes
as
$integrante
){
$integrante
=
explode
(
','
,
$integrante
);
$trabalho_user
=
new
TrabalhoUser
();
$trabalho_user
->
user_id
=
$integrante
[
0
];
$trabalho_user
->
funcao_participante_id
=
$integrante
[
1
];
$trabalho_user
->
trabalho_id
=
$trabalho
->
id
;
$trabalho_user
->
save
();
}
}
if
(
$request
->
marcado
==
null
)
{
if
(
$request
->
marcado
==
null
)
{
$idExcluido
=
$trabalho
->
participantes
->
pluck
(
'id'
);
$idExcluido
=
$trabalho
->
participantes
->
pluck
(
'id'
);
...
@@ -1036,6 +1066,16 @@ class TrabalhoController extends Controller
...
@@ -1036,6 +1066,16 @@ class TrabalhoController extends Controller
}
}
public
function
buscarUsuario
(
Request
$request
)
{
$usuario
=
User
::
where
(
'cpf'
,
$request
->
cpf_consulta
)
->
first
();
$funcao
=
FuncaoParticipantes
::
where
(
'id'
,
$request
->
funcao
)
->
first
();
if
(
$usuario
){
return
json_encode
([
$usuario
,
$funcao
]);
}
return
json_encode
(
'inexistente'
);
}
public
function
salvar
(
StoreTrabalho
$request
)
public
function
salvar
(
StoreTrabalho
$request
)
{
{
...
@@ -1156,6 +1196,19 @@ class TrabalhoController extends Controller
...
@@ -1156,6 +1196,19 @@ class TrabalhoController extends Controller
$trabalho
->
modalidade
=
$request
->
modalidade
;
$trabalho
->
modalidade
=
$request
->
modalidade
;
$trabalho
->
save
();
$trabalho
->
save
();
if
(
$evento
->
natureza_id
==
3
){
foreach
(
$request
->
integrantes
as
$integrante
){
$integrante
=
explode
(
','
,
$integrante
);
$trabalho_user
=
new
TrabalhoUser
();
$trabalho_user
->
user_id
=
$integrante
[
0
];
$trabalho_user
->
funcao_participante_id
=
$integrante
[
1
];
$trabalho_user
->
trabalho_id
=
$trabalho
->
id
;
$trabalho_user
->
save
();
}
}
$trabalho
->
ods
()
->
sync
(
$request
->
ods
);
$trabalho
->
ods
()
->
sync
(
$request
->
ods
);
DB
::
commit
();
DB
::
commit
();
if
(
!
$request
->
has
(
'rascunho'
))
{
if
(
!
$request
->
has
(
'rascunho'
))
{
...
...
app/Trabalho.php
View file @
b99dd529
...
@@ -130,4 +130,8 @@ class Trabalho extends Model
...
@@ -130,4 +130,8 @@ class Trabalho extends Model
public
function
ods
(){
public
function
ods
(){
return
$this
->
belongsToMany
(
'App\ObjetivoDeDesenvolvimentoSustentavel'
,
'objetivo_de_desenvolvimento_sustentavel_trabalhos'
,
'trabalho_id'
);
return
$this
->
belongsToMany
(
'App\ObjetivoDeDesenvolvimentoSustentavel'
,
'objetivo_de_desenvolvimento_sustentavel_trabalhos'
,
'trabalho_id'
);
}
}
public
function
integrantes
()
{
return
$this
->
belongsToMany
(
'App\User'
,
'trabalho_users'
,
'trabalho_id'
);
}
}
}
app/TrabalhoUser.php
0 → 100644
View file @
b99dd529
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
TrabalhoUser
extends
Model
{
public
function
user
(){
return
$this
->
belongsTo
(
'App\User'
);
}
public
function
funcao
(){
return
$this
->
belongsTo
(
'App\FuncaoParticipantes'
,
'funcao_participante_id'
);
}
}
database/migrations/2023_01_09_165956_create_trabalho_users_table.php
0 → 100644
View file @
b99dd529
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
CreateTrabalhoUsersTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'trabalho_users'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
timestamps
();
$table
->
integer
(
'user_id'
);
$table
->
foreign
(
'user_id'
)
->
references
(
'id'
)
->
on
(
'users'
);
$table
->
integer
(
'trabalho_id'
);
$table
->
foreign
(
'trabalho_id'
)
->
references
(
'id'
)
->
on
(
'trabalhos'
);
$table
->
integer
(
'funcao_participante_id'
);
$table
->
foreign
(
'funcao_participante_id'
)
->
references
(
'id'
)
->
on
(
'funcao_participantes'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'trabalho_users'
);
}
}
resources/views/evento/formulario/integrantes.blade.php
0 → 100644
View file @
b99dd529
<div
class=
"col-md-12"
style=
"margin-top: 20px"
>
<div
class=
"card"
style=
"border-radius: 5px"
>
<div
class=
"card-body"
style=
"padding-top: 0.2rem;"
>
<div
class=
"container"
>
<div
class=
"form-row mt-3"
>
<div
class=
"col-md-11"
>
<h5
style=
"color: #234B8B; font-weight: bold"
>
Adicionar Integrante(s)
</h5>
</div>
<div
class=
"col-md-1 text-sm-right"
>
<a
type=
"button"
value=
"{{ $edital->id }}"
id=
"atribuir1"
data-toggle=
"modal"
data-target=
"#modalIntegrante"
>
<img
class=
""
src=
"{{asset('img/icons/add.ico')}}"
style=
"width:30px"
alt=
""
>
</a>
</div>
</div>
<hr
style=
"border-top: 1px solid#1492E6"
>
<div
class=
"row"
id=
"integrante"
>
</div>
</div>
</div>
</div>
</div>
<!-- MODAL -->
<div
class=
"modal fade"
id=
"modalIntegrante"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog modal-dialog-centered modal-xl"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Adicionar Integrante
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"form-row"
style=
"padding: 30px;"
>
<div
class=
"col-md-8"
>
<label
for=
"cpf_consulta"
>
CPF:
</label>
<input
type=
"text"
id=
"cpf_consulta"
name=
"cpf_consulta"
class=
"form-control"
onkeyup=
"mask_cpf();"
>
</div>
<div
class=
"col-md-4 mt-4"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"preencherUsuarioExistente()"
>
Adicionar
</button>
</div>
</div>
<div
class=
"form-row"
style=
"padding: 0px 30px 30px 30px;"
>
<label
for=
"funcao_participante"
>
Função do Participante:
</label>
<select
name=
""
id=
"funcao_participante"
class=
"form-control"
>
@foreach($funcaoParticipantes as $funcao)
<option
value=
"{{$funcao->id}}"
>
{{ $funcao->nome }}
</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<!-- MODAL DE ERRO -->
<div
class=
"modal fade"
id=
"aviso-modal-usuario-nao-existe"
data-backdrop=
"static"
tabindex=
"-1"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
style=
"background-color: #dc3545;"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
style=
"color: white;"
>
Aviso
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
CPF não consta no sistema!
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary btn-color-dafault"
data-dismiss=
"modal"
>
Ok
</button>
</div>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"aviso-modal-usuario-adicionado"
data-backdrop=
"static"
tabindex=
"-1"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
style=
"background-color: #32CD32;"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
style=
"color: white;"
>
Sucesso!
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
Integrante adicionado com sucesso
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary btn-color-dafault"
data-dismiss=
"modal"
>
Ok
</button>
</div>
</div>
</div>
</div>
<script>
function
mask_cpf
()
{
$
(
"
#cpf_consulta
"
).
keydown
(
function
(){
try
{
$
(
"
#cpf_consulta
"
).
unmask
();
}
catch
(
e
)
{}
$
(
"
#cpf_consulta
"
).
mask
(
"
999.999.999-99
"
);
// ajustando foco
var
elem
=
this
;
setTimeout
(
function
(){
// mudo a posição do seletor
elem
.
selectionStart
=
elem
.
selectionEnd
=
10000
;
},
0
);
// reaplico o valor para mudar o foco
var
currentValue
=
$
(
this
).
val
();
$
(
this
).
val
(
''
);
$
(
this
).
val
(
currentValue
);
});
}
function
removerIntegrante
(
id
)
{
$
(
`#integrante
${
id
}
`
).
remove
()
}
function
preencherUsuarioExistente
()
{
$
.
ajaxSetup
({
headers
:
{
'
X-CSRF-TOKEN
'
:
$
(
'
meta[name="csrf-token"]
'
).
attr
(
'
content
'
)
}
});
$
.
ajax
({
url
:
'
{{ route(
'
trabalho
.
buscarUsuario
'
) }}
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
data
:
{
'
cpf_consulta
'
:
$
(
'
#cpf_consulta
'
).
val
(),
'
funcao
'
:
$
(
'
#funcao_participante
'
).
val
()
},
success
:
function
(
data
)
{
if
(
data
==
'
inexistente
'
||
$
(
'
#cpf_consulta
'
).
val
()
==
""
){
exibirModalUsuarioInexistente
();
}
else
{
exibirUsuarioAdicionado
();
$
(
'
#integrante
'
).
append
(
`
<div id="integrante
${
data
[
0
][
'
id
'
]}
" class="col-md-6">
<div class="row">
<input name="integrantes[]" type="text" value="
${
data
[
0
][
'
id
'
]}
,
${
$
(
'
#funcao_participante
'
).
val
()}
" hidden>
<div class="col-md-2" style="display: flex; align-items: center;">
<img src="{{asset('img/icons/usuario.svg')}}" style="width:60px" alt="">
</div>
<div class="col-md-4 mb-1">
<strong>Nome:</strong>
${
data
[
0
][
'
name
'
]}
<strong>CPF:</strong>
${
data
[
0
][
'
cpf
'
]}
<strong>Função:</strong>
${
data
[
1
][
'
nome
'
]}
<button type="button" class="btn btn-danger" onclick="removerIntegrante(
${
data
[
0
][
'
id
'
]}
)">Remover</button>
</div>
</div>
</div>
`
)
}
}
});
}
function
exibirModalUsuarioInexistente
()
{
$
(
'
#aviso-modal-usuario-nao-existe
'
).
modal
(
'
show
'
);
}
function
exibirUsuarioAdicionado
()
{
$
(
'
#aviso-modal-usuario-adicionado
'
).
modal
(
'
show
'
);;
}
</script>
\ No newline at end of file
resources/views/evento/submeterTrabalho.blade.php
View file @
b99dd529
...
@@ -19,7 +19,10 @@
...
@@ -19,7 +19,10 @@
@
include
(
'evento.formulario.participantes'
)
@
include
(
'evento.formulario.participantes'
)
@
if
(
$edital
->
natureza_id
==
3
)
@
include
(
'evento.formulario.integrantes'
)
@
endif
@
include
(
'evento.formulario.anexos'
)
@
include
(
'evento.formulario.anexos'
)
...
...
resources/views/projeto/editaFormulario/integrantes.blade.php
0 → 100644
View file @
b99dd529
<div
class=
"col-md-12"
style=
"margin-top: 20px"
>
<div
class=
"card"
style=
"border-radius: 5px"
>
<div
class=
"card-body"
style=
"padding-top: 0.2rem;"
>
<div
class=
"container"
>
<div
class=
"form-row mt-3"
>
<div
class=
"col-md-11"
>
<h5
style=
"color: #234B8B; font-weight: bold"
>
Integrante(s)
</h5>
</div>
<div
class=
"col-md-1 text-sm-right"
>
<a
type=
"button"
value=
"{{ $edital->id }}"
id=
"atribuir1"
data-toggle=
"modal"
data-target=
"#modalIntegrante"
>
<img
class=
""
src=
"{{asset('img/icons/add.ico')}}"
style=
"width:30px"
alt=
""
>
</a>
</div>
</div>
<hr
style=
"border-top: 1px solid#1492E6"
>
<div
class=
"row"
id=
"integrante"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"modalIntegrante"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog modal-dialog-centered modal-xl"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
Adicionar Integrante
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"form-row"
style=
"padding: 30px;"
>
<div
class=
"col-md-8"
>
<label
for=
"cpf_consulta"
>
CPF:
</label>
<input
type=
"text"
id=
"cpf_consulta"
name=
"cpf_consulta"
class=
"form-control"
onkeyup=
"mask_cpf();"
>
</div>
<div
class=
"col-md-4 mt-4"
>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"preencherUsuarioExistente()"
>
Adicionar
</button>
</div>
</div>
<div
class=
"form-row"
style=
"padding: 0px 30px 30px 30px;"
>
<label
for=
"funcao_participante"
>
Função do Participante:
</label>
<select
name=
""
id=
"funcao_participante"
class=
"form-control"
>
@foreach($funcaoParticipantes as $funcao)
<option
value=
"{{$funcao->id}}"
>
{{ $funcao->nome }}
</option>
@endforeach
</select>
</div>
</div>
</div>
</div>
<div
class=
"modal fade"
id=
"aviso-modal-usuario-adicionado"
data-backdrop=
"static"
tabindex=
"-1"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
style=
"background-color: #32CD32;"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
style=
"color: white;"
>
Sucesso!
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
Integrante adicionado com sucesso
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-primary btn-color-dafault"
data-dismiss=
"modal"
>
Ok
</button>
</div>
</div>
</div>
</div>
<!-- MODAL DE ERRO -->
<div
class=
"modal fade"
id=
"aviso-modal-usuario-nao-existe"
data-backdrop=
"static"
tabindex=
"-1"
aria-labelledby=
"exampleModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
style=
"background-color: #dc3545;"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
style=
"color: white;"
>
Aviso
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<span
id=
"texto-erro"
>
CPF não consta no sistema!
</span>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary btn-color-dafault"
data-dismiss=
"modal"
>
Ok
</button>
</div>
</div>
</div>
</div>
<script>
function
mask_cpf
()
{
$
(
"
#cpf_consulta
"
).
keydown
(
function
(){
try
{
$
(
"
#cpf_consulta
"
).
unmask
();
}
catch
(
e
)
{}
$
(
"
#cpf_consulta
"
).
mask
(
"
999.999.999-99
"
);
// ajustando foco
var
elem
=
this
;
setTimeout
(
function
(){
// mudo a posição do seletor
elem
.
selectionStart
=
elem
.
selectionEnd
=
10000
;
},
0
);
// reaplico o valor para mudar o foco
var
currentValue
=
$
(
this
).
val
();
$
(
this
).
val
(
''
);
$
(
this
).
val
(
currentValue
);
});
}
function
removerIntegrante
(
id
)
{
$
(
`#integrante
${
id
}
`
).
remove
()
}
function
preencherUsuarioExistente
()
{
$
.
ajaxSetup
({
headers
:
{
'
X-CSRF-TOKEN
'
:
$
(
'
meta[name="csrf-token"]
'
).
attr
(
'
content
'
)
}
});
$
.
ajax
({
url
:
'
{{ route(
'
trabalho
.
buscarUsuario
'
) }}
'
,
type
:
'
POST
'
,
dataType
:
'
json
'
,
data
:
{
'
cpf_consulta
'
:
$
(
'
#cpf_consulta
'
).
val
(),
'
funcao
'
:
$
(
'
#funcao_participante
'
).
val
()
},
success
:
function
(
data
)
{
console
.
log
(
data
)
if
(
data
==
'
inexistente
'
||
$
(
'
#cpf_consulta
'
).
val
()
==
""
){
$
(
'
#texto-erro
'
).
html
(
'
CPF não consta no sistema!
'
);
exibirModalUsuarioInexistente
();
}
else
{
exibirUsuarioAdicionado
();
$
(
'
#integrante
'
).
append
(
`
<div id="integrante
${
data
[
0
][
'
id
'
]}
" class="col-md-6">
<div class="row">
<input name="integrantes[]" type="text" value="
${
data
[
0
][
'
id
'
]}
,
${
$
(
'
#funcao_participante
'
).
val
()}
" hidden>
<div class="col-md-2" style="display: flex; align-items: center;">
<img src="{{asset('img/icons/usuario.svg')}}" style="width:60px" alt="">
</div>
<div class="col-md-4 mb-1">
<strong>Nome:</strong>
${
data
[
0
][
'
name
'
]}
<strong>CPF:</strong>
${
data
[
0
][
'
cpf
'
]}
<strong>Função:</strong>
${
data
[
1
][
'
nome
'
]}
<button type="button" class="btn btn-danger" onclick="removerIntegrante(
${
data
[
0
][
'
id
'
]}
)">Remover</button>
</div>
</div>
</div>
`
)
}
}
});
}
function
exibirModalUsuarioInexistente
()
{
$
(
'
#aviso-modal-usuario-nao-existe
'
).
modal
(
'
show
'
);
}
function
exibirUsuarioAdicionado
()
{
$
(
'
#aviso-modal-usuario-adicionado
'
).
modal
(
'
show
'
);;
}
$
(
document
).
ready
(
function
()
{
@
foreach
(
$trabalhos_user
as
$trabalho_user
)
$
(
'
#integrante
'
).
append
(
`
<div id="integrante{{$trabalho_user->id}}" class="col-md-6">
<div class="row">
<input name="integrantesExistentes[]" type="text" value="{{ $trabalho_user->user->id }}" hidden>
<div class="col-md-2" style="display: flex; align-items: center;">
<img src="{{asset('img/icons/usuario.svg')}}" style="width:60px" alt="">
</div>
<div class="col-md-4 mb-1">
<strong>Nome:</strong> {{{$trabalho_user->user->name}}}
<strong>CPF:</strong> {{ $trabalho_user->user->cpf }}
<strong>Função:</strong> {{ $trabalho_user->funcao->nome }}
<button type="button" class="btn btn-danger" onclick="removerIntegrante({{$trabalho_user->id}})">Remover</button>
</div>
</div>
</div>
`
)
@
endforeach
});
</script>
\ No newline at end of file
resources/views/projeto/editar.blade.php
View file @
b99dd529
...
@@ -36,6 +36,10 @@
...
@@ -36,6 +36,10 @@
@
include
(
'projeto.editaFormulario.participantes'
)
@
include
(
'projeto.editaFormulario.participantes'
)
@
if
(
$edital
->
natureza_id
==
3
)
@
include
(
'projeto.editaFormulario.integrantes'
)
@
endif
@
include
(
'projeto.editaFormulario.anexos'
)
@
include
(
'projeto.editaFormulario.anexos'
)
@
include
(
'projeto.editaFormulario.finalizar'
)
@
include
(
'projeto.editaFormulario.finalizar'
)
...
...
resources/views/projeto/formularioVisualizar/integrantes.blade.php
0 → 100644
View file @
b99dd529
<!-- Participantes -->
<div
class=
"col-md-12"
style=
"margin-top: 20px"
>
<div
class=
"card"
style=
"border-radius: 5px"
>
<div
class=
"card-body"
style=
"padding-top: 0.2rem;"
>
<div
class=
"container"
>
<div
class=
"form-row mt-3"
>
<div
class=
"col-sm-8"
><h5
style=
"color: #234B8B; font-weight: bold"
>
Integrantes
</h5></div>
</div>
<hr
style=
"border-top: 1px solid#1492E6"
>
<div
class=
"row justify-content-start"
style=
"alignment: center"
>
@foreach($trabalhos_user as $trabalho_user)
<div
class=
"col-sm-1 mt-4"
>
<img
src=
"{{asset('img/icons/usuario.svg')}}"
style=
"width:60px"
alt=
""
>
</div>
<div
class=
"col-sm-5 mt-4"
>
<h5
class=
"mb-0"
>
Nome: {{ $trabalho_user->user->name }}
</h5>
<h5
class=
"mb-0"
>
Função: {{ $trabalho_user->funcao->nome }}
</h5>
</div>
@endforeach
</div>
</div>
</div>
</div>
</div>
<!--X Participantes X-->
resources/views/projeto/visualizar.blade.php
View file @
b99dd529
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
@
component
(
'projeto.formularioVisualizar.participantes2'
,
[
'projeto'
=>
$projeto
,
'edital'
=>
$edital
])
@
component
(
'projeto.formularioVisualizar.participantes2'
,
[
'projeto'
=>
$projeto
,
'edital'
=>
$edital
])
@
endcomponent
@
endcomponent
@
if
(
$edital
->
natureza_id
==
3
)
@
component
(
'projeto.formularioVisualizar.integrantes'
,
[
'projeto'
=>
$projeto
,
'edital'
=>
$edital
,
'trabalhos_user'
=>
$trabalhos_user
])
@
endcomponent
@
endif
@
component
(
'projeto.formularioVisualizar.relatorio'
,[
'edital'
=>
$edital
,
'projeto'
=>
$projeto
,
'flagSubstituicao'
=>
$flagSubstituicao
])
@
component
(
'projeto.formularioVisualizar.relatorio'
,[
'edital'
=>
$edital
,
'projeto'
=>
$projeto
,
'flagSubstituicao'
=>
$flagSubstituicao
])
@
endcomponent
@
endcomponent
...
...
routes/web.php
View file @
b99dd529
...
@@ -153,6 +153,9 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function () {
...
@@ -153,6 +153,9 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function () {
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/visualizar/{id}'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/visualizar/{id}'
,
'TrabalhoController@show'
)
->
name
(
'trabalho.show'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
Route
::
post
(
'/projeto/buscarUsuario'
,
'TrabalhoController@buscarUsuario'
)
->
name
(
'trabalho.buscarUsuario'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
Route
::
post
(
'/projeto/{id}/atualizar'
,
'TrabalhoController@update'
)
->
name
(
'trabalho.update'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
Route
::
get
(
'/projeto/{id}/excluir'
,
'TrabalhoController@destroy'
)
->
name
(
'trabalho.destroy'
);
Route
::
get
(
'/projeto/{id}/excluirParticipante'
,
'TrabalhoController@excluirParticipante'
)
->
name
(
'trabalho.excluirParticipante'
);
Route
::
get
(
'/projeto/{id}/excluirParticipante'
,
'TrabalhoController@excluirParticipante'
)
->
name
(
'trabalho.excluirParticipante'
);
...
...
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