Skip to content
Permalink
Browse files

New log entry to show when a glossary entry is viewed

  • Loading branch information...
moodler
moodler committed Mar 10, 2005
1 parent d0d0cd9 commit a736e963a5cf3b361f3850c4b16f41262ab657d9
@@ -397,6 +397,10 @@ function glossary_upgrade($oldversion) {
}
}
}
if ($oldversion < 2005031001) {
modify_database('',"INSERT INTO prefix_log_display VALUES ('glossary', 'view entry', 'glossary_entries', 'concept');");
}
return true;
}
@@ -161,4 +161,5 @@ INSERT INTO prefix_log_display VALUES ('glossary', 'add comment', 'glossary', 'n
INSERT INTO prefix_log_display VALUES ('glossary', 'update comment', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'delete comment', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'approve entry', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view entry', 'glossary_entries', 'concept');

@@ -158,6 +158,10 @@ function glossary_upgrade($oldversion) {
}
}
if ($oldversion < 2005031001) {
modify_database('',"INSERT INTO prefix_log_display VALUES ('glossary', 'view entry', 'glossary_entries', 'concept');");
}
return true;
}
@@ -177,3 +177,4 @@ INSERT INTO prefix_log_display VALUES ('glossary', 'add comment', 'glossary', 'n
INSERT INTO prefix_log_display VALUES ('glossary', 'update comment', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'delete comment', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'approve entry', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view entry', 'glossary_entries', 'concept');
@@ -504,7 +504,7 @@ function glossary_get_entries_search($concept, $courseid) {
$conceptupper = strtoupper(trim($concept));
return get_records_sql("SELECT e.*, g.name as glossaryname
return get_records_sql("SELECT e.*, g.name as glossaryname, cm.id as cmid, cm.course as courseid
FROM {$CFG->prefix}glossary_entries e,
{$CFG->prefix}glossary g,
{$CFG->prefix}course_modules cm,
@@ -15,13 +15,15 @@
$entry = get_record("glossary_entries", "id", $eid);
$glossary = get_record('glossary','id',$entry->glossaryid);
$entry->glossaryname = $glossary->name;
$entries[] = $entry;
if (!$cm = get_coursemodule_from_instance("glossary", $glossary->id)) {
error("Could not determine which course module this belonged to!");
}
if (!$cm->visible and !isteacher($cm->course)) {
redirect($CFG->wwwroot.'/course/view.php?id='.$cm->course, get_string('activityiscurrentlyhidden'));
}
$entry->cmid = $cm->id;
$entry->courseid = $cm->course;
$entries[] = $entry;
} else if ($concept) {
$entries = glossary_get_entries_search($concept, $courseid);
} else {
@@ -32,6 +34,7 @@
foreach ($entries as $key => $entry) {
//$entries[$key]->footer = "<p align=\"right\">&raquo;&nbsp;<a onClick=\"if (window.opener) {window.opener.location.href='$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid'; return false;} else {openpopup('/mod/glossary/view.php?g=$entry->glossaryid', 'glossary', 'menubar=1,location=1,toolbar=1,scrollbars=1,directories=1,status=1,resizable=1', 0); return false;}\" href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\" target=\"_blank\">$entry->glossaryname</a></p>"; // Could not get this to work satisfactorily in all cases - Martin
$entries[$key]->footer = "<p align=\"right\">&raquo;&nbsp;<a target=\"_blank\" href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">$entry->glossaryname</a></p>";
add_to_log($entry->courseid, "glossary", "view entry", "showentry.php?eid=$entry->id", $entry->id, $entry->cmid);
}
}
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2005031000;
$module->version = 2005031001;
$module->requires = 2005031000; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)

0 comments on commit a736e96

Please sign in to comment.
You can’t perform that action at this time.