Author: david
Date: Fri Nov 20 16:45:42 2009
New Revision: 3928

Log:
1.0.5 migration - add QubitRole constant ids as per r1904. See issue #1138.

Modified:
   trunk/lib/task/migrate/QubitMigrate104to105.class.php

Modified: trunk/lib/task/migrate/QubitMigrate104to105.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate104to105.class.php       Fri Nov 20 
00:07:12 2009        (r3927)
+++ trunk/lib/task/migrate/QubitMigrate104to105.class.php       Fri Nov 20 
16:45:42 2009        (r3928)
@@ -39,9 +39,10 @@
 
     // Alter qubit classes (methods ordered alphabetically)
     $this->alterQubitInformationObjects();
+    $this->alterQubitMenus();
+    $this->alterQubitRoles();
     $this->alterQubitSettings();
     $this->alterQubitStaticPages();
-    $this->alterQubitMenus();
     $this->alterQubitTerms();
 
     return $this;
@@ -81,6 +82,36 @@
   }
 
   /**
+   * Alter QubitRoles data
+   *
+   * @return QubitMigrate104to105 this object
+   */
+  protected function alterQubitRoles()
+  {
+    // Add constant ids for Qubit Roles
+    foreach ($this->data['QubitRole'] as $key => $role)
+    {
+      switch($role['name'])
+      {
+        case 'administrator';
+          $this->data['QubitRole'][$key]['id'] = '<?php echo 
QubitRole::ADMINISTRATOR_ID."\n" ?>';
+          break;
+        case 'editor';
+          $this->data['QubitRole'][$key]['id'] = '<?php echo 
QubitRole::EDITOR_ID."\n" ?>';
+          break;
+        case 'contributor';
+          $this->data['QubitRole'][$key]['id'] = '<?php echo 
QubitRole::CONTRIBUTOR_ID."\n" ?>';
+          break;
+        case 'translator';
+          $this->data['QubitRole'][$key]['id'] = '<?php echo 
QubitRole::TRANSLATOR_ID."\n" ?>';
+          break;
+      }
+    }
+
+    return $this;
+  }
+
+  /**
    * Alter QubitSetting data
    *
    * @return QubitMigrate104to105 this object

--

You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=.


Reply via email to