From: moodler Date: Mon, 28 Aug 2006 06:41:05 +0000 (+0000) Subject: Added new field 'ajax' to user table, to store AJAX preference X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=67a3fac51f208b9e1a51d2a38424b7a160e9fc4b;p=moodle.git Added new field 'ajax' to user table, to store AJAX preference --- diff --git a/backup/backuplib.php b/backup/backuplib.php index 7473383640..dbf70b412b 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -1087,6 +1087,7 @@ 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)); diff --git a/backup/restorelib.php b/backup/restorelib.php index 71fb59a718..f9696c485f 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -3990,6 +3990,9 @@ 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; diff --git a/lib/db/install.xml b/lib/db/install.xml index df7b27faeb..854fb7bd43 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -573,7 +573,8 @@ - + + diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 6c4f900b61..7080146839 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -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; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 9ede4ab755..993ceacaf7 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -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', diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 80ad8492d4..524b5b3567 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -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; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index f1f4537a14..70455595f0 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -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' diff --git a/user/edit.html b/user/edit.html index ce83571074..136de87dda 100644 --- a/user/edit.html +++ b/user/edit.html @@ -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 + + : + ajax, "") ?> + + : diff --git a/version.php b/version.php index 7a6f70b5eb..f25a014ef3 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 = 2006082600; // YYYYMMDD = date + $version = 2006082800; // YYYYMMDD = date // XY = increments within a single day $release = '1.7 dev'; // Human-friendly version name