Add Gantt users styling and adjust layout in main view

- Introduced a new flexbox layout for .gantt_users with a gap of 20px in style.scss.
- Moved the gantt-target div to the end of the projects_container for better layout consistency.
- Adjusted the margin-bottom of projects_container for improved spacing.
This commit is contained in:
2025-04-14 00:09:42 +02:00
parent 54e28a6762
commit bff7cb8983
7 changed files with 24 additions and 11 deletions

View File

@@ -139,8 +139,8 @@
},
"class.Tasks.php": {
"type": "-",
"size": 18435,
"lmtime": 1744498887425,
"size": 18467,
"lmtime": 1744570592304,
"modified": false
},
"class.Users.php": {

View File

@@ -96,7 +96,7 @@ class Tasks
'statuses' => \factory\Tasks::get_statuses(),
'open_task_id' => $open_task_id
] ),
'tasks_gantt' => \factory\Tasks::get_tasks_gantt(),
'tasks_gantt' => \factory\Tasks::get_tasks_gantt( $projects, $users ),
] );
exit;
}
@@ -171,7 +171,8 @@ class Tasks
'show_tasks_bulk' => $show_tasks_bulk,
'show_tasks_to_review' => $show_tasks_to_review,
'users' => \factory\Users::users_list(),
'tasks_gantt' => \factory\Tasks::get_tasks_gantt(),
'tasks_gantt' => \factory\Tasks::get_tasks_gantt( \S::get_session( 'selected_projects' ), \S::get_session( 'selected_users' ) ),
'selected_gantt_users' => \S::get_session( 'selected_gantt_users' )
] );
}

View File

@@ -20,13 +20,19 @@ class Tasks
] );
}
static public function get_tasks_gantt() {
static public function get_tasks_gantt( $projects = null, $users = null ) {
global $mdb;
$tasks = $mdb -> query( 'SELECT t.id, t.name, t.date_start, t.date_end, t.status, t.client_id FROM tasks AS t WHERE show_in_calendar = 1 AND status != 2 AND status != 3 AND status != 1 AND t.date_start <= DATE_ADD(NOW(), INTERVAL 1 MONTH) ORDER BY date_start ASC' ) -> fetchAll( \PDO::FETCH_ASSOC );
if ( $users ) {
$sql = ' AND id IN (SELECT task_id FROM task_user WHERE user_id IN (' . implode( ',', $users ) . ')) ';
} else {
$sql = '';
}
$tasks = $mdb -> query( 'SELECT t.id, t.name, t.date_start, t.date_end, t.status, t.client_id FROM tasks AS t WHERE show_in_calendar = 1 AND status != 2 AND status != 3 AND status != 1 AND t.date_start <= DATE_ADD(NOW(), INTERVAL 1 MONTH) ' . $sql . ' ORDER BY date_start ASC, o ASC' ) -> fetchAll( \PDO::FETCH_ASSOC );
foreach ( $tasks as $task ) {
$task_json = [];
$task_json['name'] = $task['client_id'] ? \factory\Crm::get_client_name( (int)$task['client_id'] ) : $task['name'];
$task_json['name'] = $task['client_id'] ? \factory\Crm::get_client_name( (int)$task['client_id'] ) . ' - ' . htmlspecialchars( $task['name'] ) : htmlspecialchars( $task['name'] );
// start
$task_json['start'] = $task['date_start'];
// end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1467,4 +1467,9 @@ body>.top {
display: block;
color: #000;
}
}
.gantt_users {
display: flex;
gap: 20px;
}

View File

@@ -3,8 +3,7 @@
<i class="fa fa-plus"></i>Dodaj zadanie
</a>
</div>
<div class="gantt-target" style="margin-bottom: 25px;"></div>
<div class="projects_container">
<div class="projects_container" style="margin-bottom: 25px;">
<div class="left">
<div class="_projects">
<? foreach ( $this -> projects as $project ):?>
@@ -42,6 +41,7 @@
</div>
</div>
</div>
<div class="gantt-target" style="margin-bottom: 25px;"></div>
<div class="tasks_container">
<div class="column tasks_new">
<h2>Nowe zadania</h2>
@@ -240,6 +240,7 @@
language: 'en'
});
console.log(gantt_chart);
<? endif;?>
function reload_tasks( projects, users )
{