Unverified Commit 39b596f7 authored by Yuri Resende's avatar Yuri Resende Committed by GitHub
Browse files

Merge pull request #777 from yuriresendematias/master

Edital de fluxo continuo
parents 2640f5df d8cf7a1f
...@@ -1172,8 +1172,10 @@ class TrabalhoController extends Controller ...@@ -1172,8 +1172,10 @@ class TrabalhoController extends Controller
public function buscarUsuario(Request $request) { public function buscarUsuario(Request $request) {
$usuario = User::where('cpf', $request->cpf_consulta)->first(); $usuario = User::where('cpf', $request->cpf_consulta)->first();
$funcao = FuncaoParticipantes::where('id', $request->funcao)->first(); $funcao = FuncaoParticipantes::where('id', $request->funcao)->first();
if($usuario){ if($usuario){
return json_encode([$usuario, $funcao]); $participante = $usuario->participantes()->first();
return json_encode([$usuario, $funcao, $participante, $usuario->endereco()->first()]);
} }
return json_encode('inexistente'); return json_encode('inexistente');
...@@ -1182,6 +1184,7 @@ class TrabalhoController extends Controller ...@@ -1182,6 +1184,7 @@ class TrabalhoController extends Controller
public function salvar(StoreTrabalho $request) public function salvar(StoreTrabalho $request)
{ {
// dd($request->all());
try { try {
if (!$request->has('rascunho')) { if (!$request->has('rascunho')) {
$request->merge([ $request->merge([
...@@ -1217,15 +1220,15 @@ class TrabalhoController extends Controller ...@@ -1217,15 +1220,15 @@ class TrabalhoController extends Controller
])); ]));
} }
//adição dos participantes
if ($request->has('marcado')) { if ($request->has('marcado')) {
foreach ($request->marcado as $key => $part) { foreach ($request->marcado as $key => $part) {
$part = intval($part); $part = intval($part);
$passwordTemporario = Str::random(8); // $passwordTemporario = Str::random(8);
$data['name'] = $request->name[$part]; $data['name'] = $request->name[$part];
$data['email'] = $request->email[$part]; $data['email'] = $request->email[$part];
$data['password'] = bcrypt($passwordTemporario); // $data['password'] = bcrypt($passwordTemporario);
$data['data_de_nascimento'] = $request->data_de_nascimento[$part]; $data['data_de_nascimento'] = $request->data_de_nascimento[$part];
$data['cpf'] = $request->cpf[$part]; $data['cpf'] = $request->cpf[$part];
$data['tipo'] = 'participante'; $data['tipo'] = 'participante';
......
...@@ -26,8 +26,6 @@ class StoreTrabalho extends FormRequest ...@@ -26,8 +26,6 @@ class StoreTrabalho extends FormRequest
*/ */
public function rules() public function rules()
{ {
//dd($this->all());
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
$rules = []; $rules = [];
...@@ -51,20 +49,33 @@ class StoreTrabalho extends FormRequest ...@@ -51,20 +49,33 @@ class StoreTrabalho extends FormRequest
$rules['rg.'.$value] = ['required', 'string']; $rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string']; $rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string']; $rules['curso.'.$value] = ['required', 'string'];
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string']; //participantes da pesquisa
$rules['periodo_atual.'.$value] = ['required', 'string']; if($evento->natureza_id != 3){
$rules['total_periodos.'.$value] = ['required', 'string']; $rules['turno.'.$value] = ['required', 'string'];
if($evento->tipo != "PIBEX") { $rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['media_do_curso.' . $value] = ['required', 'string']; $rules['media_do_curso.' . $value] = ['required', 'string'];
} }
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if($evento->tipo != "CONTINUO"){
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
// if($evento->tipo != "PIBEX") {
// $rules['media_do_curso.' . $value] = ['required', 'string'];
// }
} }
} }
} else { } else if($evento->tipo != "CONTINUO"){
$rules['anexoPlanoTrabalho'] = ['required']; $rules['anexoPlanoTrabalho'] = ['required'];
$rules['nomePlanoTrabalho'] = ['required', 'string']; $rules['nomePlanoTrabalho'] = ['required', 'string'];
} }
...@@ -72,10 +83,13 @@ class StoreTrabalho extends FormRequest ...@@ -72,10 +83,13 @@ class StoreTrabalho extends FormRequest
if($this->has('rascunho')) { if($this->has('rascunho')) {
$rules = []; $rules = [];
return $rules; return $rules;
}else{ } else {
//anexos
if($evento->nome_docExtra != null ){ if($evento->nome_docExtra != null ){
$rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true),'file', 'mimes:zip,doc,docx,pdf', 'max:2048']; $rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true),'file', 'mimes:zip,doc,docx,pdf', 'max:2048'];
} }
if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){ if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
$rules['anexoPlanilhaPontuacao'] = ['required']; $rules['anexoPlanilhaPontuacao'] = ['required'];
$rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf'];
...@@ -91,22 +105,25 @@ class StoreTrabalho extends FormRequest ...@@ -91,22 +105,25 @@ class StoreTrabalho extends FormRequest
$rules['titulo'] = ['required', 'string']; $rules['titulo'] = ['required', 'string'];
$rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; $rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string'];
$rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; $rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string'];
if($evento->natureza_id == 3){ if($evento->natureza_id == 3){
$rules['area_tematica_id'] = ['required', 'string']; $rules['area_tematica_id'] = ['required', 'string'];
$rules['ods'] = ['required']; $rules['ods'] = ['required'];
} }
$rules['linkLattesEstudante'] = ['required', 'string'];
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf']; $rules['linkLattesEstudante'] = ['required', 'string'];
if($evento->tipo!="CONTINUO"){ if($evento->tipo!="CONTINUO"){
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf'];
$rules['anexoProjeto'] = ['required', 'mimes:pdf']; $rules['anexoProjeto'] = ['required', 'mimes:pdf'];
} else { } else {
$rules['anexo_SIPAC'] = ['required', 'mimes:pdf']; $rules['anexo_SIPAC'] = ['required', 'mimes:pdf'];
} }
//dd($rules, $evento);
return $rules; return $rules;
} }
} }
...@@ -143,6 +160,12 @@ class StoreTrabalho extends FormRequest ...@@ -143,6 +160,12 @@ class StoreTrabalho extends FormRequest
'media_do_curso.*.required' => 'O :attribute é obrigatório', 'media_do_curso.*.required' => 'O :attribute é obrigatório',
'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório', 'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório',
'nomePlanoTrabalho.*.required' => 'O :attribute é obrigatório', 'nomePlanoTrabalho.*.required' => 'O :attribute é obrigatório',
'area_id' => "area id",
'area_tematica_id' => 'area tematica id',
'ods.*' => 'Deve ser selecionada pelo menos uma ODS',
'linkLattesEstudante.*' => "O link do currículo lattes do estudante é obrigatório",
'anexoDecisaoCONSU.*' => 'anexoDecisaoCONSU',
'anexo_SIPAC.*' => 'anexo_SIPAC'
]; ];
} }
} }
\ No newline at end of file
...@@ -58,15 +58,20 @@ class UpdateTrabalho extends FormRequest ...@@ -58,15 +58,20 @@ class UpdateTrabalho extends FormRequest
$rules['rg.'.$value] = ['required', 'string']; $rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string']; $rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string']; $rules['curso.'.$value] = ['required', 'string'];
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string']; if($evento->tipo != "PIBEX" && $evento->tipo != "CONTINUO") {
$rules['total_periodos.'.$value] = ['required', 'string'];
if($evento->tipo != "PIBEX") {
$rules['media_do_curso.' . $value] = ['required', 'string']; $rules['media_do_curso.' . $value] = ['required', 'string'];
} }
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($participante->planoTrabalho == null)];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; if($evento->tipo != "CONTINUO"){
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['anexoPlanoTrabalho.'.$value] = [Rule::requiredIf($participante->planoTrabalho == null)];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
} }
} }
...@@ -83,7 +88,7 @@ class UpdateTrabalho extends FormRequest ...@@ -83,7 +88,7 @@ class UpdateTrabalho extends FormRequest
}else{ }else{
//$rules = []; //$rules = [];
if($evento->tipo!="PIBEX"){ if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
$rules['anexoPlanilhaPontuacao'] = [Rule::requiredIf($projeto->anexoPlanilhaPontuacao == null)]; $rules['anexoPlanilhaPontuacao'] = [Rule::requiredIf($projeto->anexoPlanilhaPontuacao == null)];
$rules['anexoLattesCoordenador'] = [Rule::requiredIf($projeto->anexoLattesCoordenador == null), 'mimes:pdf']; $rules['anexoLattesCoordenador'] = [Rule::requiredIf($projeto->anexoLattesCoordenador == null), 'mimes:pdf'];
$rules['anexoGrupoPesquisa'] = [Rule::requiredIf($projeto->anexoGrupoPesquisa == null), 'mimes:pdf']; $rules['anexoGrupoPesquisa'] = [Rule::requiredIf($projeto->anexoGrupoPesquisa == null), 'mimes:pdf'];
...@@ -109,10 +114,10 @@ class UpdateTrabalho extends FormRequest ...@@ -109,10 +114,10 @@ class UpdateTrabalho extends FormRequest
} }
$rules['linkLattesEstudante'] = ['required', 'string']; $rules['linkLattesEstudante'] = ['required', 'string'];
if($evento->tipo!="CONTINUO"){
$rules['anexoProjeto'] = [Rule::requiredIf($projeto->anexoProjeto == null), 'mimes:pdf']; $rules['anexoProjeto'] = [Rule::requiredIf($projeto->anexoProjeto == null), 'mimes:pdf'];
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu && $projeto->anexoDecisaoCONSU == null), 'mimes:pdf']; $rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu && $projeto->anexoDecisaoCONSU == null), 'mimes:pdf'];
}
return $rules; return $rules;
} }
} }
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
@endif @endif
</div> </div>
@if($evento->tipo != "PIBEX") @if($evento->tipo != "PIBEX" && $evento->tipo != "CONTINUO")
<div class="col-md-12"> <div class="col-md-12">
<br> <br>
<b style="color: #4D4D4D;">Grupo de Pesquisa: </b> <b style="color: #4D4D4D;">Grupo de Pesquisa: </b>
......
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
{{-- Arquivo --}} {{-- Arquivo --}}
@if($edital->tipo == "CONTINUO") @if($edital->tipo == "CONTINUO")
<div class="form-group col-md-6" style="margin-top: 10px"> <div class="form-group col-md-8" style="margin-top: 10px">
<label for="anexo_SIPAC" class="col-form-label font-tam" style="font-weight: bold">{{ __('Processo SIPAC: ') }}<span style="color: red; font-weight:bold">*</span></label> <label for="anexo_SIPAC" class="col-form-label font-tam" style="font-weight: bold">{{ __('Processo SIPAC: ') }}<span style="color: red; font-weight:bold">*</span></label>
<input type="file" class="input-group-text" name="anexo_SIPAC" placeholder="PDF do processo SIPAC" accept=".pdf" /> <input type="file" class="input-group-text" name="anexo_SIPAC" placeholder="PDF do processo SIPAC" accept=".pdf" />
<span>Processo completo registrado no SIPAC com o parecer da Comissão de Extensão e Cultura,
a decisão de aprovação na Câmara de Extensão e Cultura e a proposta de Atividade de Extensão.</span>
@error('anexo_SIPAC') @error('anexo_SIPAC')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
</div> </div>
@if($errors->any()) @if($errors->any())
<div class="alert alert-danger"> <div class="alert alert-danger">
@foreach($errors->all() as $error)
<li>{{$error}}</li>
@endforeach
Verifique se todos os campos obrigatórios/Dados do discente foram preenchidos! Verifique se todos os campos obrigatórios/Dados do discente foram preenchidos!
</div> </div>
@endif @endif
......
<div class="col-md-12" style="margin-top: 20px"> <div class="col-md-12" style="margin-top: 20px">
<div class="card" style="border-radius: 5px"> <div class="card" style="border-radius: 5px">
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="container"> <div class="container">
<div class="form-row mt-3"> <div class="form-row mt-3">
<div class="col-md-11"> <div class="col-md-11">
<h5 style="color: #234B8B; font-weight: bold">Adicionar Integrante(s)</h5> <h5 style="color: #234B8B; font-weight: bold">Adicionar Integrante(s)</h5>
</div> </div>
<div class="col-md-1 text-sm-right"> <div class="col-md-1 text-sm-right">
<a type="button" value="{{ $edital->id }}" id="atribuir1" data-toggle="modal" data-target="#modalIntegrante"> <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=""> <img class="" src="{{asset('img/icons/add.ico')}}" style="width:30px" alt="">
</a> </a>
</div> </div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row" id="integrante"> <!-- <h6 style="color: #234B8B; font-weight: bold;">Integrantes</h6> -->
</div> <div class="row" id="integrante" style="display:none">
</div> </div>
@include('evento.formulario.participantes')
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- MODAL --> <!-- MODAL -->
<div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <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-dialog modal-dialog-centered modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5> <h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="container">
<div class="row justify-content-center" style="padding-left:35px; padding-right:45px">
<div class="form-row d-flex align-items-end" style="padding: 30px;"> <div class="form-controll" style="margin-left:10px; margin-top:10px; margin-bottom:15px; font-weight:bold;">
<div class="col-md-8">
<label for="cpf_consulta">CPF:</label> <div class="form-row d-flex">
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();"> <label for="cpf_consulta">CPF:</label>
</div> <input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();">
<div class="col-md-4"> </div>
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
<div class="form-row d-flex" style="margin-top:10px">
<label for="funcao_participante">Função do Integrante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div>
<div class="form-row justify-content-center" style="margin-top:20px;">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
</div>
</div>
</div> </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)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
...@@ -149,7 +158,7 @@ ...@@ -149,7 +158,7 @@
if(data == 'inexistente' || $('#cpf_consulta').val() == ""){ if(data == 'inexistente' || $('#cpf_consulta').val() == ""){
exibirModalUsuarioInexistente(); exibirModalUsuarioInexistente();
}else { }else {
exibirUsuarioAdicionado(); exibirUsuarioAdicionado(data);
$('#integrante').append(` $('#integrante').append(`
<div id="integrante${data[0]['id']}" class="col-md-6"> <div id="integrante${data[0]['id']}" class="col-md-6">
<div class="row"> <div class="row">
...@@ -162,6 +171,7 @@ ...@@ -162,6 +171,7 @@
<strong>CPF:</strong> ${data[0]['cpf']} <strong>CPF:</strong> ${data[0]['cpf']}
<strong>Função:</strong> ${data[1]['nome']} <strong>Função:</strong> ${data[1]['nome']}
<button type="button" class="btn btn-danger" onclick="removerIntegrante(${data[0]['id']})">Remover</button> <button type="button" class="btn btn-danger" onclick="removerIntegrante(${data[0]['id']})">Remover</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -176,8 +186,55 @@ ...@@ -176,8 +186,55 @@
$('#aviso-modal-usuario-nao-existe').modal('show'); $('#aviso-modal-usuario-nao-existe').modal('show');
} }
function exibirUsuarioAdicionado() { let modal_id = 0;
$('#aviso-modal-usuario-adicionado').modal('show');;
function exibirUsuarioAdicionado(data) {
$('#modalIntegrante').modal('hide');
document.getElementById(`nome${modal_id}`).value = data[0]['name'];
document.getElementById(`nome${modal_id}`).setAttribute("readonly", "");
document.getElementById(`email${modal_id}`).value = data[0]['email'];
document.getElementById(`email${modal_id}`).setAttribute("readonly", "");
document.getElementById(`data_de_nascimento${modal_id}`).value = (new Date(data[2]['data_de_nascimento'])).toLocaleDateString();
document.getElementById(`data_de_nascimento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cpf${modal_id}`).value = data[0]['cpf'];
document.getElementById(`cpf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rg${modal_id}`).value = data[2]['rg'];
document.getElementById(`rg${modal_id}`).setAttribute("readonly", "");
document.getElementById(`celular${modal_id}`).value = data[0]['celular'];
document.getElementById(`celular${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cep${modal_id}`).value = data[3]['cep'];
document.getElementById(`cep${modal_id}`).setAttribute("readonly", "");
document.getElementById(`uf${modal_id}`).value = data[3]['uf'];
document.getElementById(`uf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cidade${modal_id}`).value = data[3]['cidade'];
document.getElementById(`cidade${modal_id}`).setAttribute("readonly", "");
document.getElementById(`bairro${modal_id}`).value = data[3]['bairro'];
document.getElementById(`bairro${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rua${modal_id}`).value = data[3]['rua'];
document.getElementById(`rua${modal_id}`).setAttribute("readonly", "");
document.getElementById(`numero${modal_id}`).value = data[3]['numero'];
document.getElementById(`numero${modal_id}`).setAttribute("readonly", "");
document.getElementById(`complemento${modal_id}`).value = data[3]['complemento'];
document.getElementById(`complemento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`instituicao[${modal_id}]`).value = data[0]['instituicao'];
document.getElementById(`instituicao[${modal_id}]`).setAttribute("readonly", "");
document.getElementById(`curso[${modal_id}]`).value = data[2]['curso'];
document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", "");
$(`#exampleModal${modal_id}`).modal('show');
} }
</script> </script>
\ No newline at end of file
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="container"> <div class="container">
<div class="form-row mt-3"> <div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">Informações do Projeto</h5></div>
<div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">@if($edital->tipo == 'CONTINUO')Informações da Atividade de Extensão: @else Informações do Projeto @endif</h5></div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row"> <div class="row">
<div class="form-group col-md-12" style="margin-top: 10px"> <div class="form-group col-md-12" style="margin-top: 10px">
<label for="titulo" class="col-form-label" style="font-weight: bold">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label> <label for="titulo" class="col-form-label" style="font-weight: bold">@if($edital->tipo == 'CONTINUO'){{__('Nome da Atividade de Extensão')}}
@else{{ __('Nome do Projeto') }}@endif <span style="color: red; font-weight:bold">*</span></label>
<input id="titulo" type="text" class="form-control @error('titulo') is-invalid @enderror" name="titulo" placeholder="Digite o nome do projeto" value="{{old('titulo')}}" autocomplete="titulo" maxlength="255" > <input id="titulo" type="text" class="form-control @error('titulo') is-invalid @enderror" name="titulo" placeholder="Digite o nome do projeto" value="{{old('titulo')}}" autocomplete="titulo" maxlength="255" >
@error('titulo') @error('titulo')
...@@ -88,8 +90,9 @@ ...@@ -88,8 +90,9 @@
<div class="row col-md-12"> <div class="row col-md-12">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="ods_id" class="col-form-label" style="font-weight: bold">{{ __('Objetivo de Densenvolvimento Sustentável') }} <span style="color: red; font-weight:bold">*</span></label> <label for="ods_id" class="col-form-label" style="font-weight: bold">{{ __('Objetivo de Desenvolvimento Sustentável') }} <span style="color: red; font-weight:bold">*</span></label>
<span>É possível selecionar um ou mais ODS's</span><br> <span>É possível selecionar um ou mais ODS. Para outras informações,
<a href="https://brasil.un.org/pt-br/sdgs" rel='external' target='_blank'> acesse o link.</a></span><br>
<div class="row col-md-12"> <div class="row col-md-12">
@foreach($ods as $od) @foreach($ods as $od)
<div class="col-md-6"> <div class="col-md-6">
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
@enderror @enderror
</div> </div>
@if($edital->tipo != "PIBEX") @if($edital->tipo != "PIBEX" && $edital->tipo !='CONTINUO')
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Grupo de Pesquisa: ') }}<span style="color: red; font-weight:bold">*</span></label> <label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Grupo de Pesquisa: ') }}<span style="color: red; font-weight:bold">*</span></label>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</div> </div>
@endif @endif
@if($edital->tipo != "PIBEX") @if($edital->tipo != "PIBEX" && $edital->tipo !='CONTINUO')
<div class="col-md-3"> <div class="col-md-3">
<br> <br>
<label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Valor da Planilha de Pontuação: ') }}<span style="color: red; font-weight:bold">*</span></label> <label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Valor da Planilha de Pontuação: ') }}<span style="color: red; font-weight:bold">*</span></label>
......
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
@include('evento.formulario.proponente') @include('evento.formulario.proponente')
@if ($edital->numParticipantes != 0) @if ($edital->numParticipantes != 0)
@include('evento.formulario.participantes') @include('evento.formulario.integrantes')
@endif
@if($edital->natureza_id == 3)
@include('evento.formulario.integrantes')
@endif @endif
@include('evento.formulario.anexos') @include('evento.formulario.anexos')
...@@ -202,12 +198,17 @@ ...@@ -202,12 +198,17 @@
let nomePlano = document.getElementById("nomePlano"+(id+1)); let nomePlano = document.getElementById("nomePlano"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
let cpf = document.getElementById("cpf"+id);
//let funcao = document.getElementById("funcao_participante");
let email = document.getElementById("email"+id);
console.log(planoTrabalho);
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho != null && planoTrabalho.value != ""){
nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção:`;
}else { }else {
nomePlano.innerText = `Nome: ${nome.value}`; nomePlano.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção:`;
} }
}else{ }else{
nomePlano.innerText = `Discente `+(id+1); nomePlano.innerText = `Discente `+(id+1);
...@@ -217,7 +218,8 @@ ...@@ -217,7 +218,8 @@
} }
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
$("#atribuir1").attr('data-target','#exampleModal'+(id+1)); //$("#atribuir1").attr('data-target','#modalIntegrante'+(id+1));
modal_id = id+1;
document.getElementById("part"+id).removeAttribute("hidden"); document.getElementById("part"+id).removeAttribute("hidden");
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("exampleModal"+id).modal('hide');
...@@ -230,7 +232,8 @@ ...@@ -230,7 +232,8 @@
} }
document.getElementById("checkB"+id).checked = false; document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id)); //$("#atribuir1").attr('data-target','#exampleModal'+(id));
modal_id -= 1;
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("exampleModal"+id).modal('hide');
} }
@endif @endif
......
...@@ -14,15 +14,16 @@ ...@@ -14,15 +14,16 @@
</div> </div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row" id="integrante"> <div class="row" id="integrante" style="display:none">
</div> </div>
@include('projeto.editaFormulario.participantes')
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <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-dialog modal-dialog-centered modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5> <h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5>
...@@ -31,24 +32,38 @@ ...@@ -31,24 +32,38 @@
</button> </button>
</div> </div>
<div class="form-row" style="padding: 30px;"> <div class="container">
<div class="col-md-8"> <div class="row justify-content-center" style="padding-left:35px; padding-right:45px">
<label for="cpf_consulta">CPF:</label>
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();"> <div class="form-controll" style="margin-left:10px; margin-top:10px; margin-bottom:15px; font-weight:bold;">
</div>
<div class="col-md-4 mt-4"> <div class="form-row d-flex">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button> <label for="cpf_consulta">CPF:</label>
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();">
</div>
<div class="form-row d-flex" style="margin-top:10px">
<label for="funcao_participante">Função do Integrante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div>
<div class="form-row justify-content-center" style="margin-top:20px;">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
</div>
</div>
</div> </div>
</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>
</div> </div>
...@@ -94,6 +109,26 @@ ...@@ -94,6 +109,26 @@
</div> </div>
<div class="modal fade" id="aviso-modal-limite-de-integrantes" 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">&times;</span>
</button>
</div>
<div class="modal-body" >
<span id="texto-erro">O limite de integrantes para esse projeto foi atingido.</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> <script>
function mask_cpf() { function mask_cpf() {
...@@ -122,6 +157,12 @@ ...@@ -122,6 +157,12 @@
} }
function preencherUsuarioExistente() { function preencherUsuarioExistente() {
console.log(modal_id);
if(!document.getElementById(`exampleModal${modal_id}`)){
exibirModalNumeroMaximoDeIntegrantes();
return;
}
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
...@@ -139,12 +180,12 @@ ...@@ -139,12 +180,12 @@
success: function (data) { success: function (data) {
console.log(data) // console.log(data)
if(data == 'inexistente' || $('#cpf_consulta').val() == ""){ if(data == 'inexistente' || $('#cpf_consulta').val() == ""){
$('#texto-erro').html('CPF não consta no sistema!'); $('#texto-erro').html('CPF não consta no sistema!');
exibirModalUsuarioInexistente(); exibirModalUsuarioInexistente();
}else { }else {
exibirUsuarioAdicionado(); exibirUsuarioAdicionado(data);
$('#integrante').append(` $('#integrante').append(`
<div id="integrante${data[0]['id']}" class="col-md-6"> <div id="integrante${data[0]['id']}" class="col-md-6">
<div class="row"> <div class="row">
...@@ -171,13 +212,64 @@ ...@@ -171,13 +212,64 @@
$('#aviso-modal-usuario-nao-existe').modal('show'); $('#aviso-modal-usuario-nao-existe').modal('show');
} }
function exibirUsuarioAdicionado() { function exibirModalNumeroMaximoDeIntegrantes() {
$('#aviso-modal-usuario-adicionado').modal('show');; $('#aviso-modal-limite-de-integrantes').modal('show');
}
let modal_id = 0;
function exibirUsuarioAdicionado(data) {
// console.log(`${modal_id}`, data);
$('#modalIntegrante').modal('hide');
document.getElementById(`nome${modal_id}`).value = data[0]['name'];
document.getElementById(`nome${modal_id}`).setAttribute("readonly", "");
document.getElementById(`email${modal_id}`).value = data[0]['email'];
document.getElementById(`email${modal_id}`).setAttribute("readonly", "");
document.getElementById(`data_de_nascimento${modal_id}`).value = (new Date(data[2]['data_de_nascimento'])).toLocaleDateString();
document.getElementById(`data_de_nascimento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cpf${modal_id}`).value = data[0]['cpf'];
document.getElementById(`cpf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rg${modal_id}`).value = data[2]['rg'];
document.getElementById(`rg${modal_id}`).setAttribute("readonly", "");
document.getElementById(`celular${modal_id}`).value = data[0]['celular'];
document.getElementById(`celular${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cep${modal_id}`).value = data[3]['cep'];
document.getElementById(`cep${modal_id}`).setAttribute("readonly", "");
document.getElementById(`uf${modal_id}`).value = data[3]['uf'];
document.getElementById(`uf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cidade${modal_id}`).value = data[3]['cidade'];
document.getElementById(`cidade${modal_id}`).setAttribute("readonly", "");
document.getElementById(`bairro${modal_id}`).value = data[3]['bairro'];
document.getElementById(`bairro${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rua${modal_id}`).value = data[3]['rua'];
document.getElementById(`rua${modal_id}`).setAttribute("readonly", "");
document.getElementById(`numero${modal_id}`).value = data[3]['numero'];
document.getElementById(`numero${modal_id}`).setAttribute("readonly", "");
document.getElementById(`complemento${modal_id}`).value = data[3]['complemento'];
document.getElementById(`complemento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`instituicao[${modal_id}]`).value = data[0]['instituicao'];
document.getElementById(`instituicao[${modal_id}]`).setAttribute("readonly", "");
document.getElementById(`curso[${modal_id}]`).value = data[2]['curso'];
document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", "");
$(`#exampleModal${modal_id}`).modal('show');
} }
$(document).ready(function() { $(document).ready(function() {
@foreach($trabalhos_user as $trabalho_user) @foreach($trabalhos_user as $trabalho_user)
if(<?php echo json_encode($trabalho_user) ?>['funcao']){
modal_id += 1;
}
$('#integrante').append(` $('#integrante').append(`
<div id="integrante{{$trabalho_user->id}}" class="col-md-6"> <div id="integrante{{$trabalho_user->id}}" class="col-md-6">
<div class="row"> <div class="row">
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="container"> <div class="container">
<div class="form-row mt-3"> <div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">Informações do Projeto</h5></div> <div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">@if($edital->tipo == 'CONTINUO')Informações da Atividade de Extensão: @else Informações do Projeto @endif</h5></div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row"> <div class="row">
<div class="form-group col-md-12" style="margin-top: 10px"> <div class="form-group col-md-12" style="margin-top: 10px">
<label for="titulo" class="col-form-label" style="font-weight: bold">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label> <label for="titulo" class="col-form-label" style="font-weight: bold">@if($edital->tipo == 'CONTINUO'){{__('Nome da Atividade de Extensão')}}
@else{{ __('Nome do Projeto') }}@endif <span style="color: red; font-weight:bold">*</span></label>
<input id="titulo" type="text" class="form-control @error('titulo') is-invalid @enderror" name="titulo" placeholder="Digite o nome do projeto" value="{{old('titulo') ?? $projeto->titulo}}" autocomplete="titulo" maxlength="255" > <input id="titulo" type="text" class="form-control @error('titulo') is-invalid @enderror" name="titulo" placeholder="Digite o nome do projeto" value="{{old('titulo') ?? $projeto->titulo}}" autocomplete="titulo" maxlength="255" >
<span style="color: red; font-size: 12px" id="caracsRestantestitulo"> <span style="color: red; font-size: 12px" id="caracsRestantestitulo">
</span> </span>
...@@ -88,25 +89,28 @@ ...@@ -88,25 +89,28 @@
</div> </div>
<div class="row col-md-12"> <div class="row col-md-12">
<div class="form-group col-md-12"> <div class="form-group col-md-12">
<label for="ods" class="col-form-label" style="font-weight: bold">{{ __('Objetivo de Densenvolvimento Sustentável') }} <span style="color: red; font-weight:bold">*</span></label><br> <label for="ods" class="col-form-label" style="font-weight: bold">{{ __('Objetivo de Densenvolvimento Sustentável') }} <span style="color: red; font-weight:bold">*</span></label>
<div class="row col-md-12"> <span>É possível selecionar um ou mais ODS. Para outras informações,
@foreach($listaOds as $ods) <a href="https://brasil.un.org/pt-br/sdgs" rel='external' target='_blank'> acesse o link.</a></span><br>
<div class="col-md-6">
<input type="checkbox" name="ods[]" id="ods{{$ods->id}}" value="{{$ods->id}}" @if((empty(old('ods')) && $projeto->ods->contains($ods->id)) || (!empty(old('ods')) && in_array($ods->id, old('ods')))) checked @endif > <div class="row col-md-12">
<label class="form-check-label" for="ods{{$ods->id}}"> @foreach($listaOds as $ods)
{{ $ods->nome }} <div class="col-md-6">
</label> <input type="checkbox" name="ods[]" id="ods{{$ods->id}}" value="{{$ods->id}}" @if((empty(old('ods')) && $projeto->ods->contains($ods->id)) || (!empty(old('ods')) && in_array($ods->id, old('ods')))) checked @endif >
</div> <label class="form-check-label" for="ods{{$ods->id}}">
@endforeach {{ $ods->nome }}
</div> </label>
@error('ods')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div> </div>
</div> @endforeach
</div>
@error('ods')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@endif @endif
</div> </div>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
@enderror @enderror
</div> </div>
@if($edital->tipo != "PIBEX") @if($edital->tipo != "PIBEX" && $edital->tipo !='CONTINUO')
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Grupo de Pesquisa: ') }}</label> <label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Grupo de Pesquisa: ') }}</label>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</div> </div>
@endif @endif
@if($edital->tipo != "PIBEX") @if($edital->tipo != "PIBEX" && $edital->tipo !='CONTINUO')
<div class="col-md-3"> <div class="col-md-3">
<br> <br>
<label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Valor da Planilha de Pontuação: ') }}</label> <label for="lattes" class="col-form-label font-tam" style="font-weight: bold">{{ __('Valor da Planilha de Pontuação: ') }}</label>
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
</div> </div>
@endif @endif
@if($edital->tipo !='CONTINUO')
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<label for="conflitosInteresse" class="col-form-label font-tam" <label for="conflitosInteresse" class="col-form-label font-tam"
...@@ -154,7 +155,7 @@ ...@@ -154,7 +155,7 @@
</span> </span>
@enderror @enderror
</div> </div>
@endif
</div> </div>
</div> </div>
</div> </div>
......
...@@ -35,10 +35,6 @@ ...@@ -35,10 +35,6 @@
@include('projeto.editaFormulario.proponente') @include('projeto.editaFormulario.proponente')
@if ($edital->numParticipantes != 0) @if ($edital->numParticipantes != 0)
@include('projeto.editaFormulario.participantes')
@endif
@if($edital->natureza_id == 3)
@include('projeto.editaFormulario.integrantes') @include('projeto.editaFormulario.integrantes')
@endif @endif
...@@ -50,13 +46,13 @@ ...@@ -50,13 +46,13 @@
</div> </div>
</div> </div>
</form> </form>
@if ($edital->numParticipantes != 0) <!-- @if ($edital->numParticipantes != 0)
<div id="participanteFirst" > <div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent @endcomponent
</div> </div>
@endif @endif -->
<!-- Modal de Aviso Edit --> <!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> <div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
...@@ -233,33 +229,42 @@ ...@@ -233,33 +229,42 @@
let linkNome = document.getElementById("nomePart"+(id+1)); let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
let cpf = document.getElementById("cpf"+id);
let funcao = document.getElementById("funcao_participante");
let email = document.getElementById("email"+id);
let funcaoParticipantes = <?php echo json_encode($funcaoParticipantes); ?>;
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho != null && planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcaoParticipantes[funcao.value -1].nome}`;
}else { }else {
linkNome.innerText = `Nome: ${nome.value}`; linkNome.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção: ${funcaoParticipantes[funcao.value -1].nome}`;
} }
} }
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true); // if(id >=1){
} // document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
// }
// console.log(document.getElementById("exampleModal"+id));
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
$("#atribuir1").attr('data-target','#exampleModal'+(id+1)); // $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
modal_id += 1;
document.getElementById("part"+id).removeAttribute("hidden"); document.getElementById("part"+id).removeAttribute("hidden");
document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
} }
function desmarcar(id){ function desmarcar(id){
if(id >= 1){; // if(id >= 1){
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled"); // document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
} // }
document.getElementById("checkB"+id).checked = false; document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id)); // $("#atribuir1").attr('data-target','#exampleModal'+(id));
document.getElementById("exampleModal"+id).modal('hide'); // document.getElementById("exampleModal"+id).modal('hide');
modal_id -= 1;
console.log(modal_id);
} }
@endif @endif
</script> </script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment