Commit 0b00dcd7eff9fa115366964c8a2f8d813afaa46e
1 parent
5ad50692
added bl code to download an old version
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1547 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
3 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
| @@ -74,9 +74,17 @@ if (checkSession()) { | @@ -74,9 +74,17 @@ if (checkSession()) { | ||
| 74 | PhysicalDocumentManager::inlineViewPhysicalDocument($fDocumentID); | 74 | PhysicalDocumentManager::inlineViewPhysicalDocument($fDocumentID); |
| 75 | } else if (isset($fForDownload) && Permission::userHasDocumentReadPermission($fDocumentID)) { | 75 | } else if (isset($fForDownload) && Permission::userHasDocumentReadPermission($fDocumentID)) { |
| 76 | //if the user has document read permission, perform the download | 76 | //if the user has document read permission, perform the download |
| 77 | - $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document downloaded", DOWNLOAD); | ||
| 78 | - $oDocumentTransaction->create(); | ||
| 79 | - PhysicalDocumentManager::downloadPhysicalDocument($fDocumentID); | 77 | + if (isset($fVersion)) { |
| 78 | + // we're downloading an old version of the document | ||
| 79 | + $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document version $fVersion downloaded", DOWNLOAD); | ||
| 80 | + $oDocumentTransaction->create(); | ||
| 81 | + PhysicalDocumentManager::downloadVersionedPhysicalDocument($fDocumentID, $fVersion); | ||
| 82 | + } else { | ||
| 83 | + // download the current version | ||
| 84 | + $oDocumentTransaction = & new DocumentTransaction($fDocumentID, "Document downloaded", DOWNLOAD); | ||
| 85 | + $oDocumentTransaction->create(); | ||
| 86 | + PhysicalDocumentManager::downloadPhysicalDocument($fDocumentID); | ||
| 87 | + } | ||
| 80 | } else if (isset($fBeginCollaboration) && Permission::userHasDocumentWritePermission($fDocumentID)) { | 88 | } else if (isset($fBeginCollaboration) && Permission::userHasDocumentWritePermission($fDocumentID)) { |
| 81 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 89 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 82 | //begin the collaboration process | 90 | //begin the collaboration process |