From 03af47eee32af2bbc0c1dd2845bb3d7a00348147 Mon Sep 17 00:00:00 2001 From: martin <martin> Date: Sun, 22 Sep 2002 03:16:40 +0000 Subject: [PATCH] SHow number of journal entries in the teacher link to report --- lang/en/journal.php | 2 +- mod/journal/view.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lang/en/journal.php b/lang/en/journal.php index 9275c64398..777e64eab1 100644 --- a/lang/en/journal.php +++ b/lang/en/journal.php @@ -24,6 +24,6 @@ $string['noratinggiven'] = "No rating given"; $string['overallrating'] = "Overall rating"; $string['rate'] = "Rate"; $string['startoredit'] = "Start or edit my journal entry"; -$string['viewallentries'] = "View all journal entries"; +$string['viewallentries'] = "View \$a journal entries"; ?> diff --git a/mod/journal/view.php b/mod/journal/view.php index e28201208f..2334081cc4 100644 --- a/mod/journal/view.php +++ b/mod/journal/view.php @@ -37,8 +37,17 @@ update_module_icon($cm->id, $course->id)); if (isteacher($course->id)) { - echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallentries","journal")."</A></P>"; } + if (isteacher($course->id)) { + if ($allentries = get_records("journal_entries", "journal", $journal->id)) { + $entrycount = count($allentries); + } else { + $entrycount = 0; + } + echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallentries","journal", $entrycount)."</A></P>"; + } + + print_simple_box( text_to_html($choice->text) , "center"); echo "<CENTER>\n"; -- 2.39.5