Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Roadmap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
Roadmap
Commits
50dbc5cc
Commit
50dbc5cc
authored
8 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed
#19
parent
e42599ae
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
js/main.js
+28
-2
28 additions, 2 deletions
js/main.js
php/admin/admin-tasks.php
+2
-0
2 additions, 0 deletions
php/admin/admin-tasks.php
php/admin/helper/mark-all-tasks-as-done.php
+30
-0
30 additions, 0 deletions
php/admin/helper/mark-all-tasks-as-done.php
php/mysql.php
+23
-0
23 additions, 0 deletions
php/mysql.php
with
83 additions
and
2 deletions
js/main.js
+
28
−
2
View file @
50dbc5cc
...
@@ -126,6 +126,11 @@ $(document).ready(function()
...
@@ -126,6 +126,11 @@ $(document).ready(function()
}
}
});
});
$
(
'
#button-mark-all-as-done
'
).
click
(
function
()
{
markAllTasksAsDone
(
this
.
dataset
.
milestoneid
);
});
createTrainMap
();
createTrainMap
();
});
});
...
@@ -522,7 +527,7 @@ function login()
...
@@ -522,7 +527,7 @@ function login()
$
.
post
(
'
../admin/helper/checkLogin.php
'
,
$
.
post
(
'
../admin/helper/checkLogin.php
'
,
{
{
"
password
"
:
password
,
"
password
"
:
password
},
function
(
data
,
error
)
},
function
(
data
,
error
)
{
{
...
@@ -538,3 +543,24 @@ function login()
...
@@ -538,3 +543,24 @@ function login()
}
}
});
});
}
}
function
markAllTasksAsDone
(
milestone_ID
)
{
$
.
post
(
'
../admin/helper/mark-all-tasks-as-done.php
'
,
{
"
milestoneID
"
:
milestone_ID
},
function
(
data
,
error
)
{
data
=
data
.
toString
().
trim
();
if
(
data
!=
"
error
"
&&
data
!=
"
bad_login
"
)
{
window
.
location
.
href
=
"
../admin/admin-tasks.php?id=
"
+
milestone_ID
;
}
else
{
alert
(
'
An error occurred while marking all tasks as done
'
);
}
});
}
This diff is collapsed.
Click to expand it.
php/admin/admin-tasks.php
+
2
−
0
View file @
50dbc5cc
...
@@ -70,6 +70,8 @@ if($milestone == false)
...
@@ -70,6 +70,8 @@ if($milestone == false)
<div
class=
"col s12 m8 offset-m2 l6 offset-l3 center-align"
>
<div
class=
"col s12 m8 offset-m2 l6 offset-l3 center-align"
>
<a
class=
"waves-effect waves-light btn blue darken-3"
href=
"admin-edit-task.php?milestoneID=
<?php
echo
$ID
;
?>
"
><i
<a
class=
"waves-effect waves-light btn blue darken-3"
href=
"admin-edit-task.php?milestoneID=
<?php
echo
$ID
;
?>
"
><i
class=
"material-icons left"
>
add
</i>
New
</a>
class=
"material-icons left"
>
add
</i>
New
</a>
<a
class=
"waves-effect waves-light btn blue darken-3"
id=
"button-mark-all-as-done"
data-milestoneid=
"
<?php
echo
$ID
;
?>
"
><i
class=
"material-icons left"
>
check
</i>
Mark all as done
</a>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
...
...
This diff is collapsed.
Click to expand it.
php/admin/helper/mark-all-tasks-as-done.php
0 → 100644
+
30
−
0
View file @
50dbc5cc
<?php
include_once
(
'../../mysql.php'
);
if
(
$_SERVER
[
'REQUEST_METHOD'
]
==
'POST'
)
{
if
(
!
isset
(
$_POST
[
'milestoneID'
]))
{
echo
"error"
;
exit
;
}
$db
=
new
DB
();
$db
->
createTables
();
if
(
$db
->
markAllTasksAsDone
(
$_POST
[
'milestoneID'
])
==
false
)
{
echo
"error"
;
exit
;
}
else
{
echo
"success"
;
exit
;
}
}
else
{
echo
"error"
;
exit
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
php/mysql.php
+
23
−
0
View file @
50dbc5cc
...
@@ -226,6 +226,29 @@ class DB
...
@@ -226,6 +226,29 @@ class DB
}
}
}
}
function
markAllTasksAsDone
(
$milestoneID
)
{
$tasks
=
$this
->
getTasks
(
$milestoneID
);
for
(
$m
=
0
;
$m
<
sizeof
(
$tasks
);
$m
++
)
{
$subTasks
=
$this
->
getSubtasks
(
$tasks
[
$m
][
'ID'
]);
for
(
$i
=
0
;
$i
<
sizeof
(
$subTasks
);
$i
++
)
{
if
(
$this
->
finishSubTask
(
$subTasks
[
$i
][
"ID"
])
==
false
)
{
return
false
;
}
}
if
(
$this
->
finishTask
(
$tasks
[
$m
][
'ID'
])
==
false
)
{
return
false
;
}
}
return
true
;
}
//========================================
//========================================
//----------------- get ------------------
//----------------- get ------------------
//========================================
//========================================
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment