Commit 2b20ab9e authored by unknown's avatar unknown
Browse files

Merge branch 'master' of https://github.com/antonioDurval/submeta

parents d5962a6a 920213d2
...@@ -11,3 +11,4 @@ Homestead.yaml ...@@ -11,3 +11,4 @@ Homestead.yaml
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
submeta.code-workspace submeta.code-workspace
composer.lock
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Curso extends Model
{
protected $fillable = [
'nome',
];
public function proponentes()
{
return $this->belongsToMany('App\Proponente', 'proponentes_cursos', 'curso_id');
}
}
...@@ -13,6 +13,7 @@ use App\User; ...@@ -13,6 +13,7 @@ use App\User;
use App\Participante; use App\Participante;
use App\Proponente; use App\Proponente;
use App\Rules\UrlValidacao; use App\Rules\UrlValidacao;
use App\Curso;
class RegisterController extends Controller class RegisterController extends Controller
{ {
...@@ -91,7 +92,7 @@ class RegisterController extends Controller ...@@ -91,7 +92,7 @@ class RegisterController extends Controller
*/ */
protected function create(array $data) protected function create(array $data)
{ {
//dd($data); // dd($data);
$user = new User(); $user = new User();
$user->name = $data['name']; $user->name = $data['name'];
$user->email = $data['email']; $user->email = $data['email'];
...@@ -136,6 +137,7 @@ class RegisterController extends Controller ...@@ -136,6 +137,7 @@ class RegisterController extends Controller
$proponente->linkLattes = $data['linkLattes']; $proponente->linkLattes = $data['linkLattes'];
$user->proponentes()->save($proponente); $user->proponentes()->save($proponente);
$proponente->cursos()->sync($data['curso']);
} }
return $user; return $user;
...@@ -143,6 +145,7 @@ class RegisterController extends Controller ...@@ -143,6 +145,7 @@ class RegisterController extends Controller
public function showRegistrationForm() public function showRegistrationForm()
{ {
return view('auth.register'); $cursos = Curso::orderBy('nome')->get();
return view('auth.register', compact('cursos'));
} }
} }
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class CursoController extends Controller
{
//
}
...@@ -17,12 +17,13 @@ use App\Notificacao; ...@@ -17,12 +17,13 @@ use App\Notificacao;
use App\Participante; use App\Participante;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use App\Curso;
class ProponenteController extends Controller class ProponenteController extends Controller
{ {
public function index(){ public function index(){
$cursos = Curso::orderBy('nome')->get();
return view('proponente.index'); return view('proponente.index', compact('cursos'));
} }
public function create(){ public function create(){
...@@ -71,6 +72,7 @@ class ProponenteController extends Controller ...@@ -71,6 +72,7 @@ class ProponenteController extends Controller
$proponente->bolsistaProdutividade = $request->bolsistaProdutividade; $proponente->bolsistaProdutividade = $request->bolsistaProdutividade;
$proponente->nivel = $request->nivel; $proponente->nivel = $request->nivel;
$proponente->linkLattes = $request->linkLattes; $proponente->linkLattes = $request->linkLattes;
// dd($request);
$proponente->user_id = Auth::user()->id; $proponente->user_id = Auth::user()->id;
$proponente->save(); $proponente->save();
...@@ -82,6 +84,7 @@ class ProponenteController extends Controller ...@@ -82,6 +84,7 @@ class ProponenteController extends Controller
return redirect( route('home'))->with(['mensagem' => 'Cadastro feito com sucesso! Você já pode criar projetos']); return redirect( route('home'))->with(['mensagem' => 'Cadastro feito com sucesso! Você já pode criar projetos']);
} }
}else{ }else{
// dd($request);
return redirect( route('proponente.create'))->with(['mensagem' => 'Você já é proponente!']); return redirect( route('proponente.create'))->with(['mensagem' => 'Você já é proponente!']);
} }
......
...@@ -178,7 +178,7 @@ class TrabalhoController extends Controller ...@@ -178,7 +178,7 @@ class TrabalhoController extends Controller
$trabalho->status = 'Rascunho'; $trabalho->status = 'Rascunho';
$stringKeys = ['titulo','linkGrupoPesquisa', 'linkLattesEstudante','pontuacaoPlanilha','anexoProjeto', $stringKeys = ['titulo','linkGrupoPesquisa', 'linkLattesEstudante','pontuacaoPlanilha','anexoProjeto',
'anexoPlanilhaPontuacao', 'anexoLattesCoordenador']; 'anexoPlanilhaPontuacao', 'anexoLattesCoordenador', 'conflitosInteresse'];
$intKeys = ['grande_area_id','area_id','sub_area_id','coordenador_id']; $intKeys = ['grande_area_id','area_id','sub_area_id','coordenador_id'];
$trabalho->fill( $trabalho->fill(
...@@ -205,6 +205,9 @@ class TrabalhoController extends Controller ...@@ -205,6 +205,9 @@ class TrabalhoController extends Controller
if(!(is_null($request->linkGrupo))){ if(!(is_null($request->linkGrupo))){
$trabalho->linkGrupoPesquisa = $request->linkGrupo; $trabalho->linkGrupoPesquisa = $request->linkGrupo;
} }
if(!(is_null($request->conflitosInteresse))){
$trabalho->conflitosInteresse = $request->conflitosInteresse;
}
//Anexos do projeto //Anexos do projeto
...@@ -1216,6 +1219,7 @@ class TrabalhoController extends Controller ...@@ -1216,6 +1219,7 @@ class TrabalhoController extends Controller
$projeto->evento_id = $request->editalId; $projeto->evento_id = $request->editalId;
$projeto->status = 'submetido'; $projeto->status = 'submetido';
$projeto->proponente_id = $proponente->id; $projeto->proponente_id = $proponente->id;
$projeto->conflitosInteresse = $request->conflitosInteresse;
// Salvando anexos no storage // Salvando anexos no storage
$projeto->save(); $projeto->save();
......
...@@ -19,6 +19,7 @@ use Carbon\Carbon; ...@@ -19,6 +19,7 @@ use Carbon\Carbon;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use App\Curso;
class UserController extends Controller class UserController extends Controller
{ {
...@@ -26,8 +27,7 @@ class UserController extends Controller ...@@ -26,8 +27,7 @@ class UserController extends Controller
public function index() public function index()
{ {
$eventos = Evento::orderBy('created_at', 'desc')->get(); $eventos = Evento::orderBy('created_at', 'desc')->get();
dd($eventos); if (Auth::check()) {
if(Auth::check()){
Log::debug('UserController check'); Log::debug('UserController check');
return redirect()->route('home'); return redirect()->route('home');
} }
...@@ -35,7 +35,6 @@ class UserController extends Controller ...@@ -35,7 +35,6 @@ class UserController extends Controller
$hoje = Carbon::today('America/Recife'); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString(); $hoje = $hoje->toDateString();
return view('index', ['eventos' => $eventos, 'hoje' => $hoje]); return view('index', ['eventos' => $eventos, 'hoje' => $hoje]);
//return view('auth.login');
} }
public function inicial() public function inicial()
{ {
...@@ -43,17 +42,18 @@ class UserController extends Controller ...@@ -43,17 +42,18 @@ class UserController extends Controller
$hoje = Carbon::today('America/Recife'); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString(); $hoje = $hoje->toDateString();
return view('index', ['eventos' => $eventos, 'hoje' => $hoje]); return view('index', ['eventos' => $eventos, 'hoje' => $hoje]);
//return view('auth.login');
} }
function perfil(){ function perfil()
{
$user = User::find(Auth::user()->id); $user = User::find(Auth::user()->id);
return view('user.perfilUser',['user'=>$user]); return view('user.perfilUser', ['user' => $user]);
} }
function editarPerfil(Request $request){ function editarPerfil(Request $request)
{
$id = Auth()->user()->id; $id = Auth()->user()->id;
$user = User::find($id); $user = User::find($id);
if ($request->tipo != "proponente") { if ($request->tipo != "proponente") {
...@@ -87,8 +87,8 @@ class UserController extends Controller ...@@ -87,8 +87,8 @@ class UserController extends Controller
'nivel' => ['required_if:bolsistaProdutividade,sim'], 'nivel' => ['required_if:bolsistaProdutividade,sim'],
// 'nivel' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''], // 'nivel' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''],
'linkLattes' => ['required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'], 'linkLattes' => ['required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'],
'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''], 'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required' : ''],
'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'link_lattes':''], 'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'link_lattes' : ''],
]); ]);
} }
...@@ -101,8 +101,8 @@ class UserController extends Controller ...@@ -101,8 +101,8 @@ class UserController extends Controller
if (!($request->nova_senha === $request->confirmar_senha)) { if (!($request->nova_senha === $request->confirmar_senha)) {
return redirect()->back()->withErrors(['nova_senha' => 'Senhas diferentes']); return redirect()->back()->withErrors(['nova_senha' => 'Senhas diferentes']);
} }
} }
if($user->avaliadors != null && $request->area != null && $user->tipo == "avaliador"){ if($user->avaliadors != null && $request->area != null && $user->tipo == "avaliador"){
$avaliador = Avaliador::where('user_id', '=', $id)->first(); $avaliador = Avaliador::where('user_id', '=', $id)->first();
$avaliador->user_id = $user->id; $avaliador->user_id = $user->id;
...@@ -110,6 +110,7 @@ class UserController extends Controller ...@@ -110,6 +110,7 @@ class UserController extends Controller
$avaliador->naturezas()->sync($request->natureza); $avaliador->naturezas()->sync($request->natureza);
$avaliador->update(); $avaliador->update();
} }
switch ($request->tipo) { switch ($request->tipo) {
...@@ -122,7 +123,7 @@ class UserController extends Controller ...@@ -122,7 +123,7 @@ class UserController extends Controller
$avaliador = Avaliador::where('user_id', '=', $id)->first(); $avaliador = Avaliador::where('user_id', '=', $id)->first();
$avaliador->user_id = $user->id; $avaliador->user_id = $user->id;
$avaliador->area_id = $request->area; $avaliador->area_id = $request->area;
if($user->usuarioTemp == true){ if ($user->usuarioTemp == true) {
$user->usuarioTemp = false; $user->usuarioTemp = false;
} }
$avaliador->update(); $avaliador->update();
...@@ -150,6 +151,7 @@ class UserController extends Controller ...@@ -150,6 +151,7 @@ class UserController extends Controller
$proponente->linkLattes = $request->linkLattes; $proponente->linkLattes = $request->linkLattes;
$proponente->user_id = $user->id; $proponente->user_id = $user->id;
$proponente->cursos()->sync($request->curso);
$proponente->update(); $proponente->update();
break; break;
case "participante": case "participante":
...@@ -157,7 +159,7 @@ class UserController extends Controller ...@@ -157,7 +159,7 @@ class UserController extends Controller
//$participante = $user->participantes->where('user_id', Auth::user()->id)->first(); //$participante = $user->participantes->where('user_id', Auth::user()->id)->first();
$participante->user_id = $user->id; $participante->user_id = $user->id;
//dd($participante); //dd($participante);
if($user->usuarioTemp == true){ if ($user->usuarioTemp == true) {
$user->usuarioTemp = false; $user->usuarioTemp = false;
} }
...@@ -184,24 +186,26 @@ class UserController extends Controller ...@@ -184,24 +186,26 @@ class UserController extends Controller
$user->update(); $user->update();
return redirect( route('user.perfil') )->with(['mensagem' => 'Dados atualizados com sucesso.']); return redirect(route('user.perfil'))->with(['mensagem' => 'Dados atualizados com sucesso.']);
} }
public function meusTrabalhos(){ public function meusTrabalhos()
{
//$trabalhos = Trabalho::where('autorId', Auth::user()->id)->get(); //$trabalhos = Trabalho::where('autorId', Auth::user()->id)->get();
$proponente = Proponente::with('user')->where('user_id', Auth::user()->id)->first(); $proponente = Proponente::with('user')->where('user_id', Auth::user()->id)->first();
$trabalhos = $proponente->trabalhos; $trabalhos = $proponente->trabalhos;
//dd($trabalhos); //dd($trabalhos);
return view('user.meusTrabalhos',[ return view('user.meusTrabalhos', [
'trabalhos' => $trabalhos, 'trabalhos' => $trabalhos,
'agora' => now(), 'agora' => now(),
]); ]);
} }
public function minhaConta() { public function minhaConta()
{
$id = Auth::user()->id; $id = Auth::user()->id;
$user = User::find($id); $user = User::find($id);
...@@ -209,13 +213,16 @@ class UserController extends Controller ...@@ -209,13 +213,16 @@ class UserController extends Controller
$avaliador = Avaliador::where('user_id', '=', $id)->first(); $avaliador = Avaliador::where('user_id', '=', $id)->first();
$proponente = Proponente::where('user_id', '=', $id)->first(); $proponente = Proponente::where('user_id', '=', $id)->first();
$participante = Participante::where('user_id', '=', $id)->first(); $participante = Participante::where('user_id', '=', $id)->first();
$naturezas = Natureza::orderBy('nome')->get(); $naturezas = Natureza::orderBy('nome')->get();
$cursos = Curso::orderBy('nome')->get();
return view('user.perfilUser')->with(['user' => $user, return view('user.perfilUser')->with(['user' => $user,
'adminResp' => $adminResp, 'adminResp' => $adminResp,
'avaliador' => $avaliador, 'avaliador' => $avaliador,
'proponente' => $proponente, 'proponente' => $proponente,
'participante' => $participante, 'participante' => $participante,
'cursos' => $cursos,
'naturezas' => $naturezas]); 'naturezas' => $naturezas]);
} }
} }
...@@ -14,4 +14,9 @@ class Proponente extends Model ...@@ -14,4 +14,9 @@ class Proponente extends Model
public function trabalhos(){ public function trabalhos(){
return $this->hasMany('App\Trabalho'); return $this->hasMany('App\Trabalho');
} }
public function cursos()
{
return $this->belongsToMany('App\Curso', 'proponentes_cursos', 'proponente_id');
}
} }
...@@ -21,6 +21,7 @@ class Trabalho extends Model ...@@ -21,6 +21,7 @@ class Trabalho extends Model
'linkLattesEstudante', 'linkLattesEstudante',
'comentario', 'comentario',
'modalidade', 'modalidade',
'conflitosInteresse',
'anexoDecisaoCONSU', 'anexoDecisaoCONSU',
'anexoAutorizacaoComiteEtica', 'anexoAutorizacaoComiteEtica',
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCursosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cursos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cursos');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProponentesCursosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('proponentes_cursos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('curso_id');
$table->foreign('curso_id')->references('id')->on('cursos');
$table->integer('proponente_id');
$table->foreign('proponente_id')->references('id')->on('proponentes');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('proponentes_cursos');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddConflitosInteresseToTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->text('conflitosInteresse')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->dropColumn('conflitosInteresse');
});
}
}
...@@ -140,6 +140,13 @@ ...@@ -140,6 +140,13 @@
<a style="color: #4D4D4D;">{{$trabalho->modalidade}}</a> <a style="color: #4D4D4D;">{{$trabalho->modalidade}}</a>
</div> </div>
@endif @endif
@if ($trabalho->conflitosInteresse != null)
<div class="col-md-12">
<br>
<b style="color: #4D4D4D;">Conflitos de Interesse: </b>
<a style="color: #4D4D4D;">{{ $trabalho->conflitosInteresse }}</a>
</div>
@endif
</div> </div>
</div> </div>
</div> </div>
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">{{ __('Nome Completo') }} <span style="color: red; font-weight:bold;">*</span></label> <label for="name" class="col-form-label">{{ __('Nome Completo') }} <span style="color: red; font-weight:bold;">*</span></label>
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" placeholder="Digite seu nome completo" value="{{ old('name') }}" required autocomplete="name" autofocus> <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" placeholder="Digite seu nome completo" value="{{ old('name') }}" required autocomplete="name" autofocus>
@error('name') @error('name')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
...@@ -68,7 +67,7 @@ ...@@ -68,7 +67,7 @@
<select style="display: inline" onchange="showInstituicao()" class="form-control @error('instituicaoSelect') is-invalid @enderror" name="instituicaoSelect" id="instituicaoSelect"> <select style="display: inline" onchange="showInstituicao()" class="form-control @error('instituicaoSelect') is-invalid @enderror" name="instituicaoSelect" id="instituicaoSelect">
<option value="" disabled selected hidden>-- Instituição --</option> <option value="" disabled selected hidden>-- Instituição --</option>
<option @if(old('instituicaoSelect')=='UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option> <option @if(old('instituicaoSelect')=='UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicaoSelect')=='Outra' ) selected @endif value="Outra" >Outra</option> <option @if(old('instituicaoSelect')=='Outra' ) selected @endif value="Outra">Outra</option>
</select> </select>
@error('instituicaoSelect') @error('instituicaoSelect')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
...@@ -124,11 +123,26 @@ ...@@ -124,11 +123,26 @@
@enderror @enderror
</div> </div>
</div> </div>
<div style="display:none" id="cursos" class="col-md-12 mb-2">
<label for="curso" class="col-form-label">{{ __('Cursos') }} <span style="color: red; font-weight:bold;">*</span></label>
<br>
<div class="row col-md-12">
@foreach($cursos as $curso)
<div class="col-sm-6">
<input type="checkbox" name="curso[]" id="curso{{$curso->id}}" value="{{$curso->id}}">
<label class="form-check-label" for="curso{{$curso->id}}">
{{ $curso->nome }}
</label>
</div>
@endforeach
</div>
</div>
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group" style="display: block;" id="divOutro"> <div class="form-group" style="display: block;" id="divOutro">
<label for="outro" class="col-form-label">{{ __('Qual?') }} <span style="color: red; font-weight:bold;">*</span></label> <label for="outro" class="col-form-label">{{ __('Qual?') }} <span style="color: red; font-weight:bold;">*</span></label>
<input id="outro" type="text" class="form-control @error('outro') is-invalid @enderror" name="outro" placeholder="Digite aqui o seu vínculo" value="{{ old('outro') }}"> <input id="outro" type="text" class="form-control @error('outro') is-invalid @enderror" name="outro" placeholder="Digite aqui o seu vínculo" value="{{ old('outro') }}">
@error('outro') @error('outro')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
...@@ -289,8 +303,8 @@ ...@@ -289,8 +303,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
@endsection @endsection
...@@ -314,14 +328,20 @@ ...@@ -314,14 +328,20 @@
var divProponente = document.getElementById('proponente'); var divProponente = document.getElementById('proponente');
var comboBoxCargo = document.getElementById('cargo'); var comboBoxCargo = document.getElementById('cargo');
var comboBoxVinculo = document.getElementById('vinculo'); var comboBoxVinculo = document.getElementById('vinculo');
let cursos = document.getElementById('cursos');
if (comboBoxCargo.value === "Estudante" && comboBoxVinculo.value !== "Pós-doutorando") { if (comboBoxCargo.value === "Estudante" && comboBoxVinculo.value !== "Pós-doutorando") {
divProponente.style.display = "none"; divProponente.style.display = "none";
} else { } else {
document.getElementById("outro").value=""; document.getElementById("outro").value = "";
divProponente.style.display = "block"; divProponente.style.display = "block";
} }
if (comboBoxCargo.value === "Professor") {
cursos.style.display = "block";
} else {
cursos.style.display = "none";
}
outroVinculo(); outroVinculo();
} }
...@@ -347,20 +367,20 @@ ...@@ -347,20 +367,20 @@
} }
} }
function showInstituicao(){ function showInstituicao() {
var instituicao = document.getElementById('instituicao'); var instituicao = document.getElementById('instituicao');
var instituicaoSelect = document.getElementById('instituicaoSelect'); var instituicaoSelect = document.getElementById('instituicaoSelect');
if(instituicaoSelect.value === "Outra"){ if (instituicaoSelect.value === "Outra") {
document.getElementById("displayOutro").style.display = "block"; document.getElementById("displayOutro").style.display = "block";
instituicao.parentElement.style.display = ''; instituicao.parentElement.style.display = '';
document.getElementById('instituicao').value=""; document.getElementById('instituicao').value = "";
}else if(instituicaoSelect.value === "UFAPE"){ } else if (instituicaoSelect.value === "UFAPE") {
document.getElementById("displayOutro").style.display = "none"; document.getElementById("displayOutro").style.display = "none";
} }
} }
function onload(){ function onload() {
mudarNivel(); mudarNivel();
outroVinculo(); outroVinculo();
mudar(); mudar();
......
...@@ -85,9 +85,21 @@ ...@@ -85,9 +85,21 @@
</div> </div>
@endif @endif
<div class="col-md-2">
<br>
<label for="conflitosInteresse" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Conflitos de interesse: ') }}</label>
</div>
<div class="col-md-10">
<br>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse"
autofocus id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ old('conflitosInteresse') }}</textarea>
@error('conflitosInteresse')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div> </div>
</div> </div>
......
...@@ -96,9 +96,21 @@ ...@@ -96,9 +96,21 @@
</div> </div>
@endif @endif
<div class="col-md-2">
<br>
<label for="conflitosInteresse" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Conflitos de interesse: ') }}</label>
</div>
<div class="col-md-10">
<br>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse"
autofocus id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ $projeto->conflitosInteresse }}</textarea>
@error('conflitosInteresse')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div> </div>
</div> </div>
......
...@@ -50,6 +50,17 @@ ...@@ -50,6 +50,17 @@
@enderror @enderror
</div> </div>
@if ($projeto->conflitosInteresse != null &&
(Auth::user()->tipo == 'administrador' ||
Auth::user()->tipo == 'administradorResponsavel' ||
Auth::user()->tipo == 'coordenador'))
<div class="form-group col-md-6">
<label for="conflitosInteresse">Conflitos de interesse: </label>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" name="conflitosInteresse"
rows="4" disabled>{{ $projeto->conflitosInteresse }}</textarea>
</div>
@endif
</div> </div>
</div> </div>
</div> </div>
......
...@@ -76,6 +76,18 @@ ...@@ -76,6 +76,18 @@
</div> </div>
@endif @endif
@if ($projeto->conflitosInteresse != null &&
(Auth::user()->tipo == 'administrador' ||
Auth::user()->tipo == 'administradorResponsavel' ||
Auth::user()->tipo == 'coordenador' ||
Auth::user()->id == $projeto->proponente->user->id))
<div class="col-md-12">
<br>
<b style="color: #4D4D4D;">Conflitos de Interesse: </b>
<a style="color: #4D4D4D;">{{ $projeto->conflitosInteresse }}</a>
</div>
@endif
</div> </div>
</div> </div>
</div> </div>
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<option value="{{ $user->instituicao }}" selected>{{ $user->instituicao }}</option> <option value="{{ $user->instituicao }}" selected>{{ $user->instituicao }}</option>
@endif @endif
<option @if( $user->instituicao == "UFAPE") selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option> <option @if( $user->instituicao == "UFAPE") selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicaoSelect') == "Outra") selected @endif value="Outra">Outra</option> <option @if(old('instituicaoSelect')=="Outra" ) selected @endif value="Outra">Outra</option>
</select> </select>
@error('instituicaoSelect') @error('instituicaoSelect')
...@@ -92,6 +92,22 @@ ...@@ -92,6 +92,22 @@
@enderror @enderror
</div> </div>
</div> </div>
@if (Auth()->user()->tipo == 'proponente')
<div class="col-md-12 mb-2">
<label for="curso" class="col-form-label">{{ __('Cursos*:') }}</label>
<br>
<div class="row col-md-12">
@foreach($cursos as $curso)
<div class="col-sm-6">
<input type="checkbox" name="curso[]" id="curso{{$curso->id}}" value="{{$curso->id}}" @if((empty(old('curso')) && $proponente->cursos->contains($curso->id)) || (!empty(old('curso')) && in_array($curso->id, old('curso')))) checked @endif>
<label class="form-check-label" for="curso{{$curso->id}}">
{{ $curso->nome }}
</label>
</div>
@endforeach
</div>
</div>
@endif
<div class="col-md-12" id="displayOutro" style="display: none;"> <div class="col-md-12" id="displayOutro" style="display: none;">
<div class="form-group"> <div class="form-group">
<label for="instituicao" class="col-form-label">{{ __('Digite a Instituição*') }}</label> <label for="instituicao" class="col-form-label">{{ __('Digite a Instituição*') }}</label>
...@@ -113,7 +129,7 @@ ...@@ -113,7 +129,7 @@
@if(Auth()->user()->avaliadors->area_id == $area->id) @if(Auth()->user()->avaliadors->area_id == $area->id)
<option value="{{ $area->id }}" selected>{{ $area->nome }}</option> <option value="{{ $area->id }}" selected>{{ $area->nome }}</option>
@else @else
<option value="{{ $area->id }}" >{{ $area->nome }}</option> <option value="{{ $area->id }}">{{ $area->nome }}</option>
@endif @endif
@endforeach @endforeach
@else @else
...@@ -121,7 +137,7 @@ ...@@ -121,7 +137,7 @@
@if(Auth()->user()->avaliadors->area_id == $area->id) @if(Auth()->user()->avaliadors->area_id == $area->id)
<option value="{{ $area->id }}" selected>{{ $area->nome }}</option> <option value="{{ $area->id }}" selected>{{ $area->nome }}</option>
@else @else
<option value="{{ $area->id }}" >{{ $area->nome }}</option> <option value="{{ $area->id }}">{{ $area->nome }}</option>
@endif @endif
@endforeach @endforeach
@endif @endif
...@@ -146,6 +162,7 @@ ...@@ -146,6 +162,7 @@
@endforeach @endforeach
</div> </div>
@else @else
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="cargo" class="col-form-label">{{ __('Cargo*') }}</label> <label for="cargo" class="col-form-label">{{ __('Cargo*') }}</label>
...@@ -181,7 +198,7 @@ ...@@ -181,7 +198,7 @@
<option @if($proponente->vinculo =='Pós-doutorando' ) selected @endif value="Pós-doutorando">Pós-doutorando</option> <option @if($proponente->vinculo =='Pós-doutorando' ) selected @endif value="Pós-doutorando">Pós-doutorando</option>
<option @if($proponente->vinculo =='Outro' ) selected @endif value="Outro">Outro</option> <option @if($proponente->vinculo =='Outro' ) selected @endif value="Outro">Outro</option>
@if ($proponente->vinculo !='Servidor na ativa' && $proponente->vinculo !='Servidor aposentado' && $proponente->vinculo !='Professor visitante' && $proponente->vinculo !='Pós-doutorando' && $proponente->vinculo !='Outro') @if ($proponente->vinculo !='Servidor na ativa' && $proponente->vinculo !='Servidor aposentado' && $proponente->vinculo !='Professor visitante' && $proponente->vinculo !='Pós-doutorando' && $proponente->vinculo !='Outro')
<option value="{{ $proponente->vinculo }}" selected >{{ $proponente->vinculo }}</option> <option value="{{ $proponente->vinculo }}" selected>{{ $proponente->vinculo }}</option>
@endif @endif
@else @else
<option value="Servidor na ativa">Servidor na ativa</option> <option value="Servidor na ativa">Servidor na ativa</option>
...@@ -400,7 +417,9 @@ ...@@ -400,7 +417,9 @@
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div><hr></div> <div>
<hr>
</div>
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
<div> <div>
<a class="btn btn-light botao-form" href="{{ route('home') }}" style="color:red; margin-left:5px;">Cancelar</a> <a class="btn btn-light botao-form" href="{{ route('home') }}" style="color:red; margin-left:5px;">Cancelar</a>
...@@ -432,18 +451,18 @@ ...@@ -432,18 +451,18 @@
</div> </div>
<form id="formEditUser" method="POST" action="{{ route('perfil.edit') }}"> <form id="formEditUser" method="POST" action="{{ route('perfil.edit') }}">
@csrf @csrf
{{-- Nome | CPF {{-- Nome | CPF
<div class="form-group row"> <div class="form-group row">
<input type="hidden" name="tipo" value="{{ $user->tipo }}"> <input type="hidden" name="tipo" value="{{ $user->tipo }}">
@if(session('mensagem')) @if(session('mensagem'))
<div class="col-md-12" style="margin-top: 5px;"> <div class="col-md-12" style="margin-top: 5px;">
<div class="alert alert-success"> <div class="alert alert-success">
<p>{{session('mensagem')}}</p> <p>{{session('mensagem')}}</p>
</div> </div>
</div> </div>
@endif @endif
<div class="col-md-8"> <div class="col-md-8">
<label for="name" class="col-form-label">{{ __('Nome Completo*') }}</label> <label for="name" class="col-form-label">{{ __('Nome Completo*') }}</label>
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ $user->name }}" required autocomplete="name" autofocus> <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ $user->name }}" required autocomplete="name" autofocus>
...@@ -452,9 +471,9 @@ ...@@ -452,9 +471,9 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="cpf" class="col-form-label">{{ __('CPF*') }}</label> <label for="cpf" class="col-form-label">{{ __('CPF*') }}</label>
<input id="cpf" type="text" class="form-control @error('cpf') is-invalid @enderror" name="cpf" value="{{ $user->cpf }}" required autocomplete="cpf" autofocus> <input id="cpf" type="text" class="form-control @error('cpf') is-invalid @enderror" name="cpf" value="{{ $user->cpf }}" required autocomplete="cpf" autofocus>
...@@ -463,28 +482,28 @@ ...@@ -463,28 +482,28 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
</div> </div>
{{-- Instituição de Ensino e Celular {{-- Instituição de Ensino e Celular
<div class="form-group row"> <div class="form-group row">
<div class="col-md-6"> <div class="col-md-6">
<label class="col-form-label">{{ __('Instituição de Vínculo*') }}</label> <label class="col-form-label">{{ __('Instituição de Vínculo*') }}</label>
<select style="display: inline" onchange="showInstituicao()" class="form-control @error('instituicaoSelect') is-invalid @enderror" name="instituicaoSelect" id="instituicaoSelect"> <select style="display: inline" onchange="showInstituicao()" class="form-control @error('instituicaoSelect') is-invalid @enderror" name="instituicaoSelect" id="instituicaoSelect">
<option value="" disabled hidden>-- Instituição --</option> <option value="" disabled hidden>-- Instituição --</option>
@if($user->instituicao != "UFAPE") @if($user->instituicao != "UFAPE")
<option value="{{ $user->instituicao }}" selected>{{ $user->instituicao }}</option> <option value="{{ $user->instituicao }}" selected>{{ $user->instituicao }}</option>
@endif @endif
<option @if( $user->instituicao == "UFAPE") selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option> <option @if( $user->instituicao == "UFAPE") selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicaoSelect') == "Outra") selected @endif value="Outra">Outra</option> <option @if(old('instituicaoSelect')=="Outra" ) selected @endif value="Outra">Outra</option>
</select> </select>
@error('instituicaoSelect') @error('instituicaoSelect')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class='col-md-4' style="display: none;"> <div class='col-md-4' style="display: none;">
<label for="instituicao" class="col-form-label">{{ __('Digite a Instituição*') }}</label> <label for="instituicao" class="col-form-label">{{ __('Digite a Instituição*') }}</label>
<input id="instituicao" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="instituicao" value="{{ old('instituicao') }}" placeholder="Digite o nome da Instituição" autocomplete="instituicao" autofocus> <input id="instituicao" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="instituicao" value="{{ old('instituicao') }}" placeholder="Digite o nome da Instituição" autocomplete="instituicao" autofocus>
@error('instituicao') @error('instituicao')
...@@ -492,8 +511,8 @@ ...@@ -492,8 +511,8 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label for="celular" class="col-form-label">{{ __('Celular*') }}</label> <label for="celular" class="col-form-label">{{ __('Celular*') }}</label>
<input id="celular" type="text" class="form-control @error('celular') is-invalid @enderror" name="celular" value="{{ $user->celular }}" required autocomplete="celular" autofocus> <input id="celular" type="text" class="form-control @error('celular') is-invalid @enderror" name="celular" value="{{ $user->celular }}" required autocomplete="celular" autofocus>
...@@ -502,8 +521,8 @@ ...@@ -502,8 +521,8 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="email" class="col-form-label">{{ __('E-mail*') }}</label> <label for="email" class="col-form-label">{{ __('E-mail*') }}</label>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $user->email }}" disabled> <input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $user->email }}" disabled>
...@@ -512,9 +531,9 @@ ...@@ -512,9 +531,9 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
@if(Auth()->user()->avaliadors) @if(Auth()->user()->avaliadors)
<div class="col-md-4"> <div class="col-md-4">
<label for="area" class="col-form-label">{{ __('Área:') }}</label> <label for="area" class="col-form-label">{{ __('Área:') }}</label>
<select style="display: inline" class="form-control @error('area') is-invalid @enderror" name="area" id="area"> <select style="display: inline" class="form-control @error('area') is-invalid @enderror" name="area" id="area">
@if(Auth()->user()->avaliadors->area_id == null) @if(Auth()->user()->avaliadors->area_id == null)
...@@ -523,7 +542,7 @@ ...@@ -523,7 +542,7 @@
@if(Auth()->user()->avaliadors->area_id == $area->id) @if(Auth()->user()->avaliadors->area_id == $area->id)
<option value="{{ $area->id }}" selected>{{ $area->nome }}</option> <option value="{{ $area->id }}" selected>{{ $area->nome }}</option>
@else @else
<option value="{{ $area->id }}" >{{ $area->nome }}</option> <option value="{{ $area->id }}">{{ $area->nome }}</option>
@endif @endif
@endforeach @endforeach
@else @else
...@@ -531,7 +550,7 @@ ...@@ -531,7 +550,7 @@
@if(Auth()->user()->avaliadors->area_id == $area->id) @if(Auth()->user()->avaliadors->area_id == $area->id)
<option value="{{ $area->id }}" selected>{{ $area->nome }}</option> <option value="{{ $area->id }}" selected>{{ $area->nome }}</option>
@else @else
<option value="{{ $area->id }}" >{{ $area->nome }}</option> <option value="{{ $area->id }}">{{ $area->nome }}</option>
@endif @endif
@endforeach @endforeach
@endif @endif
...@@ -543,29 +562,29 @@ ...@@ -543,29 +562,29 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
@endif @endif
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-4"> <div class="col-md-4">
<input type="checkbox" id="alterarSenhaCheckBox" name="alterarSenhaCheckBox" onchange="habilitando()"> <input type="checkbox" id="alterarSenhaCheckBox" name="alterarSenhaCheckBox" onchange="habilitando()">
<label for="alterarSenhaCheckBox">Desejo alterar minha senha</label> <label for="alterarSenhaCheckBox">Desejo alterar minha senha</label>
</div> </div>
</div> </div>
{{-- Email | Senha | Confirmar Senha {{-- Email | Senha | Confirmar Senha
<div class="form-group row"> <div class="form-group row">
<div class="col-md-4"> <div class="col-md-4">
<label for="senha_atual" class="col-form-label">{{ __('Senha atual*') }}</label> <label for="senha_atual" class="col-form-label">{{ __('Senha atual*') }}</label>
<input id="senha_atual" type="password" class="form-control @error('senha_atual') is-invalid @enderror" name="senha_atual" value="" disabled> <input id="senha_atual" type="password" class="form-control @error('senha_atual') is-invalid @enderror" name="senha_atual" value="" disabled>
@error('senha_atual') @error('senha_atual')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="nova_senha" class="col-form-label">{{ __('Nova senha*') }}</label> <label for="nova_senha" class="col-form-label">{{ __('Nova senha*') }}</label>
<input id="nova_senha" type="password" class="form-control @error('nova_senha') is-invalid @enderror" name="nova_senha" value="" disabled> <input id="nova_senha" type="password" class="form-control @error('nova_senha') is-invalid @enderror" name="nova_senha" value="" disabled>
...@@ -574,9 +593,9 @@ ...@@ -574,9 +593,9 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label for="confirmar_senha" class="col-form-label">{{ __('Confirmar nova senha*') }}</label> <label for="confirmar_senha" class="col-form-label">{{ __('Confirmar nova senha*') }}</label>
<input id="confirmar_senha" type="password" class="form-control @error('confirmar_senha') is-invalid @enderror" name="confirmar_senha" value="" disabled> <input id="confirmar_senha" type="password" class="form-control @error('confirmar_senha') is-invalid @enderror" name="confirmar_senha" value="" disabled>
...@@ -585,11 +604,11 @@ ...@@ -585,11 +604,11 @@
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
</div> </div>
@if(isset($proponente)) @if(isset($proponente))
<div id="proponente" style="display: block;"> <div id="proponente" style="display: block;">
<div> <div>
<h4>Dados de proponente</h4> <h4>Dados de proponente</h4>
...@@ -621,7 +640,7 @@ ...@@ -621,7 +640,7 @@
<option @if($proponente->vinculo =='Pós-doutorando' ) selected @endif value="Pós-doutorando">Pós-doutorando</option> <option @if($proponente->vinculo =='Pós-doutorando' ) selected @endif value="Pós-doutorando">Pós-doutorando</option>
<option @if($proponente->vinculo =='Outro' ) selected @endif value="Outro">Outro</option> <option @if($proponente->vinculo =='Outro' ) selected @endif value="Outro">Outro</option>
@if ($proponente->vinculo !='Servidor na ativa' && $proponente->vinculo !='Servidor aposentado' && $proponente->vinculo !='Professor visitante' && $proponente->vinculo !='Pós-doutorando' && $proponente->vinculo !='Outro') @if ($proponente->vinculo !='Servidor na ativa' && $proponente->vinculo !='Servidor aposentado' && $proponente->vinculo !='Professor visitante' && $proponente->vinculo !='Pós-doutorando' && $proponente->vinculo !='Outro')
<option value="{{ $proponente->vinculo }}" selected >{{ $proponente->vinculo }}</option> <option value="{{ $proponente->vinculo }}" selected>{{ $proponente->vinculo }}</option>
@endif @endif
</select> </select>
...@@ -761,12 +780,12 @@ ...@@ -761,12 +780,12 @@
@endif @endif
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endif @endif
</form> </form>
<div class="container"> <div class="container">
<div class="row justify-content-center" style="margin: 20px 0 20px 0"> <div class="row justify-content-center" style="margin: 20px 0 20px 0">
<div class="col-md-6" style="padding-left:0"> <div class="col-md-6" style="padding-left:0">
...@@ -778,13 +797,13 @@ ...@@ -778,13 +797,13 @@
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
--}} --}}
@endsection @endsection
@section('javascript') @section('javascript')
<script type="text/javascript" > <script type="text/javascript">
//var emailInput = document.getElementById('email'); //var emailInput = document.getElementById('email');
//emailInput.disabled = true; //emailInput.disabled = true;
...@@ -795,18 +814,19 @@ ...@@ -795,18 +814,19 @@
function limpa_formulário_cep() { function limpa_formulário_cep() {
//Limpa valores do formulário de cep. //Limpa valores do formulário de cep.
document.getElementById('rua').value=(""); document.getElementById('rua').value = ("");
document.getElementById('bairro').value=(""); document.getElementById('bairro').value = ("");
document.getElementById('cidade').value=(""); document.getElementById('cidade').value = ("");
document.getElementById('uf').value=(""); document.getElementById('uf').value = ("");
} }
function meu_callback(conteudo) { function meu_callback(conteudo) {
if (!("erro" in conteudo)) { if (!("erro" in conteudo)) {
//Atualiza os campos com os valores. //Atualiza os campos com os valores.
document.getElementById('rua').value=(conteudo.logradouro); document.getElementById('rua').value = (conteudo.logradouro);
document.getElementById('bairro').value=(conteudo.bairro); document.getElementById('bairro').value = (conteudo.bairro);
document.getElementById('cidade').value=(conteudo.localidade); document.getElementById('cidade').value = (conteudo.localidade);
document.getElementById('uf').value=(conteudo.uf); document.getElementById('uf').value = (conteudo.uf);
} //end if. } //end if.
else { else {
//CEP não Encontrado. //CEP não Encontrado.
...@@ -814,6 +834,7 @@ ...@@ -814,6 +834,7 @@
alert("CEP não encontrado."); alert("CEP não encontrado.");
} }
} }
function pesquisacep(valor) { function pesquisacep(valor) {
//Nova variável "cep" somente com dígitos. //Nova variável "cep" somente com dígitos.
var cep = valor.replace(/\D/g, ''); var cep = valor.replace(/\D/g, '');
...@@ -822,16 +843,16 @@ ...@@ -822,16 +843,16 @@
//Expressão regular para validar o CEP. //Expressão regular para validar o CEP.
var validacep = /^[0-9]{8}$/; var validacep = /^[0-9]{8}$/;
//Valida o formato do CEP. //Valida o formato do CEP.
if(validacep.test(cep)) { if (validacep.test(cep)) {
//Preenche os campos com "..." enquanto consulta webservice. //Preenche os campos com "..." enquanto consulta webservice.
document.getElementById('rua').value="..."; document.getElementById('rua').value = "...";
document.getElementById('bairro').value="..."; document.getElementById('bairro').value = "...";
document.getElementById('cidade').value="..."; document.getElementById('cidade').value = "...";
document.getElementById('uf').value="..."; document.getElementById('uf').value = "...";
//Cria um elemento javascript. //Cria um elemento javascript.
var script = document.createElement('script'); var script = document.createElement('script');
//Sincroniza com o callback. //Sincroniza com o callback.
script.src = 'https://viacep.com.br/ws/'+ cep + '/json/?callback=meu_callback'; script.src = 'https://viacep.com.br/ws/' + cep + '/json/?callback=meu_callback';
//Insere script no documento e carrega o conteúdo. //Insere script no documento e carrega o conteúdo.
document.body.appendChild(script); document.body.appendChild(script);
} //end if. } //end if.
...@@ -846,6 +867,7 @@ ...@@ -846,6 +867,7 @@
limpa_formulário_cep(); limpa_formulário_cep();
} }
}; };
function mudar() { function mudar() {
var divProponente = document.getElementById('proponente'); var divProponente = document.getElementById('proponente');
var comboBoxTipo = document.getElementById('tipo'); var comboBoxTipo = document.getElementById('tipo');
...@@ -880,7 +902,7 @@ ...@@ -880,7 +902,7 @@
} }
} }
function showInstituicao(){ function showInstituicao() {
var instituicao = document.getElementById('instituicao'); var instituicao = document.getElementById('instituicao');
var instituicaoSelect = document.getElementById('instituicaoSelect'); var instituicaoSelect = document.getElementById('instituicaoSelect');
...@@ -888,10 +910,10 @@ ...@@ -888,10 +910,10 @@
// instituicaoSelect.style.display = "none"; // instituicaoSelect.style.display = "none";
// instituicao.style.display = "inline"; // instituicao.style.display = "inline";
// } // }
if(instituicaoSelect.value === "Outra"){ if (instituicaoSelect.value === "Outra") {
document.getElementById("displayOutro").style.display = "block"; document.getElementById("displayOutro").style.display = "block";
instituicao.parentElement.style.display = ''; instituicao.parentElement.style.display = '';
}else if(instituicaoSelect.value === "UFAPE"){ } else if (instituicaoSelect.value === "UFAPE") {
document.getElementById("displayOutro").style.display = "none"; document.getElementById("displayOutro").style.display = "none";
} }
} }
...@@ -917,5 +939,5 @@ ...@@ -917,5 +939,5 @@
} }
window.onload = showInstituicao(); window.onload = showInstituicao();
</script> </script>
@endsection @endsection
\ No newline at end of file
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