mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
dropping studentcanpost in glossary, MDL_7170
This commit is contained in:
parent
323edd4ba4
commit
baecd8cd72
8 changed files with 19 additions and 15 deletions
|
@ -63,7 +63,6 @@
|
|||
fwrite ($bf,full_tag("MODTYPE",4,false,"glossary"));
|
||||
fwrite ($bf,full_tag("NAME",4,false,$glossary->name));
|
||||
fwrite ($bf,full_tag("INTRO",4,false,$glossary->intro));
|
||||
fwrite ($bf,full_tag("STUDENTCANPOST",4,false,$glossary->studentcanpost));
|
||||
fwrite ($bf,full_tag("ALLOWDUPLICATEDENTRIES",4,false,$glossary->allowduplicatedentries));
|
||||
fwrite ($bf,full_tag("DISPLAYFORMAT",4,false,$glossary->displayformat));
|
||||
fwrite ($bf,full_tag("MAINGLOSSARY",4,false,$glossary->mainglossary));
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="mod/glossary/db" VERSION="20060811" COMMENT="XMLDB file for Moodle mod/glossary">
|
||||
<XMLDB PATH="mod/glossary/db" VERSION="20061114" COMMENT="XMLDB file for Moodle mod/glossary"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
<TABLES>
|
||||
<TABLE NAME="glossary" COMMENT="all glossaries" NEXT="glossary_entries">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
|
||||
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
|
||||
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="studentcanpost"/>
|
||||
<FIELD NAME="studentcanpost" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="allowduplicatedentries"/>
|
||||
<FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentcanpost" NEXT="displayformat"/>
|
||||
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="allowduplicatedentries"/>
|
||||
<FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="displayformat"/>
|
||||
<FIELD NAME="displayformat" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="dictionary" SEQUENCE="false" ENUM="false" PREVIOUS="allowduplicatedentries" NEXT="mainglossary"/>
|
||||
<FIELD NAME="mainglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayformat" NEXT="showspecial"/>
|
||||
<FIELD NAME="showspecial" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="mainglossary" NEXT="showalphabet"/>
|
||||
|
|
|
@ -32,6 +32,16 @@ function xmldb_glossary_upgrade($oldversion=0) {
|
|||
/// $result = result of "/lib/ddllib.php" function calls
|
||||
/// }
|
||||
|
||||
if ($result && $oldversion < 2006111400) {
|
||||
|
||||
/// Define field studentcanpost to be dropped from glossary
|
||||
$table = new XMLDBTable('glossary');
|
||||
$field = new XMLDBField('studentcanpost');
|
||||
|
||||
/// Launch drop field studentcanpost
|
||||
$result = $result && drop_field($table, $field);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
error("You can't delete other people's entries!");
|
||||
}
|
||||
$ineditperiod = ((time() - $entry->timecreated < $CFG->maxeditingtime) || $glossary->editalways);
|
||||
if ((!$ineditperiod or !$glossary->studentcanpost) and !$manageentries) {
|
||||
if (!$ineditperiod and !$manageentries) {
|
||||
error("You can't delete this. Time expired!");
|
||||
}
|
||||
|
||||
|
|
|
@ -108,11 +108,6 @@
|
|||
$glossary->timemodified = time();
|
||||
|
||||
// Setting the default values if no values were passed
|
||||
if ( isset($xmlglossary['STUDENTCANPOST'][0]['#']) ) {
|
||||
$glossary->studentcanpost = addslashes($xmlglossary['STUDENTCANPOST'][0]['#']);
|
||||
} else {
|
||||
$glossary->studentcanpost = $CFG->glossary_studentspost;
|
||||
}
|
||||
if ( isset($xmlglossary['ENTBYPAGE'][0]['#']) ) {
|
||||
$glossary->entbypage = addslashes($xmlglossary['ENTBYPAGE'][0]['#']);
|
||||
} else {
|
||||
|
|
|
@ -1690,7 +1690,6 @@ function glossary_generate_export_file($glossary, $hook = "", $hook = 0) {
|
|||
$co .= glossary_start_tag("INFO",1,true);
|
||||
$co .= glossary_full_tag("NAME",2,false,$glossary->name);
|
||||
$co .= glossary_full_tag("INTRO",2,false,$glossary->intro);
|
||||
$co .= glossary_full_tag("STUDENTCANPOST",2,false,$glossary->studentcanpost);
|
||||
$co .= glossary_full_tag("ALLOWDUPLICATEDENTRIES",2,false,$glossary->allowduplicatedentries);
|
||||
$co .= glossary_full_tag("DISPLAYFORMAT",2,false,$glossary->displayformat);
|
||||
$co .= glossary_full_tag("SHOWSPECIAL",2,false,$glossary->showspecial);
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
$glossary->course = $restore->course_id;
|
||||
$glossary->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
|
||||
$glossary->intro = backup_todb($info['MOD']['#']['INTRO']['0']['#']);
|
||||
$glossary->studentcanpost = backup_todb($info['MOD']['#']['STUDENTCANPOST']['0']['#']);
|
||||
$glossary->allowduplicatedentries = backup_todb($info['MOD']['#']['ALLOWDUPLICATEDENTRIES']['0']['#']);
|
||||
$glossary->displayformat = backup_todb($info['MOD']['#']['DISPLAYFORMAT']['0']['#']);
|
||||
$glossary->mainglossary = backup_todb($info['MOD']['#']['MAINGLOSSARY']['0']['#']);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2006091801;
|
||||
$module->version = 2006111400;
|
||||
$module->requires = 2006082600; // Requires this Moodle version
|
||||
$module->cron = 0; // Period for cron to check this module (secs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue