* You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ ####################################################################### ## check login again if (!$loginInst->id) { echo $lang['common_accessDenied'] . "\n"; exit; } $taskInst = new task(); if (tool::securePost('action') == "save") { $taskId = tool::securePost('taskid'); } if ($taskId) { $taskInst->activate($taskId); } else { $taskId = tool::secureGet('taskid'); $taskInst->activate($taskId); } if (!$taskInst->id) { echo "no task found.\n"; exit; } $projectInst = new project($taskInst->projectId); $userInst = new user($taskInst->userId); $jobInst = new job(); $jobInst->filterTaskId = $taskInst->id; ####################################################################### ## perform action $status = 0;
/** * returns the summary of all costs for this project * @return float costs */ function getCosts() { $taskInst = new task(); $taskInst->filterProjectId = $this->id; $sum = 0; $list = $taskInst->getList(); while ($element = current($list)) { $taskInst->activate($element); $sum += $taskInst->getCosts(); next($list); } return $sum; }
} } if ($action == "search") { if (tool::securePost('lastrecordtype')) { $recordType = tool::securePost('lastrecordtype'); } $taskInst->fill(tool::securePostAll()); $taskInst->id = tool::securePost('id'); } if ($action == "delete") { $taskInst->id = tool::securePost('id'); $taskInst->delete(); } if ($action == "edit") { $recordType = "edit"; $taskInst->activate(tool::securePost('id')); } $taskInst->fillFilter(tool::securePostAll()); ####################################################################### ## make edit / new form ?> <form method="post" name="form1" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $config['attach_maxfilesize']; ?> "> <input type="hidden" name="id" value="<?php echo $taskInst->id; ?> ">
?> <th>percentage</th> <th> </th> </tr> <?php $taskInst = new task(); $order = "finish"; if (tool::securePost('order')) { $order = tool::securePost('order'); } $list = $taskInst->getList($order); if ($order == "plannedhours") { $listByHour = array(); while ($element = current($list)) { $taskInst->activate($element); if (!$taskInst->isDone() && $taskInst->statusId != TASK_STATUS_WAITING && $taskInst->plannedHours && $taskInst->plannedHours != "0") { $diff = $taskInst->plannedHours * 60 * 60 - $taskInst->getSummary(); $listByHour[$diff] = $taskInst->id; } next($list); } ksort($listByHour); while (list($diff, $id) = each($listByHour)) { $taskInst->activate($id); ?> <tr class="light" onmouseover="this.style.backgroundColor='#fafafa'" onmouseout="this.style.backgroundColor=''"><?php $projectInst = new project($taskInst->projectId); echo "<td><nobr><a href=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=projectdetails.php&view=details&projectid=" . $projectInst->id) . "',width='500',height='500')\" title=\"show details for this project\">" . $projectInst->name . "</a></nobr></td>\n"; if ($loginInst->hasAccess("task.viewOther")) { $userInst = new user($taskInst->userId);
$array[] = $jobElement; next($jobList); } } next($list); } sort($array); ### $day = 0; $newDay = 0; $firstrun = 1; $mySummary = 0; ### while ($element = current($array)) { $jobInst->activate($element); $taskInst->activate($jobInst->taskId); $userInst = new user($taskInst->userId); $projectInst->activate($taskInst->projectId); $reportInst->append(" <task>"); $reportInst->append(" <job>"); if ($loginInst->hasAccess("report.viewOther")) { $reportInst->append(" <user>" . $userInst->username . "</user>"); } $reportInst->append($toolInst->encodeXml(" <project>" . substr($projectInst->name, 0, 50) . "</project>")); $reportInst->append($toolInst->encodeXml(" <subject>" . substr($taskInst->subject, 0, 50) . "</subject>")); $reportInst->append(" <start>" . $toolInst->getTime("", $jobInst->start) . "</start>"); $reportInst->append(" <stop>" . $toolInst->getTime("", $jobInst->stop) . "</stop>"); $reportInst->append(" <used>" . $toolInst->formatTime($jobInst->getSummary()) . "</used>"); $reportInst->append($toolInst->encodeXml(" <comment>" . substr($jobInst->comment, 0, 50) . "...</comment>")); $reportInst->append(" </job>"); $reportInst->append(" </task>");