Commit 12d84e97 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

submissao e rascunho e visualizar

parent c22f4e4b
...@@ -12,7 +12,7 @@ class Arquivo extends Model ...@@ -12,7 +12,7 @@ class Arquivo extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'nome', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId' 'nome','titulo', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId'
]; ];
public function trabalho(){ public function trabalho(){
......
...@@ -35,6 +35,7 @@ use Illuminate\Support\Facades\DB; ...@@ -35,6 +35,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Log;
use App\Http\Requests\StoreTrabalho; use App\Http\Requests\StoreTrabalho;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use App\Http\Requests\UpdateTrabalho;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use App\Mail\EmailParaUsuarioNaoCadastrado; use App\Mail\EmailParaUsuarioNaoCadastrado;
...@@ -233,7 +234,7 @@ class TrabalhoController extends Controller ...@@ -233,7 +234,7 @@ class TrabalhoController extends Controller
} }
//Autorização ou Justificativa //Autorização ou Justificativa
if( isset($request->anexoComiteEtica)){ if( isset($request->anexoAutorizacaoComiteEtica)){
if(Storage::disk()->exists($trabalho->anexoAutorizacaoComiteEtica)) { if(Storage::disk()->exists($trabalho->anexoAutorizacaoComiteEtica)) {
Storage::delete($trabalho->anexoAutorizacaoComiteEtica); Storage::delete($trabalho->anexoAutorizacaoComiteEtica);
} }
...@@ -391,234 +392,233 @@ class TrabalhoController extends Controller ...@@ -391,234 +392,233 @@ class TrabalhoController extends Controller
]); ]);
} }
public function update(Request $request, $id)
{
$mytime = Carbon::now('America/Recife');
$mytime = $mytime->toDateString();
$evento = Evento::find($request->editalId);
$coordenador = CoordenadorComissao::find($evento->coordenadorId);
//Relaciona o projeto criado com o proponente que criou o projeto
$proponente = Proponente::where('user_id', Auth::user()->id)->first();
//$trabalho->proponentes()->save($proponente);
//dd($coordenador->id);
$trabalho = "trabalho";
if($evento->inicioSubmissao > $mytime){
if($mytime >= $evento->fimSubmissao){
return redirect()->route('home');
}
}
//O anexo de Decisão do CONSU dependo do tipo de edital
if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){
$validatedData = $request->validate([
'editalId' => ['required', 'string'],
'nomeProjeto' => ['required', 'string'],
'grandeArea' => ['required', 'string'],
'area' => ['required', 'string'],
'subArea' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupo' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'nomeParticipante.*' => ['required', 'string'],
'emailParticipante.*' => ['required', 'string'],
'funcaoParticipante.*' => ['required', 'string'],
]);
}else{
//Caso em que o anexo da Decisão do CONSU não necessário
$validatedData = $request->validate([
'editalId' => ['required', 'string'],
'nomeProjeto' => ['required', 'string',],
'grandeArea' => ['required', 'string'],
'area' => ['required', 'string'],
'subArea' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupo' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'nomeCoordenador' => ['required', 'string'],
'nomeParticipante.*' => ['required', 'string'],
'emailParticipante.*' => ['required', 'string'],
'funcaoParticipante.*' => ['required', 'string'],
]);
}
$trabalho = Trabalho::find($id);
$trabalho->titulo = $request->nomeProjeto;
$trabalho->coordenador_id = $coordenador->id;
$trabalho->grande_area_id = $request->grandeArea;
$trabalho->area_id = $request->area;
$trabalho->sub_area_id = $request->subArea;
$trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha;
$trabalho->linkGrupoPesquisa = $request->linkGrupo;
$trabalho->linkLattesEstudante = $request->linkLattesEstudante;
$trabalho->data = $mytime;
$trabalho->evento_id = $request->editalId;
$trabalho->proponente_id = $proponente->id;
$pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
if (!(is_null($request->anexoDecisaoCONSU))) {
Storage::delete($trabalho->anexoDecisaoCONSU);
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf");
}
if (!(is_null($request->anexoProjeto))) { // $mytime = Carbon::now('America/Recife');
Storage::delete($trabalho->anexoProjeto); // $mytime = $mytime->toDateString();
$trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf"); // $evento = Evento::find($request->editalId);
} // $coordenador = CoordenadorComissao::find($evento->coordenadorId);
// //Relaciona o projeto criado com o proponente que criou o projeto
// $proponente = Proponente::where('user_id', Auth::user()->id)->first();
// //$trabalho->proponentes()->save($proponente);
// //dd($coordenador->id);
// $trabalho = "trabalho";
// if($evento->inicioSubmissao > $mytime){
// if($mytime >= $evento->fimSubmissao){
// return redirect()->route('home');
// }
// }
if (!(is_null($request->anexoComiteEtica))) { // //O anexo de Decisão do CONSU dependo do tipo de edital
Storage::delete($trabalho->anexoComiteEtica); // if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf");
} // $validatedData = $request->validate([
// 'editalId' => ['required', 'string'],
// 'nomeProjeto' => ['required', 'string'],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string'],
// 'linkLattesEstudante' => ['required', 'string'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante.*' => ['required', 'string'],
// ]);
if (!(is_null($request->anexoLattesCoordenador))) { // }else{
Storage::delete($trabalho->anexoLattesCoordenador); // //Caso em que o anexo da Decisão do CONSU não necessário
$trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf"); // $validatedData = $request->validate([
} // 'editalId' => ['required', 'string'],
// 'nomeProjeto' => ['required', 'string',],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string'],
// 'linkLattesEstudante' => ['required', 'string'],
// 'nomeCoordenador' => ['required', 'string'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante.*' => ['required', 'string'],
// ]);
// }
if (!(is_null($request->anexoPlanilhaPontuacao))) { // $trabalho = Trabalho::find($id);
Storage::delete($trabalho->anexoLattesCoordenador); // $trabalho->titulo = $request->nomeProjeto;
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.pdf"); // $trabalho->coordenador_id = $coordenador->id;
} // $trabalho->grande_area_id = $request->grandeArea;
//atualizando projeto // $trabalho->area_id = $request->area;
$trabalho->update(); // $trabalho->sub_area_id = $request->subArea;
// $trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha;
// $trabalho->linkGrupoPesquisa = $request->linkGrupo;
// $trabalho->linkLattesEstudante = $request->linkLattesEstudante;
// $trabalho->data = $mytime;
// $trabalho->evento_id = $request->editalId;
// $trabalho->proponente_id = $proponente->id;
// $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
// if (!(is_null($request->anexoDecisaoCONSU))) {
// Storage::delete($trabalho->anexoDecisaoCONSU);
// $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf");
// }
// criando novos participantes que podem ter sido adicionados // if (!(is_null($request->anexoProjeto))) {
$participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); // Storage::delete($trabalho->anexoProjeto);
$users = User::whereIn('id', $participantesUsersIds)->get(); // $trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf");
$emailParticipantes = []; // }
foreach ($users as $user) {
array_push($emailParticipantes, $user->email);
}
foreach ($request->emailParticipante as $key => $value) {
// criando novos participantes que podem ter sido adicionados
if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) {
$userParticipante = User::where('email', $value)->first();
if($userParticipante == null){
$passwordTemporario = Str::random(8);
$subject = "Participante de Projeto";
Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject));
$usuario = User::create([
'email' => $value,
'password' => bcrypt($passwordTemporario),
'usuarioTemp' => true,
'name' => $request->nomeParticipante[$key],
'tipo' => 'participante',
]);
$participante = new Participante(); // if (!(is_null($request->anexoComiteEtica))) {
$participante->user_id = $usuario->id; // Storage::delete($trabalho->anexoComiteEtica);
$participante->trabalho_id = $trabalho->id; // $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf");
$participante->funcao_participante_id = $request->funcaoParticipante[$key]; // }
$participante->save();
}else{ // if (!(is_null($request->anexoLattesCoordenador))) {
$participante = new Participante(); // Storage::delete($trabalho->anexoLattesCoordenador);
$participante->user_id = $userParticipante->id; // $trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf");
$participante->trabalho_id = $trabalho->id; // }
$participante->funcao_participante_id = $request->funcaoParticipante[$key];
$participante->save();
$participante->trabalhos()->save($trabalho); // if (!(is_null($request->anexoPlanilhaPontuacao))) {
// Storage::delete($trabalho->anexoLattesCoordenador);
// $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.pdf");
// }
// //atualizando projeto
// $trabalho->update();
// // criando novos participantes que podem ter sido adicionados
// $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
// $users = User::whereIn('id', $participantesUsersIds)->get();
// $emailParticipantes = [];
// foreach ($users as $user) {
// array_push($emailParticipantes, $user->email);
// }
// foreach ($request->emailParticipante as $key => $value) {
// // criando novos participantes que podem ter sido adicionados
// if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) {
// $userParticipante = User::where('email', $value)->first();
// if($userParticipante == null){
// $passwordTemporario = Str::random(8);
// $subject = "Participante de Projeto";
// Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject));
// $usuario = User::create([
// 'email' => $value,
// 'password' => bcrypt($passwordTemporario),
// 'usuarioTemp' => true,
// 'name' => $request->nomeParticipante[$key],
// 'tipo' => 'participante',
// ]);
$subject = "Participante de Projeto"; // $participante = new Participante();
$email = $value; // $participante->user_id = $usuario->id;
Mail::to($email) // $participante->trabalho_id = $trabalho->id;
->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho)); // $participante->funcao_participante_id = $request->funcaoParticipante[$key];
} // $participante->save();
// }else{
// $participante = new Participante();
// $participante->user_id = $userParticipante->id;
// $participante->trabalho_id = $trabalho->id;
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->save();
// $participante->trabalhos()->save($trabalho);
// $subject = "Participante de Projeto";
// $email = $value;
// Mail::to($email)
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
// }
$path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; // $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf"; // $nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key]; // $file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome); // Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo(); // $arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key]; // $arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome; // $arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id; // $arquivo->trabalhoId = $trabalho->id;
$arquivo->data = $mytime; // $arquivo->data = $mytime;
$arquivo->participanteId = $participante->id; // $arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true; // $arquivo->versaoFinal = true;
$arquivo->save(); // $arquivo->save();
} // }
//atualizando os participantes que já estão no projeto e planos de trabalho se enviados // //atualizando os participantes que já estão no projeto e planos de trabalho se enviados
if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) { // if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) {
$userParticipante = User::where('email', $value)->first(); // $userParticipante = User::where('email', $value)->first();
if($userParticipante != null){ // if($userParticipante != null){
$user = User::where('email', $request->emailParticipante[$key])->first(); // $user = User::where('email', $request->emailParticipante[$key])->first();
$participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first(); // $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
$user->name = $request->nomeParticipante[$key]; // $user->name = $request->nomeParticipante[$key];
$user->update(); // $user->update();
$participante->funcao_participante_id = $request->funcaoParticipante[$key]; // $participante->funcao_participante_id = $request->funcaoParticipante[$key];
$participante->update(); // $participante->update();
//atualizando planos de trabalho // //atualizando planos de trabalho
if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) { // if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) {
if (!(is_null($request->anexoPlanoTrabalho[$key]))) { // if (!(is_null($request->anexoPlanoTrabalho[$key]))) {
$arquivo = Arquivo::where('participanteId', $participante->id)->first(); // $arquivo = Arquivo::where('participanteId', $participante->id)->first();
//se plano já existir, deletar // //se plano já existir, deletar
if($arquivo != null){ // if($arquivo != null){
Storage::delete($arquivo->nome); // Storage::delete($arquivo->nome);
$arquivo->delete(); // $arquivo->delete();
} // }
//atualizar plano // //atualizar plano
if($request->semPlano[$key] == null){ // if($request->semPlano[$key] == null){
$path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; // $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf"; // $nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key]; // $file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome); // Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo(); // $arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key]; // $arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome; // $arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id; // $arquivo->trabalhoId = $trabalho->id;
$arquivo->data = $mytime; // $arquivo->data = $mytime;
$arquivo->participanteId = $participante->id; // $arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true; // $arquivo->versaoFinal = true;
$arquivo->save(); // $arquivo->save();
} // }
} // }
} // }
//removendo planos de trabalho // //removendo planos de trabalho
if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){ // if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){
if($request->semPlano[$key] == 'sim'){ // if($request->semPlano[$key] == 'sim'){
$arquivo = Arquivo::where('participanteId', $participante->id)->first(); // $arquivo = Arquivo::where('participanteId', $participante->id)->first();
//se plano já existir, deletar // //se plano já existir, deletar
if($arquivo != null){ // if($arquivo != null){
Storage::delete($arquivo->nome); // Storage::delete($arquivo->nome);
$arquivo->delete(); // $arquivo->delete();
} // }
} // }
} // }
} // }
} // }
} // }
// Atualizando possiveis usuários removidos // // Atualizando possiveis usuários removidos
$participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); // $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
$users = User::whereIn('id', $participantesUsersIds)->get(); // $users = User::whereIn('id', $participantesUsersIds)->get();
// foreach ($users as $user) {
// if (!(in_array($user->email, $request->emailParticipante, false))) {
// $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
// $arquivo = Arquivo::where('participanteId', $participante->id)->first();
// if($arquivo != null){
// Storage::delete($arquivo->nome);
// $arquivo->delete();
// }
// $participante->delete();
// }
// }
foreach ($users as $user) {
if (!(in_array($user->email, $request->emailParticipante, false))) {
$participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
if($arquivo != null){
Storage::delete($arquivo->nome);
$arquivo->delete();
}
$participante->delete();
}
}
return redirect()->route('evento.visualizar',['id'=>$request->editalId]);
}
public function destroy(Request $request) public function destroy(Request $request)
{ {
...@@ -926,12 +926,168 @@ class TrabalhoController extends Controller ...@@ -926,12 +926,168 @@ class TrabalhoController extends Controller
// $trabalho->participantes()->save($participante); // $trabalho->participantes()->save($participante);
// } // }
public function salvar(StoreTrabalho $request) { public function update(UpdateTrabalho $request, $id)
{
// dd($request->participante_id);
// dd( $request->all() );
try { try {
if (!$request->has('rascunho') ) {
$request->merge([
'status' => 'submetido'
]);
}else{
$request->merge([
'status' => 'rascunho'
]);
}
$evento = Evento::find($request->editalId);
$request->merge([
'coordenador_id' => $evento->coordenadorComissao->id
]);
DB::beginTransaction();
$trabalho = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
$trabalho->update($request->except([
'anexoProjeto', 'anexoDecisaoCONSU','anexoPlanilhaPontuacao',
'anexoLattesCoordenador','anexoGrupoPesquisa','anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica'
]));
if ($request->marcado == null) {
$idExcluido = $trabalho->participantes->pluck('id');
}else{
$idExcluido = [];
}
// dd($idExcluido);
// dd(array_search( 2, $request->marcado));
foreach ($request->participante_id as $key => $value) {
// $value = intval($value);
if($request->marcado != null && array_search( $key, $request->marcado) === false){
if($value !== null)
array_push($idExcluido, $value);
}
}
// dd($idExcluido);
foreach ($idExcluido as $key => $value) {
$trabalho->participantes()->find($value)->delete();
}
$trabalho->refresh();
if($request->has('marcado')){
foreach ($request->marcado as $key => $part) {
$part = intval($part);
$passwordTemporario = Str::random(8);
$data['name'] = $request->name[$part];
$data['email'] = $request->email[$part];
$data['password'] = bcrypt($passwordTemporario);
$data['data_de_nascimento'] = $request->data_de_nascimento[$part];
$data['cpf'] = $request->cpf[$part];
$data['tipo'] = 'participante';
$data['funcao_participante_id'] = 4;
$data['rg'] = $request->rg[$part];
$data['celular'] = $request->celular[$part];
$data['cep'] = $request->cep[$part];
$data['uf'] = $request->uf[$part];
$data['cidade'] = $request->cidade[$part];
$data['rua'] = $request->rua[$part];
$data['numero'] = $request->numero[$part];
$data['bairro'] = $request->bairro[$part];
$data['complemento'] = $request->complemento[$part];
$data['instituicao'] = $request->instituicao[$part];
$data['total_periodos'] = $request->total_periodos[$part];
$data['curso'] = $request->curso[$part];
$data['turno'] = $request->turno[$part];
$data['periodo_atual'] = $request->periodo_atual[$part];
$data['ordem_prioridade'] = $request->ordem_prioridade[$part];
$data['media_do_curso'] = $request->media_do_curso[$part];
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part];
$participante = Participante::find($request->participante_id[$part]);
if (!$participante){
$data['usuarioTemp'] = true;
$user = User::updateOrCreate(
['email' => $data['email']],
$data
);
$endereco = Endereco::create($data);
$endereco->user()->save($user);
$participante = Participante::create($data);
$user->participantes()->save($participante);
$trabalho->participantes()->save($participante);
}else{
$user = $participante->user;
$user->update($data);
$endereco = $user->endereco;
$endereco->update($data);
$participante = $user->participantes->where('trabalho_id', $trabalho->id)->first();
if (!$participante){
$participante = Participante::create($data);
$user->participantes()->save($participante);
$trabalho->participantes()->save($participante);
}else{
$participante->update($data);
}
}
if ( $request->has('anexoPlanoTrabalho') && array_key_exists($part,$request->anexoPlanoTrabalho) ) {
if(Arquivo::where('participanteId', $participante->id)->count()){
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/';
$nome = $data['nomePlanoTrabalho'] .".pdf";
$file = $request->anexoPlanoTrabalho[$part] ;
Storage::putFileAs($path, $file, $nome);
$arquivo->update([
'titulo' => $nome,
'nome' => $path . $nome,
'data' => now() ,
]);
}else{
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/';
$nome = $data['nomePlanoTrabalho'] .".pdf";
$file = $request->anexoPlanoTrabalho[$part] ;
Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo();
$arquivo->titulo = $data['nomePlanoTrabalho'];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id;
$arquivo->data = now();
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
}
}
}
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->save();
DB::commit();
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta atualizada!']);
} catch (\Throwable $th) {
DB::rollback();
return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]);
}
}
public function salvar(StoreTrabalho $request) {
try {
if (!$request->has('rascunho') ) { if (!$request->has('rascunho') ) {
$request->merge([ $request->merge([
'status' => 'submetido' 'status' => 'submetido'
...@@ -969,6 +1125,7 @@ class TrabalhoController extends Controller ...@@ -969,6 +1125,7 @@ class TrabalhoController extends Controller
$data['cidade'] = $request->cidade[$part]; $data['cidade'] = $request->cidade[$part];
$data['rua'] = $request->rua[$part]; $data['rua'] = $request->rua[$part];
$data['numero'] = $request->numero[$part]; $data['numero'] = $request->numero[$part];
$data['bairro'] = $request->bairro[$part];
$data['complemento'] = $request->complemento[$part]; $data['complemento'] = $request->complemento[$part];
$data['instituicao'] = $request->instituicao[$part]; $data['instituicao'] = $request->instituicao[$part];
$data['total_periodos'] = $request->total_periodos[$part]; $data['total_periodos'] = $request->total_periodos[$part];
......
...@@ -33,7 +33,6 @@ class StoreTrabalho extends FormRequest ...@@ -33,7 +33,6 @@ class StoreTrabalho extends FormRequest
'titulo' => ['required', 'string'], 'titulo' => ['required', 'string'],
'grande_area_id' => ['required', 'string'], 'grande_area_id' => ['required', 'string'],
'area_id' => ['required', 'string'], 'area_id' => ['required', 'string'],
'sub_area_id' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'], 'linkLattesEstudante' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'], 'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'], 'linkGrupoPesquisa' => ['required', 'string'],
...@@ -80,7 +79,6 @@ class StoreTrabalho extends FormRequest ...@@ -80,7 +79,6 @@ class StoreTrabalho extends FormRequest
} }
} }
// dd($rules);
if ($this->has('rascunho')) { if ($this->has('rascunho')) {
return [ return [
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
namespace App\Http\Requests; namespace App\Http\Requests;
use App\Trabalho;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
class UpdateTrabalho extends FormRequest class UpdateTrabalho extends FormRequest
{ {
...@@ -13,7 +16,7 @@ class UpdateTrabalho extends FormRequest ...@@ -13,7 +16,7 @@ class UpdateTrabalho extends FormRequest
*/ */
public function authorize() public function authorize()
{ {
return false; return true;
} }
/** /**
...@@ -23,8 +26,69 @@ class UpdateTrabalho extends FormRequest ...@@ -23,8 +26,69 @@ class UpdateTrabalho extends FormRequest
*/ */
public function rules() public function rules()
{ {
$projeto = Trabalho::find($this->id);
$rules = [
'editalId' => ['required', 'string'],
'marcado.*' => ['required'],
'titulo' => ['required', 'string'],
'grande_area_id' => ['required', 'string'],
'area_id' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'],
'anexoProjeto' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoProjeto == null)], 'mimes:pdf'],
'anexoDecisaoCONSU' => ['mimes:pdf'],
'anexoPlanilhaPontuacao' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoPlanilhaPontuacao == null)]],
'anexoLattesCoordenador' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoLattesCoordenador == null)], 'mimes:pdf'],
'anexoGrupoPesquisa' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoGrupoPesquisa == null)], 'mimes:pdf'],
'anexoAutorizacaoComiteEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null) )
],
'justificativaAutorizacaoEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null))
],
];
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
//user
$rules['name.'.$value] = ['required', 'string'];
$rules['email.'.$value] = ['required', 'string'];
$rules['instituicao.'.$value] = ['required', 'string'];
$rules['cpf.'.$value] = ['required', 'string'];
$rules['celular.'.$value] = ['required', 'string'];
//endereco
$rules['rua.'.$value] = ['required', 'string'];
$rules['numero.'.$value] = ['required', 'string'];
$rules['bairro.'.$value] = ['required', 'string'];
$rules['cidade.'.$value] = ['required', 'string'];
$rules['uf.'.$value] = ['required', 'string'];
$rules['cep.'.$value] = ['required', 'string'];
$rules['complemento.'.$value] = ['required', 'string'];
//participante
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$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'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['media_do_curso.'.$value] = ['required', 'string'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
}
}
// dd($this->all());
if ($this->has('rascunho')) {
return [ return [
//
]; ];
}else{
return $rules;
}
} }
} }
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableArquivos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('arquivos', function (Blueprint $table) {
$table->string('nome')->nullable()->change();
$table->string('titulo')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('arquivos', function (Blueprint $table) {
//
});
}
}
@php @php
$class = $class ?? " "; $class = $class ?? " ";
$obrigatorio = $obrigatorio ?? " "; // $obrigatorio = $obrigatorio ?? " ";
@endphp @endphp
<div class="form-group"> <div class="form-group">
<label class=" control-label {{ $class }}" for="firstname">{{ $label }} @if($obrigatorio) <span style="color: red; font-weight:bold">*</span> @endif</label> <label class=" control-label {{ $class }}" for="firstname">{{ $label }} <span style="color: red; font-weight:bold">*</span></label>
<div class="">
{{ $slot }} {{ $slot }}
<div class="">
</div> </div>
</div> </div>
...@@ -42,14 +42,13 @@ ...@@ -42,14 +42,13 @@
@endcomponent @endcomponent
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)']) <label class=" control-label" for="firstname">Decisão do CONSU (.pdf)</label>
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" placeholder="anexoDecisaoCONSU" accept=".pdf" /> <input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
@error('anexoDecisaoCONSU') @error('anexoDecisaoCONSU')
<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>
</span> </span>
@enderror @enderror
@endcomponent
</div> </div>
<div class="form-group col-md-6" style="margin-top: 10px"> <div class="form-group col-md-6" style="margin-top: 10px">
......
...@@ -70,13 +70,8 @@ ...@@ -70,13 +70,8 @@
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'CPF']) @component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? "" }}" name="cpf[{{$i}}]" placeholder="CPF" onchange="checarCPFdoCampo(this)" onkeyup="mascaraCPF(this)"/> <input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? "" }}" name="cpf[{{$i}}]" placeholder="CPF" />
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF inválido.</span>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF válido.</span>
</span>
@error('cpf.'.$i) @error('cpf.'.$i)
<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>
...@@ -107,7 +102,7 @@ ...@@ -107,7 +102,7 @@
<div class="col-md-12"><h5>Endereço</h5></div> <div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'CEP']) @component('componentes.input', ['label' => 'CEP'])
<input type="number" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" /> <input type="text" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i) @error('cep.'.$i)
<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>
......
...@@ -13,12 +13,23 @@ ...@@ -13,12 +13,23 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Projeto (.pdf)']) @component('componentes.input', ['label' => 'Projeto (.pdf)'])
<input type="file" class="input-group-text" name="anexoProjeto" placeholder="nomeProjeto" accept="application/pdf" /> <input type="file" class="input-group-text" name="anexoProjeto" accept="application/pdf" />
@error('anexoProjeto')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoProjeto)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
{{-- Anexo do currículo --}} {{-- Anexo do currículo --}}
...@@ -26,12 +37,23 @@ ...@@ -26,12 +37,23 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Currículo Lattes do Proponente (.pdf)']) @component('componentes.input', ['label' => 'Currículo Lattes do Proponente (.pdf)'])
<input type="file" class="input-group-text" name="anexoLattesCoordenador" placeholder="anexoPlanoTrabalho" accept=".pdf" /> <input type="file" class="input-group-text" name="anexoLattesCoordenador" accept=".pdf" />
@error('anexoLattesCoordenador')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoLattesCoordenador)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
{{-- Anexo da Planilha de Pontuação --}} {{-- Anexo da Planilha de Pontuação --}}
...@@ -39,12 +61,24 @@ ...@@ -39,12 +61,24 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Planilha de Pontuação (.xlsx,.xls,.ods)']) @component('componentes.input', ['label' => 'Planilha de Pontuação (.xlsx,.xls,.ods)'])
<input type="file" class="input-group-text" name="anexoPlanilha" placeholder="anexoPlanoTrabalho" accept=".xlsx, .xls, .ods" /> <input type="file" class="input-group-text" name="anexoPlanilhaPontuacao" accept=".xlsx, .xls, .ods" />
@error('anexoPlanilhaPontuacao')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoPlanilhaPontuacao)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
...@@ -52,13 +86,28 @@ ...@@ -52,13 +86,28 @@
<div class="form-group col-md-6" style="margin-top: 10px"> <div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)']) <div class="form-group">
<input type="file" class="input-group-text" name="anexoConsuPreenchido" placeholder="anexoConsuPreenchido" accept=".pdf" /> <label class=" control-label" for="firstname">Decisão do CONSU (.pdf)</label>
@endcomponent
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
@error('anexoDecisaoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div> </div>
@if($projeto->anexoDecisaoCONSU)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
...@@ -68,20 +117,32 @@ ...@@ -68,20 +117,32 @@
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)']) @component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)'])
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" /> <input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" />
@error('anexoGrupoPesquisa')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoGrupoPesquisa)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.anexoGrupoPesquisa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexoGrupoPesquisa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label> <label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="radio" checked id="radioSim" onchange="displayAutorizacoesEspeciais('sim')"> <input type="radio" checked id="radioSim" name="sim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label> <label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" onchange="displayAutorizacoesEspeciais('nao')"> <input type="radio" id="radioNao" name="nao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br> <label for="radioNao" style="margin-right: 5px">Não</label><br>
<span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none"> <span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>Selecione a autorização e envie o arquivo!</strong> <strong>Selecione a autorização e envie o arquivo!</strong>
...@@ -89,20 +150,52 @@ ...@@ -89,20 +150,52 @@
<div class="form-group" id="displaySim" style="display: block; margin-top:-1rem"> <div class="form-group" id="displaySim" style="display: block; margin-top:-1rem">
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)']) @component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)'])
<input type="file" class="input-group-text" name="anexoComiteEtica" placeholder="anexoComiteEtica" accept=".pdf" /> <input type="file" class="input-group-text" name="anexoAutorizacaoComiteEtica" accept=".pdf" />
<div class="row justify-content-center">
@if($projeto->justificativaAutorizacaoEtica || $projeto->anexoAutorizacaoComiteEtica )
<div class="row justify-content-center">
<div class="col-3 mt-2">
<a href="{{ route('baixar.anexo.comite', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div>
@error('anexoAutorizacaoComiteEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem"> <div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
@component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)']) @component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)'])
<input type="file" class="input-group-text" name="inputJustificativa" placeholder="inputJustificativa" accept=".pdf" /> <input type="file" class="input-group-text" name="justificativaAutorizacaoEtica" accept=".pdf" />
@endcomponent @if($projeto->justificativaAutorizacaoEtica || $projeto->anexoAutorizacaoComiteEtica )
</div>
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-3 "> <div class="col-3 mt-2">
<a href="{{ route('baixar.anexo.justificativa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.justificativa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
@error('justificativaAutorizacaoEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div> </div>
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px"> <div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6> <h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button id="submeterFormProposta" type="submit" style="display: none;"></button> <button id="submeterFormProposta" type="submit" style="display: none;"></button>
<button type="button" class="btn btn-success" id="idButtonSubmitProjeto" onclick="submeterProposta()">{{ __('Atualizar Projeto') }}</button> <button type="submit" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Atualizar rascunho') }}</button>
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Atualizar Proposta') }}</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -18,122 +18,208 @@ ...@@ -18,122 +18,208 @@
<li id="item"> <li id="item">
<div style="margin-bottom:15px"> <div style="margin-bottom:15px">
<div id="participante" > <div id="participante" >
@foreach ($participantes as $key => $p) @for($i = 0; $i < $edital->numParticipantes; $i++)
<div class="form-row mt-2"> @php
$p = null;
if ($projeto->participantes->keys()->contains($i)) {
$p = $projeto->participantes[$i];
}
@endphp
@if($p)
<div class="form-row mb-1">
<div class="col-md-11"> <div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{ $p->id }}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left"> <a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{$i}}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4> <h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div> </div>
</a> </a>
</div> </div>
<div class="col-1" style="margin-top:4.3px"> <div class="col-1" style="margin-top:9.3px">
<button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> {{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}}
<input type="checkbox" aria-label="Checkbox for following text input" @if(old('name')[$i] ?? $p) checked @endif name="marcado[]" value="{{ $i }}">
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="collapse" id="collapseParticipante{{ $p->id }}"> <div class="collapse" id="collapseParticipante{{$i}}">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<input type="hidden" name="participante_id[]" value="{{ $p->id }}"> <input type="hidden" name="participante_id[]" value="{{ $p->id ?? "" }}">
<input type="hidden" name="funcaoParticipante[]" value="4"> <input type="hidden" name="funcaoParticipante[]" value="4">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div> <div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Nome completo']) @component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " value="{{ $p->user->name }}" name="nomeParticipante[]" placeholder="Nome Completo" required /> <input type="text" class="form-control " value="{{old('name')[$i] ?? $p->user->name }}" name="name[{{$i}}]" placeholder="Nome Completo" />
@error("name.".$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'E-mail']) @component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" value="{{ $p->user->email }}" name="emailParticipante[]" placeholder="E-mail" required/> <input type="email" class="form-control" value="{{old('email')[$i] ?? $p->user->email }}" name="email[{{$i}}]" placeholder="E-mail" />
@error('email.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento']) @component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{ $p->data_de_nascimento }}" name="data_de_nascimento[]" placeholder="Data de nascimento" required/> <input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? $p->data_de_nascimento }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('data_de_nascimento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'CPF']) @component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{ $p->user->cpf }}" name="cpf[]" placeholder="CPF" required /> <input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? $p->user->cpf }}" name="cpf[{{$i}}]" placeholder="CPF" />
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF inválido.</span> @error('cpf.'.$i)
</span> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none"> <strong>{{ $message }}</strong>
<span style="font-style: italic;">CPF válido.</span>
</span> </span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'RG']) @component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" value="{{ $p->rg }}" min="1" maxlength="12" name="rg[]" placeholder="RG" required/> <input type="number" class="form-control" min="1" maxlength="12" value="{{old('rg')[$i] ?? $p->rg }}" name="rg[{{$i}}]" placeholder="RG" />
@error('rg.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Celular']) @component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{ $p->user->celular }}" name="celular[]" placeholder="Celular" required/> <input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? $p->user->celular }}" name="celular[{{$i}}]" placeholder="Celular" />
@error('celular.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-md-12"><h5>Endereço</h5></div> <div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'CEP']) @component('componentes.input', ['label' => 'CEP'])
<input type="number" class="form-control" value="{{ $p->user->endereco->cep }}" name="cep[]" placeholder="CEP" required/> <input type="text" class="form-control" value="{{old('cep')[$i] ?? $p->user->endereco->cep }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Estado']) @component('componentes.select', ['label' => 'Estado'])
<select name="uf[]" id="estado" class="form-control" style="visibility: visible" required> <select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
<option value="" disabled selected>-- Selecione uma opção --</option> <option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome) @foreach ($estados as $sigla => $nome)
<option @if( $p->user->endereco->uf == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option> <option @if(old('uf')[$i] ?? $p->user->endereco->uf == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach @endforeach
</select> </select>
@error('uf.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Cidade']) @component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{ $p->user->endereco->cidade }}" name="cidade[]" placeholder="Cidade" required/> <input type="text" class="form-control" value="{{old('cidade')[$i] ?? $p->user->endereco->cidade }}" name="cidade[{{$i}}]" placeholder="Cidade" />
@error('cidade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Bairro']) @component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{ $p->user->endereco->bairro }}" name="bairro[]" placeholder="Bairro" required/> <input type="text" class="form-control" value="{{old('bairro')[$i] ?? $p->user->endereco->bairro }}" name="bairro[{{$i}}]" placeholder="Bairro" />
@error('bairro.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Rua']) @component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{ $p->user->endereco->rua }}" name="rua[]" placeholder="Rua" required/> <input type="text" class="form-control" value="{{old('rua')[$i] ?? $p->user->endereco->rua }}" name="rua[{{$i}}]" placeholder="Rua" />
@error('rua.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Número']) @component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{ $p->user->endereco->numero }}" name="numero[]" placeholder="Número" required/> <input type="text" class="form-control" value="{{old('numero')[$i] ?? $p->user->endereco->numero }}" name="numero[{{$i}}]" placeholder="Número" />
@error('numero.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-12"> <div class="col-12">
@component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => '']) @component('componentes.input', ['label' => 'Complemento',])
<input type="text" class="form-control" value="{{ $p->user->endereco->complemento }}" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento"/> <input type="text" class="form-control" value="{{old('complemento')[$i] ?? $p->user->endereco->complemento }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-md-12"><h5>Dados do curso</h5></div> <div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Universidade']) @component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" value="{{ $p->user->instituicao }}" name="universidade[]" placeholder="Universidade" required/> <input type="text" class="form-control" value="{{old('instituicao')[$i] ?? $p->user->instituicao }}" name="instituicao[{{$i}}]" placeholder="Universidade" />
@error('instituicao.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Curso']) @component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" value="{{ $p->curso }}" name="curso[]" placeholder="Curso" required/> <input type="text" class="form-control" value="{{old('curso')[$i] ?? $p->curso }}" name="curso[{{$i}}]" placeholder="Curso" />
@error('curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Turno']) @component('componentes.select', ['label' => 'Turno'])
<select name="turno[]" class="form-control" required> <select name="turno[{{$i}}]" class="form-control" >
<option value="" disabled selected>-- Selecione uma opção --</option> <option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value) @foreach ($enum_turno as $key => $value)
<option @if($p->turno == $value ) selected @endif value="{{ $value }}">{{ $value }}</option> <option @if(old('turno')[$i] ?? $p->turno == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach @endforeach
</select> </select>
@error('turno.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
@php @php
...@@ -141,65 +227,389 @@ ...@@ -141,65 +227,389 @@
@endphp @endphp
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos do curso']) @component('componentes.select', ['label' => 'Total de períodos do curso'])
<select name="total_periodos[]" class="form-control" onchange="gerarPeriodo(this)" required> <select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)" >
<option value="" disabled selected>-- Selecione uma opção --</option> <option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value) @foreach ($options as $key => $value)
<option @if($p->total_periodos == $key ) selected @endif value="{{ $key }}">{{ $value }}</option> <option @if(old('total_periodos')[$i] ?? $p->total_periodos == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach @endforeach
</select> </select>
@error('total_periodos.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Período atual']) @component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" required > <select name="periodo_atual[]" class="form-control" >
<option value="" disabled selected>-- Selecione uma opção --</option> <option selected value="{{ old('periodo_atual')[$i] ?? $p->periodo_atual }}">{{ old('periodo_atual')[$i] ?? $p->periodo_atual }}</option>
<option selected value="{{ $p->periodo_atual }}">{{ $p->periodo_atual }}</option>
</select> </select>
@error('periodo_atual.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@php
$ordens = array('1' => 1, '2' => 2,'3' => 3,);
@endphp
@component('componentes.select', ['label' => 'Ordem de prioridade']) @component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" required> <select name="ordem_prioridade[]" class="form-control" >
<option value="" disabled selected>-- ORDEM --</option> <option value="" selected>-- ORDEM --</option>
@foreach ($ordens as $ordem) @for($j = 1; $j <= 3; $j++)
<option @if($p->ordem_prioridade == $ordem) @endif selected value="{{ $p->ordem_prioridade }}">{{ $p->ordem_prioridade }}</option> <option @if(old('ordem_prioridade')[$i] ?? $p->ordem_prioridade == $j ) selected @endif value="{{ $j }}">{{ $j }}</option>
@endforeach @endfor
</select> </select>
@error('ordem_prioridade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento']) @component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" value="{{ $p->media_do_curso }}" name="media_geral_curso[]" min="0" max="10" step="0.01" required> <input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? $p->media_do_curso }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01" >
@error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div> <div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6"> <div class="col-6">
{{-- @dd($arquivos) --}}
@component('componentes.input', ['label' => 'Título']) @component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{ $arquivos[$loop->index]->titulo }}" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required> <input type="text" class="form-control" value="{{$p->planoTrabalho ? $p->planoTrabalho->titulo : "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" >
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)']) @component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" value="{{ $arquivos[$loop->index]->titulo }}" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" /> <input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
@if($p->planoTrabalho)
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}"> <a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a> <i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
</div> </div>
@endif
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@else
<div class="form-row mb-1">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{$i}}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div>
</a>
</div>
<div class="col-1" style="margin-top:9.3px">
{{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}}
<input type="checkbox" aria-label="Checkbox for following text input" @if(old('name')[$i] ?? "") checked @endif name="marcado[]" value="{{ $i }}">
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante{{$i}}">
<div class="container">
<div class="row">
<input type="hidden" name="participante_id[]" value="">
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " value="{{old('name')[$i] ?? "" }}" name="name[{{$i}}]" placeholder="Nome Completo" />
@error("name.".$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" value="{{old('email')[$i] ?? "" }}" name="email[{{$i}}]" placeholder="E-mail" />
@error('email.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? "" }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('data_de_nascimento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? "" }}" name="cpf[{{$i}}]" placeholder="CPF" />
@error('cpf.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" value="{{old('rg')[$i] ?? "" }}" name="rg[{{$i}}]" placeholder="RG" />
@error('rg.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? "" }}" name="celular[{{$i}}]" placeholder="Celular" />
@error('celular.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf')[$i] ?? "" == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{old('cidade')[$i] ?? "" }}" name="cidade[{{$i}}]" placeholder="Cidade" />
@error('cidade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{old('bairro')[$i] ?? "" }}" name="bairro[{{$i}}]" placeholder="Bairro" />
@error('bairro.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{old('rua')[$i] ?? "" }}" name="rua[{{$i}}]" placeholder="Rua" />
@error('rua.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{old('numero')[$i] ?? "" }}" name="numero[{{$i}}]" placeholder="Número" />
@error('numero.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento',])
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? "" }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div> </div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" value="{{old('instituicao')[$i] ?? "" }}" name="instituicao[{{$i}}]" placeholder="Universidade" />
@error('instituicao.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" value="{{old('curso')[$i] ?? "" }}" name="curso[{{$i}}]" placeholder="Curso" />
@error('curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[{{$i}}]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if(old('turno')[$i] ?? "" == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach @endforeach
</select>
@error('turno.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@php
$options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12);
@endphp
<div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos do curso'])
<select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if(old('total_periodos')[$i] ?? "" == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@error('total_periodos.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" >
<option selected value="{{ old('periodo_atual')[$i] ?? "" }}">{{ old('periodo_atual')[$i] ?? "" }}</option>
</select>
@error('periodo_atual.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" >
<option value="" selected>-- ORDEM --</option>
@for($j = 1; $j <= 3; $j++)
<option @if(old('ordem_prioridade')[$i] ?? "" == $j ) selected @endif value="{{ $j }}">{{ $j }}</option>
@endfor
</select>
@error('ordem_prioridade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? "" }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01" >
@error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" >
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
{{-- <div class="row justify-content-center">
<div class="col-3 ">
<a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div> --}}
</div>
</div>
</div>
</div>
</div>
</div>
@endif
@endfor
</div> </div>
</div> </div>
......
...@@ -11,24 +11,24 @@ ...@@ -11,24 +11,24 @@
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div> <div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 10px"> <div class="form-group col-md-12" style="margin-top: 10px">
<label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label> <label for="titulo" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" placeholder="Digite o nome do projeto" value="{{ $projeto->titulo }}" autocomplete="nomeProjeto" required > <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" >
@error('nomeProjeto') @error('titulo')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
</div> </div>
{{-- @dd($projeto->grandeArea->nome) --}}
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label> <label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" required> <select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grande_area_id" onchange="areas()" >
<option value="" disabled selected hidden>-- Grande Área --</option> <option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea) @foreach($grandeAreas as $grandeArea)
<option @if($projeto->grandeArea->id ?? "" == $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option> <option @if($projeto->grande_area_id == $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endforeach @endforeach
</select> </select>
@error('grandeArea') @error('grande_area_id')
<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>
</span> </span>
...@@ -37,13 +37,12 @@ ...@@ -37,13 +37,12 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label> <label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldArea" value="{{ old('area') }}" > <input type="hidden" id="oldArea" value="{{ old('area') }}" >
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" required> <select class="form-control @error('area') is-invalid @enderror" id="area" name="area_id" onchange="subareas()" >
@foreach($areas as $area) @foreach($areas as $area)
<option @if($projeto->area->id ?? "" == $area->id ) selected @endif value="{{$area->id}}">{{$area->nome}}</option> <option @if($projeto->area_id == $area->id ) selected @endif value="{{$area->id}}">{{$area->nome}}</option>
@endforeach @endforeach
</select> </select>
@error('area') @error('area_id')
<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>
</span> </span>
...@@ -52,16 +51,15 @@ ...@@ -52,16 +51,15 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="subArea" class="col-form-label">{{ __('Subárea') }} </label> <label for="subArea" class="col-form-label">{{ __('Subárea') }} </label>
<input type="hidden" id="oldSubArea" value="{{ old('subArea') }}" > <input type="hidden" id="oldSubArea" value="{{ old('subArea') }}" >
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="subArea" > <select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="sub_area_id" >
<option value="" disabled selected hidden>-- Subárea --</option> <@if ($projeto->subarea != null)
@if ($projeto->subarea != null) @foreach($subAreas as $subarea)
@foreach($subareas as $subarea) <option @if($projeto->sub_area_id == $subarea->id ) selected @endif value="{{$subarea->id}}">{{$subarea->nome}}</option>
<option @if($projeto->subarea->id ?? "" == $subarea->id ) selected @endif value="{{$subarea->id}}">{{$subarea->nome}}</option>
@endforeach @endforeach
@endif @endif
</select> </select>
@error('subArea') @error('sub_area_id')
<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>
</span> </span>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
value="{{ Auth()->user()->proponentes->linkLattes }}" value="{{ Auth()->user()->proponentes->linkLattes }}"
@else @else
value="" value=""
@endif required > @endif >
<small>Ex.: http://lattes.cnpq.br/8363536830656923</small> <small>Ex.: http://lattes.cnpq.br/8363536830656923</small>
@error('linkLattesEstudante') @error('linkLattesEstudante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
...@@ -32,12 +32,12 @@ ...@@ -32,12 +32,12 @@
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="linkGrupo">Link do grupo de pesquisa</label> <label for="linkGrupoPesquisa">Link do grupo de pesquisa</label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="url" name="linkGrupo" <input class="form-control @error('linkGrupoPesquisa') is-invalid @enderror" type="url" name="linkGrupoPesquisa"
value="{{ $projeto->linkGrupoPesquisa }}" required> value="{{ $projeto->linkGrupoPesquisa }}" >
<small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small> <small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
@error('linkGrupo') @error('linkGrupoPesquisa')
<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>
</span> </span>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="pontuacaoPlanilha">Valor da planilha de pontuação <span style="color: red; font-weight:bold">*</span></label> <label for="pontuacaoPlanilha">Valor da planilha de pontuação <span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('pontuacaoPlanilha') is-invalid @enderror" type="number" min="0" name="pontuacaoPlanilha" <input class="form-control @error('pontuacaoPlanilha') is-invalid @enderror" type="number" min="0" name="pontuacaoPlanilha"
value="{{ $projeto->pontuacaoPlanilha }}" required> value="{{ $projeto->pontuacaoPlanilha }}" >
@error('pontuacaoPlanilha') @error('pontuacaoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
......
...@@ -4,34 +4,46 @@ ...@@ -4,34 +4,46 @@
<div> <div>
{{-- action="{{route('trabalho.store')}}" --}} {{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" > <form method="POST" id="updateProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" >
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container"> <div class="container">
{{-- @dd($errors->get('name.*')) --}}
{{-- @dd($errors->has('cpf.*')) --}}
{{-- @dd($errors->getBags()['default']->keys()) --}}
@if (session('mensagem')) @if (session('mensagem'))
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
{{ session('mensagem') }} {{ session('mensagem') }}
</div> </div>
@endif @endif
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="row justify-content-center"> <div class="row justify-content-center">
@component('projeto.editaFormulario.projeto', @include('projeto.editaFormulario.projeto')
['grandeAreas' => $grandeAreas, 'projeto' => $projeto,
'areas' => $areas, 'subareas' => $subAreas])
@endcomponent
@component('projeto.editaFormulario.proponente', ['projeto' => $projeto])
@endcomponent
@component('projeto.editaFormulario.anexos', ['projeto' => $projeto]) @include('projeto.editaFormulario.proponente')
@endcomponent
@component('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'projeto' => $projeto, 'participantes' => $participantes, 'arquivos' =>$arquivos])
@endcomponent
@component('projeto.editaFormulario.finalizar', ['projeto' => $projeto]) @include('projeto.editaFormulario.anexos')
@endcomponent
@include('projeto.editaFormulario.participantes')
{{-- @include('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'edital'=>$edital, 'projeto' => $projeto])
--}}
@include('projeto.editaFormulario.finalizar')
</div> </div>
</div> </div>
...@@ -94,7 +106,9 @@ ...@@ -94,7 +106,9 @@
<script> <script>
let buttonSubmit = document.getElementById('idButtonSubmitProjeto'); let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
let parts = document.getElementById('participante'); let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst'); let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild; const participante = partsFirst.firstElementChild;
...@@ -102,6 +116,12 @@ ...@@ -102,6 +116,12 @@
buttonSubmit.addEventListener('click', (e)=>{ buttonSubmit.addEventListener('click', (e)=>{
$('.collapse').addClass('show') $('.collapse').addClass('show')
})
buttonRascunho.addEventListener('click', (e)=>{
$('.collapse').addClass('show')
const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">';
$("#updateProjetoForm").append(input);
}) })
function gerarPeriodo(e){ function gerarPeriodo(e){
...@@ -123,7 +143,7 @@ ...@@ -123,7 +143,7 @@
}else{ }else{
parts.removeChild(e.parentElement.parentElement); parts.removeChild(e.parentElement.parentElement);
contador--; //contador--;
} }
} }
...@@ -148,13 +168,13 @@ ...@@ -148,13 +168,13 @@
let input = cln.children[i].querySelectorAll('input')[index]; let input = cln.children[i].querySelectorAll('input')[index];
let name = input.getAttributeNode("name").value; let name = input.getAttributeNode("name").value;
name = name.replace("[]", ""); name = name.replace("[]", "");
// input.getAttributeNode("name").value = name + '['+ contador +']'; input.getAttributeNode("name").value = name + '['+ contador +']';
let select = cln.children[i].querySelectorAll('select')[index]; let select = cln.children[i].querySelectorAll('select')[index];
if(select){ if(select){
let selectName = select.getAttributeNode("name").value; let selectName = select.getAttributeNode("name").value;
selectName = selectName.replace("[", ""); selectName = selectName.replace("[", "");
selectName = selectName.replace("]", ""); selectName = selectName.replace("]", "");
// select.getAttributeNode("name").value = selectName + '['+ contador +']'; select.getAttributeNode("name").value = selectName + '['+ contador +']';
} }
} }
...@@ -168,9 +188,7 @@ ...@@ -168,9 +188,7 @@
} }
}; };
parts.appendChild(cln); parts.appendChild(cln);
// console.log(cln); $("input.cpf:text").val("").mask("000.000.000-00");
$(cln).find(".cpf").val("").mask("000.000.000-00");
// $("input.cpf:text").val("").mask("000.000.000-00");
$("input.celular:text").val("").mask(SPMaskBehavior, spOptions); $("input.celular:text").val("").mask(SPMaskBehavior, spOptions);
$("input.cep:text").val("").mask("00000-000"); $("input.cep:text").val("").mask("00000-000");
...@@ -228,145 +246,144 @@ ...@@ -228,145 +246,144 @@
$.validator.setDefaults( { // $.validator.setDefaults( {
submitHandler: function (form) {
form.submit();
}
} );
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
});
$( "#criarProjetoForm" ).validate( {
ignore: false,
lang: 'PT_BR',
rules: {
firstname: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
email: {
required: true,
email: true,
}, // submitHandler: function (form) {
"complemento[]":{ // form.submit();
// }
// } );
// jQuery.extend(jQuery.validator.messages, {
// required: "Este campo &eacute; requerido.",
// remote: "Por favor, corrija este campo.",
// email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
// url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
// date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
// dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
// number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
// digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
// creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
// equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
// accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
// maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
// minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
// rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
// range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
// max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
// min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
// });
// $( "#criarProjetoForm" ).validate( {
// lang: 'PT_BR',
// rules: {
// firstname: "required",
// username: {
// required: true,
// minlength: 2
// },
// password: {
// required: true,
// minlength: 5
// },
// confirm_password: {
// required: true,
// minlength: 5,
// equalTo: "#password"
// },
// email: {
// required: true,
// email: true,
// },
// "complemento[]":{
},
"nomeParticipante[]":{
required:true,
alpha:true,
},
'rg[]':{
required: true,
maxlength: 12,
},
agree: "required"
},
messages: {
// nomeProjeto: "O nome do projeto é obrigatório.",
// 'emailParticipante[]': "Este campo é obrigatório.",
// 'data_de_nascimento[]': "Este campo é obrigatório.",
// 'cpf[]': "Este campo é obrigatório.",
// 'rg[]': {
// required: "Este campo é obrigatório.",
// maxlength: "Este campo deve conter no máximo 8 números."
// }, // },
// 'celular[]': "Este campo é obrigatório.", // "nomeParticipante[]":{
// 'cep[]': "Este campo é obrigatório.",
// 'uf[]': "Este campo é obrigatório.", // alpha:true,
// 'cidade[]': "Este campo é obrigatório.",
// 'bairro[]': "Este campo é obrigatório.",
// 'rua[]': "Este campo é obrigatório.",
// 'numero[]': "Este campo é obrigatório.",
// 'complemento[]': "Este campo é obrigatório.",
// 'universidade[]': "Este campo é obrigatório.",
// 'curso[]': "Este campo é obrigatório.",
// 'turno[]': "Este campo é obrigatório.",
// 'total_periodos[]': "Este campo é obrigatório.",
// 'periodo_atual[]': "Este campo é obrigatório.",
// 'ordem_prioridade[]': "Este campo é obrigatório.",
// 'media_geral_curso[]': "Este campo é obrigatório.",
// 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// grandeArea: "Escolha uma grande área.",
// area: "Escolha uma área.",
// linkGrupo: "Este campo é obrigatório.",
// pontuacaoPlanilha: "Este campo é obrigatório.",
// anexoProjeto: "Este campo é obrigatório.",
// anexoLattesCoordenador: "Este campo é obrigatório.",
// anexoConsuPreenchido: "Este campo é obrigatório.",
// anexoGrupoPesquisa: "Este campo é obrigatório.",
// anexoPlanilha: "Este campo é obrigatório.",
// anexoComiteEtica: "Este campo é obrigatório.",
// inputJustificativa: "Este campo é obrigatório.",
// "nomeParticipante[]": {
// required: "O nome do participante é obrigatório.",
// alpha: "Não é permitido números."
// }, // },
// username: { // 'rg[]':{
// required: "Please enter a username",
// minlength: "Your username must consist of at least 2 characters" // maxlength: 12,
// }, // },
// password: {
// required: "Please provide a password", // agree: "required"
// minlength: "Your password must be at least 5 characters long"
// }, // },
// confirm_password: { // messages: {
// required: "Please provide a password", // // nomeProjeto: "O nome do projeto é obrigatório.",
// minlength: "Your password must be at least 5 characters long",
// equalTo: "Please enter the same password as above" // // 'emailParticipante[]': "Este campo é obrigatório.",
// // 'data_de_nascimento[]': "Este campo é obrigatório.",
// // 'cpf[]': "Este campo é obrigatório.",
// // 'rg[]': {
// // required: "Este campo é obrigatório.",
// // maxlength: "Este campo deve conter no máximo 8 números."
// // },
// // 'celular[]': "Este campo é obrigatório.",
// // 'cep[]': "Este campo é obrigatório.",
// // 'uf[]': "Este campo é obrigatório.",
// // 'cidade[]': "Este campo é obrigatório.",
// // 'bairro[]': "Este campo é obrigatório.",
// // 'rua[]': "Este campo é obrigatório.",
// // 'numero[]': "Este campo é obrigatório.",
// // 'complemento[]': "Este campo é obrigatório.",
// // 'universidade[]': "Este campo é obrigatório.",
// // 'curso[]': "Este campo é obrigatório.",
// // 'turno[]': "Este campo é obrigatório.",
// // 'total_periodos[]': "Este campo é obrigatório.",
// // 'periodo_atual[]': "Este campo é obrigatório.",
// // 'ordem_prioridade[]': "Este campo é obrigatório.",
// // 'media_geral_curso[]': "Este campo é obrigatório.",
// // 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// // grandeArea: "Escolha uma grande área.",
// // area: "Escolha uma área.",
// // linkGrupo: "Este campo é obrigatório.",
// // pontuacaoPlanilha: "Este campo é obrigatório.",
// // anexoProjeto: "Este campo é obrigatório.",
// // anexoLattesCoordenador: "Este campo é obrigatório.",
// // anexoConsuPreenchido: "Este campo é obrigatório.",
// // anexoGrupoPesquisa: "Este campo é obrigatório.",
// // anexoPlanilha: "Este campo é obrigatório.",
// // anexoComiteEtica: "Este campo é obrigatório.",
// // inputJustificativa: "Este campo é obrigatório.",
// // "nomeParticipante[]": {
// // required: "O nome do participante é obrigatório.",
// // alpha: "Não é permitido números."
// // },
// // username: {
// // required: "Please enter a username",
// // minlength: "Your username must consist of at least 2 characters"
// // },
// // password: {
// // required: "Please provide a password",
// // minlength: "Your password must be at least 5 characters long"
// // },
// // confirm_password: {
// // required: "Please provide a password",
// // minlength: "Your password must be at least 5 characters long",
// // equalTo: "Please enter the same password as above"
// // },
// // email: "Please enter a valid email address",
// // agree: "Please accept our policy"
// }, // },
// email: "Please enter a valid email address", // errorElement: "em",
// agree: "Please accept our policy" // errorPlacement: function ( error, element ) {
}, // // Add the `help-block` class to the error element
errorElement: "em", // error.addClass( "invalid-feedback" );
errorPlacement: function ( error, element ) {
// Add the `help-block` class to the error element
error.addClass( "invalid-feedback" );
if ( element.prop( "type" ) === "checkbox" ) { // if ( element.prop( "type" ) === "checkbox" ) {
error.insertAfter( element.parent( "label" ) ); // error.insertAfter( element.parent( "label" ) );
} else { // } else {
error.insertAfter( element ); // error.insertAfter( element );
} // }
}, // },
highlight: function ( element, errorClass, validClass ) { // highlight: function ( element, errorClass, validClass ) {
$( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" ); // $( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" );
}, // },
unhighlight: function (element, errorClass, validClass) { // unhighlight: function (element, errorClass, validClass) {
$( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" ); // $( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" );
} // }
} ); // } );
} ); } );
</script> </script>
...@@ -650,11 +667,11 @@ ...@@ -650,11 +667,11 @@
} }
function submeterProposta() { function submeterProposta() {
if (checarCpfs()) {
document.getElementById("submeterFormProposta").click(); document.getElementById("submeterFormProposta").click();
// if (checarCpfs()) { } else {
// } else { $("#modalCpfInvalido").modal('show');
// $("#modalCpfInvalido").modal('show'); }
// }
} }
function mascaraCPF(input) { function mascaraCPF(input) {
......
...@@ -15,9 +15,15 @@ ...@@ -15,9 +15,15 @@
@component('componentes.input', ['label' => 'Projeto (.pdf)']) @component('componentes.input', ['label' => 'Projeto (.pdf)'])
@endcomponent @endcomponent
</div> </div>
<div class="col-2 "> @if($projeto->anexoProjeto)
<div class="col-3 ">
<a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
{{-- Anexo do currículo --}} {{-- Anexo do currículo --}}
...@@ -28,9 +34,15 @@ ...@@ -28,9 +34,15 @@
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoLattesCoordenador)
<div class="col-2 "> <div class="col-2 ">
<a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-2 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
{{-- Anexo da Planilha de Pontuação --}} {{-- Anexo da Planilha de Pontuação --}}
...@@ -41,9 +53,15 @@ ...@@ -41,9 +53,15 @@
@endcomponent @endcomponent
</div> </div>
@if($projeto->anexoPlanilhaPontuacao)
<div class="col-2 "> <div class="col-2 ">
<a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-2 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
...@@ -51,13 +69,24 @@ ...@@ -51,13 +69,24 @@
<div class="form-group col-md-6" style="margin-top: 10px"> <div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-start"> <div class="row justify-content-start">
<div class="col-10"> <div class="col-10">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)'])
@endcomponent <div class="form-group">
<label class=" control-label" for="firstname">Decisão do CONSU (.pdf)</label>
<div class="">
</div> </div>
</div>
</div>
@if($projeto->anexoDecisaoCONSU)
<div class="col-2 "> <div class="col-2 ">
<a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-2 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
...@@ -69,9 +98,15 @@ ...@@ -69,9 +98,15 @@
@endcomponent @endcomponent
</div> </div>
<div class="col-2 "> @if($projeto->anexoGrupoPesquisa)
<div class="col-3 ">
<a href="{{ route('baixar.anexoGrupoPesquisa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <a href="{{ route('baixar.anexoGrupoPesquisa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
{{-- Anexo da autorizações especiais --}} {{-- Anexo da autorizações especiais --}}
...@@ -84,9 +119,9 @@ ...@@ -84,9 +119,9 @@
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label> <label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label>
</div> </div>
<div class="col-12"> <div class="col-12">
<input type="radio" checked id="radioSim" disabled onchange="displayAutorizacoesEspeciais('sim')"> <input type="radio" checked id="radioSim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label> <label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" disabled onchange="displayAutorizacoesEspeciais('nao')"> <input type="radio" id="radioNao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br> <label for="radioNao" style="margin-right: 5px">Não</label><br>
</div> </div>
</div> </div>
...@@ -97,18 +132,52 @@ ...@@ -97,18 +132,52 @@
<div class="form-group" id="displaySim" style="display: block; margin-top:-1rem"> <div class="form-group" id="displaySim" style="display: block; margin-top:-1rem">
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)']) @component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)'])
<div class="row justify-content-center">
@if($projeto->anexoAutorizacaoComiteEtica )
<div class="col-3 mt-2">
<a href="{{ route('baixar.anexo.comite', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div>
@error('anexoAutorizacaoComiteEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent @endcomponent
</div> </div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem"> <div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
@component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)']) @component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)'])
@endcomponent @if($projeto->justificativaAutorizacaoEtica )
<div class="row justify-content-center">
<div class="col-3 mt-2">
<a href="{{ route('baixar.anexo.justificativa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
</div> </div>
<div class="col-2 mt-2"> @else
<a href="{{ route('baixar.anexo.justificativa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a> <div class="row justify-content-center">
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
</div> </div>
@endif
@error('justificativaAutorizacaoEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
</div> </div>
</div> </div>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<div class="col-md-12"><h5>Endereço</h5></div> <div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'CEP']) @component('componentes.input', ['label' => 'CEP'])
<input type="number" class="form-control" value="{{ $p->user->endereco->cep }}" name="cep[]" placeholder="CEP" disabled/> <input type="text" class="form-control" value="{{ $p->user->endereco->cep }}" name="cep[]" placeholder="CEP" disabled/>
@endcomponent @endcomponent
</div> </div>
...@@ -189,11 +189,18 @@ ...@@ -189,11 +189,18 @@
</div> </div>
</div> </div>
<div class="row justify-content-center"> <div class="row justify-content-center">
@if($p->planoTrabalho)
<div class="col-3 "> <div class="col-3 ">
<a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}"> <a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a> <i class="fas fa-file-pdf fa-2x"></i></a>
</div> </div>
</div> </div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div> </div>
</div> </div>
</div> </div>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" disabled> <select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" disabled>
<option value="" disabled selected hidden>-- Grande Área --</option> <option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea) @foreach($grandeAreas as $grandeArea)
<option @if($projeto->grandeArea->id == $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option> <option @if($projeto->grande_area_id == $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endforeach @endforeach
</select> </select>
@error('grandeArea') @error('grandeArea')
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<input type="hidden" id="oldArea" value="{{ old('area') }}" > <input type="hidden" id="oldArea" value="{{ old('area') }}" >
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" disabled> <select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" disabled>
@foreach($areas as $area) @foreach($areas as $area)
<option @if($projeto->area->id == $area->id ) selected @endif value="{{$area->id}}">{{$area->nome}}</option> <option @if($projeto->area_id == $area->id ) selected @endif value="{{$area->id}}">{{$area->nome}}</option>
@endforeach @endforeach
</select> </select>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<option value="" disabled selected hidden>-- Subárea --</option> <option value="" disabled selected hidden>-- Subárea --</option>
@if ($projeto->subarea != null) @if ($projeto->subarea != null)
@foreach($subareas as $subarea) @foreach($subareas as $subarea)
<option @if($projeto->subarea->id == $subarea->id ) selected @endif value="{{$subarea->id}}">{{$subarea->nome}}</option> <option @if($projeto->sub_area_id == $subarea->id ) selected @endif value="{{$subarea->id}}">{{$subarea->nome}}</option>
@endforeach @endforeach
@endif @endif
</select> </select>
......
<?php <?php
use App\Http\Middleware\checkCoordenador; use App\Http\Middleware\checkCoordenador;
use App\Trabalho; use App\Trabalho;
...@@ -33,21 +33,21 @@ Auth::routes(['verify' => true]); ...@@ -33,21 +33,21 @@ Auth::routes(['verify' => true]);
//######### Proponente ########################################
Route::get( '/proponente/index', 'ProponenteController@index' )->name('proponente.index');
Route::get( '/proponente/cadastro', 'ProponenteController@create' )->name('proponente.create');
Route::post('/proponente/cadastro', 'ProponenteController@store' )->name('proponente.store');
Route::get( '/proponente/editais', 'ProponenteController@editais' )->name('proponente.editais');
Route::get( '/projetos-submetidos', 'ProponenteController@projetosDoProponente' )->name('proponente.projetos');
Route::get( '/projetos-edital/{id}', 'ProponenteController@projetosEdital' )->name('proponente.projetosEdital')->middleware('auth');
//######### Rotas Administrador ################################# Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route::get('/perfil-usuario', 'UserController@minhaConta' )->name('user.perfil')->middleware(['auth', 'verified']); //######### Proponente ########################################
Route::post('/perfil-usuario', 'UserController@editarPerfil' )->name('perfil.edit')->middleware(['auth', 'verified']); Route::get( '/proponente/index', 'ProponenteController@index' )->name('proponente.index');
Route::get( '/proponente/cadastro', 'ProponenteController@create' )->name('proponente.create');
Route::post('/proponente/cadastro', 'ProponenteController@store' )->name('proponente.store');
Route::get( '/proponente/editais', 'ProponenteController@editais' )->name('proponente.editais');
Route::get( '/projetos-submetidos', 'ProponenteController@projetosDoProponente' )->name('proponente.projetos');
Route::get( '/projetos-edital/{id}', 'ProponenteController@projetosEdital' )->name('proponente.projetosEdital')->middleware('auth');
Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){ //######### Rotas Administrador #################################
Route::get('/perfil-usuario', 'UserController@minhaConta' )->name('user.perfil')->middleware(['auth', 'verified']);
Route::post('/perfil-usuario', 'UserController@editarPerfil' )->name('perfil.edit')->middleware(['auth', 'verified']);
//######## Rotas Avaliador #################################### //######## Rotas Avaliador ####################################
Route::prefix('avaliador')->name('avaliador.')->group(function(){ Route::prefix('avaliador')->name('avaliador.')->group(function(){
...@@ -123,7 +123,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){ ...@@ -123,7 +123,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route::get( '/edital/{id}/projetos', 'TrabalhoController@projetosDoEdital' )->name('projetos.edital'); Route::get( '/edital/{id}/projetos', 'TrabalhoController@projetosDoEdital' )->name('projetos.edital');
Route::get( '/projeto/visualizar/{id}', 'TrabalhoController@show' )->name('trabalho.show'); Route::get( '/projeto/visualizar/{id}', 'TrabalhoController@show' )->name('trabalho.show');
Route::get( '/projeto/{id}/editar', 'TrabalhoController@edit' )->name('trabalho.editar'); Route::get( '/projeto/{id}/editar', 'TrabalhoController@edit' )->name('trabalho.editar');
Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@atualizar' )->name('trabalho.update'); Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@update' )->name('trabalho.update');
Route::get( '/projeto/{id}/excluir', 'TrabalhoController@destroy' )->name('trabalho.destroy'); Route::get( '/projeto/{id}/excluir', 'TrabalhoController@destroy' )->name('trabalho.destroy');
Route::get( '/projeto/{id}/excluirParticipante','TrabalhoController@excluirParticipante')->name('trabalho.excluirParticipante'); Route::get( '/projeto/{id}/excluirParticipante','TrabalhoController@excluirParticipante')->name('trabalho.excluirParticipante');
Route::get( '/projeto/exportar/{id}','TrabalhoController@exportProjeto' )->name('exportar.projeto'); Route::get( '/projeto/exportar/{id}','TrabalhoController@exportProjeto' )->name('exportar.projeto');
......
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