Tinebase_FileSystem_RecordAttachements - add path to nodes
authorPaul Mehrer <p.mehrer@metaways.de>
Fri, 23 Jun 2017 09:27:30 +0000 (11:27 +0200)
committerMichael Spahn <m.spahn@metaways.de>
Tue, 27 Jun 2017 13:05:32 +0000 (15:05 +0200)
Change-Id: Iebb85be764bd40c982261ec953684ebb8cd646a2
Reviewed-on: http://gerrit.tine20.com/customers/4938
Reviewed-by: Michael Spahn <m.spahn@metaways.de>
Tested-by: Michael Spahn <m.spahn@metaways.de>
tine20/Tinebase/FileSystem/RecordAttachments.php

index 7b14de6..3114c69 100644 (file)
@@ -72,6 +72,16 @@ class Tinebase_FileSystem_RecordAttachments
         
         try {
             $record->attachments = $this->_fsController->scanDir($parentPath);
+            $fileSystem = Tinebase_FileSystem::getInstance();
+            foreach($record->attachments as $node) {
+                $nodePath = Tinebase_Model_Tree_Node_Path::createFromStatPath($fileSystem->getPathOfNode($node,
+                    true));
+                $node->path = Tinebase_Model_Tree_Node_Path::removeAppIdFromPath($nodePath->flatpath,
+                    $record->getApplication());
+            }
+
+            // to resolve grants... but as not needed currently we save the effort
+            //Filemanager_Controller_Node::getInstance()->resolveGrants($record->attachments);
         } catch (Tinebase_Exception_NotFound $tenf) {
             $record->attachments = new Tinebase_Record_RecordSet('Tinebase_Model_Tree_Node');
         }