if (!$client) { if ($hour == 0 && $minute == 30) { Checks_Logic::startAll(); } } // Database maintenance and trimming. // It takes a few minutes on a production machine. if ($hour == 0 && $minute == 50) { Tasks_Logic::queue(Tasks_Logic::PHP, array(__DIR__ . "/database.php")); } // Sprint burndown. // It runs every hour. // The script itself determines what to do at which hour of the day or day of the week or day of the month. if (!$client) { if ($minute == 5) { Sprint_Logic::burndown("", false); } } // A flag is set upon installation, so it (re-)generates the stylesheets once. $create_css_flag = "../dyncss/create_css.txt"; if (file_exists($create_css_flag)) { unlink($create_css_flag); Styles_Sheets::create_all(); } // Export the Bibles to the various output formats. // This may take an hour on a production machine. if ($hour == 1 && $minute == 10) { Export_Logic::scheduleAll(); } // Re-index Bible and notes. if ($hour == 2 && $minute == 0) {
foreach ($categories as $category) { $category = trim($category); if ($category != "") { $categories2[] = $category; } } $categories = implode("\n", $categories2); $database_config_bible->setSprintTaskCompletionCategories($bible, $categories); } $tasks = $database_sprint->getTasks($bible, $year, $month); $titles = array(); $percentages = array(); foreach ($tasks as &$id) { $titles[] = Filter_Html::sanitize($database_sprint->getTitle($id)); $percentages[] = $database_sprint->getComplete($id); } $view->view->bible = $bible; $view->view->sprint = date("F Y", mktime(0, 0, 0, $month, 1, $year)); $view->view->tasks = $tasks; $view->view->titles = $titles; $view->view->percentages = $percentages; //if (extension_loaded ("gd")) { // $view->view->chart = base64_encode (Sprint_Logic::createGraphicalBurndownChart ($bible, $year, $month)); //} $view->view->chart2 = Sprint_Logic::createTextBasedBurndownChart($bible, $year, $month); $categorytext = $database_config_bible->getSprintTaskCompletionCategories($bible); $view->view->categorytext = $categorytext; $categories = explode("\n", $categorytext); $view->view->categories = $categories; $view->render("index.php"); Assets_Page::footer();
$body = array(); $body[] = "<h3>" . Locale_Translate::_("Sprint Planning and Team's Progress") . " | {$bible}</h3>"; $body[] = "<table>"; $tasks = $database_sprint->getTasks($bible, $year, $month); foreach ($tasks as $id) { $body[] = "<tr>"; $title = $database_sprint->getTitle($id); $body[] = "<td>" . $title . "</td>"; $complete = $database_sprint->getComplete($id); $text = str_repeat("▓", intval($complete / $category_percentage)) . str_repeat("▁", $category_count - intval($complete / $category_percentage)); $body[] = "<td>" . $text . "</td>"; $body[] = "</tr>"; } $body[] = "</table>"; $body[] = "<h3>" . Locale_Translate::_("Sprint Burndown Chart - Remaining Tasks") . "</h3>"; $burndownchart = Sprint_Logic::createTextBasedBurndownChart($bible, $year, $month); $body[] = "<p>{$burndownchart}</p>"; if (count($body) > 0) { $body = implode("\n", $body); if (!Filter_Client::enabled()) { $database_mail->send($user, $subject, $body); } } } } } else { // Since there are no tasks, no mail will be sent: Make a logbook entry. $database_logs->log("No tasks in this Sprint: No email was sent"); } } }