]> git.mjollnir.org Git - moodle.git/commitdiff
Upgrade to roles code for data module.
authorvyshane <vyshane>
Wed, 20 Sep 2006 17:46:20 +0000 (17:46 +0000)
committervyshane <vyshane>
Wed, 20 Sep 2006 17:46:20 +0000 (17:46 +0000)
mod/data/db/mysql.php
mod/data/db/mysql.sql
mod/data/db/postgres7.php
mod/data/db/postgres7.sql
mod/data/lib.php
mod/data/version.php

index 69eaa359e97ff31cf2d0b2b84f9887befd25c518..541a62ef70b6eeae0946fe4b6d8808304c907c19 100644 (file)
@@ -71,7 +71,7 @@ function data_upgrade($oldversion) {
     if ($oldversion < 2006081700) {
         table_column('data', '', 'jstemplate', 'text', '', '', '', 'not null', 'csstemplate');
     }
-    /*
+    
     if ($oldversion < 2006092000) {
         // Upgrades for new roles and capabilities support.
         require_once($CFG->dirroot.'/mod/data/lib.php');
@@ -104,11 +104,10 @@ function data_upgrade($oldversion) {
 
         modify_database('', 'ALTER TABLE prefix_data DROP COLUMN participants;');
         modify_database('', 'ALTER TABLE prefix_data DROP COLUMN assesspublic;');
-        modify_database('', 'ALTER TABLE prefix_data DROP COLUMN groupmode;');
         
     }
-    */
+    
     return true;
 }
 
-?>
+?>
\ No newline at end of file
index 8b2397118b4aebc6eaf31eceac48aa4d22d55ef0..31dabf659bebc0e0ce4f41ae6936d44e6dc2cca3 100755 (executable)
@@ -21,7 +21,6 @@ CREATE TABLE prefix_data (
   timeavailableto int(10) unsigned NOT NULL default '0',
   timeviewfrom int(10) unsigned NOT NULL default '0',
   timeviewto int(10) unsigned NOT NULL default '0',
-  participants int(4) unsigned NOT NULL default '0',
   requiredentries int(8) unsigned NOT NULL default '0',
   requiredentriestoview int(8) unsigned NOT NULL default '0',
   maxentries int(8) unsigned NOT NULL default '0',
@@ -38,7 +37,6 @@ CREATE TABLE prefix_data (
   approval tinyint(4) unsigned NOT NULL default '0',
   scale int(10) NOT NULL default '0',
   assessed int(10) unsigned NOT NULL default '0',
-  assesspublic int(4) unsigned NOT NULL default '0',
   defaultsort int(10) unsigned NOT NULL default '0',
   defaultsortdir tinyint(4) unsigned NOT NULL default '0',
   editany tinyint(4) unsigned NOT NULL default '0',
index 7c883c56224528e6629edb36e379f76ddcced66c..beebfab51cffa5dd09fa1c69514bc85f4194a5f0 100644 (file)
@@ -155,7 +155,7 @@ function data_upgrade($oldversion) {
     if ($oldversion < 2006081700) {
         table_column('data', '', 'jstemplate', 'text', '', '', '', 'not null', 'csstemplate');
     }
-    /*
+    
     if ($oldversion < 2006092000) {
         // Upgrades for new roles and capabilities support.
         require_once($CFG->dirroot.'/mod/data/lib.php');
@@ -175,7 +175,7 @@ function data_upgrade($oldversion) {
                        'this upgrade.');
             }
             foreach ($data as $d) {
-                if (!data_convert_to_roles($d $teacherroles, $studentroles)) {
+                if (!data_convert_to_roles($d, $teacherroles, $studentroles)) {
                     notify('Data with id '.$d->id.' was not upgraded');
                 }
             }
@@ -188,10 +188,9 @@ function data_upgrade($oldversion) {
 
         modify_database('', 'ALTER TABLE prefix_data DROP COLUMN participants;');
         modify_database('', 'ALTER TABLE prefix_data DROP COLUMN assesspublic;');
-        modify_database('', 'ALTER TABLE prefix_data DROP COLUMN groupmode;');
         
     }
-    */
+    
     return true;
 }
 
index e3f735786ba44f163431345a28e38fbb7c9a39c4..30711a475f9bbc4ee01a1738b140dc4c8b8b580d 100755 (executable)
@@ -10,7 +10,6 @@ CREATE TABLE prefix_data (
   timeavailableto integer NOT NULL default '0',
   timeviewfrom integer NOT NULL default '0',
   timeviewto integer NOT NULL default '0',
-  participants integer NOT NULL default '0',
   requiredentries integer NOT NULL default '0',
   requiredentriestoview integer NOT NULL default '0',
   maxentries integer NOT NULL default '0',
@@ -27,7 +26,6 @@ CREATE TABLE prefix_data (
   approval integer NOT NULL default '0',
   scale integer NOT NULL default '0',
   assessed integer NOT NULL default '0',
-  assesspublic integer NOT NULL default '0',
   defaultsort integer NOT NULL default '0',
   defaultsortdir integer NOT NULL default '0',
   editany integer NOT NULL default '0'
index 05422278ddfaafab6ce274c22e0b4b308cce791d..1e3ef5979170f5ad82bc4819ad7d7f3f5460ef08 100755 (executable)
@@ -1316,8 +1316,8 @@ function data_convert_to_roles($data, $teacherroles=array(), $studentroles=array
     
     if (empty($cmid)) {
         // We were not given the course_module id. Try to find it.
-        if (!$cm = get_coursemodule_from_instance('forum', $forum->id)) {
-            notify('Could not get the course module for the forum');
+        if (!$cm = get_coursemodule_from_instance('data', $data->id)) {
+            notify('Could not get the course module for the data');
             return false;
         } else {
             $cmid = $cm->id;
index 5fe726bab38eccaa623d4f299f2a0527f9d94fdd..14812f454d4d38c9401343932c2d5642aa8aa60b 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2006091800;
+$module->version  = 2006092000;
 $module->requires = 2006080900;  // Requires this Moodle version
 $module->cron     = 60;