Author: david
Date: Tue Sep 20 15:57:44 2011
New Revision: 9768

Log:
Add browse physical object menu.  Disable broken asset path migration script

Modified:
   trunk/data/fixtures/menus.yml
   trunk/data/fixtures/settings.yml
   trunk/lib/search/QubitSearch.class.php
   trunk/lib/task/migrate/QubitMigrate110.class.php

Modified: trunk/data/fixtures/menus.yml
==============================================================================
--- trunk/data/fixtures/menus.yml       Tue Sep 20 15:29:42 2011        (r9767)
+++ trunk/data/fixtures/menus.yml       Tue Sep 20 15:57:44 2011        (r9768)
@@ -56,6 +56,13 @@
     label:
       en: Donors
     path: donor/browse
+  QubitMenu_mainmenu_manage_physicalobject:
+    parent_id: QubitMenu_mainmenu_manage
+    source_culture: en
+    name: browsePhysicalObjects
+    label:
+      en: 'Physical objects'
+    path: physicalobject/browse
   QubitMenu_mainmenu_manage_rightsholders:
     parent_id: QubitMenu_mainmenu_manage
     source_culture: en

Modified: trunk/data/fixtures/settings.yml
==============================================================================
--- trunk/data/fixtures/settings.yml    Tue Sep 20 15:29:42 2011        (r9767)
+++ trunk/data/fixtures/settings.yml    Tue Sep 20 15:57:44 2011        (r9768)
@@ -3,7 +3,7 @@
     name: version
     editable: 0
     deleteable: 0
-    value: 71
+    value: 72
   QubitSetting_2:
     name: upload_dir
     editable: 0

Modified: trunk/lib/search/QubitSearch.class.php
==============================================================================
--- trunk/lib/search/QubitSearch.class.php      Tue Sep 20 15:29:42 2011        
(r9767)
+++ trunk/lib/search/QubitSearch.class.php      Tue Sep 20 15:57:44 2011        
(r9768)
@@ -459,6 +459,8 @@
 
     $doc->addField(Zend_Search_Lucene_Field::Text('scopeAndContent', 
$informationObject->getScopeAndContent(array('culture' => $language))));
 
+    // Force load sfIsadPlugin library
+    
require_once(sfConfig::get('sf_plugins_dir').'/sfIsadPlugin/lib/sfIsadPlugin.class.php');
     $isad = new sfIsadPlugin($informationObject);
     $doc->addField(Zend_Search_Lucene_Field::Text('referenceCode', 
$isad->referenceCode));
 

Modified: trunk/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate110.class.php    Tue Sep 20 15:29:42 
2011        (r9767)
+++ trunk/lib/task/migrate/QubitMigrate110.class.php    Tue Sep 20 15:57:44 
2011        (r9768)
@@ -72,10 +72,13 @@
         $this->addThemesMenu();
 
       case 69:
-        $this->updatePathToAssets();
+        //$this->updatePathToAssets();
 
       case 70:
         $this->addRepostioryUploadLimit();
+
+      case 71:
+        $this->addPhysicalObjectBrowseMenu();
     }
 
     // Delete "stub" objects
@@ -680,11 +683,13 @@
 
           // Delete old dirs, if they are empty
           $p = strlen($oldpath);
-          while ($p = strrpos($oldpath, '/', $p - strlen($oldpath))
-
+          while ($p = strrpos($oldpath, '/', $p - strlen($oldpath)))
+          {
+            break;
+          }
 
           // Update path in yaml file
-          $item2['path'] = str_replace('uploads', 'uploads/r/'.$repo['slug'], 
$item2['path']);
+          // $item2['path'] = str_replace('uploads', 
'uploads/r/'.$repo['slug'], $item2['path']);
         }
       }
     }
@@ -708,6 +713,33 @@
   }
 
   /**
+   * Add physical object menu
+   *
+   * @return QubitMigrate110 SELF
+   */
+  protected function addPhysicalObjectBrowseMenu()
+  {
+    $menu = array(
+      'parent_id' => '<?php echo QubitMenu::MANAGE_ID."\n" ?>',
+      'source_culture' => 'en',
+      'name' => 'browsePhysicalObjects',
+      'label' => array('en' => 'Physical objects'),
+      'path' => 'physicalobject/browse');
+
+    // Introduce Physical objects menu before Rights-holders
+    if ($pivotKey = $this->findRowKeyForColumnValue($this->data['QubitMenu'], 
'name', 'rightsholders'))
+    {
+      self::insertBeforeNestedSet($this->data['QubitMenu'], $pivotKey, 
array('QubitMenu_mainmenu_manage_physicalobjects' => $menu));
+    }
+    else
+    {
+      $this->data['QubitMenu']['QubitMenu_mainmenu_manage_physicalobjects'] = 
$menu;
+    }
+
+    return $this;
+  }
+
+  /**
    * Slugs are inserted when some resources are inserted, but slugs are dumped
    * separately when data is dumped. So loading slug data will try to insert
    * duplicate slugs. To work around this, turn slugs into resource properties

-- 
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