Skip to content
Snippets Groups Projects
Commit 7b3b682f authored by Robert Goldmann's avatar Robert Goldmann
Browse files

fixed wrong display of subtasks on index

parent 162b2722
Branches
Tags
No related merge requests found
...@@ -460,7 +460,7 @@ function editSubtask(subtask_ID, task_ID) ...@@ -460,7 +460,7 @@ function editSubtask(subtask_ID, task_ID)
$.post('../admin/helper/edit-subtask.php', $.post('../admin/helper/edit-subtask.php',
{ {
"title": title, "title": title,
"de6scription": description, "description": description,
"done": done, "done": done,
"edit": edit, "edit": edit,
"ID": subtask_ID, "ID": subtask_ID,
......
...@@ -65,8 +65,7 @@ $db->createTables(); ...@@ -65,8 +65,7 @@ $db->createTables();
if($roadmaps == false) if($roadmaps == false)
{ {
header('Location: ../error.php?message=error_database_connection'); echo '<td colspan="2" class="center-align">No Roadmaps</td>';
exit;
} }
else else
{ {
......
...@@ -271,7 +271,7 @@ function printMilestoneIndevWithTasks($currentMilestone, $db, $tasks, $color, $l ...@@ -271,7 +271,7 @@ function printMilestoneIndevWithTasks($currentMilestone, $db, $tasks, $color, $l
else else
{ {
$numberOfOpenTasks = $numberOfOpenTasks['count']; $numberOfOpenTasks = $numberOfOpenTasks['count'];
$percentage = ($numberOfOpenTasks / sizeof($tasks))*100; $percentage = ((sizeof($tasks) - $numberOfOpenTasks) / sizeof($tasks))*100;
$percentage = round($percentage); $percentage = round($percentage);
echo '<div class="card padding white milestone">' . echo '<div class="card padding white milestone">' .
...@@ -342,17 +342,17 @@ function printSubTasksDone($currentTask, $subtasks, $db) ...@@ -342,17 +342,17 @@ function printSubTasksDone($currentTask, $subtasks, $db)
else else
{ {
$numberOfOpenSubtasks = $numberOfOpenSubtasks['count']; $numberOfOpenSubtasks = $numberOfOpenSubtasks['count'];
if($numberOfOpenSubtasks == sizeof($subtasks)) if($numberOfOpenSubtasks == 0)
{ {
echo '<li>' . echo '<li>' .
'<div class="collapsible-header bold"><i class="material-icons green-text">check</i>Layout<span class="right">' . $numberOfOpenSubtasks . '/' . sizeof($subtasks) . '</span></div>' . '<div class="collapsible-header bold"><i class="material-icons green-text">check</i>'.$currentTask['Title'].'<span class="right">' . (sizeof($subtasks) - $numberOfOpenSubtasks) . '/' . sizeof($subtasks) . '</span></div>' .
'<div class="collapsible-body">' . '<div class="collapsible-body">' .
'<ul class="collapsible white margin-left-and-right no-shadow margin-top-and-bottom" data-collapsible="accordion">'; '<ul class="collapsible white margin-left-and-right no-shadow margin-top-and-bottom" data-collapsible="accordion">';
} }
else else
{ {
echo '<li>' . echo '<li>' .
'<div class="collapsible-header bold"><i class="material-icons red-text">build</i>Layout<span class="right">' . $numberOfOpenSubtasks . '/' . sizeof($subtasks) . '</span></div>' . '<div class="collapsible-header bold"><i class="material-icons red-text">build</i>'.$currentTask['Title'].'<span class="right">' . (sizeof($subtasks) - $numberOfOpenSubtasks) . '/' . sizeof($subtasks) . '</span></div>' .
'<div class="collapsible-body">' . '<div class="collapsible-body">' .
'<ul class="collapsible white margin-left-and-right no-shadow margin-top-and-bottom" data-collapsible="accordion">'; '<ul class="collapsible white margin-left-and-right no-shadow margin-top-and-bottom" data-collapsible="accordion">';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment