-
Notifications
You must be signed in to change notification settings - Fork 0
/
mytasks.php
48 lines (43 loc) · 1.26 KB
/
mytasks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
include("init.php");
if (!isset($_SESSION["userid"])) {
$template->assign("loginerror", 0);
$template->display("login.tpl");
die();
}
$task = new task();
$project = new project();
$myprojects = $project->getMyProjects($userid);
$milestone = new milestone();
$milestones = array();
$cou = 0;
$tasknum = 0;
$ltasksa = array();
$tlist = new tasklist();
if (!empty($myprojects)) {
foreach($myprojects as $proj) {
$tasks = $task->getAllMyProjectTasks($proj["ID"], 10000);
$lists = $tlist->getProjectTasklists($proj["ID"], 1);
$donetasks = $task->getMyDoneProjectTasks($proj["ID"], 10000);
$myprojects[$cou]['tasks'] = $tasks;
$myprojects[$cou]['oldtasks'] = $donetasks;
$myprojects[$cou]['lists'] = $lists;
if (!empty($tasks)) {
$pcount = count($tasks);
} else {
$pcount = 0;
}
$myprojects[$cou]['tasknum'] = $pcount;
if (!empty($tasks)) {
$tcount = count($tasks);
$tasknum = $tasknum + $tcount;
}
$cou = $cou + 1;
}
}
$title = $langfile['mytasks'];
$template->assign("title", $title);
$template->assign("tasknum", $tasknum);
$template->assign("myprojects", $myprojects);
$template->display("mytasks.tpl");
?>