function journal_user_complete_index($course, $user, $journal, $journalopen, $heading) { /// Prints a journal, entry and feedback ... used on the journal index page. if (isteacher($course->id)) { $entrycount = journal_count_entries($journal, get_current_group($course->id)); $entryinfo = " (<a href=\"report.php?id={$journal->coursemodule}\">" . get_string("viewallentries", "journal", $entrycount) . "</a>)"; } else { $entryinfo = ""; } $journal->name = "<a href=\"view.php?id={$journal->coursemodule}\">" . format_string($journal->name, true) . "</a>"; if ($heading) { echo "<h3>{$heading} - {$journal->name}{$entryinfo}</h3>"; } else { echo "<h3>{$journal->name}{$entryinfo}</h3>"; } print_simple_box_start("left", "90%"); echo format_text($journal->intro, $journal->introformat); print_simple_box_end(); echo "<br clear=\"all\" />"; echo "<br />"; if (isstudent($course->id) or isteacher($course->id)) { print_simple_box_start("right", "90%"); if ($journalopen) { echo "<p align=\"right\"><a href=\"edit.php?id={$journal->coursemodule}\">"; echo get_string("edit") . "</a></p>"; } else { echo "<p align=\"right\"><a href=\"view.php?id={$journal->coursemodule}\">"; echo get_string("view") . "</a></p>"; } if ($entry = get_record("journal_entries", "userid", $user->id, "journal", $journal->id)) { if ($entry->modified) { echo "<p align=\"center\"><font size=\"1\">" . get_string("lastedited") . ": " . userdate($entry->modified) . "</font></p>"; } if ($entry->text) { echo format_text($entry->text, $entry->format); } if ($entry->teacher) { $grades = make_grades_menu($journal->assessed); journal_print_feedback($course, $entry, $grades); } } else { print_string("noentry", "journal"); } print_simple_box_end(); echo "<br clear=\"all\" />"; echo "<br />"; } }
echo format_text($entry->text, $entry->format); } } else { echo '<span class="warning">' . get_string('notstarted', 'journal') . '</span>'; } print_simple_box_end(); if ($timenow < $timefinish) { if (!empty($entry->modified)) { echo '<div class="lastedit"><strong>' . get_string('lastedited') . ':</strong> '; echo userdate($entry->modified); echo ' (' . get_string('numwords', '', count_words($entry->text)) . ')'; echo "</div>"; } if (!empty($journal->days)) { echo '<div class="editend"><strong>' . get_string('editingends', 'journal') . ':</strong> '; echo userdate($timefinish) . '</div>'; } } else { echo '<div class="editend"><strong>' . get_string('editingended', 'journal') . ':</strong> '; echo userdate($timefinish) . '</div>'; } if (!empty($entry->entrycomment) or !empty($entry->rating)) { $grades = make_grades_menu($journal->assessed); print_heading(get_string('feedback')); journal_print_feedback($course, $entry, $grades); } } else { echo '<div class="warning">' . get_string('notopenuntil', 'journal') . ': '; echo userdate($timestart) . '</div>'; } print_footer($course);
function journal_user_complete($course, $user, $mod, $journal) { global $DB, $OUTPUT; if ($entry = $DB->get_record("journal_entries", array("userid" => $user->id, "journal" => $journal->id))) { echo $OUTPUT->box_start(); if ($entry->modified) { echo "<p><font size=\"1\">" . get_string("lastedited") . ": " . userdate($entry->modified) . "</font></p>"; } if ($entry->text) { echo format_text($entry->text, $entry->format); } if ($entry->teacher) { $grades = make_grades_menu($journal->grade); journal_print_feedback($course, $entry, $grades); } echo $OUTPUT->box_end(); } else { print_string("noentry", "journal"); } }