From: moodler Date: Fri, 23 May 2003 05:32:40 +0000 (+0000) Subject: New field for user: autosubscribe X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7f2a3e678e1d8a1eaaf6b497ad4f2c89417f356d;p=moodle.git New field for user: autosubscribe This sets the default value for on-the-fly forum subscription. Defaults to on = subscribe. (Also fixed a bug in postgres7.sql - a missing field for htmleditor!) --- diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 1b185754d7..de0e2e6781 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -40,6 +40,9 @@ $string['assignadmins'] = "Assign admins"; $string['assigncreators'] = "Assign course creators"; $string['assignteachers'] = "Assign teachers"; $string['authentication'] = "Authentication"; +$string['autosubscribe'] = "Forum auto-subscribe"; +$string['autosubscribeno'] = "No: don't automatically subscribe me to forums"; +$string['autosubscribeyes'] = "Yes: when I post, subscribe me to that forum"; $string['availablecourses'] = "Available Courses"; $string['backup'] = "Backup"; $string['backupdir'] = "backupdata"; diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 2d95ee664b..7b122ac3be 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -393,6 +393,10 @@ function main_upgrade($oldversion=0) { print_simple_box("Thanks for upgrading!

There are many changes since the last release. Please read the release notes carefully. If you are using CUSTOM themes you will need to edit them. You will also need to check your site's config.php file.", "center", "50%", "$THEME->cellheading", "20", "noticebox"); } + if ($oldversion < 2003052300) { + table_column("user", "", "autosubscribe", "integer", "1", "unsigned", "1", "", "htmleditor"); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 82302af4cc..c34cfed900 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -200,6 +200,7 @@ CREATE TABLE `prefix_user` ( `mailformat` tinyint(1) unsigned NOT NULL default '1', `maildisplay` tinyint(2) unsigned NOT NULL default '2', `htmleditor` tinyint(1) unsigned NOT NULL default '1', + `autosubscribe` tinyint(1) unsigned NOT NULL default '1', `timemodified` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`), diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 8096f517bd..1654ac5c99 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -164,6 +164,10 @@ function main_upgrade($oldversion=0) { print_simple_box("Thanks for upgrading!

There are many changes since the last release. Please read the release notes carefully. If you are using CUSTOM themes you will need to edit them. You will also need to check your site's config.php file.", "center", "50%", "$THEME->cellheading", "20", "noticebox"); } + if ($oldversion < 2003052300) { + table_column("user", "", "autosubscribe", "integer", "1", "unsigned", "1", "", "htmleditor"); + } + return $result; } ?> diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 6a8e5fd50f..feeb4760b7 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -126,6 +126,8 @@ CREATE TABLE prefix_user ( description text, mailformat integer NOT NULL default '1', maildisplay integer NOT NULL default '2', + htmleditor integer NOT NULL default '1', + autosubscribe integer NOT NULL default '1', timemodified integer NOT NULL default '0', CONSTRAINT user_username_uk UNIQUE (username) ); diff --git a/mod/forum/post.html b/mod/forum/post.html index b8b16d0735..7b9b987e6e 100644 --- a/mod/forum/post.html +++ b/mod/forum/post.html @@ -68,9 +68,13 @@ $options[1] = get_string("subscribestop", "forum"); choose_from_menu($options, "unsubscribe", 0, ""); } else { + $default = 0; + if (!empty($USER->autosubscribe)) { + $default = 1; + } $options[0] = get_string("subscribestop", "forum"); $options[1] = get_string("subscribestart", "forum"); - choose_from_menu($options, "subscribe", 0, ""); + choose_from_menu($options, "subscribe", $default, ""); } } helpbutton("subscription", get_string("subscription", "forum"), "forum"); diff --git a/user/edit.html b/user/edit.html index 5d1c9f6e4e..aa2d421069 100644 --- a/user/edit.html +++ b/user/edit.html @@ -79,6 +79,15 @@ if (isadmin()) { choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?> + +

: + autosubscribe, "") ?> + + htmleditor) { ?>

: diff --git a/version.php b/version.php index 54eb651aa0..a3070d746f 100644 --- a/version.php +++ b/version.php @@ -5,9 +5,9 @@ // database to determine whether upgrades should // be performed (see lib/db/*.php) -$version = 2003052000; // The current version is a date (YYYYMMDDXX) +$version = 2003052300; // The current version is a date (YYYYMMDDXX) $release = "1.0.9 Beta 1 +"; // User-friendly version number -?> \ No newline at end of file +?>