From 0b00dcd7eff9fa115366964c8a2f8d813afaa46e Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Thu, 13 Mar 2003 14:20:01 +0000 Subject: [PATCH] added bl code to download an old version --- presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php index b186727..b804a76 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php @@ -74,9 +74,17 @@ if (checkSession()) { PhysicalDocumentManager::inlineViewPhysicalDocument($fDocumentID); } else if (isset($fForDownload) && Permission::userHasDocumentReadPermission($fDocumentID)) { //if the user has document read permission, perform the download - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document downloaded", DOWNLOAD); - $oDocumentTransaction->create(); - PhysicalDocumentManager::downloadPhysicalDocument($fDocumentID); + if (isset($fVersion)) { + // we're downloading an old version of the document + $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document version $fVersion downloaded", DOWNLOAD); + $oDocumentTransaction->create(); + PhysicalDocumentManager::downloadVersionedPhysicalDocument($fDocumentID, $fVersion); + } else { + // download the current version + $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document downloaded", DOWNLOAD); + $oDocumentTransaction->create(); + PhysicalDocumentManager::downloadPhysicalDocument($fDocumentID); + } } else if (isset($fBeginCollaboration) && Permission::userHasDocumentWritePermission($fDocumentID)) { require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); //begin the collaboration process -- libgit2 0.21.4