]> git.mjollnir.org Git - moodle.git/commitdiff
New field for user: autosubscribe
authormoodler <moodler>
Fri, 23 May 2003 05:32:40 +0000 (05:32 +0000)
committermoodler <moodler>
Fri, 23 May 2003 05:32:40 +0000 (05:32 +0000)
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!)

lang/en/moodle.php
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
mod/forum/post.html
user/edit.html
version.php

index 1b185754d72afdaebb4ede53639bdadbc8449581..de0e2e67818e1cd3f730c94d3d49759809149977 100644 (file)
@@ -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";
index 2d95ee664b1101525d4f764ba620c5a03ba23132..7b122ac3be1d08e9fcc0b6468c214e87fff62574 100644 (file)
@@ -393,6 +393,10 @@ function main_upgrade($oldversion=0) {
         print_simple_box("Thanks for upgrading!<p>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;
 
 }
index 82302af4cc6f2ea4a5c550fda5a3668159a764ad..c34cfed9007f54cd6319b189f85d8fc09b65897c 100644 (file)
@@ -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`),
index 8096f517bde3269de02abc6fa6c73f02fb0c7257..1654ac5c9934f1a9551ba538d784cf005aa55df4 100644 (file)
@@ -164,6 +164,10 @@ function main_upgrade($oldversion=0) {
         print_simple_box("Thanks for upgrading!<p>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;
 }
 ?>    
index 6a8e5fd50fbc997115a92867488bac230d6b1928..feeb4760b7366396811713a0a62752142b49ce2e 100644 (file)
@@ -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)
 );
index b8b16d073532c37d056f2bd58caa168bac8fadd5..7b9b987e6e665beff0647f09bbbf6e20aff9fe74 100644 (file)
                $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"); 
index 5d1c9f6e4e20ae82b3ba1fea6e3f7d5e0f264a33..aa2d421069fa364e3380a6b9e1cfa480072606b4 100644 (file)
@@ -79,6 +79,15 @@ if (isadmin()) {
     choose_from_menu ($choices, "mailformat", $user->mailformat, "") ?>
     </td>
 </tr>
+<tr valign=top>
+    <td><p><?php print_string("autosubscribe") ?>:</td>
+    <td><?php 
+    unset($choices);
+    $choices["1"] = get_string("autosubscribeyes");
+    $choices["0"] = get_string("autosubscribeno");
+    choose_from_menu ($choices, "autosubscribe", $user->autosubscribe, "") ?>
+    </td>
+</tr>
 <?php if ($CFG->htmleditor) { ?>
 <tr valign=top>
     <td><p><?php print_string("textediting") ?>:</td>
index 54eb651aa0653d899d10c090cdfb7c95034d6e32..a3070d746f5f96bef6a2d7441564bb26578eafc0 100644 (file)
@@ -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
+?>