From cbd66de3110dfd089974bf59641228d087cfb737 Mon Sep 17 00:00:00 2001 From: nbm Date: Tue, 20 Sep 2005 09:10:39 +0000 Subject: [PATCH] Use the new moveDocument arguments, and rename oFolder to oNewFolder to make more understandable. --- presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php index 40ff6c1..d3c2836 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/moveDocumentBL.php @@ -119,9 +119,11 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { //we're trying to move a document $oDocument = & Document::get($fDocumentIDs[$i]); - $oFolder = & Folder::get($fFolderID); + $oNewFolder = & Folder::get($fFolderID); $iOldFolderID = $oDocument->getFolderID(); + $oOldFolder =& Folder::get($iOldFolderID); + // check that there is no filename collision in the destination directory $sNewDocumentFileSystemPath = Folder::getFolderPath($fFolderID) . $oDocument->getFileName(); @@ -131,7 +133,7 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { continue; } - if (!Permission::userHasDocumentWritePermission($oDocument) || !Permission::userHasFolderWritePermission($oFolder)) { + if (!Permission::userHasDocumentWritePermission($oDocument) || !Permission::userHasFolderWritePermission($oNewFolder)) { array_push($aUnmovedDocs, array($oDocument, _("You do not have rights to move this document"))); continue; } @@ -150,7 +152,7 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { //get the old document path $sOldDocumentFileSystemPath = Folder::getFolderPath($iOldFolderID) . $oDocument->getFileName(); //move the document on the file system - if (!$oStorage->moveDocument($sOldDocumentFileSystemPath, $oDocument, $oFolder)) { + if (!$oStorage->moveDocument($oDocument, $oOldFolder, $oNewFolder)) { $oDocument->setFolderID($iOldFolderID); $oDocument->update(true); @@ -158,6 +160,7 @@ for ($i = 0; $i < count($fDocumentIDs); $i++) { array_push($aUnmovedDocs, array($oDocument, _("Could not move document on file system"))); continue; } + $oDocument->update(); // fire subscription alerts for the moved document (and the folder its in) $count = SubscriptionEngine::fireSubscription($fDocumentIDs[$i], SubscriptionConstants::subscriptionAlertType("MovedDocument"), -- libgit2 0.21.4