From: willcast Date: Thu, 16 Oct 2003 05:15:59 +0000 (+0000) Subject: - Now entries could be commented by other users. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ed0201dd7f32299f8a5dee9d504b74b07149a4f8;p=moodle.git - Now entries could be commented by other users. - KNOWN BUG: It does not restore the comments even when userinfo is set... Eloy! I need your help! :) --- diff --git a/lang/en/glossary.php b/lang/en/glossary.php index 7ce7d0d725..d43001b9e1 100644 --- a/lang/en/glossary.php +++ b/lang/en/glossary.php @@ -1,20 +1,29 @@ diff --git a/lang/en/help/glossary/allowcomments.html b/lang/en/help/glossary/allowcomments.html new file mode 100644 index 0000000000..d404442295 --- /dev/null +++ b/lang/en/help/glossary/allowcomments.html @@ -0,0 +1,4 @@ +

Allow comments on entries

+ +

You can specify if the system should or should not allow comments on glossary entries. + diff --git a/mod/glossary/backuplib.php b/mod/glossary/backuplib.php index 9a406ab200..1ab0e729b2 100644 --- a/mod/glossary/backuplib.php +++ b/mod/glossary/backuplib.php @@ -11,6 +11,12 @@ // | | // glossary_entries -------------- glossary_entries_categories // (UL,pk->id, fk->glossaryid, files) (UL, [pk->categoryid,entryid] + // | + // | + // | + // glossary_comments + // (UL,pk->id, fk->entryid) + // // // Meaning: pk->primary key field of the table // fk->foreign key to link with parent @@ -45,6 +51,7 @@ fwrite ($bf,full_tag("SHOWSPECIAL",4,false,$glossary->showspecial)); fwrite ($bf,full_tag("SHOWALPHABET",4,false,$glossary->showalphabet)); fwrite ($bf,full_tag("SHOWALL",4,false,$glossary->showall)); + fwrite ($bf,full_tag("ALLOWCOMMENTS",4,false,$glossary->allowcomments)); fwrite ($bf,full_tag("TIMECREATED",4,false,$glossary->timecreated)); fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$glossary->timemodified)); @@ -52,6 +59,9 @@ backup_glossary_categories($bf,$preferences,$glossary->id, $preferences->mods["glossary"]->userinfo); + if ( $preferences->mods["glossary"]->userinfo ) { + backup_glossary_comments($bf,$preferences,$glossary->id, $preferences->mods["glossary"]->userinfo); + } //End mod $status =fwrite ($bf,end_tag("MOD",3,true)); } @@ -134,7 +144,26 @@ fwrite ($bf,full_tag("TIMECREATED",6,false,$glo_ent->timecreated)); fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$glo_ent->timemodified)); fwrite ($bf,full_tag("TEACHERENTRY",6,false,$glo_ent->teacherentry)); - +/* + if ( $userinfo ) { + $comments = get_records("glossary_comments","entryid",$glo_ent->id); + if ( $comments ) { + $status =fwrite ($bf,start_tag("COMMENTS",6,true)); + foreach ($comments as $comment) { + $status =fwrite ($bf,start_tag("COMMENT",7,true)); + + fwrite ($bf,full_tag("ID",6,false,$comment->id)); + fwrite ($bf,full_tag("USERID",6,false,$comment->userid)); + fwrite ($bf,full_tag("COMMENT",6,false,$comment->comment)); + fwrite ($bf,full_tag("FORMAT",6,false,$comment->format)); + fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$comment->timemodified)); + + $status =fwrite ($bf,end_tag("COMMENT",7,true)); + } + $status =fwrite ($bf,end_tag("COMMENTS",6,true)); + } + } +*/ $status =fwrite ($bf,end_tag("ENTRY",5,true)); //Now include entry attachment in backup (if it exists) @@ -151,7 +180,6 @@ return $status; } - //Backup glossary files because we've selected to backup user info //or current entry is a teacher entry function backup_glossary_files($bf,$preferences,$glossary,$entry) { diff --git a/mod/glossary/comment.gif b/mod/glossary/comment.gif new file mode 100644 index 0000000000..0dd9874c06 Binary files /dev/null and b/mod/glossary/comment.gif differ diff --git a/mod/glossary/comment.html b/mod/glossary/comment.html new file mode 100644 index 0000000000..737642670e --- /dev/null +++ b/mod/glossary/comment.html @@ -0,0 +1,68 @@ + +

action="comment.php"> + + + + + + + + +

:

+ + "; + if ($usehtmleditor) { + helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); + } else { + emoticonhelpbutton("form", "comment"); + } + ?> +
+
+
+ text); + + echo "

"; + helpbutton("textformat", get_string("helpformatting")); + print_string("formattexttype"); + echo ": "; + if (!$form->format) { + $form->format = $defaultformat; + } + choose_from_menu(format_text_menu(), "format", $format->format, ""); + echo "

"; + ?> +
+

+ id) { + echo "id\">"; + } + ?> + + + + + + "> + "> +

+
+

+ + +
+ + + diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php new file mode 100644 index 0000000000..026220a586 --- /dev/null +++ b/mod/glossary/comment.php @@ -0,0 +1,210 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $glossary = get_record("glossary", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + if (! $entry = get_record("glossary_entries", "id", $eid)) { + error("Entry is incorrect"); + } + + if ( $cid ) { + if (! $comment = get_record("glossary_comments", "id", $cid)) { + error("Comment is incorrect"); + } + } + + require_login($course->id); + if (!$cm->visible and !isteacher($course->id)) { + notice(get_string("activityiscurrentlyhidden")); + } + + add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id", "$glossary->id"); + +/// Printing the page header + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + switch ( $action ){ + case "add": + $straction = get_string("addingcomment","glossary"); + break; + case "edit": + $straction = get_string("editingcomment","glossary"); + break; + case "delete": + $straction = get_string("deletingcomment","glossary"); + break; + } + $strglossaries = get_string("modulenameplural", "glossary"); + $strglossary = get_string("modulename", "glossary"); + $strcomments = get_string("comments", "glossary"); + + print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", + "$navigation id>$strglossaries -> id>$glossary->name -> id&eid=$entry->id>$strcomments -> " . $straction, + "", "", true, update_module_button($cm->id, $course->id, $strglossary), + navmenu($course, $cm)); + + print_heading($glossary->name); + +/// Info boxes + + if ( $glossary->intro ) { + print_simple_box_start("center","70%"); + echo '

'; + echo $glossary->intro; + echo '

'; + print_simple_box_end(); + } + + echo "

"; + echo ""; + echo "cellheading2>"; + echo ""; + echo "
"; + echo "$entry->concept"; + echo "
"; + if ($entry->attachment) { + $entry->course = $course->id; + echo "
"; + echo glossary_print_attachments($entry,"html"); + echo "
"; + } + echo format_text($entry->definition, $entry->format); + echo "

"; + +/// Input section + if ( $action == "delete" ) { + if ( $confirm ) { + delete_records("glossary_comments","id", $cid); + + print_simple_box_start("center","40%", "#FFBBBB"); + echo "

" . get_string("commentdeleted","glossary") . "
"; + print_simple_box_end(); + + print_footer($course); + add_to_log($course->id, "glossary", "delete comment", "comments.php?id=$cm->id&eid=$entry->id", $comment); + redirect("comments.php?id=$cm->id&eid=$entry->id"); + } else { + echo "

"; + echo ""; + echo "
cellheading\">"; + + $user = get_record("user", "id", $comment->userid); + $strby = get_string("writtenby","glossary"); + + print_user_picture($user->id, $course->id, $user->picture); + echo "
$strby $user->firstname $user->lastname"; + echo "
(".get_string("lastedited").": ".userdate($comment->timemodified).")"; + + echo "
cellcontent\">"; + echo format_text($comment->comment, $comment->format); + echo "
"; + echo "

"; + + print_simple_box_start("center","40%", "#FFBBBB"); + echo "


" . get_string("areyousuredeletecomment","glossary"); +?> +
+ + + + + + "> + " onclick="javascript:history.go(-1);"> + +
+
+ timemodified >= $CFG->maxeditingtime or $USER->id != $comment->userid) and !isteacher($course->id) ) { + echo "
"; + if ( $USER->id != $comment->userid ) { + echo get_string("youarenottheauthor","glossary",$CFG->maxeditingtime); + } elseif (time() - $comment->timemodified >= $CFG->maxeditingtime ) { + echo get_string("maxtimehaspassed","glossary",$CFG->maxeditingtime); + } + echo "
"; + print_footer($course); + die; + } + } + + if ( $confirm and $form = data_submitted() ) { + $form->text = clean_text($form->text, $form->format); + + $newentry->entryid = $entry->id; + $newentry->comment = $form->text; + $newentry->format = $form->format; + $newentry->timemodified = $comment->timemodified; + + if ( $action == "add" ) { + $newentry->userid = $USER->id; + + if (! $newentry->id = insert_record("glossary_comments", $newentry)) { + error("Could not insert this new comment"); + } else { + add_to_log($course->id, "glossary", "add comment", "comments.php?id=$cm->id&eid=$entry->id", "$newentry->id"); + } + } else { + $newentry->id = $form->cid; + $newentry->userid = $comment->userid; + + if (! update_record("glossary_comments", $newentry)) { + error("Could not update this comment"); + } else { + add_to_log($course->id, "glossary", "update comment", "comments.php?id=$cm->id&eid=$entry->id", "$newentry->id"); + } + } + print_simple_box_start("center","40%", "#FFBBBB"); + echo "
" . get_string("commentupdated","glossary") . "
"; + print_simple_box_end(); + + print_footer($course); + + redirect("comments.php?id=$cm->id&eid=$entry->id"); + } else { + if ($usehtmleditor = can_use_richtext_editor()) { + $defaultformat = FORMAT_HTML; + $onsubmit = "onsubmit=\"copyrichtext(theform.text);\""; + } else { + $defaultformat = FORMAT_MOODLE; + $onsubmit = ""; + } + + $form->text = $comment->comment; + $form->format = $comment->format; + include("comment.html"); + } + } +/// Finish the page + print_footer($course); +?> \ No newline at end of file diff --git a/mod/glossary/comments.php b/mod/glossary/comments.php new file mode 100644 index 0000000000..1d3da9c3b9 --- /dev/null +++ b/mod/glossary/comments.php @@ -0,0 +1,105 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $glossary = get_record("glossary", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + if (! $entry = get_record("glossary_entries", "id", $eid)) { + error("Entry is incorrect"); + } + + + require_login($course->id); + if (!$cm->visible and !isteacher($course->id)) { + notice(get_string("activityiscurrentlyhidden")); + } + + add_to_log($course->id, "glossary", "view", "view.php?id=$cm->id", "$glossary->id"); + + +/// Printing the page header + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + $strglossaries = get_string("modulenameplural", "glossary"); + $strglossary = get_string("modulename", "glossary"); + $strallcategories = get_string("allcategories", "glossary"); + $straddentry = get_string("addentry", "glossary"); + $strnoentries = get_string("noentries", "glossary"); + $strsearchconcept = get_string("searchconcept", "glossary"); + $strsearchindefinition = get_string("searchindefinition", "glossary"); + $strsearch = get_string("search"); + + print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname", + "$navigation id>$strglossaries -> id>$glossary->name -> " . get_string("comments","glossary"), + "", "", true, update_module_button($cm->id, $course->id, $strglossary), + navmenu($course, $cm)); + + print_heading($glossary->name); + +/// Info boxes + + if ( $glossary->intro ) { + print_simple_box_start("center","70%"); + echo '

'; + echo $glossary->intro; + echo '

'; + print_simple_box_end(); + } + + echo "

"; + echo ""; + echo "cellheading2>"; + echo ""; + echo "
"; + echo ""; + echo "
"; + echo get_string("commentson","glossary") . " $entry->concept"; + if ( $glossary->allowcomments ) { + echo "id&eid=$entry->id\">\"" "; + } + echo "
"; + + echo "
"; + if ($entry->attachment) { + $entry->course = $course->id; + echo "
"; + echo glossary_print_attachments($entry,"html"); + echo "
"; + } + echo "$entry->concept: "; + echo format_text($entry->definition, $entry->format); + echo "
"; + +/// comments + $comments = get_records("glossary_comments","entryid",$entry->id,"timemodified ASC"); + if ( !$comments ) { + echo "

" . get_string("nocomments","glossary") . ""; + } else { + foreach ($comments as $comment) { + echo "

"; + glossary_print_comment($course, $cm, $glossary, $entry, $comment); + } + } + +/// Finish the page + print_footer($course); +?> \ No newline at end of file diff --git a/mod/glossary/db/mysql.php b/mod/glossary/db/mysql.php index 17a69aeb7e..ac24cb0a97 100644 --- a/mod/glossary/db/mysql.php +++ b/mod/glossary/db/mysql.php @@ -72,6 +72,25 @@ function glossary_upgrade($oldversion) { } + if ( $oldversion < 2003101501 ) { + execute_sql( "ALTER TABLE `{$CFG->prefix}glossary` " . + "ADD `allowcomments` TINYINT(2) UNSIGNED NOT NULL DEFAULT '0' AFTER `showall` " ); + + execute_sql("CREATE TABLE `{$CFG->prefix}glossary_comments` ( + `id` INT(10) unsigned NOT NULL auto_increment, + `entryid` INT(10) UNSIGNED NOT NULL default '0', + `userid` INT(10) UNSIGNED NOT NULL default '0', + `comment` TEXT NOT NULL default '', + `timemodified` INT(10) UNSIGNED NOT NULL default '0', + `format` TINYINT(2) UNSIGNED NOT NULL default '0', + PRIMARY KEY (`id`) + ) TYPE=MyISAM COMMENT='comments on glossary entries'"); + + execute_sql(" INSERT INTO {$CFG->prefix}log_display VALUES ('glossary', 'add comment', 'glossary', 'name') "); + execute_sql(" INSERT INTO {$CFG->prefix}log_display VALUES ('glossary', 'update comment', 'glossary', 'name') "); + execute_sql(" INSERT INTO {$CFG->prefix}log_display VALUES ('glossary', 'delete comment', 'glossary', 'name') "); + } + return true; } diff --git a/mod/glossary/db/mysql.sql b/mod/glossary/db/mysql.sql index d6196acb98..e7d3696045 100644 --- a/mod/glossary/db/mysql.sql +++ b/mod/glossary/db/mysql.sql @@ -20,6 +20,7 @@ CREATE TABLE prefix_glossary ( showspecial tinyint(2) unsigned NOT NULL default '1', showalphabet tinyint(2) unsigned NOT NULL default '1', showall tinyint(2) unsigned NOT NULL default '1', + allowcomments tinyint(2) unsigned NOT NULL default '0', timecreated int(10) unsigned NOT NULL default '0', timemodified int(10) unsigned NOT NULL default '0', PRIMARY KEY (id) @@ -66,6 +67,17 @@ CREATE TABLE prefix_glossary_entries_categories ( PRIMARY KEY (id) ) TYPE=MyISAM COMMENT='categories of each glossary entry'; +CREATE TABLE prefix_glossary_comments ( + id int(10) unsigned NOT NULL auto_increment, + entryid int(10) unsigned NOT NULL default '0', + userid int(10) unsigned NOT NULL default '0', + comment text NOT NULL, + format tinyint(2) unsigned NOT NULL default '0', + timemodified int(10) unsigned NOT NULL default '0', + + PRIMARY KEY (id) +) TYPE=MyISAM COMMENT='comments on glossary entries'; + # # Dumping data for table `log_display` # @@ -79,4 +91,7 @@ INSERT INTO prefix_log_display VALUES ('glossary', 'update entry', 'glossary', ' INSERT INTO prefix_log_display VALUES ('glossary', 'add category', 'glossary', 'name'); INSERT INTO prefix_log_display VALUES ('glossary', 'update category', 'glossary', 'name'); INSERT INTO prefix_log_display VALUES ('glossary', 'delete category', 'glossary', 'name'); +INSERT INTO prefix_log_display VALUES ('glossary', 'add comment', 'glossary', 'name'); +INSERT INTO prefix_log_display VALUES ('glossary', 'update comment', 'glossary', 'name'); +INSERT INTO prefix_log_display VALUES ('glossary', 'delete comment', 'glossary', 'name'); diff --git a/mod/glossary/db/postgres7.sql b/mod/glossary/db/postgres7.sql index 0c1746c09c..310a4ca3d5 100644 --- a/mod/glossary/db/postgres7.sql +++ b/mod/glossary/db/postgres7.sql @@ -20,6 +20,7 @@ CREATE TABLE prefix_glossary ( showspecial int2 NOT NULL default '1', showalphabet int2 NOT NULL default '1', showall int2 NOT NULL default '1', + allowcomments int2 NOT NULL default '0', timecreated int4 NOT NULL default '0', timemodified int4 NOT NULL default '0', PRIMARY KEY (id) @@ -66,6 +67,20 @@ CREATE TABLE prefix_glossary_entries_categories ( PRIMARY KEY (id) ); +# +# Table structure for table `glossary_comments` +# + +CREATE TABLE prefix_glossary_comments ( + id SERIAL, + entryid int4 NOT NULL default '0', + userid int4 NOT NULL default '0', + comment text NOT NULL, + format int2 NOT NULL default '0', + timemodified int4 NOT NULL default '0', + PRIMARY KEY (id) +); + # # Dumping data for table `log_display` # @@ -79,4 +94,6 @@ INSERT INTO prefix_log_display VALUES ('glossary', 'update entry', 'glossary', ' INSERT INTO prefix_log_display VALUES ('glossary', 'add category', 'glossary', 'name'); INSERT INTO prefix_log_display VALUES ('glossary', 'update category', 'glossary', 'name'); INSERT INTO prefix_log_display VALUES ('glossary', 'delete category', 'glossary', 'name'); - +INSERT INTO prefix_log_display VALUES ('glossary', 'add comment', 'glossary', 'name'); +INSERT INTO prefix_log_display VALUES ('glossary', 'update comment', 'glossary', 'name'); +INSERT INTO prefix_log_display VALUES ('glossary', 'delete comment', 'glossary', 'name'); diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index a0096525ef..08279b094d 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -235,25 +235,34 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$currentview $isteacher = isteacher($course->id); $ismainglossary = $glossary->mainglossary; - if ($isteacher or $glossary->studentcanpost and $entry->userid == $USER->id) { - echo "

"; - // only teachers can export entries so check it out - if ($isteacher and !$ismainglossary and !$importedentry) { - $mainglossary = get_record("glossary","mainglossary",1,"course",$course->id); - if ( $mainglossary ) { // if there is a main glossary defined, allow to export the current entry - + echo "
"; + + $count = count_records("glossary_comments","entryid",$entry->id); + echo "id&eid=$entry->id\">$count " . get_string("comments","glossary") . ""; + echo ""; + if ( $glossary->allowcomments ) { + echo "id&eid=$entry->id\">\"" "; + } + + if ($isteacher or $glossary->studentcanpost and $entry->userid == $USER->id) { + // only teachers can export entries so check it out + + if ($isteacher and !$ismainglossary and !$importedentry) { + $mainglossary = get_record("glossary","mainglossary",1,"course",$course->id); + if ( $mainglossary ) { // if there is a main glossary defined, allow to export the current entry + echo "id&entry=$entry->id¤tview=$currentview&cat=$cat\">\"" "; - } - } - + } + } + if ( $entry->sourceglossaryid ) { $icon = "minus.gif"; // graphical metaphor (minus) for deleting an imported entry } else { $icon = "../../pix/t/delete.gif"; } - // Exported entries can be updated/deleted only by teachers in the main glossary + // Exported entries can be updated/deleted only by teachers in the main glossary if ( !$importedentry and ($isteacher or !$ismainglossary) ) { echo "id&mode=delete&entry=$entry->id¤tview=$currentview&cat=$cat\">\""" . get_string("exportedentry","glossary") . ""; } - } + } + echo "
"; } function glossary_search_entries($searchterms, $glossary, $includedefinition) { @@ -325,9 +335,9 @@ function glossary_search_entries($searchterms, $glossary, $includedefinition) { } } - if ( !$includedefinition ) { - $definitionsearch = "0"; - } + if ( !$includedefinition ) { + $definitionsearch = "0"; + } $selectsql = "{$CFG->prefix}glossary_entries e, {$CFG->prefix}glossary g $onlyvisibletable @@ -337,7 +347,7 @@ function glossary_search_entries($searchterms, $glossary, $includedefinition) { $totalcount = count_records_sql("SELECT COUNT(*) FROM $selectsql"); - return get_records_sql("SELECT e.concept, e.definition, e.userid, e.timemodified, e.id, e.format FROM + return get_records_sql("SELECT e.concept, e.definition, e.userid, e.timemodified, e.id, e.format FROM $selectsql ORDER BY e.concept ASC $limit"); } @@ -571,13 +581,13 @@ for ($row = 0; $row < $numrows; $row++) { echo "link . "\">"; } - if ( !$data[$tabproccessed]->link ) { - echo ""; - } + if ( !$data[$tabproccessed]->link ) { + echo ""; + } echo $data[$tabproccessed]->caption; - if ( !$data[$tabproccessed]->link ) { - echo ""; - } + if ( !$data[$tabproccessed]->link ) { + echo ""; + } if ($tabproccessed != $currenttab and $data[$tabproccessed]->link) { echo ""; @@ -615,13 +625,13 @@ for ($row = 0; $row < $numrows; $row++) { echo "link . "\">"; } - if ( !$data[$tabproccessed]->link ) { - echo ""; - } + if ( !$data[$tabproccessed]->link ) { + echo ""; + } echo $data[$tabproccessed]->caption; - if ( !$data[$tabproccessed]->link ) { - echo ""; - } + if ( !$data[$tabproccessed]->link ) { + echo ""; + } if ($tabproccessed != $currenttab and $data[$tabproccessed]->link) { echo ""; @@ -783,4 +793,49 @@ function glossary_sort_entries ( $entry0, $entry1 ) { } } +function glossary_print_comment($course, $cm, $glossary, $entry, $comment) { + global $THEME, $CFG, $USER; + +// if ($entry->timemarked < $entry->modified) { + $colour = $THEME->cellheading2; +// } else { +// $colour = $THEME->cellheading; +// } + + $user = get_record("user", "id", $comment->userid); + $strby = get_string("writtenby","glossary"); + + echo "
"; + + echo "\n"; + + echo "\n"; + + echo ""; + + echo "
cellheading\" WIDTH=25% VALIGN=TOP align=right >"; + print_user_picture($user->id, $course->id, $user->picture); + echo "
$strby $user->firstname $user->lastname"; + echo "
(".get_string("lastedited").": ".userdate($comment->timemodified).")
"; + echo "
cellcontent\">"; + if ($comment) { + echo format_text($comment->comment, $comment->format); + } else { + echo "
"; + print_string("nocomment", "glossary"); + echo "
"; + } + + echo "

"; + if ( (time() - $comment->timemodified < $CFG->maxeditingtime and $USER->id == $comment->userid) or isteacher($course->id) ) { + echo "id&eid=$entry->id&cid=$comment->id&action=edit\">\"" "; + } + if ( $USER->id == $comment->userid or isteacher($course->id) ) { + echo "id&eid=$entry->id&cid=$comment->id&action=delete\">\"""; + } + echo "

\n"; + + echo "
"; +} + ?> diff --git a/mod/glossary/mod.html b/mod/glossary/mod.html index ca0238dff0..3da3f7ab59 100644 --- a/mod/glossary/mod.html +++ b/mod/glossary/mod.html @@ -93,6 +93,25 @@ if (!$mainglossary or $mainglossary->id == $form->instance ) { + +

:

+ + + +
diff --git a/mod/glossary/restorelib.php b/mod/glossary/restorelib.php index 085ed792ea..274fbb947f 100644 --- a/mod/glossary/restorelib.php +++ b/mod/glossary/restorelib.php @@ -49,6 +49,7 @@ $glossary->showspecial = backup_todb($info['MOD']['#']['SHOWSPECIAL']['0']['#']); $glossary->showalphabet = backup_todb($info['MOD']['#']['SHOWALPHABET']['0']['#']); $glossary->showall = backup_todb($info['MOD']['#']['SHOWALL']['0']['#']); + $glossary->allowcomments = backup_todb($info['MOD']['#']['ALLOWCOMMENTS']['0']['#']); $glossary->timecreated = backup_todb($info['MOD']['#']['TIMECREATED']['0']['#']); $glossary->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']); @@ -115,7 +116,6 @@ $entry->timemodified = backup_todb($ent_info['#']['TIMEMODIFIED']['0']['#']); $entry->teacherentry = backup_todb($ent_info['#']['TEACHERENTRY']['0']['#']); - //We have to recode the userid field $user = backup_getid($restore->backup_unique_code,"user",$entry->userid); if ($user) { diff --git a/mod/glossary/version.php b/mod/glossary/version.php index de38c6f75f..1f92564c72 100644 --- a/mod/glossary/version.php +++ b/mod/glossary/version.php @@ -5,7 +5,7 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2003101500; // The current module version (Date: YYYYMMDDXX) +$module->version = 2003101501; // The current module version (Date: YYYYMMDDXX) $module->cron = 0; // Period for cron to check this module (secs) $release = "0.5 development"; // User-friendly version number