Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
e845ab51
Commit
e845ab51
authored
Jun 04, 2020
by
carlos
Browse files
atualizando criar e editar projeto
parent
ae44f10e
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
e845ab51
...
@@ -80,7 +80,7 @@ class TrabalhoController extends Controller
...
@@ -80,7 +80,7 @@ class TrabalhoController extends Controller
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
//$trabalho->proponentes()->save($proponente);
//$trabalho->proponentes()->save($proponente);
//dd($coordenador->id);
//dd($coordenador->id);
$trabalho
=
"trabalho"
;
if
(
$evento
->
inicioSubmissao
>
$mytime
){
if
(
$evento
->
inicioSubmissao
>
$mytime
){
if
(
$mytime
>=
$evento
->
fimSubmissao
){
if
(
$mytime
>=
$evento
->
fimSubmissao
){
return
redirect
()
->
route
(
'home'
);
return
redirect
()
->
route
(
'home'
);
...
@@ -179,8 +179,6 @@ class TrabalhoController extends Controller
...
@@ -179,8 +179,6 @@ class TrabalhoController extends Controller
}
}
//Envia email com senha temp para cada participante do projeto
//Envia email com senha temp para cada participante do projeto
if
(
$request
->
emailParticipante
!=
null
){
if
(
$request
->
emailParticipante
!=
null
){
...
@@ -198,11 +196,10 @@ class TrabalhoController extends Controller
...
@@ -198,11 +196,10 @@ class TrabalhoController extends Controller
'usuarioTemp'
=>
true
,
'usuarioTemp'
=>
true
,
'name'
=>
$request
->
nomeParticipante
[
$key
],
'name'
=>
$request
->
nomeParticipante
[
$key
],
'tipo'
=>
'participante'
,
'tipo'
=>
'participante'
,
'funcao_participante_id'
=>
$request
->
funcaoParticipante
[
$key
],
]);
]);
$participante
=
$usuario
->
participantes
()
->
create
([
$participante
=
$usuario
->
participantes
()
->
create
([
'trabalho_id'
=>
$trabalho
->
id
,
'trabalho_id'
=>
$trabalho
->
id
,
'funcao_participante_id'
=>
$request
->
funcaoParticipante
[
$key
],
]);
]);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
...
@@ -216,30 +213,15 @@ class TrabalhoController extends Controller
...
@@ -216,30 +213,15 @@ class TrabalhoController extends Controller
}
}
}
}
$anexos
=
array
(
$pasta
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
;
$request
->
anexoCONSU
,
$request
->
anexoProjeto
,
$trabalho
->
anexoDecisaoCONSU
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoCONSU
,
"CONSU.pdf"
);
$request
->
anexoComiteEtica
,
$trabalho
->
anexoProjeto
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoProjeto
,
"Projeto.pdf"
);
$request
->
anexoLatterCoordenador
,
$trabalho
->
anexoAutorizacaoComiteEtica
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoComiteEtica
,
"Comite_de_etica.pdf"
);
$request
->
anexoPlanilha
,
$trabalho
->
anexoLattesCoordenador
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoLatterCoordenador
,
"Latter_Coordenador.pdf"
);
);
$trabalho
->
anexoPlanilhaPontuacao
=
Storage
::
putFileAs
(
$pasta
,
$request
->
anexoPlanilha
,
"Planilha.pdf"
);
$trabalho
->
update
();
foreach
(
$anexos
as
$key
=>
$value
)
{
$file
=
$value
;
$path
=
'trabalhos/'
.
$request
->
editalId
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
"1.pdf"
;
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
Arquivo
::
create
([
'nome'
=>
$path
.
$nome
,
'trabalhoId'
=>
$trabalho
->
id
,
'data'
=>
$mytime
,
'versaoFinal'
=>
true
,
]);
}
if
(
$request
->
anexoPlanoTrabalho
!=
null
){
if
(
$request
->
anexoPlanoTrabalho
!=
null
){
foreach
(
$request
->
anexoPlanoTrabalho
as
$key
=>
$value
)
{
foreach
(
$request
->
anexoPlanoTrabalho
as
$key
=>
$value
)
{
...
@@ -285,9 +267,23 @@ class TrabalhoController extends Controller
...
@@ -285,9 +267,23 @@ class TrabalhoController extends Controller
* @param \App\Trabalho $trabalho
* @param \App\Trabalho $trabalho
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
edit
(
Trabalho
$trabalho
)
public
function
edit
(
$id
)
{
{
//
$projeto
=
Trabalho
::
find
(
$id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$grandeAreas
=
GrandeArea
::
all
();
$areas
=
Area
::
all
();
$subareas
=
Subarea
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$participantes
=
Participante
::
where
(
'trabalho_id'
,
$id
)
->
get
();
return
view
(
'projeto.editar'
)
->
with
([
'projeto'
=>
$projeto
,
'grandeAreas'
=>
$grandeAreas
,
'areas'
=>
$areas
,
'subAreas'
=>
$subareas
,
'edital'
=>
$edital
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'participantes'
=>
$participantes
]);
}
}
/**
/**
...
@@ -451,4 +447,29 @@ class TrabalhoController extends Controller
...
@@ -451,4 +447,29 @@ class TrabalhoController extends Controller
return
view
(
'projeto.index'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
return
view
(
'projeto.index'
)
->
with
([
'edital'
=>
$edital
,
'projetos'
=>
$projetos
]);
}
}
public
function
baixarAnexoProjeto
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoProjeto
);
}
public
function
baixarAnexoConsu
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoDecisaoCONSU
);
}
public
function
baixarAnexoComite
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoAutorizacaoComiteEtica
);
}
public
function
baixarAnexoLattes
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoLattesCoordenador
);
}
public
function
baixarAnexoPlanilha
(
$id
)
{
$projeto
=
Trabalho
::
find
(
$id
);
return
Storage
::
download
(
$projeto
->
anexoPlanilhaPontuacao
);
}
}
}
app/Participante.php
View file @
e845ab51
...
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
...
@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class
Participante
extends
Model
class
Participante
extends
Model
{
{
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
];
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
public
function
user
(){
return
$this
->
belongsTo
(
'App\User'
);
return
$this
->
belongsTo
(
'App\User'
);
...
...
resources/views/projeto/editar.blade.php
0 → 100644
View file @
e845ab51
This diff is collapsed.
Click to expand it.
resources/views/projeto/index.blade.php
View file @
e845ab51
...
@@ -35,14 +35,14 @@
...
@@ -35,14 +35,14 @@
@
else
@
else
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
<
td
style
=
"color: rgb(0, 0, 0)"
>
Submetido
</
td
>
@
endif
@
endif
<
td
>
{{
$projeto
->
update
}}
</
td
>
<
td
>
{{
date
(
'd-m-Y'
,
strtotime
(
$projeto
->
update
d_at
))
}}
</
td
>
<
td
>
<
td
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
div
class
=
"btn-group dropright dropdown-options"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
<
a
id
=
"options"
class
=
"dropdown-toggle "
data
-
toggle
=
"dropdown"
aria
-
haspopup
=
"true"
aria
-
expanded
=
"false"
>
{{
--
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
--
}}
{{
--
<
img
src
=
"
{
{asset('img/icons/ellipsis-v-solid.svg')}
}
"
style
=
"width:8px"
>
--
}}
</
a
>
</
a
>
<
div
class
=
"dropdown-menu"
>
<
div
class
=
"dropdown-menu"
>
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center;"
>
<
a
href
=
"
{{ route('trabalho.editar', ['id' =>
$projeto->id
]) }}
"
class
=
"dropdown-item"
style
=
"text-align: center;"
>
Editar
projeto
Editar
projeto
</
a
>
</
a
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
{{
--
<
a
href
=
""
class
=
"dropdown-item"
style
=
"text-align: center"
>
...
...
routes/web.php
View file @
e845ab51
...
@@ -88,6 +88,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -88,6 +88,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/novaVersao'
,
'TrabalhoController@novaVersao'
)
->
name
(
'trabalho.novaVersao'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
post
(
'/trabalho/criar'
,
'TrabalhoController@store'
)
->
name
(
'trabalho.store'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/edital/{id}/projetos'
,
'TrabalhoController@projetosDoEdital'
)
->
name
(
'projetos.edital'
);
Route
::
get
(
'/projeto/{id}/editar'
,
'TrabalhoController@edit'
)
->
name
(
'trabalho.editar'
);
//######### Atribuição #######################################
//######### Atribuição #######################################
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
Route
::
get
(
'/atribuir'
,
'AtribuicaoController@distribuicaoAutomatica'
)
->
name
(
'distribuicao'
);
...
@@ -101,7 +102,13 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
...
@@ -101,7 +102,13 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route
::
post
(
'/revisor/email'
,
'RevisorController@enviarEmailRevisor'
)
->
name
(
'revisor.email'
);
Route
::
post
(
'/revisor/email'
,
'RevisorController@enviarEmailRevisor'
)
->
name
(
'revisor.email'
);
Route
::
post
(
'/revisor/emailTodos'
,
'RevisorController@enviarEmailTodosRevisores'
)
->
name
(
'revisor.emailTodos'
);
Route
::
post
(
'/revisor/emailTodos'
,
'RevisorController@enviarEmailTodosRevisores'
)
->
name
(
'revisor.emailTodos'
);
//########## Rotas de download de documentos ###########################
Route
::
get
(
'/baixar/edital/{id}'
,
'EventoController@baixarEdital'
)
->
name
(
'baixar.edital'
);
Route
::
get
(
'/baixar/anexo-projeto/{id}'
,
'TrabalhoController@baixarAnexoProjeto'
)
->
name
(
'baixar.anexo.projeto'
);
Route
::
get
(
'/baixar/anexo-consu/{id}'
,
'TrabalhoController@baixarAnexoConsu'
)
->
name
(
'baixar.anexo.consu'
);
Route
::
get
(
'/baixar/anexo-comite/{id}'
,
'TrabalhoController@baixarAnexoComite'
)
->
name
(
'baixar.anexo.comite'
);
Route
::
get
(
'/baixar/anexo-lattes/{id}'
,
'TrabalhoController@baixarAnexoLattes'
)
->
name
(
'baixar.anexo.lattes'
);
Route
::
get
(
'/baixar/anexo-planilha/{id}'
,
'TrabalhoController@baixarAnexoPlanilha'
)
->
name
(
'baixar.anexo.planilha'
);
});
});
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
Route
::
prefix
(
'usuarios'
)
->
name
(
'admin.'
)
->
group
(
function
(){
...
@@ -180,8 +187,6 @@ Route::prefix('evento')->name('evento.')->group(function(){
...
@@ -180,8 +187,6 @@ Route::prefix('evento')->name('evento.')->group(function(){
});
});
Route
::
get
(
'/baixar/edital/{id}'
,
'EventoController@baixarEdital'
)
->
name
(
'baixar.edital'
);
//########## Rotas de administrador responsavel (Reitor ou pro-reitor)########
//########## Rotas de administrador responsavel (Reitor ou pro-reitor)########
Route
::
prefix
(
'adminResp'
)
->
name
(
'adminResp.'
)
->
group
(
function
(){
Route
::
prefix
(
'adminResp'
)
->
name
(
'adminResp.'
)
->
group
(
function
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment