/// Rename field format on table assignment to introformat
$table = new xmldb_table('assignment');
- $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'description');
+ $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
/// Launch rename field format
$dbman->rename_field($table, $field, 'introformat');
/// Rename field format on table choice to NEWNAMEGOESHERE
$table = new xmldb_table('choice');
- $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'text');
+ $field = new xmldb_field('format', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
/// Launch rename field format
$dbman->rename_field($table, $field, 'introformat');
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/data/db" VERSION="20080226" COMMENT="XMLDB file for Moodle mod/data"
+<XMLDB PATH="mod/data/db" VERSION="20090420" COMMENT="XMLDB file for Moodle mod/data"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<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="comments"/>
- <FIELD NAME="comments" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="timeavailablefrom"/>
+ <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
+ <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="comments"/>
+ <FIELD NAME="comments" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="timeavailablefrom"/>
<FIELD NAME="timeavailablefrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="comments" NEXT="timeavailableto"/>
<FIELD NAME="timeavailableto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeavailablefrom" NEXT="timeviewfrom"/>
<FIELD NAME="timeviewfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeavailableto" NEXT="timeviewto"/>
</KEYS>
</TABLE>
</TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
upgrade_mod_savepoint($result, 2008112700, 'data');
}
+ if ($result && $oldversion < 2009042000) {
+
+ /// Define field introformat to be added to data
+ $table = new xmldb_table('data');
+ $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+
+ /// Launch add field introformat
+ $dbman->add_field($table, $field);
+
+ /// data savepoint reached
+ upgrade_mod_savepoint($result, 2009042000, 'data');
+ }
+
return $result;
}
}
$currentsection = $data->section;
}
- $row = array ($printsection, $link, format_text($data->intro, FORMAT_MOODLE, $options), $numrecords, $numunapprovedrecords);
+ $row = array ($printsection, $link, format_text($data->intro, $data->introformat, $options), $numrecords, $numunapprovedrecords);
} else {
- $row = array ($link, format_text($data->intro, FORMAT_MOODLE, $options), $numrecords, $numunapprovedrecords);
+ $row = array ($link, format_text($data->intro, $data->introformat, $options), $numrecords, $numunapprovedrecords);
}
if ($rss) {
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2008112700;
-$module->requires = 2008080701; // Requires this Moodle version
+$module->version = 2009042000;
+$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 60;
?>
if ($data->intro and empty($page) and empty($record) and $mode != 'single') {
$options = new object();
$options->noclean = true;
- print_box(format_text($data->intro, FORMAT_MOODLE, $options), 'generalbox', 'intro');
+ print_box(format_text($data->intro, $data->introformat, $options), 'generalbox', 'intro');
}
/// Delete any requested records
fwrite ($bf,full_tag("MODTYPE",4,false,"feedback"));
fwrite ($bf,full_tag("VERSION",4,false,1)); //version 1 steht fuer die neue Version
fwrite ($bf,full_tag("NAME",4,false,$feedback->name));
- fwrite ($bf,full_tag("SUMMARY",4,false,$feedback->summary));
+ fwrite ($bf,full_tag("SUMMARY",4,false,$feedback->intro));
fwrite ($bf,full_tag("ANONYMOUS",4,false,$feedback->anonymous));
fwrite ($bf,full_tag("EMAILNOTIFICATION",4,false,$feedback->email_notification));
fwrite ($bf,full_tag("MULTIPLESUBMIT",4,false,$feedback->multiple_submit));
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/feedback/db" VERSION="20070101" COMMENT="XMLDB file for Moodle mod/feedback">
+<XMLDB PATH="mod/feedback/db" VERSION="20090420" COMMENT="XMLDB file for Moodle mod/feedback"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
<TABLES>
<TABLE NAME="feedback" COMMENT="all feedbacks" NEXT="feedback_template">
<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="summary"/>
- <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="anonymous"/>
- <FIELD NAME="anonymous" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="email_notification"/>
+ <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="introformat"/>
+ <FIELD NAME="introformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="anonymous"/>
+ <FIELD NAME="anonymous" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="email_notification"/>
<FIELD NAME="email_notification" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="anonymous" NEXT="multiple_submit"/>
<FIELD NAME="multiple_submit" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="email_notification" NEXT="autonumbering"/>
<FIELD NAME="autonumbering" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="multiple_submit" NEXT="site_after_submit"/>
</INDEXES>
</TABLE>
</TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
upgrade_mod_savepoint($result, 2009031301, 'feedback');
}
-
+
+ if ($result && $oldversion < 2009042000) {
+
+ /// Rename field summary on table feedback to intro
+ $table = new xmldb_table('feedback');
+ $field = new xmldb_field('summary', XMLDB_TYPE_TEXT, 'small', null, XMLDB_NOTNULL, null, null, null, null, 'name');
+
+ /// Launch rename field summary
+ $dbman->rename_field($table, $field, 'intro');
+
+ /// feedback savepoint reached
+ upgrade_mod_savepoint($result, 2009042000, 'feedback');
+ }
+
+ if ($result && $oldversion < 2009042001) {
+
+ /// Define field introformat to be added to feedback
+ $table = new xmldb_table('feedback');
+ $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+
+ /// Launch add field introformat
+ $dbman->add_field($table, $field);
+
+ /// feedback savepoint reached
+ upgrade_mod_savepoint($result, 2009042001, 'feedback');
+ }
+
return $result;
}
if($feedback->timeopen > 0) {
$event = NULL;
$event->name = get_string('start', 'feedback').' '.$feedback->name;
- $event->description = $feedback->summary;
+ $event->description = $feedback->intro;
$event->courseid = $feedback->course;
$event->groupid = 0;
$event->userid = 0;
if($feedback->timeclose > 0) {
$event = NULL;
$event->name = get_string('stop', 'feedback').' '.$feedback->name;
- $event->description = $feedback->summary;
+ $event->description = $feedback->intro;
$event->courseid = $feedback->course;
$event->groupid = 0;
$event->userid = 0;
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', null, 'required', null, 'client');
- $mform->addElement('htmleditor', 'summary', get_string("description", "feedback"), array('rows' => 20));
- $mform->setType('summary', PARAM_RAW);
- $mform->addRule('summary', null, 'required', null, 'client');
+ $mform->addElement('htmleditor', 'intro', get_string("description", "feedback"), array('rows' => 20));
+ $mform->setType('intro', PARAM_RAW);
+ $mform->addRule('intro', null, 'required', null, 'client');
//-------------------------------------------------------------------------------
$mform->addElement('header', 'timinghdr', get_string('timing', 'form'));
//Now, build the feedback record structure
$feedback->course = $restore->course_id;
$feedback->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
- $feedback->summary = backup_todb($info['MOD']['#']['SUMMARY']['0']['#']);
+ $feedback->intro = backup_todb($info['MOD']['#']['SUMMARY']['0']['#']);
$feedback->anonymous = backup_todb($info['MOD']['#']['ANONYMOUS']['0']['#']);
$feedback->email_notification = backup_todb($info['MOD']['#']['EMAILNOTIFICATION']['0']['#']);
$feedback->multiple_submit = backup_todb($info['MOD']['#']['MULTIPLESUBMIT']['0']['#']);
if($feedback->timeopen > 0) {
$event = NULL;
$event->name = get_string('start', 'feedback').' '.$feedback->name;
- $event->description = $feedback->summary;
+ $event->description = $feedback->intro;
$event->courseid = $feedback->course;
$event->groupid = 0;
$event->userid = 0;
if($feedback->timeclose > 0) {
$event = NULL;
$event->name = get_string('stop', 'feedback').' '.$feedback->name;
- $event->description = $feedback->summary;
+ $event->description = $feedback->intro;
$event->courseid = $feedback->course;
$event->groupid = 0;
$event->userid = 0;
*/
- $module->version = 2009031301; // The current module version (Date: YYYYMMDDXX)
- $module->requires = 2008072401; // Requires this Moodle version
+ $module->version = 2009042001; // The current module version (Date: YYYYMMDDXX)
+ $module->requires = 2009041700; // Requires this Moodle version
$feedback_version_intern = 1; //this version is used for restore older backups
$module->cron = 0; // Period for cron to check this module (secs)
// print_simple_box_start('center', '80%');
print_box_start('generalbox boxaligncenter boxwidthwide');
- echo format_text($feedback->summary);
+ $options = (object)array('noclean'=>true);
+ echo format_text($feedback->intro, $feedback->introformat, $options);
// print_simple_box_end();
print_box_end();