]> git.mjollnir.org Git - moodle.git/commitdiff
Added new field 'ajax' to user table, to store AJAX preference
authormoodler <moodler>
Mon, 28 Aug 2006 06:41:05 +0000 (06:41 +0000)
committermoodler <moodler>
Mon, 28 Aug 2006 06:41:05 +0000 (06:41 +0000)
backup/backuplib.php
backup/restorelib.php
lib/db/install.xml
lib/db/mysql.php
lib/db/mysql.sql
lib/db/postgres7.php
lib/db/postgres7.sql
user/edit.html
version.php

index 7473383640732a659013ce580b7569c28c192895..dbf70b412b4d0dd9f9f04c069cd102211778a396 100644 (file)
                 fwrite ($bf,full_tag("MAILDIGEST",4,false,$user_data->maildigest));
                 fwrite ($bf,full_tag("MAILDISPLAY",4,false,$user_data->maildisplay));
                 fwrite ($bf,full_tag("HTMLEDITOR",4,false,$user_data->htmleditor));
+                fwrite ($bf,full_tag("AJAX",4,false,$user_data->ajax));
                 fwrite ($bf,full_tag("AUTOSUBSCRIBE",4,false,$user_data->autosubscribe));
                 fwrite ($bf,full_tag("TRACKFORUMS",4,false,$user_data->trackforums));
                 fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user_data->timemodified));
index 71fb59a71833d7fe7fee52926ff165644833d204..f9696c485f1e4f8ddc7afa295f7ebf7a961d1ad9 100644 (file)
                         case "HTMLEDITOR": 
                             $this->info->tempuser->htmleditor = $this->getContents();
                             break;
+                        case "AJAX": 
+                            $this->info->tempuser->ajax = $this->getContents();
+                            break;
                         case "AUTOSUBSCRIBE": 
                             $this->info->tempuser->autosubscribe = $this->getContents();
                             break;
index df7b27faeb2b6485c452a2cd148e02c5a8b0612f..854fb7bd431c947d5fff2ace2543169496ee113f 100644 (file)
         <FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="maildigest"/>
         <FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
         <FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" ENUM="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
-        <FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="autosubscribe"/>
+        <FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="ajax"/>
+        <FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
         <FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="trackforums"/>
         <FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums"/>
index 6c4f900b612adef74c6712e90cda4745dfc76a2d..7080146839c5fe941c7d0638243ff0fdd41ed282 100644 (file)
@@ -2137,6 +2137,10 @@ function main_upgrade($oldversion=0) {
     if ($oldversion < 2006082200) {
         table_column('timezone', 'rule', 'tzrule', 'varchar', '20', '', '', 'not null', '');
     }
+
+    if ($oldversion < 2006082800) {
+        table_column('user', '', 'ajax', 'integer', '1', 'unsigned', '1', '', 'htmleditor');
+    }
     
     return $result;
 }
index 9ede4ab7550fe1090d54bc8561465c36f345d3d6..993ceacaf78ca9aef6135ca2f1783c9bf3a5d7d6 100644 (file)
@@ -618,6 +618,7 @@ CREATE TABLE `prefix_user` (
   `maildigest` tinyint(1) unsigned NOT NULL default '0',
   `maildisplay` tinyint(2) unsigned NOT NULL default '2',
   `htmleditor` tinyint(1) unsigned NOT NULL default '1',
+  `ajax` tinyint(1) unsigned NOT NULL default '1',
   `autosubscribe` tinyint(1) unsigned NOT NULL default '1',
   `trackforums` tinyint(1) unsigned NOT NULL default '0',
   `timemodified` int(10) unsigned NOT NULL default '0',
index 80ad8492d495e6a979420bd1c76a1842ffb498ce..524b5b3567d6cf1d7b3ca8892ae9c984c3b5b688 100644 (file)
@@ -1737,6 +1737,10 @@ function main_upgrade($oldversion=0) {
         table_column('timezone', 'rule', 'tzrule', 'varchar', '20', '', '', 'not null', '');
     }
 
+    if ($oldversion < 2006082800) {
+        table_column('user', '', 'ajax', 'integer', '1', 'unsigned', '1', '', 'htmleditor');
+    }
+
     return $result;
 }
 
index f1f4537a14e8b8a8ce1229bf29c0b5bc00cbe3dd..70455595f0c205e793c0ff5954444623aa152d14 100644 (file)
@@ -437,6 +437,7 @@ CREATE TABLE prefix_user (
    maildigest integer NOT NULL default '0',
    maildisplay integer NOT NULL default '2',
    htmleditor integer NOT NULL default '1',
+   ajax integer NOT NULL default '1',
    autosubscribe integer NOT NULL default '1',
    trackforums integer NOT NULL default '0',
    timemodified integer NOT NULL default '0'
index ce835710742a88718be9c5e79506105d4d466f32..136de87dda16126a5a5e378c992e19e423d5fd68 100644 (file)
@@ -2,6 +2,9 @@
    if (!isset($user->htmleditor)) {
        $user->htmleditor = 1;
    }
+   if (!isset($user->ajax)) {
+       $user->ajax = 1;
+   }
    if (!isset($user->picture)) {
        $user->picture = NULL;
    }
@@ -193,6 +196,15 @@ if (has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM, SI
     </td>
 </tr>
 <?php } ?>
+<tr>
+    <th><?php print_string("ajaxuse") ?>:</th>
+    <td><?php
+    unset($choices);
+    $choices["0"] = get_string("ajaxno");
+    $choices["1"] = get_string("ajaxyes");
+    choose_from_menu ($choices, 'ajax', $user->ajax, "") ?>
+    </td>
+</tr>
 <tr>
     <th><?php print_string("city") ?>:</th>
     <td>
index 7a6f70b5eb6b599b68272a1c75c428fdd5df78ad..f25a014ef39797b2d4ee9a96612e300a414b08d6 100644 (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 = 2006082600;  // YYYYMMDD = date
+   $version = 2006082800;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.7 dev';    // Human-friendly version name