<td class=list<?php echo $jobStyle; ?> > <?php if ($jobInst->comment) { echo $jobInst->comment; } echo " </td>\n"; echo "<td class=list{$jobStyle}>" . $toolInst->getTime("d.m.Y, H:i", $jobInst->start) . "</td>\n"; if ($jobInst->id == $jobInst->getOpenJob()) { echo "<td class=list{$jobStyle}>" . $lang['tasks_running'] . "</td>\n"; } else { echo "<td class=list{$jobStyle}>" . $toolInst->getTime("d.m.Y, H:i", $jobInst->stop) . "</td>\n"; } echo "<td class=list{$jobStyle} align=right>" . $toolInst->formatTime($jobInst->getSummary()) . "</td>\n"; echo "</tr>\n"; next($list); } echo "<tr>\n"; echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_summaryTime'] . " : </b></td>\n"; echo "<td class=list align=right><b>" . $toolInst->formatTime($taskInst->getSummary()) . "</b></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td class=list_private colspan=" . $colspan . " align=right><b>" . $lang['common_private_jobs'] . " - " . $lang['common_summaryTime'] . " : </b></td>\n"; echo "<td class=list_private align=right><b>" . $toolInst->formatTime($taskInst->getSummary(true)) . "</b></td>\n"; echo "</tr>\n"; if ($projectInst->rate || $userInst->rate) { if ($loginInst->hasAccess("task.getSummary")) { echo "<tr>\n"; echo "<td class=list colspan=" . $colspan . " align=right><b>" . $lang['common_roundedSummaryTime'] . " : </b></td>\n";
$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>"); } $boxInst->addContent("<td class=list align=right>" . $toolInst->formatTime($jobInst->getSummary()) . "</td></tr>"); $sum += $jobInst->getSummary(); next($list); } $boxInst->addContent("<tr><td colspan=4 class=list align=right><b>" . $lang['common_summary'] . " </b></td><td class=list align=right><b>" . $toolInst->formatTime($sum) . "</b></td></tr>"); $boxInst->addContent("</table>"); } else { $boxInst->addContent(" " . $lang['home_myWorkTodayNoMatches'] . "<br> "); } $dayBefore = $dayToShow - 60 * 60 * 24; $dayAfter = $dayToShow + 60 * 60 * 24; $boxInst->addContent("<table border=0 cellpadding=2 cellspacing=0 width=100%>"); $boxInst->addContent("<tr><td class=list>[<a href=\"" . $toolInst->encodeUrl("index.php?content=home.php&day=" . $dayBefore) . "\">« " . $toolInst->getTime("Y-m-d", $dayBefore) . "</a>]</td>"); // show forward link only, if not current day (huuuaa, what a date compare ;)) if ($toolInst->timestampToSec($toolInst->getTime("Y", $dayToShow), $toolInst->getTime("m", $dayToShow), $toolInst->getTime("d", $dayToShow), 0, 0) < $toolInst->timestampToSec($toolInst->getTime("Y"), $toolInst->getTime("m"), $toolInst->getTime("d"), 0, 0)) { $boxInst->addContent("<td class=list align=right>[<a href=\"" . $toolInst->encodeUrl("index.php?content=home.php&day=" . $dayAfter) . "\">" . $toolInst->getTime("Y-m-d", $dayAfter) . " »</a>]</td>");
while ($element = current($list)) { echo "<tr>\n"; // create a new user object, based on the current element of the list $user = new user($element); echo "<td>" . $user->username . "</td>\n"; // determine the id of the job, the user is currently working at $job = new job(); $jobId = $job->getOpenJob($user->id); if ($jobId) { $job = new job($jobId); $task = new task($job->taskId); $project = new project($task->projectId); echo "<td>" . $project->name . "</td>\n"; echo "<td>" . $task->subject . "</td>\n"; echo "<td>" . $toolInst->getTime("H:i", $job->start) . "</td>\n"; echo "<td>" . $toolInst->formatTime($job->getSummary()) . "</td>\n"; } else { echo "<td colspan=\"4\">offline</td>\n"; } next($list); echo "</tr>\n"; } ?> </table> <?php /*************************************************************************** * $Log: index.php,v $ * Revision 1.1.1.1 2003/07/28 19:23:13 willuhn * reimport * * Revision 1.2 2002/04/15 22:14:35 willuhn
### 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>"); ### $day = $newDay; $newDay = $toolInst->getTime("d", $jobInst->start); if ($day < $newDay && $firstrun != "1") { echo "<tr>\n"; echo "<td colspan=\"5\" class=list align=right><b>" . $lang['common_summary'] . ":</b></td>\n"; echo "<td class=list align=right><b>" . $toolInst->formatTime($mySummary) . "</b></td>\n"; echo "</tr>\n"; echo "<tr><td colspan=\"6\" class=list> </td></tr>\n"; $mySummary = 0; } ###