Exemple #1
0
function formatSearchResults(array $results, $search_type, $highlight_term, $limit = 0, $start = 0)
{
    // If only a limited number of results is required, reduce the array down to that number.
    if ($limit != 0) {
        $results = array_slice($results, $start, $limit);
    }
    switch ($search_type) {
        case 'service':
        case 'hostname':
            $results = highlightSearchQuery($results, $highlight_term, $search_type);
            $html = printOnCallTableHeader();
            foreach ($results as $n) {
                $html .= formatOnCallRowForPrint($n);
            }
            $html .= printOnCallTableFooter();
            break;
        case 'report':
            $results = highlightSearchQuery($results, $highlight_term, 'report');
            foreach ($results as $result) {
                $html .= formatWeeklyReportForPrint($result);
            }
            break;
        case 'notes':
            $results = highlightSearchQuery($results, $highlight_term, 'notes');
            foreach ($results as $result) {
                $html .= formatMeetingNotesForPrint($result, true);
            }
            break;
        default:
            return false;
    }
    return $html;
}
Exemple #2
0
if (isset($_GET['meeting_done'])) {
    echo insertNotify("success", "Thanks for running the weekly meeting! Your notes have been saved. ");
}
if ($results = checkForPreviousMeetingNotes(generateMeetingNotesID($start_ts, $end_ts))) {
    echo formatMeetingNotesForPrint($results);
}
if (getTeamConfig('oncall')) {
    // Print the on call report if there is one yet for this period
    if ($results = getOnCallReportForWeek($oncall_start, $oncall_end)) {
        echo "<h3>On call report <small> for week " . date("l jS F Y", $oncall_start) . " - " . date("l jS F Y", $oncall_end);
        echo " compiled by " . guessPersonOnCall($oncall_start, $oncall_end) . "</small></h3>";
        echo "<h5>" . count($results) . " notifications received this week ";
        ?>
                <small><a href="#" onClick="$('#oncall-table').fadeToggle('fast')">hide/show</a></small></h5>
    <?php 
        echo printOnCallTableHeader();
        foreach ($results as $n) {
            echo formatOnCallRowForPrint($n);
        }
        echo printOnCallTableFooter();
    }
}
// Print the generic weekly updates (if any)
if (!($updates = getGenericWeeklyReportsForWeek($start_ts, $end_ts))) {
    echo insertNotify("error", "No Weekly Updates have been entered yet this week");
} else {
    foreach ($updates as $update) {
        echo formatWeeklyReportForPrint($update);
    }
}
?>