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

@@ -63,6 +63,12 @@
"modified": false "modified": false
}, },
"controls": { "controls": {
"class.BackendSites.php": {
"type": "-",
"size": 2508,
"lmtime": 1746373999381,
"modified": false
},
"class.Crm.php": { "class.Crm.php": {
"type": "-", "type": "-",
"size": 1824, "size": 1824,
@@ -101,8 +107,8 @@
}, },
"class.Users.php": { "class.Users.php": {
"type": "-", "type": "-",
"size": 3591, "size": 3681,
"lmtime": 0, "lmtime": 1746370508373,
"modified": false "modified": false
}, },
"class.Wiki.php": { "class.Wiki.php": {
@@ -113,6 +119,12 @@
} }
}, },
"factory": { "factory": {
"class.BackendSites.php": {
"type": "-",
"size": 2566,
"lmtime": 1746374004947,
"modified": false
},
"class.Crm.php": { "class.Crm.php": {
"type": "-", "type": "-",
"size": 1863, "size": 1863,
@@ -191,20 +203,20 @@
"layout": { "layout": {
"style.css": { "style.css": {
"type": "-", "type": "-",
"size": 22469, "size": 22689,
"lmtime": 1744580016978, "lmtime": 1746373939657,
"modified": false "modified": false
}, },
"style.css.map": { "style.css.map": {
"type": "-", "type": "-",
"size": 39280, "size": 39717,
"lmtime": 1744580016978, "lmtime": 1746373939656,
"modified": false "modified": false
}, },
"style.scss": { "style.scss": {
"type": "-", "type": "-",
"size": 27332, "size": 27607,
"lmtime": 1744580016556, "lmtime": 1746373939490,
"modified": false "modified": false
} }
}, },
@@ -349,6 +361,46 @@
"lmtime": 0, "lmtime": 0,
"modified": false "modified": false
} }
},
"grid": {
"templates": {
"container.php": {
"type": "-",
"size": 16603,
"lmtime": 1746371511458,
"modified": false
},
"edit.php": {
"type": "-",
"size": 6041,
"lmtime": 0,
"modified": false
},
"edit-simple.php": {
"type": "-",
"size": 10753,
"lmtime": 0,
"modified": false
},
"print.php": {
"type": "-",
"size": 5140,
"lmtime": 0,
"modified": false
},
"results.php": {
"type": "-",
"size": 20382,
"lmtime": 0,
"modified": false
},
"upload.php": {
"type": "-",
"size": 6498,
"lmtime": 0,
"modified": false
}
}
} }
}, },
"robots.txt": { "robots.txt": {
@@ -359,6 +411,32 @@
}, },
"temp": {}, "temp": {},
"templates": { "templates": {
"backpro": {},
"crm": {},
"cron": {},
"finances": {},
"html": {},
"projects": {},
"site": {
"layout-cron.php": {
"type": "-",
"size": 5804,
"lmtime": 0,
"modified": false
},
"layout-logged.php": {
"type": "-",
"size": 6017,
"lmtime": 1746372845193,
"modified": false
},
"layout-unlogged.php": {
"type": "-",
"size": 986,
"lmtime": 0,
"modified": false
}
},
"tasks": { "tasks": {
"filtr_save_form.php": { "filtr_save_form.php": {
"type": "-", "type": "-",
@@ -403,23 +481,31 @@
"modified": false "modified": false
} }
}, },
"site": { "users": {},
"layout-cron.php": { "wiki": {},
"backend_sites": {
"collective_topic_edit.php": {
"type": "-", "type": "-",
"size": 5804, "size": 1859,
"lmtime": 0, "lmtime": 1746372498433,
"modified": false "modified": false
}, },
"layout-logged.php": { "collective_topics.php": {
"type": "-", "type": "-",
"size": 5556, "size": 1801,
"lmtime": 1744321038374, "lmtime": 1746373172486,
"modified": false "modified": false
}, },
"layout-unlogged.php": { "topic_edit.php": {
"type": "-", "type": "-",
"size": 986, "size": 2079,
"lmtime": 0, "lmtime": 1746373620277,
"modified": false
},
"topics.php": {
"type": "-",
"size": 2493,
"lmtime": 1746376040917,
"modified": false "modified": false
} }
} }

View File

@@ -22,6 +22,7 @@
<script type="text/javascript" src="/libraries/jquery-confirm/jquery-confirm.min.js"></script> <script type="text/javascript" src="/libraries/jquery-confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/libraries/select2/js/select2.full.min.js"></script> <script type="text/javascript" src="/libraries/select2/js/select2.full.min.js"></script>
<script type="text/javascript" src="/libraries/Simple-Gant-master/frappe-gantt.js"></script> <script type="text/javascript" src="/libraries/Simple-Gant-master/frappe-gantt.js"></script>
<script type="text/javascript" src="/libraries/icheck-1.0.2/icheck.min.js"></script>
<script type="text/javascript" src="/libraries/functions.js"></script> <script type="text/javascript" src="/libraries/functions.js"></script>
<link rel="Stylesheet" type="text/css" href="/libraries/framework/skin/default_skin/css/theme.css"> <link rel="Stylesheet" type="text/css" href="/libraries/framework/skin/default_skin/css/theme.css">
<link rel="stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css"> <link rel="stylesheet" type="text/css" href="/libraries/framework/vendor/plugins/datepicker/css/bootstrap-datetimepicker.css">
@@ -31,6 +32,7 @@
<link rel="stylesheet" type="text/css" href="/libraries/select2/css/select2-bootstrap-5-theme.min.css"> <link rel="stylesheet" type="text/css" href="/libraries/select2/css/select2-bootstrap-5-theme.min.css">
<link rel="stylesheet" type="text/css" href="/libraries/font-awesome-4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="/libraries/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/libraries/Simple-Gant-master/frappe-gantt.css"> <link rel="stylesheet" type="text/css" href="/libraries/Simple-Gant-master/frappe-gantt.css">
<link rel="stylesheet" type="text/css" href="/libraries/icheck-1.0.2/skins/all.css">
<link rel="stylesheet" type="text/css" href="/layout/style.css"> <link rel="stylesheet" type="text/css" href="/layout/style.css">
</head> </head>
<body class="logged"> <body class="logged">

View File

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