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
a7031949
Commit
a7031949
authored
May 07, 2024
by
alissonalbuquerque
Browse files
feat(calendar): add tratamento de erro no calendário de horarios
parent
7bf03170
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Models/TaskTime.php
View file @
a7031949
...
@@ -129,7 +129,7 @@ class TaskTime extends Model
...
@@ -129,7 +129,7 @@ class TaskTime extends Model
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'
);
}
}
...
@@ -165,10 +165,10 @@ class TaskTime extends Model
...
@@ -165,10 +165,10 @@ class TaskTime extends Model
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'
);
}
}
...
@@ -184,10 +184,10 @@ class TaskTime extends Model
...
@@ -184,10 +184,10 @@ class TaskTime extends Model
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'
);
}
}
...
@@ -199,10 +199,10 @@ class TaskTime extends Model
...
@@ -199,10 +199,10 @@ class TaskTime extends Model
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'
);
}
}
...
@@ -234,7 +234,7 @@ class TaskTime extends Model
...
@@ -234,7 +234,7 @@ class TaskTime extends Model
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'
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
}
}
public
function
userPad
()
{
public
function
userPad
()
{
...
@@ -253,7 +253,7 @@ class TaskTime extends Model
...
@@ -253,7 +253,7 @@ class TaskTime extends Model
*/
*/
public
function
getName
()
{
public
function
getName
()
{
// Return Ensino Models
// Return Ensino Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
return
$this
->
tarefa
->
componente_curricular
;
return
$this
->
tarefa
->
componente_curricular
;
}
}
...
@@ -289,10 +289,10 @@ class TaskTime extends Model
...
@@ -289,10 +289,10 @@ class TaskTime extends Model
if
(
$this
->
type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
if
(
$this
->
type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
return
$this
->
tarefa
->
atividade
;
return
$this
->
tarefa
->
atividade
;
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Pesquisa Models
// Return Pesquisa Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
return
$this
->
tarefa
->
titulo_projeto
;
}
}
...
@@ -308,10 +308,10 @@ class TaskTime extends Model
...
@@ -308,10 +308,10 @@ class TaskTime extends Model
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
return
$this
->
tarefa
->
atividade
;
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Extensao Models
// Return Extensao Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
return
$this
->
tarefa
->
titulo_projeto
;
return
$this
->
tarefa
->
titulo_projeto
;
}
}
...
@@ -323,10 +323,10 @@ class TaskTime extends Model
...
@@ -323,10 +323,10 @@ class TaskTime extends Model
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
if
(
$this
->
type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
return
$this
->
tarefa
->
atividade
;
return
$this
->
tarefa
->
atividade
;
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// 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
->
tarefa
->
nome
;
return
$this
->
tarefa
->
nome
;
}
}
...
@@ -358,7 +358,7 @@ class TaskTime extends Model
...
@@ -358,7 +358,7 @@ class TaskTime extends Model
if
(
$this
->
type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
if
(
$this
->
type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
return
$this
->
tarefa
->
nome
;
return
$this
->
tarefa
->
nome
;
}
}
// - - - - - - - - - -
// - - - - - - - - - -
}
}
/**
/**
...
@@ -374,7 +374,7 @@ class TaskTime extends Model
...
@@ -374,7 +374,7 @@ class TaskTime extends Model
public
function
intervalTime
(
$format
=
'H:i:s'
)
{
public
function
intervalTime
(
$format
=
'H:i:s'
)
{
$startTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
start_time
);
$startTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
start_time
);
$endTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
end_time
);
$endTime
=
DateTime
::
createFromFormat
(
'H:i:s'
,
$this
->
end_time
);
$interval
=
$startTime
->
diff
(
$endTime
);
$interval
=
$startTime
->
diff
(
$endTime
);
...
@@ -427,7 +427,7 @@ class TaskTime extends Model
...
@@ -427,7 +427,7 @@ class TaskTime extends Model
public
static
function
listTaskTypes
(
$value
=
null
)
{
public
static
function
listTaskTypes
(
$value
=
null
)
{
$values
=
[
$values
=
[
self
::
TYPE_ENSINO_AULA
=>
''
,
self
::
TYPE_ENSINO_AULA
=>
''
,
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
=>
''
,
self
::
TYPE_ENSINO_COORDENACAO_REGENCIA
=>
''
,
self
::
TYPE_ENSINO_ORIENTACAO
=>
''
,
self
::
TYPE_ENSINO_ORIENTACAO
=>
''
,
...
@@ -460,8 +460,8 @@ class TaskTime extends Model
...
@@ -460,8 +460,8 @@ class TaskTime extends Model
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
return
$value
!=
null
?
$values
[
$value
]
:
$values
;
}
}
/**
/**
* @param $floatValue
* @param $floatValue
* @return string|time
* @return string|time
*/
*/
public
static
function
float_to_date_interval
(
$float_value
)
public
static
function
float_to_date_interval
(
$float_value
)
...
@@ -475,15 +475,15 @@ class TaskTime extends Model
...
@@ -475,15 +475,15 @@ class TaskTime extends Model
// Calcula os segundos
// Calcula os segundos
$segundos
=
round
((
$minutos_decimal
-
$minutos
)
*
60
);
$segundos
=
round
((
$minutos_decimal
-
$minutos
)
*
60
);
/** @var DateInterval */
/** @var DateInterval */
$date_interval
=
new
DateInterval
(
"PT
{
$horas
}
H
{
$minutos
}
M
{
$segundos
}
S"
);
$date_interval
=
new
DateInterval
(
"PT
{
$horas
}
H
{
$minutos
}
M
{
$segundos
}
S"
);
return
$date_interval
;
return
$date_interval
;
}
}
/**
/**
* @param $floatValue
* @param $floatValue
* @return string|time
* @return string|time
*/
*/
public
static
function
convertFloatToHour
(
$float_value
)
public
static
function
convertFloatToHour
(
$float_value
)
...
@@ -497,7 +497,7 @@ class TaskTime extends Model
...
@@ -497,7 +497,7 @@ class TaskTime extends Model
// Calcula os segundos
// Calcula os segundos
$segundos
=
round
((
$minutos_decimal
-
$minutos
)
*
60
);
$segundos
=
round
((
$minutos_decimal
-
$minutos
)
*
60
);
/** @var DateInterval */
/** @var DateInterval */
$date_interval
=
new
DateInterval
(
"PT
{
$horas
}
H
{
$minutos
}
M
{
$segundos
}
S"
);
$date_interval
=
new
DateInterval
(
"PT
{
$horas
}
H
{
$minutos
}
M
{
$segundos
}
S"
);
...
@@ -532,7 +532,7 @@ class TaskTime extends Model
...
@@ -532,7 +532,7 @@ class TaskTime extends Model
return
$hour
;
return
$hour
;
}
}
/**
/**
* @param $taskTimes
* @param $taskTimes
* @return DateTime
* @return DateTime
*/
*/
...
@@ -543,7 +543,7 @@ class TaskTime extends Model
...
@@ -543,7 +543,7 @@ class TaskTime extends Model
foreach
(
$taskTimes
as
$taskTime
)
{
foreach
(
$taskTimes
as
$taskTime
)
{
$split_time
=
explode
(
":"
,
$taskTime
->
intervalTime
());
$split_time
=
explode
(
":"
,
$taskTime
->
intervalTime
());
$hours
=
$split_time
[
0
];
$hours
=
$split_time
[
0
];
$minutes
=
$split_time
[
1
];
$minutes
=
$split_time
[
1
];
$seconds
=
$split_time
[
2
];
$seconds
=
$split_time
[
2
];
...
@@ -554,7 +554,7 @@ class TaskTime extends Model
...
@@ -554,7 +554,7 @@ class TaskTime extends Model
return
$sumDateTime
;
return
$sumDateTime
;
}
}
/**
/**
* @param $taskTimes
* @param $taskTimes
* @return DateTime
* @return DateTime
*/
*/
...
@@ -584,10 +584,10 @@ class TaskTime extends Model
...
@@ -584,10 +584,10 @@ class TaskTime extends Model
public
static
function
date_interval_to_minutes
(
DateInterval
$date_interval
)
{
public
static
function
date_interval_to_minutes
(
DateInterval
$date_interval
)
{
[
$days_to_minutes
,
$hours_to_minutes
,
$minutes
]
=
[(
$date_interval
->
d
*
24
*
60
),
(
$date_interval
->
h
*
60
),
(
$date_interval
->
i
*
1
)];
[
$days_to_minutes
,
$hours_to_minutes
,
$minutes
]
=
[(
$date_interval
->
d
*
24
*
60
),
(
$date_interval
->
h
*
60
),
(
$date_interval
->
i
*
1
)];
return
$days_to_minutes
+
$hours_to_minutes
+
$minutes
;
return
$days_to_minutes
+
$hours_to_minutes
+
$minutes
;
}
}
/**
/**
* @param DateTime $dateTimeX
* @param DateTime $dateTimeX
* @param DateTime $dateTimeY
* @param DateTime $dateTimeY
* @return DateTime
* @return DateTime
...
@@ -600,13 +600,13 @@ class TaskTime extends Model
...
@@ -600,13 +600,13 @@ class TaskTime extends Model
$newDateTime
=
new
DateTime
(
$time_x
);
$newDateTime
=
new
DateTime
(
$time_x
);
$split_time
=
explode
(
":"
,
$time_y
);
$split_time
=
explode
(
":"
,
$time_y
);
$hours
=
$split_time
[
0
];
$hours
=
$split_time
[
0
];
$minutes
=
$split_time
[
1
];
$minutes
=
$split_time
[
1
];
$seconds
=
$split_time
[
2
];
$seconds
=
$split_time
[
2
];
$newDateTime
->
modify
(
"+
{
$hours
}
hours +
{
$minutes
}
minutes +
{
$seconds
}
seconds"
);
$newDateTime
->
modify
(
"+
{
$hours
}
hours +
{
$minutes
}
minutes +
{
$seconds
}
seconds"
);
return
$newDateTime
;
return
$newDateTime
;
}
}
...
@@ -614,7 +614,7 @@ class TaskTime extends Model
...
@@ -614,7 +614,7 @@ class TaskTime extends Model
public
static
function
tarefaByStatic
(
$type
,
$tarefa_id
)
public
static
function
tarefaByStatic
(
$type
,
$tarefa_id
)
{
{
// Return Ensino Models
// Return Ensino Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
if
(
$type
==
self
::
TYPE_ENSINO_ATENDIMENTO_DISCENTE
)
{
return
EnsinoAtendimentoDiscente
::
find
(
$tarefa_id
);
return
EnsinoAtendimentoDiscente
::
find
(
$tarefa_id
);
}
}
...
@@ -650,10 +650,10 @@ class TaskTime extends Model
...
@@ -650,10 +650,10 @@ class TaskTime extends Model
if
(
$type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
if
(
$type
==
self
::
TYPE_ENSINO_SUPERVISAO
)
{
return
EnsinoSupervisao
::
find
(
$tarefa_id
);
return
EnsinoSupervisao
::
find
(
$tarefa_id
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Pesquisa Models
// Return Pesquisa Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
if
(
$type
==
self
::
TYPE_PESQUISA_COORDENACAO
)
{
return
PesquisaCoordenacao
::
find
(
$tarefa_id
);
return
PesquisaCoordenacao
::
find
(
$tarefa_id
);
}
}
...
@@ -669,10 +669,10 @@ class TaskTime extends Model
...
@@ -669,10 +669,10 @@ class TaskTime extends Model
if
(
$type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
if
(
$type
==
self
::
TYPE_PESQUISA_OUTROS
)
{
return
PesquisaOutros
::
find
(
$tarefa_id
);
return
PesquisaOutros
::
find
(
$tarefa_id
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Extensao Models
// Return Extensao Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
if
(
$type
==
self
::
TYPE_EXTENSAO_COORDENACAO
)
{
return
ExtensaoCoordenacao
::
find
(
$tarefa_id
);
return
ExtensaoCoordenacao
::
find
(
$tarefa_id
);
}
}
...
@@ -684,10 +684,10 @@ class TaskTime extends Model
...
@@ -684,10 +684,10 @@ class TaskTime extends Model
if
(
$type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
if
(
$type
==
self
::
TYPE_EXTENSAO_OUTROS
)
{
return
ExtensaoOutros
::
find
(
$tarefa_id
);
return
ExtensaoOutros
::
find
(
$tarefa_id
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
// Return Gestao Models
// Return Gestao Models
// - - - - - - - - - -
// - - - - - - - - - -
if
(
$type
==
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
if
(
$type
==
self
::
TYPE_GESTAO_COORDENACAO_LABORATORIOS_DIDATICOS
)
{
return
GestaoCoordenacaoLaboratoriosDidaticos
::
find
(
$tarefa_id
);
return
GestaoCoordenacaoLaboratoriosDidaticos
::
find
(
$tarefa_id
);
}
}
...
@@ -719,6 +719,6 @@ class TaskTime extends Model
...
@@ -719,6 +719,6 @@ class TaskTime extends Model
if
(
$type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
if
(
$type
==
self
::
TYPE_GESTAO_REPRESENTANTE_UNIDADE_EDUCACAO
)
{
return
GestaoRepresentanteUnidadeEducacao
::
find
(
$tarefa_id
);
return
GestaoRepresentanteUnidadeEducacao
::
find
(
$tarefa_id
);
}
}
// - - - - - - - - - -
// - - - - - - - - - -
}
}
}
}
resources/views/task-time/create.blade.php
View file @
a7031949
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
@
csrf
@
csrf
@
method
(
'POST'
)
@
method
(
'POST'
)
<
div
class
=
"row"
>
<
input
type
=
"hidden"
id
=
"user_pad_id"
name
=
"user_pad_id"
value
=
"{{
$user_pad_id
}}"
>
<
input
type
=
"hidden"
id
=
"user_pad_id"
name
=
"user_pad_id"
value
=
"{{
$user_pad_id
}}"
>
...
@@ -16,77 +15,90 @@
...
@@ -16,77 +15,90 @@
<
input
type
=
"hidden"
id
=
"id"
name
=
"id"
value
=
""
>
<
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'
,
[
<
div
class
=
"row"
>
'field'
=>
'cod_atividade_create'
])
</
div
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"mb-4 col-sm-2"
>
<
div
class
=
"mt-3"
>
<
div
class
=
""
>
<
label
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<
label
class
=
"form-label"
for
=
"cod_atividade"
>
Cód
.
Atividade
</
label
>
<
select
name
=
"weekday"
id
=
"weekday"
class
=
"form-select @error('weekday') is-invalid @enderror ajax-errors"
>
<
input
class
=
"form-control @error('cod_atividade') is-invalid @enderror ajax-errors"
type
=
"text"
name
=
"cod_atividade"
id
=
"cod_atividade"
readonly
>
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
</
div
>
<
option
value
=
"
{
{$id}}">{{$text}
}
</option>
@endforeach
</select>
@
include
(
'components.divs.errors'
,
[
@
include
(
'components.divs.errors'
,
[
'field' => '
weekday
_create'
'field'
=>
'
cod_atividade
_create'
])
])
</
div
>
</
div
>
</div>
<div class="
col
-
sm
-
12
">
<
div
class
=
"col-sm-10"
>
<div class="">
<
div
class
=
""
>
<label for="
slct_tarefa_id
">Atividade</label>
<
label
class
=
"mb-2"
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<select name="
slct_tarefa_id
" id="
slct_tarefa_id
" class="
form
-
select
@
error
(
'slct_tarefa_id'
)
is
-
invalid
@
enderror
ajax
-
errors
">
</select>
<
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>
@include('components.divs.errors', [
'field' => 'slct_tarefa_id_create'
])
</div>
</div>
<div class="
col
-
sm
-
6
">
<div class="
row
">
<div class="
mt
-
3
">
<div class="
col
-
md
-
12
">
<label class="
form
-
label
" for="
start_time
">Horário Inicial</label>
<div class="">
<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
" >
<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', [
@include('components.divs.errors', [
'field' => 's
tart_time
_create'
,
'field' => 's
lct_tarefa_id
_create'
])
])
</div>
</div>
</div>
</div>
<div class="
col
-
sm
-
6
">
<div class="
row
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
end_time
">Horário Final</label>
<div class="
col
-
sm
-
6
">
<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
" >
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
start_time
">Horário Inicial</label>
@include('components.divs.errors', [
<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
" >
'field' => 'end_time_create',
])
@include('components.divs.errors', [
'field' => 'start_time_create',
])
</div>
</div>
</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
">
<div class="
mt
-
1
text
-
end
">
@include('components.divs.errors', [
<div class="
modal
-
footer
">
'field' => 'end_time_create',
@include('components.buttons.btn-save', [
])
'id' => 'btn_submit',
</div>
'content' => 'Cadastrar',
</div>
])
@include('components.buttons.btn-close_modal')
</div>
</div>
<div class="
mt
-
1
text
-
end
">
<div class="
modal
-
footer
">
@include('components.buttons.btn-save', [
'id' => 'btn_submit',
'content' => 'Cadastrar',
])
@include('components.buttons.btn-close_modal')
</div>
</div>
</div>
</div>
</form>
</form>
...
@@ -100,12 +112,12 @@
...
@@ -100,12 +112,12 @@
<script type="
text
/
javascript
">
<script type="
text
/
javascript
">
$('#weekday').select2(
//
$('#weekday').select2(
{
// {
allowClear: true,
//
allowClear: true,
placeholder: 'Dia da Semana',
//
placeholder: 'Dia da Semana',
dropdownParent: $('#modal')
//
dropdownParent: $('#modal')
})
//
})
$('#slct_tarefa_id').select2(
$('#slct_tarefa_id').select2(
{
{
...
@@ -164,7 +176,7 @@
...
@@ -164,7 +176,7 @@
error: (xhr, status, error) => {
error: (xhr, status, error) => {
console.error('Erro na requisição!');
console.error('Erro na requisição!');
}
}
});
});
}
}
})
})
...
...
resources/views/task-time/index.blade.php
View file @
a7031949
...
@@ -38,7 +38,12 @@
...
@@ -38,7 +38,12 @@
$weekColumn
=
TaskTime
::
whereUserPadId
(
$user_pad_id
)
->
whereWeekday
(
$weekday
)
->
orderBy
(
'start_time'
,
'ASC'
)
->
get
();
$weekColumn
=
TaskTime
::
whereUserPadId
(
$user_pad_id
)
->
whereWeekday
(
$weekday
)
->
orderBy
(
'start_time'
,
'ASC'
)
->
get
();
$weekColumns
[
$weekday
]
=
$weekColumn
->
isNotEmpty
()
?
$weekColumn
:
collect
([
'--'
]);
$weekColumn
=
$weekColumn
->
filter
(
function
(
TaskTIme
$model
)
{
return
$model
->
tarefa
!==
null
;
});
$weekColumns
[
$weekday
]
=
$weekColumn
->
isNotEmpty
()
?
$weekColumn
:
collect
([
'--'
]);
if
(
count
(
$weekColumns
[
$weekday
])
>
$max_len_column
)
{
if
(
count
(
$weekColumns
[
$weekday
])
>
$max_len_column
)
{
$max_len_column
=
count
(
$weekColumns
[
$weekday
]);
$max_len_column
=
count
(
$weekColumns
[
$weekday
]);
...
...
resources/views/task-time/update.blade.php
View file @
a7031949
...
@@ -15,15 +15,15 @@
...
@@ -15,15 +15,15 @@
@
csrf
@
csrf
@
method
(
'POST'
)
@
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
=
"
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
=
"t
arefa_id
"
name
=
"t
arefa_id
"
value
=
"{{
$model->t
arefa_id
}}"
>
<
input
type
=
"hidden"
id
=
"t
ype
"
name
=
"t
ype
"
value
=
"{{
$model->t
ype
}}"
>
´
<
input
type
=
"hidden"
id
=
"
type
"
name
=
"
type
"
value
=
"{{
$model->
type
}}"
>
´
<
input
type
=
"hidden"
id
=
"
id
"
name
=
"
id
"
value
=
"{{
$model->
id
}}"
>
<
input
type
=
"hidden"
id
=
"id"
name
=
"id"
value
=
"{{
$model->id
}}
"
>
<
div
class
=
"row
"
>
<
div
class
=
"mb-4 col-sm-2"
>
<
div
class
=
"mb-4 col-sm-2"
>
<
div
class
=
""
>
<
div
class
=
""
>
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
</
div
>
</
div
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"col-sm-10"
>
<
div
class
=
"
mt-3
"
>
<
div
class
=
""
>
<
label
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<
label
class
=
"mb-2"
for
=
"weekday"
>
Dia
da
Semana
</
label
>
<
select
name
=
"weekday"
id
=
"weekday"
class
=
"form-select @error('weekday') is-invalid @enderror ajax-errors"
>
<
select
name
=
"weekday"
id
=
"weekday"
class
=
"form-select @error('weekday') is-invalid @enderror ajax-errors"
>
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
@
foreach
(
TaskTime
::
listWeekDays
()
as
$id
=>
$text
)
@
if
(
$model
->
weekday
==
$id
)
@
if
(
$model
->
weekday
==
$id
)
...
@@ -55,6 +55,9 @@
...
@@ -55,6 +55,9 @@
</div>
</div>
</div>
</div>
</div>
<div class="
row
">
<div class="
col
-
sm
-
12
">
<div class="
col
-
sm
-
12
">
<div class="">
<div class="">
<label for="
slct_tarefa_id
">Atividade</label>
<label for="
slct_tarefa_id
">Atividade</label>
...
@@ -67,12 +70,15 @@
...
@@ -67,12 +70,15 @@
'field' => 'slct_tarefa_id'
'field' => 'slct_tarefa_id'
])
])
</div>
</div>
</div>
<div class="
row
">
<div class="
col
-
sm
-
6
">
<div class="
col
-
sm
-
6
">
<div class="
mt
-
3
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
start_time
">Horário Inicial</label>
<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
" >
<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', [
@include('components.divs.errors', [
'field' => 'start_time_update',
'field' => 'start_time_update',
])
])
...
@@ -83,14 +89,15 @@
...
@@ -83,14 +89,15 @@
<div class="
mt
-
3
">
<div class="
mt
-
3
">
<label class="
form
-
label
" for="
end_time
">Horário Final</label>
<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
" >
<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', [
@include('components.divs.errors', [
'field' => 'end_time_update',
'field' => 'end_time_update',
])
])
</div>
</div>
</div>
</div>
</div>
</div>
<div class="
mt
-
4
">
<div class="
mt
-
4
">
<div class="
modal
-
footer
">
<div class="
modal
-
footer
">
<div class="
text
-
start
">
<div class="
text
-
start
">
...
@@ -121,12 +128,12 @@
...
@@ -121,12 +128,12 @@
<script type="
text
/
javascript
">
<script type="
text
/
javascript
">
$('#weekday').select2(
//
$('#weekday').select2(
{
// {
allowClear: true,
//
allowClear: true,
placeholder: 'Dia da Semana',
//
placeholder: 'Dia da Semana',
dropdownParent: $('#modal')
//
dropdownParent: $('#modal')
})
//
})
$('#slct_tarefa_id').select2(
$('#slct_tarefa_id').select2(
{
{
...
@@ -151,7 +158,7 @@
...
@@ -151,7 +158,7 @@
})
})
$('#slct_tarefa_id').on('change', function(e)
$('#slct_tarefa_id').on('change', function(e)
{
{
const type = $('#type')
const type = $('#type')
const tarefa_id = $('#tarefa_id')
const tarefa_id = $('#tarefa_id')
...
@@ -185,7 +192,7 @@
...
@@ -185,7 +192,7 @@
error: (xhr, status, error) => {
error: (xhr, status, error) => {
console.error('Erro na requisição!');
console.error('Erro na requisição!');
}
}
});
});
}
}
})
})
...
...
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