$boxInst->setBgColor("#f8f8f8"); $jobInst = new job(); $jobInst->filterUserId = $loginInst->id; $jobInst->filterStartTime = $toolInst->timestampToSec($toolInst->getTime("Y", $dayToShow), $toolInst->getTime("m", $dayToShow), $toolInst->getTime("d", $dayToShow), 0, 0); $jobInst->filterStopTime = $toolInst->timestampToSec($toolInst->getTime("Y", $dayToShow), $toolInst->getTime("m", $dayToShow), $toolInst->getTime("d", $dayToShow), 23, 59); // show currently running job only today if ($toolInst->getTime("Y", $dayToShow) != $toolInst->getTime("Y")) { $jobInst->filterCurrentlyRunning = "1"; } if ($toolInst->getTime("m", $dayToShow) != $toolInst->getTime("m")) { $jobInst->filterCurrentlyRunning = "1"; } if ($toolInst->getTime("d", $dayToShow) != $toolInst->getTime("d")) { $jobInst->filterCurrentlyRunning = "1"; } $list = $jobInst->getList(); if ($jobInst->matches > 0) { $boxInst->addContent("<table border=0 cellpadding=2 cellspacing=0 width=100%>"); $boxInst->addContent("<tr><th>" . $lang['common_task'] . "</th><th>" . $lang['common_comment'] . "</th><th class=right>" . $lang['common_start'] . "</th><th class=right>" . $lang['common_stop'] . "</th><th class=right>" . $lang['common_used'] . "</th></tr>"); $sum = 0; while ($element = current($list)) { $jobInst->activate($element); $taskInst = new task($jobInst->taskId); $projectInst = new project($taskInst->projectId); $boxInst->addContent("<tr><td class=list><a href=\"javascript:openwindow('" . $toolInst->encodeUrl("index.php?content=taskdetails.php&view=details&taskid=" . $taskInst->id) . "',width='500',height='500')\" title=\"" . $lang['common_showTaskdetails'] . "\">" . substr($projectInst->name . ": " . $taskInst->subject, 0, 40) . "...</a></td>"); $boxInst->addContent("<td class=list>" . substr($jobInst->comment, 0, 50) . "...</td>"); $boxInst->addContent("<td class=list align=right>" . $toolInst->getTime("H:i", $jobInst->start) . "</td>"); if ($jobInst->id == $jobInst->getOpenJob()) { $boxInst->addContent("<td class=list align=right>running</td>"); } else { $boxInst->addContent("<td class=list align=right>" . $toolInst->getTime("H:i", $jobInst->stop) . "</td>");
} ?> <?php # order if (!$order) { $order = "start"; } else { $order = tool::secureGet('order'); } if (tool::secureGet('desc') == "DESC") { $desc = ""; } else { $desc = "DESC"; } $list = $jobInst->getList($order, $desc); if ($jobInst->matches > 0) { ####################################################################### ## show existing jobs $colspan = 4; if ($loginInst->id != $taskInst->userId) { $colspan--; } ?> <br> <a name="joblist"></a> <form method="post" name="form2"> <input type="hidden" name="action" value=""> <input type="hidden" name="id" value=""> <input type="hidden" name="taskid" value="<?php echo $taskInst->id;
</th> <th align=left><?php echo $lang['common_stop']; ?> </th> <th align=left><nobr><?php echo $lang['common_usedTime']; ?> </nobr></th> </tr> <?php $array = array(); $list = $taskInst->getList($order, $desc); while ($element = current($list)) { $jobInst->filterTaskId = $element; $jobList = $jobInst->getList(); if ($jobInst->matches > 0) { while ($jobElement = current($jobList)) { $array[] = $jobElement; next($jobList); } } next($list); } sort($array); ### $day = 0; $newDay = 0; $firstrun = 1; $mySummary = 0; ###