forum MDL-23145 switched forum digests over to just use email instead of being chanelled through messaging

This commit is contained in:
Andrew Davis
2010-07-08 08:08:16 +00:00
parent 3ba3c59d9c
commit b58bd1a2fa
5 changed files with 17 additions and 18 deletions
-4
View File
@@ -27,10 +27,6 @@ $messageproviders = array (
/// Ordinary single forum posts
'posts' => array (
),
/// Digests
'digests' => array (
)
);
+9
View File
@@ -284,6 +284,15 @@ function xmldb_forum_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2010042800, 'forum');
}
if ($oldversion < 2010070800) {
// Remove the forum digests message provider MDL-23145
$DB->delete_records('message_providers', array('name' => 'digests','component'=>'mod_forum'));
// forum savepoint reached
upgrade_mod_savepoint(true, 2010070800, 'forum');
}
return true;
}
+5 -11
View File
@@ -903,17 +903,11 @@ function forum_cron() {
$posthtml = '';
}
$eventdata = new object();
$eventdata->component = 'mod/forum';
$eventdata->name = 'digests';
$eventdata->userfrom = $site->shortname;
$eventdata->userto = $userto;
$eventdata->subject = $postsubject;
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
$eventdata->smallmessage = '';
if (!message_send($eventdata)){
$attachment = $attachname='';
$usetrueaddress = true;
$mailresult = email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml, $attachment, $attachname, $usetrueaddress, $CFG->forum_replytouser);
if (!$mailresult) {
mtrace("ERROR!");
echo "Error: mod/forum/cron.php: Could not send out digest mail to user $userto->id ($userto->email)... not trying again.\n";
add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);
+2 -2
View File
@@ -24,8 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$module->version = 2010042800;
$module->requires = 2010042800; // Requires this Moodle version
$module->version = 2010070800;
$module->requires = 2010070800; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -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 = 2010070701; // YYYYMMDD = date of the last version bump
$version = 2010070800; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 Preview 4+ (Build: 20100708)'; // Human-friendly version name