Permalink
Browse files

Fixes to two database fields log_display(table -> mtable) and

user_teachers(authority from varchar -> int)
  • Loading branch information...
1 parent 9368336 commit 565f7a95044e28e957e63d29709f892de9aaafeb martin committed Aug 4, 2002
Showing with 11 additions and 6 deletions.
  1. +2 −2 course/lib.php
  2. +3 −3 lib/db/mysql.sql
  3. +6 −1 version.php
View
@@ -154,7 +154,7 @@ function print_log($course, $user=0, $date=0, $order="ORDER BY l.time ASC") {
foreach ($logs as $log) {
if ($ld = get_record_sql("SELECT * FROM log_display WHERE module='$log->module' AND action='$log->action'")) {
- $log->info = get_field($ld->table, $ld->field, "id", $log->info);
+ $log->info = get_field($ld->mtable, $ld->field, "id", $log->info);
}
echo "<TR>";
@@ -182,7 +182,7 @@ function print_all_courses($cat=1, $style="full", $maxcount=999) {
$count = 0;
$icon = "<IMG SRC=\"pix/i/course.gif\" HEIGHT=16 WIDTH=16 ALT=\"Course\">";
foreach ($courses as $course) {
- $moddata[]="<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
+ $moddata[]="<A TITLE=\"$course->shortname\" HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname</A>";
$modicon[]=$icon;
if ($count++ >= $maxcount) {
break;
View
@@ -117,9 +117,9 @@ CREATE TABLE `log` (
CREATE TABLE `log_display` (
`module` varchar(20) NOT NULL default '',
`action` varchar(20) NOT NULL default '',
- `table` varchar(20) NOT NULL default '',
+ `mtable` varchar(20) NOT NULL default '',
`field` varchar(40) NOT NULL default ''
-) TYPE=MyISAM COMMENT='For a particular module/action, specifies a table field.';
+) TYPE=MyISAM COMMENT='For a particular module/action, specifies a moodle table/field.';
# --------------------------------------------------------
#
@@ -213,7 +213,7 @@ CREATE TABLE `user_teachers` (
`id` int(10) unsigned NOT NULL auto_increment,
`user` int(10) unsigned NOT NULL default '0',
`course` int(10) unsigned NOT NULL default '0',
- `authority` varchar(10) default NULL,
+ `authority` tinyint(3) NOT NULL default '3',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per teacher per course';
View
@@ -17,7 +17,7 @@
// If there's something it cannot do itself, it
// will tell you what you need to do.
-$version = 2002080200;
+$version = 2002080300;
function upgrade_moodle($oldversion=0) {
@@ -42,6 +42,11 @@ function upgrade_moodle($oldversion=0) {
execute_sql(" ALTER TABLE `modules` DROP `search` ");
}
+ if ($oldversion < 2002080300) {
+ execute_sql(" ALTER TABLE `log_display` CHANGE `table` `mtable` VARCHAR( 20 ) NOT NULL ");
+ execute_sql(" ALTER TABLE `user_teachers` CHANGE `authority` `authority` TINYINT( 3 ) DEFAULT '3' NOT NULL ");
+ }
+
return true;
}

0 comments on commit 565f7a9

Please sign in to comment.