mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
Fixes to two database fields log_display(table -> mtable) and
user_teachers(authority from varchar -> int)
This commit is contained in:
parent
9368336bae
commit
565f7a9504
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user