feat: Add iCheck library for enhanced checkbox styling and update date handling in task edit form

This commit is contained in:
2025-05-07 23:09:55 +02:00
parent 9dfa15b115
commit b8e12f5f3b
3 changed files with 147 additions and 45 deletions

View File

@@ -26,32 +26,41 @@ ob_start();
]
);
?>
<?=
\Html::input(
[
'label' => 'Data rozpoczęcia',
'name' => 'date_start',
'id' => 'date_start',
'value' => $this -> task[ 'date_start' ],
'class' => 'datetime',
'inline' => true,
'autocomplete' => 'off'
]
);
?>
<?=
\Html::input(
[
'label' => 'Data zakończenia',
'name' => 'date_end',
'id' => 'date_end',
'value' => $this -> task[ 'date_end' ],
'class' => 'datetime',
'inline' => true,
'autocomplete' => 'off'
]
);
<?
if ( $this -> task['date_start'] )
$date_start = date( 'Y-m-d', strtotime( $this -> task['date_start'] ) );
else
{
if ( !$this -> task['id'] )
$date_start = date( 'Y-m-d' );
}
if ( $this -> task['date_end'] )
$date_end = date( 'Y-m-d', strtotime( $this -> task['date_end'] ) );
else
{
if ( !$this -> task['id'] )
$date_end = date( 'Y-m-d' );
}
?>
<?= \Html::input([
'label' => 'Data rozpoczęcia',
'name' => 'date_start',
'id' => 'date_start',
'value' => $date_start,
'class' => 'datetime',
'inline' => true,
'autocomplete' => 'off'
]);?>
<?= \Html::input([
'label' => 'Data zakończenia',
'name' => 'date_end',
'id' => 'date_end',
'value' => $date_end,
'class' => 'datetime',
'inline' => true,
'autocomplete' => 'off'
]);?>
<?
$projects[ 0 ] = '--- wybierz projekt ---';
if ( is_array( $this -> projects ) )
@@ -141,7 +150,7 @@ if ( is_array( $this -> priorities ) )
'label' => 'Powiadom o zmianie statusu',
'name' => 'status_change_mail',
'id' => 'status_change_mail',
'checked' => $this -> task[ 'status_change_mail' ] ? true : false,
'checked' => ( $this -> task[ 'status_change_mail' ] or !$this -> taks['id'] ) ? true : false,
'type' => 'checkbox'
] );
?>
@@ -200,7 +209,7 @@ if ( is_array( $this -> priorities ) )
'label' => 'Pokaż w kalendarzu',
'name' => 'show_in_calendar',
'id' => 'show_in_calendar',
'checked' => $this -> task[ 'show_in_calendar' ] ? true : false,
'checked' => ( $this -> task[ 'show_in_calendar' ] or !$this -> taks['id'] ) ? true : false,
'type' => 'checkbox'
] );
?>
@@ -246,6 +255,11 @@ echo $grid -> draw();
<script type="text/javascript">
$(document).ready(function ()
{
$('input[type="checkbox"]').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
});
$( 'body' ).on( 'click', '.task-remove', function(e)
{
e.preventDefault();