Author: sevein
Date: Mon Jul 23 21:03:56 2012
New Revision: 11963

Log:
Add upgrade step regarding to issue 1931, visibility settings

Modified:
   trunk/data/fixtures/settings.yml
   trunk/lib/task/migrate/arUpgrader120.class.php

Modified: trunk/data/fixtures/settings.yml
==============================================================================
--- trunk/data/fixtures/settings.yml    Mon Jul 23 21:02:55 2012        (r11962)
+++ trunk/data/fixtures/settings.yml    Mon Jul 23 21:03:56 2012        (r11963)
@@ -3,7 +3,7 @@
     name: version
     editable: 0
     deleteable: 0
-    value: 89
+    value: 90
   QubitSetting_2:
     name: upload_dir
     editable: 0

Modified: trunk/lib/task/migrate/arUpgrader120.class.php
==============================================================================
--- trunk/lib/task/migrate/arUpgrader120.class.php      Mon Jul 23 21:02:55 
2012        (r11962)
+++ trunk/lib/task/migrate/arUpgrader120.class.php      Mon Jul 23 21:03:56 
2012        (r11963)
@@ -331,6 +331,8 @@
         $sql = 'UPDATE '.QubitProperty::TABLE_NAME.' SET name = "aipUUID" 
WHERE name = "dipUUID"';
         QubitPdo::modify($sql);
 
+        break;
+
       // According to r10747, keymap.source_id changed from INTEGER to TEXT
       case 88:
         $sql = 'ALTER TABLE '.QubitKeymap::TABLE_NAME.' CHANGE source_id 
source_id TEXT';
@@ -338,6 +340,50 @@
 
         break;
 
+      // Add "Visible elements" assets
+      case 89:
+        $elements = array(
+          'isad_immediate_source',
+          'isad_appraisal_destruction',
+          'isad_notes',
+          'isad_physical_condition',
+          'rad_general_note',
+          'rad_conservation',
+          'rad_physical_condition',
+          'rad_immediate_source',
+          'digital_object_url',
+          'digital_object_file_name',
+          'digital_object_media_type',
+          'digital_object_mime_type',
+          'digital_object_file_size',
+          'digital_object_uploaded',
+          'physical_storage');
+
+        // Add visibility settings
+        foreach ($elements as $item)
+        {
+          $setting = new QubitSetting;
+          $setting->name  = $item;
+          $setting->scope = 'element_visibility';
+          $setting->value = 1;
+          $setting->culture = 'en';
+          $setting->save();
+        }
+
+        // Add "Visible elements" menu
+        $node = new QubitMenu;
+        $node->parentId = QubitMenu::ADMIN_ID;
+        $node->name = 'visibleElements';
+        $node->path = 'settings/visibleElements';
+        $node->label = 'Visible elements';
+        $node->save();
+
+        // Introduce it after "globalReplace"
+        if (null !== $target = QubitMenu::getByName('globalReplace'))
+        {
+          $node->moveToNextSiblingOf($target);
+        }
+
       // Return false if no upgrade available
       default:
 

-- 
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=en.

Reply via email to