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
pad-upe
Commits
230703eb
Commit
230703eb
authored
Mar 04, 2024
by
alissonalbuquerque
Browse files
feat(task-time): add implementação de 'Horário Semana' para PDAs
parent
46aae30d
Changes
19
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AvaliadorTaskTimeController.php
0 → 100644
View file @
230703eb
<?php
namespace
App\Http\Controllers
;
use
App\Models\Util\MenuItemsAvaliador
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
class
AvaliadorTaskTimeController
extends
Controller
{
public
function
index
()
{
$menu
=
MenuItemsAvaliador
::
TASK_TIME
;
$user
=
Auth
::
user
();
// $userPads =
// AvaliadorPad::where('user_id', '=', $user->id)
// ->join('pad', 'avaliador_pad.pad_id', '=', 'pad.id')
// ->get();
return
view
(
'avaliador-task-time.index'
,
[
'index_menu'
=>
$menu
]);
}
}
app/Http/Controllers/TaskController.php
View file @
230703eb
...
@@ -316,4 +316,9 @@ class TaskController extends Controller
...
@@ -316,4 +316,9 @@ class TaskController extends Controller
return
Response
::
json
(
$results
);
return
Response
::
json
(
$results
);
}
}
public
function
searchById
(
Request
$request
)
{
dd
(
$request
->
all
());
}
}
}
app/Http/Controllers/TaskTimeController.php
View file @
230703eb
...
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
...
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use
App\Models\TaskTime
;
use
App\Models\TaskTime
;
use
App\Models\Util\Menu
;
use
App\Models\Util\Menu
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Response
;
use
Illuminate\Support\Facades\Validator
;
class
TaskTimeController
extends
Controller
class
TaskTimeController
extends
Controller
{
{
...
@@ -12,8 +14,6 @@ class TaskTimeController extends Controller
...
@@ -12,8 +14,6 @@ class TaskTimeController extends Controller
{
{
$menu
=
Menu
::
PADS
;
$menu
=
Menu
::
PADS
;
$taskTimes
=
TaskTime
::
whereUserPadId
(
$user_pad_id
)
->
get
();
return
view
(
'task-time.index'
,
[
return
view
(
'task-time.index'
,
[
'menu'
=>
$menu
,
'menu'
=>
$menu
,
'user_pad_id'
=>
$user_pad_id
'user_pad_id'
=>
$user_pad_id
...
@@ -28,20 +28,92 @@ class TaskTimeController extends Controller
...
@@ -28,20 +28,92 @@ class TaskTimeController extends Controller
public
function
save
(
Request
$request
)
{
public
function
save
(
Request
$request
)
{
$
array
=
TaskTime
::
splitTarefaAndType
(
$request
->
get
(
'tarefa_id'
));
$
model
=
new
TaskTime
(
$request
->
all
(
));
dd
(
$request
->
get
(
'tarefa_id'
),
$array
);
if
(
$model
->
save
())
{
return
redirect
()
->
route
(
'TaskTimeIndex'
,
[
'user_pad_id'
=>
$model
->
user_pad_id
])
->
with
(
'success'
,
'Cadastro realizado com sucesso!'
);
}
}
}
public
function
updateView
()
{
public
function
edit
(
$id
)
{
$model
=
TaskTime
::
find
(
$id
);
return
view
(
'task-time.update'
,
[
'model'
=>
$model
]);
}
}
public
function
update
()
{
public
function
update
(
$id
,
Request
$request
)
{
$request
->
merge
([
'start_time'
=>
TaskTime
::
traitHour
(
$request
->
get
(
'start_time'
))]);
$request
->
merge
([
'end_time'
=>
TaskTime
::
traitHour
(
$request
->
get
(
'end_time'
))]);
$model
=
TaskTime
::
find
(
$id
);
$model
->
fill
(
$request
->
all
());
if
(
$model
->
save
())
{
return
redirect
()
->
route
(
'TaskTimeIndex'
,
[
'user_pad_id'
=>
$model
->
user_pad_id
])
->
with
(
'success'
,
'Atualizado com sucesso!'
);
}
return
redirect
()
->
route
(
'TaskTimeIndex'
,
[
'user_pad_id'
=>
$model
->
user_pad_id
])
->
with
(
'fail'
,
'Erro ao Atualizar!'
);
}
}
public
function
delete
()
{
public
function
delete
(
$id
)
{
$model
=
TaskTime
::
find
(
$id
);
if
(
$model
->
delete
())
{
return
redirect
()
->
route
(
'TaskTimeIndex'
,
[
'user_pad_id'
=>
$model
->
user_pad_id
])
->
with
(
'success'
,
'Deletado com sucesso!'
);
}
return
redirect
()
->
route
(
'TaskTimeIndex'
,
[
'user_pad_id'
=>
$model
->
user_pad_id
])
->
with
(
'fail'
,
'Erro ao Deletar!'
);
}
public
function
searchTask
(
Request
$request
)
{
$type
=
$request
->
get
(
'type'
);
$tarefa_id
=
$request
->
get
(
'tarefa_id'
);
$model
=
new
TaskTime
();
$model
->
tarefa_id
=
$tarefa_id
;
$model
->
type
=
$type
;
$attributes
=
$model
->
tarefa
->
getAttributes
();
return
Response
::
json
([
'task'
=>
$attributes
]);
}
public
function
ajaxValidation
(
Request
$request
)
{
$request
->
merge
([
'start_time'
=>
TaskTime
::
traitHour
(
$request
->
get
(
'start_time'
))]);
$request
->
merge
([
'end_time'
=>
TaskTime
::
traitHour
(
$request
->
get
(
'end_time'
))]);
$attributes
=
[
'id'
=>
$request
->
get
(
'id'
),
'user_pad_id'
=>
$request
->
get
(
'user_pad_id'
),
'tarefa_id'
=>
$request
->
get
(
'tarefa_id'
),
'type'
=>
$request
->
get
(
'type'
),
'start_time'
=>
$request
->
get
(
'start_time'
),
'end_time'
=>
$request
->
get
(
'end_time'
),
];
$validator
=
Validator
::
make
(
$request
->
all
(),
TaskTime
::
rules
(
$attributes
),
TaskTime
::
messages
());
if
(
$validator
->
passes
())
{
return
Response
::
json
([
'message'
=>
true
,
'status'
=>
200
]);
}
return
Response
::
json
([
'errors'
=>
$validator
->
errors
(),
'status'
=>
400
]);
}
}
}
}
app/Models/TaskTime.php
View file @
230703eb
...
@@ -2,7 +2,37 @@
...
@@ -2,7 +2,37 @@
namespace
App\Models
;
namespace
App\Models
;
use
Illuminate\Validation\Rule
;
use
App\Models\Tabelas\Ensino\EnsinoAtendimentoDiscente
;
use
App\Models\Tabelas\Ensino\EnsinoAula
;
use
App\Models\Tabelas\Ensino\EnsinoCoordenacaoRegencia
;
use
App\Models\Tabelas\Ensino\EnsinoMembroDocente
;
use
App\Models\Tabelas\Ensino\EnsinoOrientacao
;
use
App\Models\Tabelas\Ensino\EnsinoOutros
;
use
App\Models\Tabelas\Ensino\EnsinoParticipacao
;
use
App\Models\Tabelas\Ensino\EnsinoProjeto
;
use
App\Models\Tabelas\Ensino\EnsinoSupervisao
;
use
App\Models\Tabelas\Extensao\ExtensaoCoordenacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOrientacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoLaboratoriosDidaticos
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoProgramaInstitucional
;
use
App\Models\Tabelas\Gestao\GestaoMembroCamaras
;
use
App\Models\Tabelas\Gestao\GestaoMembroComissao
;
use
App\Models\Tabelas\Gestao\GestaoMembroConselho
;
use
App\Models\Tabelas\Gestao\GestaoMembroTitularConselho
;
use
App\Models\Tabelas\Gestao\GestaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoRepresentanteUnidadeEducacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaCoordenacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaLideranca
;
use
App\Models\Tabelas\Pesquisa\PesquisaOrientacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaOutros
;
use
App\Rules\ValidationLimitTime
;
use
DateInterval
;
use
DateTime
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Collection
;
class
TaskTime
extends
Model
class
TaskTime
extends
Model
{
{
...
@@ -39,6 +69,7 @@ class TaskTime extends Model
...
@@ -39,6 +69,7 @@ class TaskTime extends Model
CONST
TYPE_GESTAO_MEMBRO_COMISSAO
=
23
;
CONST
TYPE_GESTAO_MEMBRO_COMISSAO
=
23
;
CONST
TYPE_GESTAO_OUTROS
=
24
;
CONST
TYPE_GESTAO_OUTROS
=
24
;
CONST
WEEK_HOUR
=
0
;
CONST
WEEK_DAY_SUNDAY
=
1
;
CONST
WEEK_DAY_SUNDAY
=
1
;
CONST
WEEK_DAY_MONDAY
=
2
;
CONST
WEEK_DAY_MONDAY
=
2
;
CONST
WEEK_DAY_TUESDAY
=
3
;
CONST
WEEK_DAY_TUESDAY
=
3
;
...
@@ -49,114 +80,158 @@ class TaskTime extends Model
...
@@ -49,114 +80,158 @@ class TaskTime extends Model
protected
$table
=
'task_time'
;
protected
$table
=
'task_time'
;
protected
$fillable
=
[
'user_pad_upe'
,
'tarefa_id'
,
'type'
,
'weekday'
,
'start_time'
,
'end_time'
];
protected
$fillable
=
[
'user_pad_id'
,
'tarefa_id'
,
'type'
,
'weekday'
,
'start_time'
,
'end_time'
];
public
static
function
rules
(
$attributes
)
{
return
[
'cod_atividade'
=>
[
'required'
],
'slct_tarefa_id'
=>
[
'required'
],
'tarefa_id'
=>
[
'required'
,
'integer'
],
'type'
=>
[
'required'
,
'integer'
,
Rule
::
in
(
array_keys
(
self
::
listTaskTypes
()))],
'weekday'
=>
[
'required'
,
'integer'
,
Rule
::
in
(
array_keys
(
self
::
listWeekDays
()))],
'start_time'
=>
[
'required'
,
'date_format:H:i'
,
'after_or_equal:07:30'
,
'before_or_equal:21:15'
],
// 'end_time' => ['required', 'date_format:H:i', 'after_or_equal:07:30', 'before_or_equal:21:15'],
'end_time'
=>
[
'required'
,
'date_format:H:i'
,
'after_or_equal:07:30'
,
'before_or_equal:21:15'
,
new
ValidationLimitTime
(
$attributes
)],
];
}
public
static
function
messages
()
{
return
[
//cod_atividade
'cod_atividade.required'
=>
''
,
//tarefa_id
'slct_tarefa_id.required'
=>
'O campo "Atividade" é obrigatório!'
,
// //type
// 'type.required' => 'O campo "Atividade" é obrigatório!',
//weekday
'weekday.required'
=>
'O campo "Dia da Semana" é obrigatório!'
,
'weekday.in'
=>
'Selecione uma opção da lista de "Dia da Semana"!'
,
'weekday.integer'
=>
'O campo "Dia da Semana" deve cónter um inteiro!'
,
//start_time
'start_time.required'
=>
'O campo "Horário Inicial" é obrigatório!'
,
'start_time.after_or_equal'
=>
'O valor minímo do "Horário Inicial" é 07:30!'
,
'start_time.before_or_equal'
=>
'O valor máximo do "Horário Inicial" é 21:15!'
,
//end_time
'end_time.required'
=>
'O campo "Horário Final" é obrigatório!'
,
'end_time.after_or_equal'
=>
'O valor minímo do "Horário Final" é 07:30!'
,
'end_time.before_or_equal'
=>
'O valor máximo do "Horário Final" é 21:15!'
];
}
public
function
tarefa
()
public
function
tarefa
()
{
{
// Return Ensino Models
// Return Ensino Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
return
$this
->
hasOne
(
EnsinoAtendimentoDiscente
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoAtendimentoDiscente
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_AULA
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_AULA
)
{
return
$this
->
hasOne
(
EnsinoAula
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoAula
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
)
{
return
$this
->
hasOne
(
EnsinoCoordenacaoRegencia
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoCoordenacaoRegencia
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_MEMBRO_DOCENTE
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_MEMBRO_DOCENTE
)
{
return
$this
->
hasOne
(
EnsinoMembroDocente
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoMembroDocente
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_ORIENTACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ORIENTACAO
)
{
return
$this
->
hasOne
(
EnsinoOrientacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoOrientacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_OUTROS
)
{
return
$this
->
hasOne
(
EnsinoOutros
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoOutros
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_PARTICIPACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_PARTICIPACAO
)
{
return
$this
->
hasOne
(
EnsinoParticipacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoParticipacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_PROJETO
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_PROJETO
)
{
return
$this
->
hasOne
(
EnsinoProjeto
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoProjeto
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_ENSINO_SUPERVISAO
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
return
$this
->
hasOne
(
EnsinoSupervisao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
EnsinoSupervisao
::
class
,
'id'
,
'tarefa_id'
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Pesquisa Models
// Return Pesquisa Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
=
self
::
TYPE_PESQUISA_COORDENACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
return
$this
->
hasOne
(
PesquisaCoordenacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
PesquisaCoordenacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_PESQUISA_LIDERANCA
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_LIDERANCA
)
{
return
$this
->
hasOne
(
PesquisaLideranca
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
PesquisaLideranca
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_PESQUISA_ORIENTACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_ORIENTACAO
)
{
return
$this
->
hasOne
(
PesquisaOrientacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
PesquisaOrientacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_PESQUISA_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
return
$this
->
hasOne
(
PesquisaOutros
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
PesquisaOutros
::
class
,
'id'
,
'tarefa_id'
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Extensao Models
// Return Extensao Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
=
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
return
$this
->
hasOne
(
ExtensaoCoordenacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
ExtensaoCoordenacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_EXTENSAO_ORIENTACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_ORIENTACAO
)
{
return
$this
->
hasOne
(
ExtensaoOrientacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
ExtensaoOrientacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_EXTENSAO_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
return
$this
->
hasOne
(
ExtensaoOutros
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
ExtensaoOutros
::
class
,
'id'
,
'tarefa_id'
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Gestao Models
// Return Gestao Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
return
$this
->
hasOne
(
GestaoCoordenacaoLaboratoriosDidaticos
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoCoordenacaoLaboratoriosDidaticos
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_COORDENACAO_PROGRAMA_INSTITUCIONAL
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_COORDENACAO_PROGRAMA_INSTITUCIONAL
)
{
return
$this
->
hasOne
(
GestaoCoordenacaoProgramaInstitucional
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoCoordenacaoProgramaInstitucional
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_MEMBRO_CAMARAS
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_CAMARAS
)
{
return
$this
->
hasOne
(
GestaoMembroCamaras
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoMembroCamaras
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_MEMBRO_COMISSAO
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_COMISSAO
)
{
return
$this
->
hasOne
(
GestaoMembroComissao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoMembroComissao
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_MEMBRO_CONSELHO
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_CONSELHO
)
{
return
$this
->
hasOne
(
GestaoMembroConselho
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoMembroConselho
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_MEMBRO_TITULAR_CONSELHO
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_TITULAR_CONSELHO
)
{
return
$this
->
hasOne
(
GestaoMembroTitularConselho
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoMembroTitularConselho
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_OUTROS
)
{
return
$this
->
hasOne
(
GestaoOutros
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoOutros
::
class
,
'id'
,
'tarefa_id'
);
}
}
if
(
$this
->
type
==
=
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
return
$this
->
hasOne
(
GestaoRepresentanteUnidadeEducacao
::
class
,
'id'
,
'tarefa_id'
);
return
$this
->
hasOne
(
GestaoRepresentanteUnidadeEducacao
::
class
,
'id'
,
'tarefa_id'
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
...
@@ -166,9 +241,164 @@ class TaskTime extends Model
...
@@ -166,9 +241,164 @@ class TaskTime extends Model
return
$this
->
hasOne
(
UserPad
::
class
,
'id'
,
'user_pad_id'
);
return
$this
->
hasOne
(
UserPad
::
class
,
'id'
,
'user_pad_id'
);
}
}
/**
* @return string
*/
public
function
getCode
()
{
return
$this
->
tarefa
->
cod_atividade
;
}
/**
* @return string
*/
public
function
getName
()
{
// Return Ensino Models
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
return
$this
->
tarefa
->
componente_curricular
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_AULA
)
{
return
$this
->
tarefa
->
componente_curricular
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
)
{
return
$this
->
tarefa
->
componente_curricular
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_MEMBRO_DOCENTE
)
{
return
$this
->
tarefa
->
nucleo
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ORIENTACAO
)
{
return
$this
->
tarefa
->
atividade
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_PARTICIPACAO
)
{
return
$this
->
tarefa
->
curso
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_PROJETO
)
{
return
$this
->
tarefa
->
componente_curricular
;
}
if
(
$this
->
type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
return
$this
->
tarefa
->
atividade
;
}
// - - - - - - - - - -
// Return Pesquisa Models
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
}
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_LIDERANCA
)
{
return
$this
->
tarefa
->
grupo_pesquisa
;
}
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_ORIENTACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
}
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
}
// - - - - - - - - - -
// Return Extensao Models
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
}
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_ORIENTACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
}
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
}
// - - - - - - - - - -
// Return Gestao Models
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_COORDENACAO_PROGRAMA_INSTITUCIONAL
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_CAMARAS
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_COMISSAO
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_CONSELHO
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_MEMBRO_TITULAR_CONSELHO
)
{
return
$this
->
tarefa
->
nome
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
}
if
(
$this
->
type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
return
$this
->
tarefa
->
nome
;
}
// - - - - - - - - - -
}
/**
* @return string
*/
public
function
intervalTime
(
$format
=
'H:i:s'
)
{
$startTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
start_time
);
$endTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
end_time
);
$interval
=
$startTime
->
diff
(
$endTime
);
$dateTime
=
new
DateTime
(
'00:00'
);
$dateTime
->
add
(
$interval
);
// Popular com Interval
return
$dateTime
->
format
(
$format
);
}
/**
* STATIC METHODS
*/
public
static
function
listWeekDaysTable
(
$value
=
null
)
{
$values
=
[
self
::
WEEK_HOUR
=>
"HORÁRIO"
,
self
::
WEEK_DAY_MONDAY
=>
"SEGUNDA-FEIRA"
,
self
::
WEEK_DAY_TUESDAY
=>
"TERÇA-FEIRA"
,
self
::
WEEK_DAY_WEDNESDAY
=>
"QUARTA-FEIRA"
,
self
::
WEEK_DAY_THURSDAY
=>
"QUINTA-FEIRA"
,
self
::
WEEK_DAY_FRIDAY
=>
"SEXTA-FEIRA"
,
self
::
WEEK_DAY_SATURDAY
=>
"SÁBADO"
,
];
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
}
public
static
function
listWeekDays
(
$value
=
null
)
{
public
static
function
listWeekDays
(
$value
=
null
)
{
$values
=
[
$values
=
[
self
::
WEEK_DAY_SUNDAY
=>
"DOMINGO"
,
//
self::WEEK_DAY_SUNDAY => "DOMINGO",
self
::
WEEK_DAY_MONDAY
=>
"SEGUNDA-FEIRA"
,
self
::
WEEK_DAY_MONDAY
=>
"SEGUNDA-FEIRA"
,
self
::
WEEK_DAY_TUESDAY
=>
"TERÇA-FEIRA"
,
self
::
WEEK_DAY_TUESDAY
=>
"TERÇA-FEIRA"
,
self
::
WEEK_DAY_WEDNESDAY
=>
"QUARTA-FEIRA"
,
self
::
WEEK_DAY_WEDNESDAY
=>
"QUARTA-FEIRA"
,
...
@@ -180,25 +410,234 @@ class TaskTime extends Model
...
@@ -180,25 +410,234 @@ class TaskTime extends Model
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
}
}
public
static
function
listTaskTypes
(
$value
=
null
)
{
$values
=
[
self
::
TYPE_ENSINO_AULA
=>
''
,
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
=>
''
,
self
::
TYPE_ENSINO_ORIENTACAO
=>
''
,
self
::
TYPE_ENSINO_SUPERVISAO
=>
''
,
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
=>
''
,
self
::
TYPE_ENSINO_PROJETO
=>
''
,
self
::
TYPE_ENSINO_PARTICIPACAO
=>
''
,
self
::
TYPE_ENSINO_MEMBRO_DOCENTE
=>
''
,
self
::
TYPE_ENSINO_OUTROS
=>
''
,
self
::
TYPE_PESQUISA_COORDENACAO
=>
''
,
self
::
TYPE_PESQUISA_ORIENTACAO
=>
''
,
self
::
TYPE_PESQUISA_LIDERANCA
=>
''
,
self
::
TYPE_PESQUISA_OUTROS
=>
''
,
self
::
TYPE_EXTENSAO_COORDENACAO
=>
''
,
self
::
TYPE_EXTENSAO_ORIENTACAO
=>
''
,
self
::
TYPE_EXTENSAO_OUTROS
=>
''
,
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
=>
''
,
self
::
TYPE_GESTAO_MEMBRO_CONSELHO
=>
''
,
self
::
TYPE_GESTAO_COORDENACAO_PROGRAMA_INSTITUCIONAL
=>
''
,
self
::
TYPE_GESTAO_MEMBRO_TITULAR_CONSELHO
=>
''
,
self
::
TYPE_GESTAO_MEMBRO_CAMARAS
=>
''
,
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
=>
''
,
self
::
TYPE_GESTAO_MEMBRO_COMISSAO
=>
''
,
self
::
TYPE_GESTAO_OUTROS
=>
''
,
];
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
}
/**
* @param $floatValue
* @return string|time
*/
public
static
function
convertFloatToHour
(
$floatValue
)
{
$percent
=
$floatValue
*
100.0
;
// float to percent
$one_percent_from_hour
=
0.6
;
// 0.6 min
$minutes
=
$one_percent_from_hour
*
$percent
;
// minutes
// Criar um objeto DateTime com um intervalo de minutos
$interval
=
new
DateInterval
(
'PT'
.
$minutes
.
'M'
);
// Criar um objeto DateTime base com 0 horas e 0 minutos
$dateTime
=
new
DateTime
(
'00:00'
);
$dateTime
->
add
(
$interval
);
// Popular com Interval
return
$dateTime
->
format
(
'H:i:s'
);
}
/**
/**
* Explode string with format "id_{id}|type_{type}" to array ['tarefa_id' => 'integer', 'type' => 'integer']
* Recebe e formata uma string para formato H:i
* @return array
* Pode ser recebido uma hora completa H:i:s ou uma hora padrão H:i
* @return string|date
*/
public
static
function
traitHour
(
string
|
null
$hour
=
""
)
{
if
(
!
empty
(
$hour
))
{
$hour_splited
=
explode
(
':'
,
$hour
);
$hour_h_i
=
"
{
$hour_splited
[
0
]
}
:
$hour_splited[1]
"
;
return
$hour_h_i
;
}
return
$hour
;
}
/**
* @param $taskTimes
* @return DateTime
*/
public
static
function
sumIntervalTimes
(
Collection
$taskTimes
)
{
$sumDateTime
=
new
DateTime
(
"00:00:00"
);
foreach
(
$taskTimes
as
$taskTime
)
{
$split_time
=
explode
(
":"
,
$taskTime
->
intervalTime
());
$hours
=
$split_time
[
0
];
$minutes
=
$split_time
[
1
];
$seconds
=
$split_time
[
2
];
$sumDateTime
->
modify
(
"+
{
$hours
}
hours +
{
$minutes
}
minutes +
{
$seconds
}
seconds"
);
}
return
$sumDateTime
;
}
/**
* @param DateTime $dateTimeX
* @param DateTime $dateTimeY
* @return DateTime
*/
*/
public
static
function
splitTarefaAndType
(
string
$task_type
)
{
public
static
function
sumDateTimes
(
DateTime
$dateTimeX
,
DateTime
$dateTimeY
)
{
$time_x
=
$dateTimeX
->
format
(
"H:i:s"
);
$time_y
=
$dateTimeY
->
format
(
"H:i:s"
);
$newDateTime
=
new
DateTime
(
$time_x
);
$split_time
=
explode
(
":"
,
$time_y
);
$split_task_type
=
explode
(
"|"
,
$task_type
);
$hours
=
$split_time
[
0
];
$minutes
=
$split_time
[
1
];
$seconds
=
$split_time
[
2
];
$newDateTime
->
modify
(
"+
{
$hours
}
hours +
{
$minutes
}
minutes +
{
$seconds
}
seconds"
);
$task_data
=
$split_task_type
[
0
];
return
$newDateTime
;
$split_task
=
explode
(
"_"
,
$task_data
);
}
$task_id
=
$split_task
[
1
];
/** @return mixed */
public
static
function
tarefaByStatic
(
$type
,
$tarefa_id
)
{
// Return Ensino Models
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
return
EnsinoAtendimentoDiscente
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_AULA
)
{
return
EnsinoAula
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
)
{
return
EnsinoCoordenacaoRegencia
::
find
(
$tarefa_id
);
}
$type_data
=
$split_task_type
[
1
];
if
(
$type
==
self
::
TYPE_ENSINO_MEMBRO_DOCENTE
)
{
$split_type
=
explode
(
"_"
,
$type_data
);
return
EnsinoMembroDocente
::
find
(
$tarefa_id
);
$type
=
$split_type
[
1
];
}
if
(
$type
==
self
::
TYPE_ENSINO_ORIENTACAO
)
{
return
EnsinoOrientacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_OUTROS
)
{
return
EnsinoOutros
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_PARTICIPACAO
)
{
return
EnsinoParticipacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_PROJETO
)
{
return
EnsinoProjeto
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
return
EnsinoSupervisao
::
find
(
$tarefa_id
);
}
// - - - - - - - - - -
// Return Pesquisa Models
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
return
PesquisaCoordenacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_PESQUISA_LIDERANCA
)
{
return
PesquisaLideranca
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_PESQUISA_ORIENTACAO
)
{
return
PesquisaOrientacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
return
PesquisaOutros
::
find
(
$tarefa_id
);
}
// - - - - - - - - - -
// Return Extensao Models
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
return
ExtensaoCoordenacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_EXTENSAO_ORIENTACAO
)
{
return
ExtensaoOrientacao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
return
ExtensaoOutros
::
find
(
$tarefa_id
);
}
// - - - - - - - - - -
// Return Gestao Models
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
return
GestaoCoordenacaoLaboratoriosDidaticos
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_GESTAO_COORDENACAO_PROGRAMA_INSTITUCIONAL
)
{
return
GestaoCoordenacaoProgramaInstitucional
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_GESTAO_MEMBRO_CAMARAS
)
{
return
GestaoMembroCamaras
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_GESTAO_MEMBRO_COMISSAO
)
{
return
GestaoMembroComissao
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_GESTAO_MEMBRO_CONSELHO
)
{
return
GestaoMembroConselho
::
find
(
$tarefa_id
);
}
if
(
$type
==
self
::
TYPE_GESTAO_MEMBRO_TITULAR_CONSELHO
)
{
return
GestaoMembroTitularConselho
::
find
(
$tarefa_id
);
}
$data
=
[
'tarefa_id'
=>
$task_id
,
'type'
=>
$type
];
if
(
$type
==
self
::
TYPE_GESTAO_OUTROS
)
{
return
GestaoOutros
::
find
(
$tarefa_id
);
}
return
$data
;
if
(
$type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
return
GestaoRepresentanteUnidadeEducacao
::
find
(
$tarefa_id
);
}
// - - - - - - - - - -
}
}
}
}
app/Models/Util/MenuItemsAvaliador.php
View file @
230703eb
...
@@ -8,4 +8,5 @@ class MenuItemsAvaliador
...
@@ -8,4 +8,5 @@ class MenuItemsAvaliador
const
HOME
=
0
;
const
HOME
=
0
;
const
PADs
=
1
;
const
PADs
=
1
;
const
REPORT
=
2
;
const
REPORT
=
2
;
const
TASK_TIME
=
3
;
}
}
app/Rules/ValidationLimitTime.php
0 → 100644
View file @
230703eb
<?php
namespace
App\Rules
;
use
App\Models\TaskTime
;
use
DateTime
;
use
Illuminate\Contracts\Validation\Rule
;
use
Illuminate\Database\Eloquent\Collection
;
class
ValidationLimitTime
implements
Rule
{
/** @var string|integer */
protected
$id
;
/** @var string|integer */
protected
$user_pad_id
;
/** @var string|integer */
protected
$tarefa_id
;
/** @var string|integer */
protected
$type
;
/** @var string|date */
protected
$start_time
;
/** @var string|date */
protected
$end_time
;
/** @var string */
protected
$limit_hours
;
/** @var DateInterval */
protected
$outLineTime
;
/** @var mixed */
protected
$task
;
/** @var TaskTime */
protected
$taskTime
;
/** @var Collection */
protected
$taskTimes
;
/**
* Create a new rule instance.
*
* @param array $attributes
* @return void
*
* Example
* $attributes = ['user_pad_id' => $user_pad_id, 'tarefa_id' => $tarefa_id, 'type' => $type, 'start_time' => $start_time, 'end_time' => $end_time]
*/
public
function
__construct
(
$attributes
=
[])
{
$this
->
id
=
$attributes
[
'id'
];
$this
->
user_pad_id
=
$attributes
[
'user_pad_id'
];
$this
->
tarefa_id
=
$attributes
[
'tarefa_id'
];
$this
->
type
=
$attributes
[
'type'
];
$this
->
start_time
=
$attributes
[
'start_time'
];
$this
->
end_time
=
$attributes
[
'end_time'
];
$this
->
task
=
TaskTime
::
tarefaByStatic
(
$this
->
type
,
$this
->
tarefa_id
);
$this
->
limit_hours
=
TaskTime
::
convertFloatToHour
(
$this
->
task
->
ch_semanal
);
$this
->
taskTimes
=
$this
->
getTaskTimes
();
$this
->
taskTime
=
$this
->
createTaskTime
();
}
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public
function
passes
(
$attribute
,
$value
)
{
$limitDateTime
=
new
DateTime
(
$this
->
limit_hours
);
$sumDateTime
=
TaskTime
::
sumIntervalTimes
(
$this
->
taskTimes
);
$newDateTime
=
new
DateTime
(
$this
->
taskTime
->
intervalTime
());
$totalDateTime
=
TaskTime
::
sumDateTimes
(
$sumDateTime
,
$newDateTime
);
$this
->
outLineTime
=
$totalDateTime
->
diff
(
$limitDateTime
);
// dd([
// 'limite' => $limitDateTime,
// 'total' => $totalDateTime,
// 'interval' => $this->outLineTime
// ]);
return
$limitDateTime
>=
$totalDateTime
;
}
/**
* Get the validation error message.
*
* @return string
*/
public
function
message
()
{
$limitDateTime
=
new
DateTime
(
$this
->
limit_hours
);
$sumDateTime
=
TaskTime
::
sumIntervalTimes
(
$this
->
taskTimes
);
$diffInterval
=
$sumDateTime
->
diff
(
$limitDateTime
);
$dateTime
=
new
DateTime
(
'00:00:00'
);
$dateTime
->
add
(
$diffInterval
);
$diff_time
=
$dateTime
->
format
(
'H:i'
);
$taskTime
=
$this
->
createTaskTime
();
$interval_time
=
$taskTime
->
intervalTime
(
'H:i'
);
$msgError
=
"Carga horária disponível restante:
{
$diff_time
}
hora(s)!"
;
$msgError
.
=
$diff_time
==
"00:00"
?
" Atividade Indisponível!"
:
" Intervalo entre inicio e fim :
{
$interval_time
}
hora(s)!"
;
return
$msgError
;
}
/**
* @return App\Models\TaskTime[]
*/
public
function
getTaskTimes
()
{
$id
=
$this
->
id
;
return
(
TaskTime
::
where
(
'user_pad_id'
,
'='
,
$this
->
user_pad_id
)
->
where
(
'tarefa_id'
,
'='
,
$this
->
tarefa_id
)
->
where
(
'type'
,
'='
,
$this
->
type
)
->
get
()
->
reject
(
function
(
TaskTime
$model
,
int
$key
)
use
(
$id
)
{
return
$model
->
id
==
$id
;
})
);
}
/**
* @return App\Models\TaskTime
*/
public
function
createTaskTime
()
{
$model
=
new
TaskTime
();
$model
->
user_pad_id
=
$this
->
user_pad_id
;
$model
->
tarefa_id
=
$this
->
tarefa_id
;
$model
->
type
=
$this
->
type
;
$model
->
start_time
=
$this
->
start_time
;
$model
->
end_time
=
$this
->
end_time
;
$model
->
start_time
=
"
{
$model
->
start_time
}
:00"
;
$model
->
end_time
=
"
{
$model
->
end_time
}
:00"
;
return
$model
;
}
}
resources/views/avaliador-task-time/card_horario.blade.php
0 → 100644
View file @
230703eb
<div
class=
"card mx-2"
style=
"width: 12rem;"
>
<div
class=
"card-body"
>
<h3
class=
"text-center"
>
<i
class=
"bi bi-clock-fill"
></i>
</h3>
<h5
class=
"text-center"
>
PAD: {{ $userPad->pad->nome }}
</h4>
<h5
class=
"text-center"
>
Status: {{ $userPad->pad->statusAsString() }}
</h4>
<a
class=
"stretched-link"
href=
"{{ route('pad_relatório', ['id' => $userPad->id]) }}"
></a>
</div>
</div>
resources/views/avaliador-task-time/index.blade.php
0 → 100644
View file @
230703eb
@
extends
(
'layouts.main'
)
@
section
(
'header'
)
@
include
(
'layouts.header'
,
[
'user'
=>
Auth
::
user
(),
])
@
endsection
@
section
(
'nav'
)
@
include
(
'layouts.navigation'
,
[
'menu'
=>
$index_menu
])
@
endsection
@
section
(
'title'
,
'Horários'
)
@
section
(
'body'
)
<
div
class
=
"tab-content"
>
<
div
class
=
"tab-pane active"
id
=
"home"
role
=
"tabpanel"
aria
-
labelledby
=
"home-tab"
>
<
div
class
=
"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"
>
<
h1
class
=
"h2"
>
Horários
</
h1
>
</
div
>
<
div
class
=
"d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3"
>
<
h3
>
<
i
class
=
"bi bi-clock-fill"
></
i
>
Horários
Disponíveis
</
h3
>
</
div
>
<
div
class
=
"d-flex"
>
{{
--
@
foreach
(
$userPads
as
$userPad
)
@
include
(
'avaliador-task-time.card_horario'
,
[
'userPad'
=>
$userPad
])
@
endforeach
--
}}
</
div
>
</
div
>
</
div
>
@
endsection
\ No newline at end of file
resources/views/components/buttons/btn-delete-by-alert.blade.php
0 → 100644
View file @
230703eb
{{
--
@
include
(
'components.buttons.btn-delete-by-alert'
,
[
'_id'
=>
''
,
'_class'
=>
''
,
'_route'
=>
route
(
''
)
])
--
}}
<!--
Button
trigger
alert
-->
<
button
type
=
"button"
id
=
"{{
$_id
}}"
class
=
"btn btn-danger
{
{$_class}
}
"
>
<
i
class
=
"bi bi-trash"
></
i
>
</
button
>
<
script
>
$
(
'.{{$_class}}'
)
.
click
(
function
(
e
)
{
const
_id
=
$
(
this
)
.
attr
(
'id'
)
const
is_delete
=
confirm
(
'Você tem certeza que deseja excluir esse item?'
)
if
(
is_delete
)
{
$
(
'#form-delete-'
+
_id
)
.
submit
()
}
})
</
script
>
\ No newline at end of file
resources/views/components/cards/relatorio_pad.blade.php
View file @
230703eb
<div
class=
"card mx-2"
style=
"width: 12rem;"
>
<div
class=
"card mx-2"
style=
"width: 12rem;"
>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<h3
class=
"text-center"
>
<i
class=
"bi bi-file-
bar-graph
-fill"
></i>
</h3>
<h3
class=
"text-center"
>
<i
class=
"bi bi-file-
earmark-word
-fill"
></i>
</h3>
<h5
class=
"text-center"
>
PAD: {{ $userPad->pad->nome }}
</h4>
<h5
class=
"text-center"
>
PAD: {{ $userPad->pad->nome }}
</h4>
<h5
class=
"text-center"
>
Status: {{ $userPad->pad->statusAsString() }}
</h4>
<h5
class=
"text-center"
>
Status: {{ $userPad->pad->statusAsString() }}
</h4>
<a
class=
"stretched-link"
href=
"{{ route('pad_relatório', ['id' => $userPad->id]) }}"
></a>
<a
class=
"stretched-link"
href=
"{{ route('pad_relatório', ['id' => $userPad->id]) }}"
></a>
...
...
resources/views/layouts/user-navigation/navigation_avaliador.blade.php
View file @
230703eb
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
$home_active
=
$index_menu
===
MenuItemsAvaliador
::
HOME
?
'active'
:
''
;
$home_active
=
$index_menu
===
MenuItemsAvaliador
::
HOME
?
'active'
:
''
;
$report_active
=
$index_menu
===
MenuItemsAvaliador
::
REPORT
?
'active'
:
''
;
$report_active
=
$index_menu
===
MenuItemsAvaliador
::
REPORT
?
'active'
:
''
;
$task_time_active
=
$index_menu
===
MenuItemsAvaliador
::
TASK_TIME
?
'active'
:
''
;
@
endphp
@
endphp
<!--
SidebarMenu
:
Vertical
Options
-->
<!--
SidebarMenu
:
Vertical
Options
-->
...
@@ -19,10 +20,12 @@
...
@@ -19,10 +20,12 @@
</
li
>
</
li
>
<
li
class
=
"nav-item"
>
<
li
class
=
"nav-item"
>
<
a
href
=
"{{ route('avaliador_relatorio') }}"
class
=
"custom-nav-link {{
$report_active
}}"
>
<
a
href
=
"{{ route('avaliador_relatorio') }}"
class
=
"custom-nav-link {{
$report_active
}}"
>
<
svg
xmlns
=
"http://www.w3.org/2000/svg"
width
=
"16"
height
=
"16"
fill
=
"currentColor"
class
=
"bi bi-file-bar-graph-fill"
viewBox
=
"0 0 16 16"
>
<
i
class
=
"bi bi-file-earmark-word-fill"
></
i
>
Relatórios
<
path
d
=
"M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm-2 11.5v-6a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm-2.5.5a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-1zm-3 0a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-1z"
/>
</
svg
>
Relatórios
</
a
>
</
a
>
</
li
>
</
li
>
{{
--
<
li
class
=
"nav-item"
>
<
a
href
=
"{{ route('avaliador_task_time_index') }}"
class
=
"custom-nav-link {{
$task_time_active
}}"
>
<
i
class
=
"bi bi-clock-fill"
></
i
>
Horários
</
a
>
</
li
>
--
}}
</
ul
>
</
ul
>
\ No newline at end of file
resources/views/task-time/_form.blade.php
deleted
100644 → 0
View file @
46aae30d
resources/views/task-time/create.blade.php
View file @
230703eb
...
@@ -2,30 +2,80 @@
...
@@ -2,30 +2,80 @@
use
App\Models\TaskTime
;
use
App\Models\TaskTime
;
@
endphp
@
endphp
<
form
id
=
"
form-user_pad
"
action
=
"{{ route('TaskTimeSave') }}"
method
=
"post"
>
<
form
id
=
"
task-time-form
"
action
=
"{{ route('TaskTimeSave') }}"
method
=
"post"
>
@
csrf
@
csrf
@
method
(
'POST'
)
@
method
(
'POST'
)
<
div
class
=
"col-sm-12"
>
<
div
class
=
"row"
>
<
div
class
=
"mb-3"
>
<
label
for
=
"weekday"
>
Atividade
</
label
>
<
input
type
=
"hidden"
id
=
"user_pad_id"
name
=
"user_pad_id"
value
=
"{{
$user_pad_id
}}"
>
<
select
name
=
"tarefa_id"
id
=
"tarefa_id"
class
=
"form-select"
>
<!--
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
<
input
type
=
"hidden"
id
=
"tarefa_id"
name
=
"tarefa_id"
value
=
""
>
<
option
value
=
"
{
{$id}}">{{$text}
}
</option>
@endforeach -->
<
input
type
=
"hidden"
id
=
"type"
name
=
"type"
value
=
""
>
</select>
<
input
type
=
"hidden"
id
=
"id"
name
=
"id"
value
=
""
>
<
div
class
=
"mb-4 col-sm-2"
>
<
div
class
=
""
>
<
label
class
=
"form-label"
for
=
"cod_atividade"
>
Cód
.
Atividade
</
label
>
<
input
class
=
"form-control @error('cod_atividade') is-invalid @enderror ajax-errors"
type
=
"text"
name
=
"cod_atividade"
id
=
"cod_atividade"
readonly
>
</
div
>
@
include
(
'components.divs.errors'
,
[
'field'
=>
'cod_atividade_create'
])
</
div
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"mt-3"
>
<
label
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<
select
name
=
"weekday"
id
=
"weekday"
class
=
"form-select @error('weekday') is-invalid @enderror ajax-errors"
>
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
<
option
value
=
"
{
{$id}}">{{$text}
}
</option>
@endforeach
</select>
@include('components.divs.errors', [
'field' => 'weekday_create'
])
</div>
</div>
<div class="
col
-
sm
-
12
">
<div class="">
<label for="
slct_tarefa_id
">Atividade</label>
<select name="
slct_tarefa_id
" id="
slct_tarefa_id
" class="
form
-
select
@
error
(
'slct_tarefa_id'
)
is
-
invalid
@
enderror
ajax
-
errors
">
</select>
</div>
@include('components.divs.errors', [
'field' => 'slct_tarefa_id_create'
])
</div>
</div>
</div>
<div class="
col
-
sm
-
12
">
<div class="
col
-
sm
-
6
">
<div class="
mb
-
3
">
<div class="
mt
-
3
">
<label for="
weekday
">Dia da Semana</label>
<label class="
form
-
label
" for="
start_time
">Horário Inicial</label>
<select name="
weekday
" id="
weekday
" class="
form
-
select
">
<input type="
time
" min="
07
:
30
" max="
21
:
15
" name="
start_time
" id="
start_time
" class="
form
-
control
@
error
(
'start_time'
)
is
-
invalid
@
enderror
ajax
-
errors
" >
@foreach(TaskTime::listWeekDays() as
$id
=>
$text
)
<option value="
{{
$id
}}
">
{
{$text}
}
</option>
@include('components.divs.errors', [
@endforeach
'field' => 'start_time_create',
</select>
])
</div>
</div>
</div>
<div class="
col
-
sm
-
6
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
end_time
">Horário Final</label>
<input type="
time
" min="
07
:
30
" max="
21
:
15
" name="
end_time
" id="
end_time
" class="
form
-
control
@
error
(
'end_time'
)
is
-
invalid
@
enderror
ajax
-
errors
" >
@include('components.divs.errors', [
'field' => 'end_time_create',
])
</div>
</div>
</div>
</div>
<div class="
mt
-
1
text
-
end
">
<div class="
mt
-
1
text
-
end
">
...
@@ -41,6 +91,13 @@
...
@@ -41,6 +91,13 @@
</form>
</form>
@include('pad.components.scripts.ajaxValidation', [
'btn_submit_id' => 'btn_submit',
'form_id' => 'task-time-form',
'route' => route('TaskTimeValidation'),
'form_type' => 'create',
])
<script type="
text
/
javascript
">
<script type="
text
/
javascript
">
$('#weekday').select2(
$('#weekday').select2(
...
@@ -50,10 +107,15 @@
...
@@ -50,10 +107,15 @@
dropdownParent: $('#modal')
dropdownParent: $('#modal')
})
})
$('#tarefa_id').select2(
$('#
slct_
tarefa_id').select2(
{
{
allowClear: true,
allowClear: true,
placeholder: 'Tarefa',
placeholder: 'Tarefa',
language: {
noResults: function() {
return "
Resultados
não
Encontrados
";
}
},
ajax: {
ajax: {
url: '{{ route("
TaskSearch
") }}',
url: '{{ route("
TaskSearch
") }}',
data: function(params) {
data: function(params) {
...
@@ -67,4 +129,43 @@
...
@@ -67,4 +129,43 @@
dropdownParent: $('#modal')
dropdownParent: $('#modal')
})
})
</script>
$('#slct_tarefa_id').on('change', function(e)
\ No newline at end of file
{
const type = $('#type')
const tarefa_id = $('#tarefa_id')
$('#cod_atividade').val('')
if($(this).val()) {
const value = $(this).val()
const split_data = value.split('|')
const split_tarefa_id = split_data[0].split('_')
const split_type = split_data[1].split('_')
const _tarefa_id = split_tarefa_id[1]
const _type = split_type[1]
type.val(_type)
tarefa_id.val(_tarefa_id)
$.ajax({
url: '{{ route("
TaskTimeSearchTask
") }}',
type: 'GET',
data: {
tarefa_id: _tarefa_id,
type: _type
},
dataType: 'json',
success: (response) => {
const cod_atividade = response.task.cod_atividade
$('#cod_atividade').val(cod_atividade)
},
error: (xhr, status, error) => {
console.error('Erro na requisição!');
}
});
}
})
</script>
resources/views/task-time/index.blade.php
View file @
230703eb
...
@@ -19,12 +19,96 @@
...
@@ -19,12 +19,96 @@
@
include
(
'components.alerts'
)
@
include
(
'components.alerts'
)
@
include
(
'components.buttons.btn-show-modal'
,
[
@
include
(
'components.buttons.btn-show-modal'
,
[
// '_id' => 'btn-task-time-create',
'_class'
=>
'btn-success'
,
'_class'
=>
'btn-success'
,
'_content'
=>
'Cadastrar'
,
'_content'
=>
'Cadastrar'
,
'_target_class'
=>
'task-time-create'
,
'_target_class'
=>
'task-time-create'
,
])
])
@
php
use
App\Models\TaskTime
;
// $hours = ['07:30', '08:20', '09:10', '10:00', '10:50', '11:40', '12:30', '13:30', '14:30', '15:30', '16:30', '17:30', '19:00', '19:45', '20:30', '21:15'];
$rangeHours
=
[
[
'07:30'
,
'08:20'
],
[
'08:20'
,
'09:10'
],
[
'09:10'
,
'10:00'
],
[
'10:00'
,
'10:50'
],
[
'10:50'
,
'11:40'
],
[
'11:40'
,
'12:30'
],
[
'12:30'
,
'13:30'
],
[
'13:30'
,
'14:30'
],
[
'14:30'
,
'15:30'
],
[
'15:30'
,
'16:30'
],
[
'16:30'
,
'17:30'
],
[
'17:30'
,
'19:00'
],
[
'19:00'
,
'19:45'
],
[
'19:45'
,
'20:30'
],
[
'20:30'
,
'21:15'
],
[
'21:15'
,
'21:15'
],
];
$calendar
=
[];
$row
=
[];
foreach
(
$rangeHours
as
$rangeHour
)
{
$start_time
=
$rangeHour
[
0
];
$end_time
=
$rangeHour
[
1
];
$row
[
0
]
=
$start_time
;
foreach
(
array_keys
(
TaskTime
::
listWeekDays
())
as
$weekday
)
{
$row
[
$weekday
]
=
TaskTime
::
where
(
'user_pad_id'
,
'='
,
$user_pad_id
)
->
where
(
'weekday'
,
'='
,
$weekday
)
->
where
(
function
(
$query
)
use
(
$rangeHour
)
{
$query
->
orWhereBetween
(
'start_time'
,
$rangeHour
)
->
orWhereBetween
(
'end_time'
,
$rangeHour
);
})
->
first
();
$row
[
$weekday
]
=
$row
[
$weekday
]
?
$row
[
$weekday
]
:
''
;
}
$calendar
[]
=
$row
;
}
@
endphp
<
div
class
=
"my-4"
>
<
table
class
=
"table table-hover"
>
<
thead
>
<
tr
>
@
foreach
(
TaskTime
::
listWeekDaysTable
()
as
$key
=>
$weekday
)
<
th
scope
=
"col"
>
{{
$weekday
}}
</
th
>
@
endforeach
</
tr
>
</
thead
>
<
tbody
>
@
foreach
(
$calendar
as
$rowHour
)
<
tr
>
@
foreach
(
$rowHour
as
$model
)
@
if
(
gettype
(
$model
)
==
'string'
)
<
th
scope
=
"col"
>
{{
$model
}}
</
th
>
@
endif
@
if
(
gettype
(
$model
)
==
'object'
)
<
td
>
<
a
href
=
"#modal"
class
=
"btn btn-edit_task"
id
=
"{{
$model->id
}}"
>
{{
"
{
$model
->
getCode
()
}
:
{
$model
->
getName
()
}
"
}}
</
a
>
</
td
>
@
endif
@
endforeach
</
tr
>
@
endforeach
</
tbody
>
</
table
>
</
div
>
@
include
(
'components.modal'
,
[
'size'
=>
'modal-lg'
,
'header'
=>
''
])
@
include
(
'components.modal'
,
[
'size'
=>
'modal-lg'
,
'header'
=>
''
])
</
div
>
</
div
>
...
@@ -39,4 +123,35 @@
...
@@ -39,4 +123,35 @@
'btn_class'
=>
'task-time-create'
,
'btn_class'
=>
'task-time-create'
,
])
])
@
endsection
@
include
(
'pad.components.scripts.dimensao.ensino.show_modal'
,
[
\ No newline at end of file
'modal_id'
=>
'modal'
,
'route'
=>
route
(
'TaskTimeEdit'
),
'btn_class'
=>
'btn-edit_task'
,
])
@
endsection
{{
--
@
include
(
'components.buttons.btn-edit'
,
[
'route'
=>
route
(
'TaskTimeEdit'
,
[
'id'
=>
$model
->
id
])
])
@
include
(
'components.buttons.btn-delete'
,
[
'id'
=>
$model
->
id
,
'route'
=>
route
(
'TaskTimeDelete'
,
[
'id'
=>
$model
->
id
])
])
--
}}
{{
--
@
foreach
(
$listTaskTime
as
$key
=>
$taskTimes
)
<
tr
>
@
foreach
(
$taskTimes
as
$model
)
@
if
(
gettype
(
$model
)
==
'string'
)
<
th
>
{{
$model
}}
</
th
>
@
endif
@
if
(
gettype
(
$model
)
==
'object'
)
@
endif
@
endforeach
</
tr
>
@
endforeach
--
}}
\ No newline at end of file
resources/views/task-time/update.blade.php
0 → 100644
View file @
230703eb
@
php
use
App\Models\TaskTime
;
/**
* @var App\Models\TaskTime $model
*/
@
endphp
<
form
id
=
"form-delete-
{
{$model->id}
}
"
action
=
"{{ route('TaskTimeDelete', ['id' =>
$model->id
]) }}"
method
=
"post"
>
@
method
(
'DELETE'
)
@
csrf
</
form
>
<
form
id
=
"task-time-update-form"
action
=
"{{ route('TaskTimeUpdate', ['id' =>
$model->id
]) }}"
method
=
"post"
>
@
csrf
@
method
(
'POST'
)
<
div
class
=
"row"
>
<
input
type
=
"hidden"
id
=
"user_pad_id"
name
=
"user_pad_id"
value
=
"{{
$model->user_pad_id
}}"
>
<
input
type
=
"hidden"
id
=
"tarefa_id"
name
=
"tarefa_id"
value
=
"{{
$model->tarefa_id
}}"
>
<
input
type
=
"hidden"
id
=
"type"
name
=
"type"
value
=
"{{
$model->type
}}"
>
´
<
input
type
=
"hidden"
id
=
"id"
name
=
"id"
value
=
"{{
$model->id
}}"
>
<
div
class
=
"mb-4 col-sm-2"
>
<
div
class
=
""
>
<
label
class
=
"form-label"
for
=
"cod_atividade"
>
Cód
.
Atividade
</
label
>
<
input
type
=
"text"
id
=
"cod_atividade"
name
=
"cod_atividade"
value
=
"{{
$model->tarefa
->cod_atividade }}"
readonly
class
=
"form-control @error('cod_atividade') is-invalid @enderror ajax-errors"
>
</
div
>
@
include
(
'components.divs.errors'
,
[
'field'
=>
'cod_atividade_update'
])
</
div
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"mt-3"
>
<
label
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<
select
name
=
"weekday"
id
=
"weekday"
class
=
"form-select @error('weekday') is-invalid @enderror ajax-errors"
>
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
@
if
(
$model
->
weekday
==
$id
)
<
option
selected
value
=
"
{
{$id}}">{{$text}
}
</option>
@else
<option value="
{{
$id
}}
">
{
{$text}
}
</option>
@endif
@endforeach
</select>
@include('components.divs.errors', [
'field' => 'weekday_update'
])
</div>
</div>
<div class="
col
-
sm
-
12
">
<div class="">
<label for="
slct_tarefa_id
">Atividade</label>
<select name="
slct_tarefa_id
" id="
slct_tarefa_id
" class="
form
-
select
@
error
(
'slct_tarefa_id'
)
is
-
invalid
@
enderror
ajax
-
errors
">
<option selected value="
{{
$model
->
tarefa_id
}}
">
{
{$model->getName()}
}
</option>
</select>
</div>
@include('components.divs.errors', [
'field' => 'slct_tarefa_id'
])
</div>
<div class="
col
-
sm
-
6
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
start_time
">Horário Inicial</label>
<input type="
time
" name="
start_time
" id="
start_time
" value="
{{
$model
->
start_time
}}
" class="
form
-
control
@
error
(
'start_time'
)
is
-
invalid
@
enderror
ajax
-
errors
" >
@include('components.divs.errors', [
'field' => 'start_time_update',
])
</div>
</div>
<div class="
col
-
sm
-
6
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
end_time
">Horário Final</label>
<input type="
time
" name="
end_time
" id="
end_time
" value="
{{
$model
->
end_time
}}
" class="
form
-
control
@
error
(
'end_time'
)
is
-
invalid
@
enderror
ajax
-
errors
" >
@include('components.divs.errors', [
'field' => 'end_time_update',
])
</div>
</div>
</div>
<div class="
mt
-
4
">
<div class="
modal
-
footer
">
<div class="
text
-
start
">
@include('components.buttons.btn-delete-by-alert', [
'_id' =>
$model->id
,
'_class' => "
delete_task_time
",
])
</div>
<div class="
text
-
end
">
@include('components.buttons.btn-save', [
'id' => 'btn_submit',
'content' => 'Atualizar',
])
@include('components.buttons.btn-close_modal')
</div>
</div>
</div>
</form>
@include('pad.components.scripts.ajaxValidation', [
'btn_submit_id' => 'btn_submit',
'form_id' => 'task-time-update-form',
'route' => route('TaskTimeValidation'),
'form_type' => 'update',
])
<script type="
text
/
javascript
">
$('#weekday').select2(
{
allowClear: true,
placeholder: 'Dia da Semana',
dropdownParent: $('#modal')
})
$('#slct_tarefa_id').select2(
{
allowClear: true,
placeholder: 'Tarefa',
language: {
noResults: function() {
return "
Resultados
não
Encontrados
";
}
},
ajax: {
url: '{{ route("
TaskSearch
") }}',
data: function(params) {
return {
q: params.term,
user_pad_id :
{
{$model->user_pad_id}
}
}
},
dataType: 'json'
},
dropdownParent: $('#modal')
})
$('#slct_tarefa_id').on('change', function(e)
{
const type = $('#type')
const tarefa_id = $('#tarefa_id')
$('#cod_atividade').val('')
if($(this).val()) {
const value = $(this).val()
const split_data = value.split('|')
const split_tarefa_id = split_data[0].split('_')
const split_type = split_data[1].split('_')
const _tarefa_id = split_tarefa_id[1]
const _type = split_type[1]
type.val(_type)
tarefa_id.val(_tarefa_id)
$.ajax({
url: '{{ route("
TaskTimeSearchTask
") }}',
type: 'GET',
data: {
tarefa_id: _tarefa_id,
type: _type
},
dataType: 'json',
success: (response) => {
const cod_atividade = response.task.cod_atividade
$('#cod_atividade').val(cod_atividade)
},
error: (xhr, status, error) => {
console.error('Erro na requisição!');
}
});
}
})
</script>
routes/Task.php
View file @
230703eb
...
@@ -5,4 +5,5 @@ use Illuminate\Support\Facades\Route;
...
@@ -5,4 +5,5 @@ use Illuminate\Support\Facades\Route;
Route
::
prefix
(
'/tarefa/geral'
)
->
group
(
function
()
{
Route
::
prefix
(
'/tarefa/geral'
)
->
group
(
function
()
{
Route
::
get
(
'/search'
,
[
TaskController
::
class
,
'search'
])
->
name
(
'TaskSearch'
);
Route
::
get
(
'/search'
,
[
TaskController
::
class
,
'search'
])
->
name
(
'TaskSearch'
);
Route
::
get
(
'/search-by-id'
,
[
TaskController
::
class
,
'searchById'
])
->
name
(
'TaskSearchById'
);
});
});
\ No newline at end of file
routes/TaskTime.php
View file @
230703eb
...
@@ -7,9 +7,9 @@ Route::prefix('/tarefa/horario')->group(function () {
...
@@ -7,9 +7,9 @@ Route::prefix('/tarefa/horario')->group(function () {
Route
::
get
(
'/index/{user_pad_id}'
,
[
TaskTimeController
::
class
,
'index'
])
->
name
(
'TaskTimeIndex'
);
Route
::
get
(
'/index/{user_pad_id}'
,
[
TaskTimeController
::
class
,
'index'
])
->
name
(
'TaskTimeIndex'
);
Route
::
get
(
'/create/{user_pad_id}'
,
[
TaskTimeController
::
class
,
'create'
])
->
name
(
'TaskTimeCreate'
);
Route
::
get
(
'/create/{user_pad_id}'
,
[
TaskTimeController
::
class
,
'create'
])
->
name
(
'TaskTimeCreate'
);
Route
::
post
(
'/save'
,
[
TaskTimeController
::
class
,
'save'
])
->
name
(
'TaskTimeSave'
);
Route
::
post
(
'/save'
,
[
TaskTimeController
::
class
,
'save'
])
->
name
(
'TaskTimeSave'
);
//edit
Route
::
get
(
'/edit/{id?}'
,
[
TaskTimeController
::
class
,
'edit'
])
->
name
(
'TaskTimeEdit'
);
//update
Route
::
post
(
'/update/{id}'
,
[
TaskTimeController
::
class
,
'update'
])
->
name
(
'TaskTimeUpdate'
);
//delete
Route
::
delete
(
'/delete/{id}'
,
[
TaskTimeController
::
class
,
'delete'
])
->
name
(
'TaskTimeDelete'
);
//move
Route
::
get
(
'/search-task'
,
[
TaskTimeController
::
class
,
'searchTask'
])
->
name
(
'TaskTimeSearchTask'
);
Route
::
post
(
'/validation'
,
[
TaskTimeController
::
class
,
'ajaxValidation'
])
->
name
(
'TaskTimeValidation'
);
});
});
\ No newline at end of file
routes/avaliador.php
0 → 100644
View file @
230703eb
<?php
use
App\Http\Controllers\AvaliadorController
;
use
App\Http\Controllers\AvaliadorTaskTimeController
;
use
App\Http\Controllers\PadController
;
use
Illuminate\Support\Facades\Route
;
Route
::
prefix
(
'/avaliador'
)
->
group
(
function
()
{
Route
::
get
(
'/index'
,
[
AvaliadorController
::
class
,
'index'
])
->
name
(
'avaliador_index'
);
Route
::
put
(
'/avaliar'
,
[
AvaliadorController
::
class
,
'avaliar'
])
->
name
(
'avaliador_avaliar'
);
Route
::
get
(
'/create'
,
[
AvaliadorController
::
class
,
'create'
])
->
name
(
'avaliador_create'
);
Route
::
post
(
'/store'
,
[
AvaliadorController
::
class
,
'store'
])
->
name
(
'avaliador_store'
);
Route
::
get
(
'/edit/{id}'
,
[
AvaliadorController
::
class
,
'edit'
])
->
name
(
'avaliador_edit'
);
Route
::
post
(
'/update/{id}'
,
[
AvaliadorController
::
class
,
'update'
])
->
name
(
'avaliador_update'
);
Route
::
delete
(
'/delete/{id}'
,
[
AvaliadorController
::
class
,
'destroy'
])
->
name
(
'avaliador_delete'
);
Route
::
get
(
'/relatorio'
,
[
AvaliadorController
::
class
,
'relatorio'
])
->
name
(
'avaliador_relatorio'
);
Route
::
get
(
'/relatorio/{id}'
,
[
PadController
::
class
,
'relatorio'
])
->
name
(
'pad_relatório'
);
Route
::
get
(
'/relatorio/{id}/pdf'
,
[
PadController
::
class
,
'generatePDF'
])
->
name
(
'pad_relatório_pdf'
);
Route
::
get
(
'/horario/index'
,
[
AvaliadorTaskTimeController
::
class
,
'index'
])
->
name
(
'avaliador_task_time_index'
);
});
routes/web.php
View file @
230703eb
...
@@ -29,7 +29,11 @@ require __DIR__ . '/auth.php';
...
@@ -29,7 +29,11 @@ require __DIR__ . '/auth.php';
require
__DIR__
.
'/profile.php'
;
require
__DIR__
.
'/profile.php'
;
require
__DIR__
.
'/pad.php'
;
require
__DIR__
.
'/pad.php'
;
require
__DIR__
.
'/avaliador.php'
;
require
__DIR__
.
'/avaliador_pad.php'
;
require
__DIR__
.
'/avaliador_pad.php'
;
require
__DIR__
.
'/professor_pad.php'
;
require
__DIR__
.
'/professor_pad.php'
;
require
__DIR__
.
'/unidade.php'
;
require
__DIR__
.
'/unidade.php'
;
...
@@ -97,19 +101,6 @@ Route::prefix('/professor')->group(function () {
...
@@ -97,19 +101,6 @@ Route::prefix('/professor')->group(function () {
Route
::
delete
(
'/delete/{id}'
,
[
ProfessorController
::
class
,
'destroy'
])
->
name
(
'professor_delete'
);
Route
::
delete
(
'/delete/{id}'
,
[
ProfessorController
::
class
,
'destroy'
])
->
name
(
'professor_delete'
);
});
});
Route
::
prefix
(
'/avaliador'
)
->
group
(
function
()
{
Route
::
get
(
'/index'
,
[
AvaliadorController
::
class
,
'index'
])
->
name
(
'avaliador_index'
);
Route
::
put
(
'/avaliar'
,
[
AvaliadorController
::
class
,
'avaliar'
])
->
name
(
'avaliador_avaliar'
);
Route
::
get
(
'/create'
,
[
AvaliadorController
::
class
,
'create'
])
->
name
(
'avaliador_create'
);
Route
::
post
(
'/store'
,
[
AvaliadorController
::
class
,
'store'
])
->
name
(
'avaliador_store'
);
Route
::
get
(
'/edit/{id}'
,
[
AvaliadorController
::
class
,
'edit'
])
->
name
(
'avaliador_edit'
);
Route
::
post
(
'/update/{id}'
,
[
AvaliadorController
::
class
,
'update'
])
->
name
(
'avaliador_update'
);
Route
::
delete
(
'/delete/{id}'
,
[
AvaliadorController
::
class
,
'destroy'
])
->
name
(
'avaliador_delete'
);
Route
::
get
(
'/relatorio'
,
[
AvaliadorController
::
class
,
'relatorio'
])
->
name
(
'avaliador_relatorio'
);
Route
::
get
(
'/relatorio/{id}'
,
[
PadController
::
class
,
'relatorio'
])
->
name
(
'pad_relatório'
);
Route
::
get
(
'/relatorio/{id}/pdf'
,
[
PadController
::
class
,
'generatePDF'
])
->
name
(
'pad_relatório_pdf'
);
});
Route
::
prefix
(
'/user'
)
->
group
(
function
()
{
Route
::
prefix
(
'/user'
)
->
group
(
function
()
{
Route
::
get
(
'/edit/perfil/{tab?}'
,
[
UserController
::
class
,
'editPerfil'
])
->
name
(
'edit_perfil'
);
Route
::
get
(
'/edit/perfil/{tab?}'
,
[
UserController
::
class
,
'editPerfil'
])
->
name
(
'edit_perfil'
);
Route
::
post
(
'/update/perfil'
,
[
UserController
::
class
,
'updatePerfil'
])
->
name
(
'update_perfil'
);
Route
::
post
(
'/update/perfil'
,
[
UserController
::
class
,
'updatePerfil'
])
->
name
(
'update_perfil'
);
...
...
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