From: tjhunt Date: Thu, 13 Nov 2008 08:40:57 +0000 (+0000) Subject: cleanup: MDL-17083 Remove the old teacher, teachers, student and students columns... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9101efd3129184770b3e02dcc4235b0fd5b0cdd1;p=moodle.git cleanup: MDL-17083 Remove the old teacher, teachers, student and students columns from the course table. For something that has been deprecated for over two years, they were still used in a lot of places! --- diff --git a/admin/cliupgrade.php b/admin/cliupgrade.php index 2a819321c8..67cabe740a 100644 --- a/admin/cliupgrade.php +++ b/admin/cliupgrade.php @@ -1132,10 +1132,6 @@ if ( file_exists(dirname(dirname(__FILE__)) . '/config.php')) { $newsite->numsections = 0; $newsite->category = 0; $newsite->format = 'site'; // Only for this course - $newsite->teacher = get_string("defaultcourseteacher"); - $newsite->teachers = get_string("defaultcourseteachers"); - $newsite->student = get_string("defaultcoursestudent"); - $newsite->students = get_string("defaultcoursestudents"); $newsite->timemodified = time(); if ($newid = $DB->insert_record('course', $newsite)) { diff --git a/backup/backup_form.html b/backup/backup_form.html index 17bc085567..b94e15f150 100644 --- a/backup/backup_form.html +++ b/backup/backup_form.html @@ -332,7 +332,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) { echo ""; echo get_string("backuproleassignments"); echo ""; - $roles = $DB->get_records('role', null, 'sortorder'); + $roles = get_all_roles(); foreach ($roles as $role) { print_checkbox('backupassignments_' . $role->shortname, 1, true, strip_tags(format_string($role->name, true))); echo "
"; diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index f339b2ccce..00c5ba5013 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -471,7 +471,7 @@ function schedule_backup_course_configure($course,$starttime = 0) { $preferences->keep_name = $keep_name; //Roleasignments - $roles = $DB->get_records('role', null, 'sortorder'); + $roles = get_all_roles(); foreach ($roles as $role) { $preferences->backuproleassignments[$role->id] = $role; } diff --git a/backup/backuplib.php b/backup/backuplib.php index d82e8f5e70..4d97673565 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -680,10 +680,6 @@ fwrite ($bf,full_tag("FORMAT",3,false,$course->format)); fwrite ($bf,full_tag("SHOWGRADES",3,false,$course->showgrades)); fwrite ($bf,full_tag("NEWSITEMS",3,false,$course->newsitems)); - fwrite ($bf,full_tag("TEACHER",3,false,$course->teacher)); - fwrite ($bf,full_tag("TEACHERS",3,false,$course->teachers)); - fwrite ($bf,full_tag("STUDENT",3,false,$course->student)); - fwrite ($bf,full_tag("STUDENTS",3,false,$course->students)); fwrite ($bf,full_tag("GUEST",3,false,$course->guest)); fwrite ($bf,full_tag("STARTDATE",3,false,$course->startdate)); fwrite ($bf,full_tag("NUMSECTIONS",3,false,$course->numsections)); @@ -2686,7 +2682,7 @@ $preferences->backup_name = required_param('backup_name',PARAM_FILE); $preferences->backup_unique_code = required_param('backup_unique_code'); - $roles = $DB->get_records('role', null, 'sortorder'); + $roles = get_all_roles(); $preferences->backuproleassignments = array(); foreach ($roles as $role) { if (optional_param('backupassignments_' . $role->shortname, 0, PARAM_INT)) { diff --git a/backup/restore_form.html b/backup/restore_form.html index 11b998123d..7bedead232 100644 --- a/backup/restore_form.html +++ b/backup/restore_form.html @@ -602,7 +602,7 @@ $info = restore_read_xml_info($xml_file); // fix for MDL-9068, front page course is just a normal course $siterolesarray = get_assignable_roles(get_context_instance(CONTEXT_COURSE, $course->id), ROLENAME_ORIGINALANDSHORT); -$allroles = $DB->get_records('role'); +$allroles = get_all_roles(); echo (''); echo (''); diff --git a/backup/restorelib.php b/backup/restorelib.php index f254d56487..bba9419cfb 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -708,10 +708,6 @@ define('RESTORE_GROUPS_GROUPINGS', 3); $course->format = $course_header->course_format; $course->showgrades = $course_header->course_showgrades; $course->newsitems = $course_header->course_newsitems; - $course->teacher = $course_header->course_teacher; - $course->teachers = $course_header->course_teachers; - $course->student = $course_header->course_student; - $course->students = $course_header->course_students; $course->guest = $course_header->course_guest; $course->startdate = $course_header->course_startdate; $course->startdate += $restore->course_startdateoffset; @@ -5156,18 +5152,6 @@ define('RESTORE_GROUPS_GROUPINGS', 3); case "NEWSITEMS": $this->info->course_newsitems = $this->getContents(); break; - case "TEACHER": - $this->info->course_teacher = $this->getContents(); - break; - case "TEACHERS": - $this->info->course_teachers = $this->getContents(); - break; - case "STUDENT": - $this->info->course_student = $this->getContents(); - break; - case "STUDENTS": - $this->info->course_students = $this->getContents(); - break; case "GUEST": $this->info->course_guest = $this->getContents(); break; diff --git a/blocks/quiz_results/block_quiz_results.php b/blocks/quiz_results/block_quiz_results.php index 9a44636cc9..ae1d403b46 100644 --- a/blocks/quiz_results/block_quiz_results.php +++ b/blocks/quiz_results/block_quiz_results.php @@ -330,10 +330,10 @@ class block_quiz_results extends block_base { foreach($best as $userid => $gradeid) { switch($nameformat) { case B_QUIZRESULTS_NAME_FORMAT_ID: - $thisname = $course->student.' '.intval($users[$userid]->idnumber); + $thisname = get_string('user').' '.intval($users[$userid]->idnumber); break; case B_QUIZRESULTS_NAME_FORMAT_ANON: - $thisname = $course->student; + $thisname = get_string('user'); break; default: case B_QUIZRESULTS_NAME_FORMAT_FULL: @@ -371,10 +371,10 @@ class block_quiz_results extends block_base { foreach($worst as $userid => $gradeid) { switch($nameformat) { case B_QUIZRESULTS_NAME_FORMAT_ID: - $thisname = $course->student.' '.intval($users[$userid]->idnumber); + $thisname = get_string('user').' '.intval($users[$userid]->idnumber); break; case B_QUIZRESULTS_NAME_FORMAT_ANON: - $thisname = $course->student; + $thisname = get_string('user'); break; default: case B_QUIZRESULTS_NAME_FORMAT_FULL: diff --git a/course/category.php b/course/category.php index 9102eb2130..b30cb9fb73 100644 --- a/course/category.php +++ b/course/category.php @@ -269,7 +269,7 @@ unset($course); // To avoid unwanted language effects later $courses = get_courses_page($category->id, 'c.sortorder ASC', - 'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.teacher,c.guest,c.password', + 'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.guest,c.password', $totalcount, $page*$perpage, $perpage); $numcourses = count($courses); diff --git a/course/edit_form.php b/course/edit_form.php index 13a3bb9aea..93d412ba94 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -403,7 +403,7 @@ class course_edit_form extends moodleform { if ($roles = get_all_roles()) { if ($coursecontext) { - $roles = role_fix_names($roles, $coursecontext,ROLENAME_ALIAS_RAW); + $roles = role_fix_names($roles, $coursecontext, ROLENAME_ALIAS_RAW); } $assignableroles = get_roles_for_contextlevels(CONTEXT_COURSE); foreach ($roles as $role) { diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 6b43723dbd..9d91e5e1ea 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -58,11 +58,10 @@ $editing = $PAGE->user_is_editing(); if ($editing) { - $strstudents = moodle_strtolower($course->students); - $strtopichide = get_string('topichide', '', $strstudents); - $strtopicshow = get_string('topicshow', '', $strstudents); - $strmarkthistopic = get_string('markthistopic'); - $strmarkedthistopic = get_string('markedthistopic'); + $strtopichide = get_string('hidetopicfromothers'); + $strtopicshow = get_string('showtopicfromothers'); + $strmarkthistopic = get_string('markthistopic'); + $strmarkedthistopic = get_string('markedthistopic'); $strmoveup = get_string('moveup'); $strmovedown = get_string('movedown'); } diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 9bf6148e39..674ff48fbd 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -49,9 +49,8 @@ $editing = $PAGE->user_is_editing(); if ($editing) { - $strstudents = moodle_strtolower($course->students); - $strweekhide = get_string('weekhide', '', $strstudents); - $strweekshow = get_string('weekshow', '', $strstudents); + $strweekhide = get_string('hideweekfromothers'); + $strweekshow = get_string('showweekfromothers'); $strmoveup = get_string('moveup'); $strmovedown = get_string('movedown'); } diff --git a/course/pending.php b/course/pending.php index fe28ed5f12..15f010fa7d 100644 --- a/course/pending.php +++ b/course/pending.php @@ -27,10 +27,6 @@ unset($course->id); $teacherid = $course->requester; unset($course->requester); - $course->teacher = get_string("defaultcourseteacher"); - $course->teachers = get_string("defaultcourseteachers"); - $course->student = get_string("defaultcoursestudent"); - $course->students = get_string("defaultcoursestudents"); if (!empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor != 'none' && !empty($CFG->restrictbydefault)) { $course->restrictmodules = 1; } @@ -52,8 +48,7 @@ $user = $DB->get_record('user', array('id'=>$teacherid)); $a->name = $course->fullname; $a->url = $CFG->wwwroot.'/course/view.php?id='.$courseid; - $a->teacher = $course->teacher; - + $eventdata = new object(); $eventdata->modulename = 'moodle'; $eventdata->userfrom = $USER; diff --git a/enrol/database/enrol.php b/enrol/database/enrol.php index 8af7b99697..5812b4a88d 100644 --- a/enrol/database/enrol.php +++ b/enrol/database/enrol.php @@ -26,7 +26,7 @@ function setup_enrolments(&$user) { // we execute the below code for every role type. Otherwise we just // execute it once with null (hence the dummy array). $roles = !empty($CFG->enrol_db_remoterolefield) && !empty($CFG->enrol_db_localrolefield) - ? $DB->get_records('role') + ? get_all_roles() : array(null); //error_log('[ENROL_DB] found ' . count($roles) . ' roles:'); @@ -575,10 +575,6 @@ function create_course ($course,$skip_fix_course_sortorder=0){ 'showgrades' => 1, 'groupmode' => 0, 'groupmodeforce' => 0, - 'student' => $site->student, - 'students' => $site->students, - 'teacher' => $site->teacher, - 'teachers' => $site->teachers, ); } // overlay template diff --git a/enrol/database/enrol_database_sync.php b/enrol/database/enrol_database_sync.php index d9b5d0ade2..f8efcf0314 100644 --- a/enrol/database/enrol_database_sync.php +++ b/enrol/database/enrol_database_sync.php @@ -27,7 +27,7 @@ // role and update it. Otherwise, just got through once (with no role // specified). $roles = !empty($CFG->enrol_db_remoterolefield) && !empty($CFG->enrol_db_localrolefield) - ? $DB->get_records('role') + ? get_all_roles() : array(null); foreach ($roles as $role) { diff --git a/enrol/imsenterprise/enrol.php b/enrol/imsenterprise/enrol.php index 7f3c3cb805..325814fa87 100644 --- a/enrol/imsenterprise/enrol.php +++ b/enrol/imsenterprise/enrol.php @@ -508,17 +508,6 @@ function process_group_tag($tagcontents){ $course->visible = 0; // Insert default names for teachers/students, from the current language $site = get_site(); - if (current_language() == $CFG->lang) { - $course->teacher = $site->teacher; - $course->teachers = $site->teachers; - $course->student = $site->student; - $course->students = $site->students; - } else { - $course->teacher = get_string("defaultcourseteacher"); - $course->teachers = get_string("defaultcourseteachers"); - $course->student = get_string("defaultcoursestudent"); - $course->students = get_string("defaultcoursestudents"); - } // Handle course categorisation (taken from the group.org.orgunit field if present) if(strlen($group->category)>0){ diff --git a/enrol/ldap/config.html b/enrol/ldap/config.html index 832338f8a9..e8444beb5a 100755 --- a/enrol/ldap/config.html +++ b/enrol/ldap/config.html @@ -62,7 +62,7 @@ if (!isset ($frm->enrol_ldap_course_summary_editlock)) { } // Roles -$roles = $DB->get_records('role'); +$roles = get_all_roles(); foreach($roles as $role) { if (!isset($frm->{'enrol_ldap_contexts_role'.$role->id})) { $frm->{'enrol_ldap_contexts_role'.$role->id} = ''; diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php index bdab28a084..c0adcb46f8 100755 --- a/enrol/ldap/enrol.php +++ b/enrol/ldap/enrol.php @@ -27,7 +27,7 @@ function setup_enrolments(&$user) { // we are connected OK, continue... // Get all the possible roles - $roles = $DB->get_records('role'); + $roles = get_all_roles(); // Make sure the config settings have been upgraded. $this->check_legacy_config(); @@ -397,7 +397,7 @@ function process_config($config) { } set_config('enrol_ldap_autocreate', $config->enrol_ldap_autocreate); - $roles = $DB->get_records('role'); + $roles = get_all_roles(); foreach ($roles as $role) { if (!isset($config->{'enrol_ldap_contexts_role'.$role->id})) { $config->{'enrol_ldap_contexts_role'.$role->id} = ''; @@ -557,10 +557,6 @@ function create_course ($course_ext,$skip_fix_course_sortorder=0){ } else { // set defaults $course = new object(); - $course->student = get_string('defaultcoursestudent'); - $course->students = get_string('defaultcoursestudents'); - $course->teacher = get_string('defaultcourseteacher'); - $course->teachers = get_string('defaultcourseteachers'); $course->format = 'topics'; } diff --git a/enrol/ldap/enrol_ldap_sync.php b/enrol/ldap/enrol_ldap_sync.php index 7a42b0cd14..4d516941c7 100755 --- a/enrol/ldap/enrol_ldap_sync.php +++ b/enrol/ldap/enrol_ldap_sync.php @@ -22,7 +22,7 @@ $enrol->check_legacy_config(); - $roles = $DB->get_records('role'); + $roles = get_all_roles(); foreach ($roles as $role) { $enrol->sync_enrolments($role->shortname, true); } diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index 7385cb06f7..33729f4cb1 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -442,7 +442,7 @@ function print_enrolmentkeyfrom($course) { if (!empty($teacher)) { $teachername = "id&course=".SITEID."\">".fullname($teacher)."."; } else { - $teachername = strtolower( get_string('defaultcourseteacher') ); //get_string('yourteacher', '', $course->teacher); + $teachername = strtolower( get_string('defaultcourseteacher') ); } // guest user has a slightly different message diff --git a/enrol/paypal/return.php b/enrol/paypal/return.php index 8d9ac6ff7e..7d6724aef5 100644 --- a/enrol/paypal/return.php +++ b/enrol/paypal/return.php @@ -30,7 +30,7 @@ } else { /// Somehow they aren't enrolled yet! :-( print_header(); - notice(get_string('paymentsorry', '', $course), $destination); + notice(get_string('paymentsorry', '', get_string('defaultcourseteacher')), $destination); } ?> diff --git a/lang/en_utf8/glossary.php b/lang/en_utf8/glossary.php index b86bd39d52..8d136af9a1 100644 --- a/lang/en_utf8/glossary.php +++ b/lang/en_utf8/glossary.php @@ -181,6 +181,7 @@ $string['rating'] = 'Rating'; $string['ratingeveryone'] = 'Everyone can rate entries'; $string['ratingno'] = 'No ratings'; $string['ratingonlyteachers'] = 'Only $a can rate entries'; +$string['ratingonlywithpermissions'] = 'Only people with permission to rate entries'; $string['ratings'] = 'Ratings'; $string['ratingssaved'] = 'Ratings saved'; $string['ratingsuse'] = 'Use ratings'; diff --git a/lang/en_utf8/lesson.php b/lang/en_utf8/lesson.php index c5644fa44b..0f7adf127a 100644 --- a/lang/en_utf8/lesson.php +++ b/lang/en_utf8/lesson.php @@ -130,6 +130,7 @@ $string['eolstudentoutoftime'] = 'Attention: You ran out of time for this lesso $string['eolstudentoutoftimenoanswers'] = 'You did not answer any questions. You have received a 0 for this lesson.'; $string['essay'] = 'Essay'; $string['essayemailmessage'] = '

Essay prompt:

$a->question

Your response:

$a->response

$a->teacher\'s comments:

$a->comment

You have received $a->earned out of $a->outof for this essay question.

Your grade for the lesson has been changed to $a->newgrade%.

'; +$string['essayemailmessage2'] = '

Essay prompt:

$a->question

Your response:

$a->response

Grader\'s comments:

$a->comment

You have received $a->earned out of $a->outof for this essay question.

Your grade for the lesson has been changed to $a->newgrade%.

'; $string['essayemailsubject'] = 'Your grade for $a question'; $string['essays'] = 'Essays'; $string['essayscore'] = 'Essay score'; @@ -174,6 +175,7 @@ $string['lessondefault'] = 'Use this lesson\'s settings as defaults'; $string['lessonformating'] = 'Lesson formatting'; $string['lessonmenu'] = 'Lesson menu'; $string['lessonnotready'] = 'This lesson is not ready to be taken. Please contact your $a.'; +$string['lessonnotready2'] = 'This lesson is not ready to be taken.'; $string['lessonopen'] = 'This lesson will be open on $a.'; $string['lessonopens'] = 'Lesson opens'; $string['lessonpagelinkingbroken'] = 'First page not found. Lesson page linking must be broken. Please contact an admin.'; @@ -265,6 +267,7 @@ $string['previewlesson'] = 'Preview $a'; $string['previouspage'] = 'Previous page'; $string['progressbar'] = 'Progress Bar'; $string['progressbarteacherwarning'] = 'Progress Bar does not display for $a'; +$string['progressbarteacherwarning2'] = 'You will not see the progress bar because you can edit this lesson'; $string['deleteallattempts'] = 'Delete all lesson attempts'; $string['qtype'] = 'Page type'; $string['question'] = 'Question'; @@ -279,6 +282,7 @@ $string['redisplaypage'] = 'Redisplay page'; $string['report'] = 'Report'; $string['reports'] = 'Reports'; $string['response'] = 'Response'; +$string['retakesallowed'] = 'Re-takes allowed'; $string['returnto'] = 'Return to $a'; $string['returntocourse'] = 'Return to the course'; $string['review'] = 'Review'; @@ -330,6 +334,7 @@ $string['usepassword'] = 'Password protected lesson'; $string['viewgrades'] = 'View grades'; $string['viewhighscores'] = 'View high scores list'; $string['viewreports'] = 'View $a->attempts completed $a->student attempts'; +$string['viewreports2'] = 'View $a completed attempts'; $string['welldone'] = 'Well done!'; $string['whatdofirst'] = 'What would you like to do first?'; $string['wronganswerjump'] = 'Wrong answer jump'; diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index c6a9dc42c4..f2c21cba96 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -265,6 +265,7 @@ $string['counteditems'] = '$a->count $a->items'; $string['country'] = 'Country'; $string['course'] = 'Course'; $string['courseapprovedemail'] = 'Your requested course, $a->name, has been approved and you have been made a $a->teacher. To access your new course, go to $a->url'; +$string['courseapprovedemail2'] = 'Your requested course, $a->name, has been approved. To access your new course, go to $a->url'; $string['courseapprovedfailed'] = 'Failed to save the course as approved!'; $string['courseapprovedsubject'] = 'Your course has been approved!'; $string['courseavailable'] = 'This course is available to students'; @@ -781,6 +782,8 @@ $string['hideadvancedsettings'] = 'Hide advanced settings'; $string['hidepicture'] = 'Hide picture'; $string['hidesection'] = 'Hide section $a'; $string['hidesettings'] = 'Hide settings'; +$string['hidetopicfromothers'] = 'Hide topic from others'; +$string['hideweekfromothers'] = 'Hide week from others'; $string['hits'] = 'Hits'; $string['hitsoncourse'] = 'Hits on $a->coursename by $a->username'; $string['hitsoncoursetoday'] = 'Today\'s hits on $a->coursename by $a->username'; @@ -1383,6 +1386,8 @@ $string['showrecent'] = 'Show recent activity'; $string['showreports'] = 'Show activity reports'; $string['showsettings'] = 'Show settings'; $string['showtheselogs'] = 'Show these logs'; +$string['showtopicfromothers'] = 'Show topic from others'; +$string['showweekfromothers'] = 'Show week from others'; $string['since'] = 'Since'; $string['sincelast'] = 'since last login'; $string['site'] = 'Site'; @@ -1687,6 +1692,7 @@ $string['youneedtoenrol'] = 'To perform that action you need to enrol in this co $string['yourlastlogin'] = 'Your last login was'; $string['yourself'] = 'yourself'; $string['yourteacher'] = 'your $a'; +$string['yourwordforx'] = 'Your word for \'$a\''; $string['zippingbackup'] = 'Zipping backup'; $string['authenticationplugins'] = 'Authentication Plugins'; diff --git a/lang/en_utf8/resource.php b/lang/en_utf8/resource.php index 1120242fbf..50cffef0de 100644 --- a/lang/en_utf8/resource.php +++ b/lang/en_utf8/resource.php @@ -13,6 +13,7 @@ $string['cannotupdate'] = 'Cannot update resource.'; $string['choose'] = 'Choose'; $string['chooseafile'] = 'Choose or upload a file'; $string['chooseparameter'] = 'Choose parameter'; +$string['chooseaparameter'] = 'Choose a parameter...'; $string['clicktoopen'] = 'To open this document, click on this link: '; $string['configallowlocalfiles'] = 'When creating a new file resource, allow links to files on a local file system such as a CD drive or a hard drive. This may be useful in a classroom where all students have access to a common network drive or where files on a CD need to be accessed. Use of this feature may require changes to your browser\'s security settings.'; $string['configautofilerenamesettings'] = 'Automatically update references to files and directories when renamed in file manager.'; diff --git a/lib/adminlib.php b/lib/adminlib.php index 9326535e9c..95444c0914 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -4141,7 +4141,7 @@ class admin_setting_pickroles extends admin_setting_configmulticheckbox { if (is_array($this->choices)) { return true; } - if ($roles = $DB->get_records('role')) { + if ($roles = get_all_roles()) { $this->choices = array(); foreach($roles as $role) { $this->choices[$role->id] = format_string($role->name); diff --git a/lib/datalib.php b/lib/datalib.php index 0e1d0599ca..7f722197fd 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -538,7 +538,6 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a $basefields = array('id', 'category', 'sortorder', 'shortname', 'fullname', 'idnumber', - 'teacher', 'teachers', 'student', 'students', 'guest', 'startdate', 'visible', 'newsitems', 'cost', 'enrol', 'groupmode', 'groupmodeforce'); @@ -748,7 +747,6 @@ function get_my_courses($userid, $sort='visible DESC,sortorder ASC', $fields=NUL $basefields = array('id', 'category', 'sortorder', 'shortname', 'fullname', 'idnumber', - 'teacher', 'teachers', 'student', 'students', 'guest', 'startdate', 'visible', 'newsitems', 'cost', 'enrol', 'groupmode', 'groupmodeforce'); diff --git a/lib/db/install.xml b/lib/db/install.xml index ba48f95967..817c6be416 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -40,12 +40,8 @@ - - - - - - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 720f784b5a..7821efb7cf 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -992,6 +992,38 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint($result, 2008110603); } + /// Drop the deprecated teacher, teachers, student and students columns from the course table. + if ($result && $oldversion < 2008111200) { + $table = new xmldb_table('course'); + + /// Conditionally launch drop field teacher + $field = new xmldb_field('teacher'); + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + /// Conditionally launch drop field teacher + $field = new xmldb_field('teachers'); + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + /// Conditionally launch drop field teacher + $field = new xmldb_field('student'); + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + /// Conditionally launch drop field teacher + $field = new xmldb_field('students'); + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + /// Main savepoint reached + upgrade_main_savepoint($result, 2008111200); + } + return $result; } diff --git a/lib/weblib.php b/lib/weblib.php index a29bdde3ba..302acd0135 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4662,7 +4662,7 @@ function print_user($user, $course, $messageselect=false, $return=false) { $output .= '
'.get_string('sourcerole').''.get_string('targetrole').'
'; $output .= '
'.fullname($user, has_capability('moodle/site:viewfullnames', $context)).'
'; $output .= '
'; - if (!empty($user->role) and ($user->role <> $course->teacher)) { + if (!empty($user->role)) { $output .= $string->role .': '. $user->role .'
'; } if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index f1b1bd5cea..9c34a679b6 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -243,7 +243,7 @@ class assignment_base { } /// Print the feedback - print_heading(get_string('feedbackfromteacher', 'assignment', $this->course->teacher)); // TODO: fix teacher string + print_heading(get_string('feedbackfromteacher', 'assignment', fullname($teacher))); echo ''; @@ -1089,8 +1089,8 @@ class assignment_base { get_string('fullname'), get_string('grade'), get_string('comment', 'assignment'), - get_string('lastmodified').' ('.$course->student.')', - get_string('lastmodified').' ('.$course->teacher.')', + get_string('lastmodified').' ('.get_string('submission', 'assignment').')', + get_string('lastmodified').' ('.get_string('grade').')', get_string('status'), get_string('finalgrade', 'grades')); if ($uses_outcomes) { diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index f11bccadca..ea3d7ebeb9 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -82,7 +82,7 @@ class assignment_upload extends assignment_base { if (empty($submission->timemarked)) { /// Nothing to show, so print nothing if ($this->count_responsefiles($USER->id)) { - print_heading(get_string('responsefiles', 'assignment', $this->course->teacher), '', 3); + print_heading(get_string('responsefiles', 'assignment'), '', 3); $responsefiles = $this->print_responsefiles($USER->id, true); print_simple_box($responsefiles, 'center'); } diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php index 69a95502ba..5c6509264a 100644 --- a/mod/glossary/mod_form.php +++ b/mod/glossary/mod_form.php @@ -127,7 +127,7 @@ class mod_glossary_mod_form extends moodleform_mod { $mform->addElement('checkbox', 'userating', get_string('allowratings', 'glossary') , get_string('ratingsuse', 'glossary')); $options=array(); - $options[2] = get_string('ratingonlyteachers', 'glossary', moodle_strtolower($COURSE->teachers)); + $options[2] = get_string('ratingonlywithpermissions', 'glossary'); $options[1] = get_string('ratingeveryone', 'glossary'); $mform->addElement('select', 'assessed', get_string('users'), $options); $mform->disabledIf('assessed', 'userating'); diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index 19ac3acf9c..12f6db8ba3 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -205,16 +205,14 @@ $a->earned = $essayinfo->score; $a->outof = 1; } - + // Set rest of the message values $a->question = format_text($pages[$attempt->pageid]->contents, FORMAT_MOODLE, $options); $a->response = s($essayinfo->answer); - $a->teacher = $course->teacher; $a->comment = s($essayinfo->response); - - + // Fetch message HTML and plain text formats - $message = get_string('essayemailmessage', 'lesson', $a); + $message = get_string('essayemailmessage2', 'lesson', $a); $plaintxt = format_text_email($message, FORMAT_HTML); // Subject @@ -265,7 +263,7 @@ // Setup table $table = new stdClass; - $table->head = array($course->students, get_string('essays', 'lesson'), get_string('email', 'lesson')); + $table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('email', 'lesson')); $table->align = array('left', 'left', 'left'); $table->wrap = array('nowrap', 'nowrap', 'nowrap'); diff --git a/mod/lesson/highscores.php b/mod/lesson/highscores.php index 25ff04d325..abce2e2404 100644 --- a/mod/lesson/highscores.php +++ b/mod/lesson/highscores.php @@ -174,7 +174,7 @@ $table->cellspacing = '10px'; $table->size = array('*', '*', '*'); - $table->head = array(get_string("rank", "lesson"), $course->students, get_string("scores", "lesson")); + $table->head = array(get_string("rank", "lesson"), get_string('name'), get_string("scores", "lesson")); $printed = 0; while (true) { diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 6cb9da60de..5dae74c0d2 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1614,7 +1614,7 @@ function lesson_print_progress_bar($lesson, $course) { // catch teachers if (has_capability('mod/lesson:manage', $context)) { - notify(get_string('progressbarteacherwarning', 'lesson', $course->teachers)); + notify(get_string('progressbarteacherwarning2', 'lesson')); return false; } if (!isset($USER->modattempts[$lesson->id])) { diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index 632719b408..21318f1733 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -74,8 +74,8 @@ class mod_lesson_mod_form extends moodleform_mod { $mform->setDefault('grade', 0); $mform->setHelpButton('grade', array('grade', get_string('maximumgrade'), 'lesson')); - $mform->addElement('selectyesno', 'retake', get_string('canretake', 'lesson', $COURSE->student)); - $mform->setHelpButton('retake', array('retake', get_string('canretake', 'lesson', $COURSE->student), 'lesson')); + $mform->addElement('selectyesno', 'retake', get_string('retakesallowed', 'lesson')); + $mform->setHelpButton('retake', array('retake', get_string('retakesallowed', 'lesson'), 'lesson')); $mform->setDefault('retake', 0); $options = array(); diff --git a/mod/lesson/report.php b/mod/lesson/report.php index f7eae99f59..228767eb38 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -188,7 +188,7 @@ $table = new stdClass; // set up the table object - $table->head = array(get_string('studentname', 'lesson', $course->student), get_string('attempts', 'lesson'), get_string('highscore', 'lesson')); + $table->head = array(get_string('name'), get_string('attempts', 'lesson'), get_string('highscore', 'lesson')); $table->align = array("center", "left", "left"); $table->wrap = array("nowrap", "nowrap", "nowrap"); $table->width = "90%"; @@ -863,7 +863,7 @@ $gradeinfo = lesson_grade($lesson, $try, $user->id); - $table->data[] = array($course->student.':', print_user_picture($user->id, $course->id, $user->picture, 0, true).fullname($user, true)); + $table->data[] = array(get_string('name').':', print_user_picture($user->id, $course->id, $user->picture, 0, true).fullname($user, true)); $table->data[] = array(get_string("timetaken", "lesson").":", format_time($timetotake)); $table->data[] = array(get_string("completed", "lesson").":", userdate($completed)); $table->data[] = array(get_string('rawgrade', 'lesson').':', $gradeinfo->earned.'/'.$gradeinfo->total); diff --git a/mod/lesson/tabs.php b/mod/lesson/tabs.php index c822231096..8186247412 100644 --- a/mod/lesson/tabs.php +++ b/mod/lesson/tabs.php @@ -28,13 +28,11 @@ $tabs = $row = $inactive = $activated = array(); /// user attempt count for reports link hover (completed attempts - much faster) - $counts = new stdClass; - $counts->attempts = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id)); - $counts->student = $course->student; + $attemptscount = $DB->count_records('lesson_grades', array('lessonid'=>$lesson->id)); $row[] = new tabobject('view', "$CFG->wwwroot/mod/lesson/view.php?id=$cm->id", get_string('preview', 'lesson'), get_string('previewlesson', 'lesson', format_string($lesson->name))); $row[] = new tabobject('edit', "$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id", get_string('edit', 'lesson'), get_string('edit', 'moodle', format_string($lesson->name))); - $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports', 'lesson', $counts)); + $row[] = new tabobject('reports', "$CFG->wwwroot/mod/lesson/report.php?id=$cm->id", get_string('reports', 'lesson'), get_string('viewreports2', 'lesson', $attemptscount)); if (has_capability('mod/lesson:edit', $context)) { $row[] = new tabobject('essay', "$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id", get_string('manualgrading', 'lesson')); } diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 1b7802871f..e845a07f5c 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -178,7 +178,7 @@ // make sure there are pages to view if (!$DB->get_field('lesson_pages', 'id', array('lessonid' => $lesson->id, 'prevpageid' => 0))) { if (!has_capability('mod/lesson:manage', $context)) { - lesson_set_message(get_string('lessonnotready', 'lesson', $course->teacher)); // a nice message to the student + lesson_set_message(get_string('lessonnotready2', 'lesson')); // a nice message to the student } else { if (!$DB->count_records('lesson_pages', array('lessonid'=>$lesson->id))) { redirect("$CFG->wwwroot/mod/lesson/edit.php?id=$cm->id"); // no pages - redirect to add pages diff --git a/mod/quiz/report/overview/overviewgraph.php b/mod/quiz/report/overview/overviewgraph.php index 58809e1a3c..6989d35b90 100644 --- a/mod/quiz/report/overview/overviewgraph.php +++ b/mod/quiz/report/overview/overviewgraph.php @@ -31,7 +31,7 @@ require_capability('mod/quiz:viewreports', $modcontext); $line = new graph(800,600); $line->parameter['title'] = ''; -$line->parameter['y_label_left'] = $course->students; +$line->parameter['y_label_left'] = get_string('participants'); $line->parameter['x_label'] = get_string('grade'); $line->parameter['y_label_angle'] = 90; $line->parameter['x_label_angle'] = 0; diff --git a/mod/quiz/report/overview/overviewsettings_form.php b/mod/quiz/report/overview/overviewsettings_form.php index 77ab6c35be..ea778f4fb3 100644 --- a/mod/quiz/report/overview/overviewsettings_form.php +++ b/mod/quiz/report/overview/overviewsettings_form.php @@ -9,10 +9,10 @@ class mod_quiz_report_overview_settings extends moodleform { $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview')); if (!$this->_customdata['currentgroup']){ - $studentsstring = "'".$COURSE->students."'"; + $studentsstring = get_string('participants'); } else { $a = new object(); - $a->coursestudent = $COURSE->students; + $a->coursestudent = get_string('participants'); $a->groupname = groups_get_group_name($this->_customdata['currentgroup']); if (20 < strlen($a->groupname)){ $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a); diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index 242c9868f0..3f2ebe002c 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -283,7 +283,7 @@ class quiz_overview_report extends quiz_default_report { if ($currentgroup){ $a= new object(); $a->groupname = groups_get_group_name($currentgroup); - $a->coursestudents = $COURSE->students; + $a->coursestudents = get_string('participants'); $a->countregradeneeded = $countregradeneeded; $regradealldrydolabel = get_string('regradealldrydogroup', 'quiz_overview', $a); $regradealldrylabel = get_string('regradealldrygroup', 'quiz_overview', $a); diff --git a/mod/quiz/report/responses/responsessettings_form.php b/mod/quiz/report/responses/responsessettings_form.php index 48f0a144cf..9f28185451 100644 --- a/mod/quiz/report/responses/responsessettings_form.php +++ b/mod/quiz/report/responses/responsessettings_form.php @@ -9,10 +9,10 @@ class mod_quiz_report_responses_settings extends moodleform { $mform->addElement('header', 'preferencespage', get_string('preferencespage', 'quiz_overview')); if (!$this->_customdata['currentgroup']){ - $studentsstring = "'".$COURSE->students."'"; + $studentsstring = get_string('participants'); } else { $a = new object(); - $a->coursestudent = $COURSE->students; + $a->coursestudent = get_string('participants'); $a->groupname = groups_get_group_name($this->_customdata['currentgroup']); if (20 < strlen($a->groupname)){ $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a); diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 345dcb1ca6..34f71268a7 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -28,9 +28,7 @@ class resource_file extends resource_base { $littlecfg->wwwroot = $CFG->wwwroot; - $this->parameters = array( - 'label2' => array('langstr' => "", - 'value' =>'/optgroup'), + $courseparameters = array( 'label3' => array('langstr' => get_string('course'), 'value' => 'optgroup'), @@ -46,17 +44,19 @@ class resource_file extends resource_base { 'value' => $this->course->summary), 'courseformat' => array('langstr' => get_string('format'), 'value' => $this->course->format), - 'courseteacher' => array('langstr' => get_string('wordforteacher'), - 'value' => $this->course->teacher), - 'courseteachers' => array('langstr' => get_string('wordforteachers'), - 'value' => $this->course->teachers), - 'coursestudent' => array('langstr' => get_string('wordforstudent'), - 'value' => $this->course->student), - 'coursestudents' => array('langstr' => get_string('wordforstudents'), - 'value' => $this->course->students), - - 'label4' => array('langstr' => "", - 'value' =>'/optgroup'), + ); + + $roles = get_all_roles(); + $coursecontext = get_context_instance(CONTEXT_COURSE, $this->course->id); + $roles = role_fix_names($roles, $coursecontext, ROLENAME_ALIAS); + foreach ($roles as $role) { + $courseparameters['course' . $role->shortname] = array( + 'langstr' => get_string('yourwordforx', '', $role->name), + 'value' => $role->localname); + } + $courseparameters['label4'] = array('langstr' => '', 'value' =>'/optgroup'); + + $miscparameters = array( 'label5' => array('langstr' => get_string('miscellaneous'), 'value' => 'optgroup'), @@ -72,13 +72,12 @@ class resource_file extends resource_base { 'value' => $this->set_encrypted_parameter()), 'label6' => array('langstr' => "", - 'value' =>'/optgroup') + 'value' =>'/optgroup'), ); + $userparameters = array(); if (!empty($USER->id)) { - $userparameters = array( - 'label1' => array('langstr' => get_string('user'), 'value' => 'optgroup'), @@ -113,11 +112,13 @@ class resource_file extends resource_base { 'usertimezone' => array('langstr' => get_string('timezone'), 'value' => get_user_timezone_offset()), 'userurl' => array('langstr' => get_string('webpage'), - 'value' => $USER->url) - ); + 'value' => $USER->url), - $this->parameters = $userparameters + $this->parameters; + 'label2' => array('langstr' => "", + 'value' =>'/optgroup'), + ); } + $this->parameters = array_merge($userparameters, $courseparameters, $miscparameters); } function add_instance($resource) { @@ -268,6 +269,14 @@ class resource_file extends resource_base { $parray = explode(',', $resource->alltext); foreach ($parray as $fieldstring) { $field = explode('=', $fieldstring); + // Backwards compatibility. This is not ideal, but we no longer + // store plural role names, so the best we can do is send the + // singular instead. + if ($field[0] == 'courseteachers') { + $field[0] = 'courseeditingteacher'; + } else if ($field[0] == 'coursestudents') { + $field[0] = 'coursestudent'; + } $querys[] = urlencode($field[1]).'='.urlencode($this->parameters[$field[0]]['value']); } if ($isteamspeak) { @@ -800,27 +809,27 @@ class resource_file extends resource_base { $mform->addElement('header', 'parameters', get_string('parameters', 'resource')); - $options = array(); - $options['-'] = get_string('chooseparameter', 'resource').'...'; - $optgroup = ''; + $optiongroups = array(); + $optiongroups[''] = array('-' => get_string('chooseaparameter', 'resource')); + $addto = &$optiongroups['']; foreach ($this->parameters as $pname=>$param) { if ($param['value']=='/optgroup') { - $optgroup = ''; continue; } if ($param['value']=='optgroup') { - $optgroup = $param['langstr']; + $optiongroups[$param['langstr']] = array(); + $addto = &$optiongroups[$param['langstr']]; continue; } - $options[$pname] = $optgroup.' - '.$param['langstr']; + $addto[$pname] = $param['langstr']; } for ($i = 0; $i < $this->maxparameters; $i++) { $parametername = "parameter$i"; $parsename = "parse$i"; $group = array(); - $group[] =& $mform->createElement('text', $parsename, '', array('size'=>'12'));//TODO: accessiblity - $group[] =& $mform->createElement('select', $parametername, '', $options);//TODO: accessiblity + $group[] =& $mform->createElement('text', $parsename, '', array('size'=>'12')); + $group[] =& $mform->createElement('selectgroups', $parametername, '', $optiongroups); $mform->addGroup($group, 'pargroup'.$i, get_string('variablename', 'resource').'='.get_string('parameter', 'resource'), ' ', false); $mform->setAdvanced('pargroup'.$i); diff --git a/mod/resource/type/repository/resource.class.php b/mod/resource/type/repository/resource.class.php index 6528da85f5..04ef457540 100644 --- a/mod/resource/type/repository/resource.class.php +++ b/mod/resource/type/repository/resource.class.php @@ -35,8 +35,6 @@ function set_parameters() { $site = get_site(); $this->parameters = array( - 'label2' => array('langstr' => "", - 'value' =>'/optgroup'), 'label3' => array('langstr' => get_string('course'), 'value' => 'optgroup'), @@ -52,14 +50,6 @@ function set_parameters() { 'value' => $this->course->summary), 'courseformat' => array('langstr' => get_string('format'), 'value' => $this->course->format), - 'courseteacher' => array('langstr' => get_string('wordforteacher'), - 'value' => $this->course->teacher), - 'courseteachers' => array('langstr' => get_string('wordforteachers'), - 'value' => $this->course->teachers), - 'coursestudent' => array('langstr' => get_string('wordforstudent'), - 'value' => $this->course->student), - 'coursestudents' => array('langstr' => get_string('wordforstudents'), - 'value' => $this->course->students), 'label4' => array('langstr' => "", 'value' =>'/optgroup'), @@ -78,7 +68,7 @@ function set_parameters() { 'value' => $this->set_encrypted_parameter()), 'label6' => array('langstr' => "", - 'value' =>'/optgroup') + 'value' =>'/optgroup'), ); if (!empty($USER->id)) { @@ -119,8 +109,10 @@ function set_parameters() { 'usertimezone' => array('langstr' => get_string('timezone'), 'value' => get_user_timezone_offset()), 'userurl' => array('langstr' => get_string('webpage'), - 'value' => $USER->url) - ); + 'value' => $USER->url), + 'label2' => array('langstr' => "", + 'value' =>'/optgroup'), + ); $this->parameters = $userparameters + $this->parameters; } diff --git a/mod/survey/graph.php b/mod/survey/graph.php index fc159cf7a8..698e47b4f2 100644 --- a/mod/survey/graph.php +++ b/mod/survey/graph.php @@ -18,6 +18,12 @@ print_error('coursemisconf'); } + if ($sid) { + if (!$user = $DB->get_record("user", array("id"=>$sid))) { + print_error('invaliduserid'); + } + } + require_login($course->id, false, $cm); $groupmode = groups_get_activity_groupmode($cm); // Groups are being used @@ -49,11 +55,11 @@ $stractual = get_string("actual", "survey"); $stractualclass = get_string("actualclass", "survey"); - $stractualstudent = get_string("actualstudent", "survey", $course->student); + $stractualstudent = get_string("actualstudent", "survey", fullname($user)); $strpreferred = get_string("preferred", "survey"); $strpreferredclass = get_string("preferredclass", "survey"); - $strpreferredstudent = get_string("preferredstudent", "survey", $course->student); + $strpreferredstudent = get_string("preferredstudent", "survey", fullname($user)); $virtualscales = false; //set default value for case clauses diff --git a/mod/survey/report.php b/mod/survey/report.php index 7872abdb79..2e914447e1 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -97,7 +97,7 @@ echo "$strsummary"; echo "    $strscales"; echo "    $strquestions"; - echo "    $course->students"; + echo "    ".get_string('participants').""; if (has_capability('mod/survey:download', $context)) { echo "    $strdownload"; } @@ -106,7 +106,7 @@ } } else { echo "$strquestions"; - echo "    $course->students"; + echo "    ".get_string('participants').""; if (has_capability('mod/survey:download', $context)) { echo "    $strdownload"; } @@ -309,7 +309,7 @@ case "students": - print_heading(get_string("analysisof", "survey", "$course->students")); + print_heading(get_string("analysisof", "survey", get_string('participants'))); if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) { notify(get_string("nobodyyet","survey")); diff --git a/mod/wiki/index.php b/mod/wiki/index.php index becd344979..c62a00ddb5 100644 --- a/mod/wiki/index.php +++ b/mod/wiki/index.php @@ -74,11 +74,11 @@ switch ($wiki->wtype) { case 'teacher': - $wtype = $site->teacher; + $wtype = get_string('defaultcoursestudent'); break; case 'student': - $wtype = $site->student; + $wtype = get_string('defaultcoursestudent'); break; case 'group': diff --git a/user/message.html b/user/message.html index 1343c81ae4..23331fd572 100644 --- a/user/message.html +++ b/user/message.html @@ -52,14 +52,8 @@ emailto[$id])) { - if (!$course->teacher) { - $course->teacher = get_string('defaultcourseteacher'); - } foreach ($SESSION->emailto[$id] as $user) { echo '
'.fullname($user,true).''.$user->email.''; - if ($user->teacher) { - echo ''.$course->teacher.''; - } if ($user->emailstop) { $error = get_string('emaildisable'); } elseif (empty($user->email)) { diff --git a/user/messageselect.php b/user/messageselect.php index d37a84e0a3..0ab50d50a6 100644 --- a/user/messageselect.php +++ b/user/messageselect.php @@ -5,9 +5,9 @@ $id = required_param('id',PARAM_INT); $messagebody = optional_param('messagebody','',PARAM_CLEANHTML); - $send = optional_param('send','',PARAM_RAW); // Content is actually treated as boolean - $preview = optional_param('preview','',PARAM_RAW); // Content is actually treated as boolean - $edit = optional_param('edit','',PARAM_RAW); // Content is actually treated as boolean + $send = optional_param('send','',PARAM_BOOL); + $preview = optional_param('preview','',PARAM_BOOL); + $edit = optional_param('edit','',PARAM_BOOL); $returnto = optional_param('returnto','',PARAM_LOCALURL); $format = optional_param('format',FORMAT_MOODLE,PARAM_INT); $deluser = optional_param('deluser',0,PARAM_INT); @@ -48,7 +48,6 @@ if (!array_key_exists($m[2],$SESSION->emailto[$id])) { if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) { $SESSION->emailto[$id][$m[2]] = $user; - $SESSION->emailto[$id][$m[2]]->teacher = ($m[1] == 'teacher'); $count++; } } @@ -100,12 +99,8 @@ echo "\n"; } else if (!empty($send)) { $good = 1; - $teachers = array(); foreach ($SESSION->emailto[$id] as $user) { $good = $good && message_post_message($USER,$user,$messagebody,$format,'direct'); - if ($user->teacher) { - $teachers[] = $user->id; - } } if (!empty($good)) { print_heading(get_string('messagedselectedusers')); diff --git a/version.php b/version.php index 50fd4e4cec..ec6c238314 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2008111100; // YYYYMMDD = date of the last version bump + $version = 2008111200; // YYYYMMDD = date of the last version bump // XX = daily increments $release = '2.0 dev (Build: 20081113)'; // Human-friendly version name