Commit 2b496a0093d1ff3c0033221fee5aeeb812507b73
1 parent
665a6d1a
display error message if an archived document is viewed
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1953 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
11 additions
and
5 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
| @@ -225,10 +225,16 @@ if (checkSession()) { | @@ -225,10 +225,16 @@ if (checkSession()) { | ||
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | $oPatternCustom = & new PatternCustom(); | 227 | $oPatternCustom = & new PatternCustom(); |
| 228 | - if (Permission::userHasDocumentWritePermission($fDocumentID)) { | ||
| 229 | - $oPatternCustom->setHtml(getEditPage($oDocument)); | ||
| 230 | - } else if (Permission::userHasDocumentReadPermission($fDocumentID)) { | ||
| 231 | - $oPatternCustom->setHtml(getViewPage($oDocument)); | 228 | + if ($oDocument->getStatusID() == lookupStatusID("Live")) { |
| 229 | + if (Permission::userHasDocumentWritePermission($fDocumentID)) { | ||
| 230 | + $oPatternCustom->setHtml(getEditPage($oDocument)); | ||
| 231 | + } else if (Permission::userHasDocumentReadPermission($fDocumentID)) { | ||
| 232 | + $oPatternCustom->setHtml(getViewPage($oDocument)); | ||
| 233 | + } | ||
| 234 | + } else if ($oDocument->getStatusID() == lookupStatusID("Archived")) { | ||
| 235 | + // cancel | ||
| 236 | + $oPatternCustom->setHtml("<a href=\"" . generateControllerLink("browse", "fFolderID=" . $oDocument->getFolderID()) . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a>\n"); | ||
| 237 | + $main->setErrorMessage("This document has been archived."); | ||
| 232 | } | 238 | } |
| 233 | $main->setCentralPayload($oPatternCustom); | 239 | $main->setCentralPayload($oPatternCustom); |
| 234 | $main->setFormAction("$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID()); | 240 | $main->setFormAction("$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID()); |
| @@ -237,7 +243,7 @@ if (checkSession()) { | @@ -237,7 +243,7 @@ if (checkSession()) { | ||
| 237 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | 243 | require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); |
| 238 | 244 | ||
| 239 | $oPatternCustom = & new PatternCustom(); | 245 | $oPatternCustom = & new PatternCustom(); |
| 240 | - $oPatternCustom->setHtml(""); | 246 | + $oPatternCustom->setHtml("<a href=\"" . generateControllerLink("browse", "fFolderID=" . $oDocument->getFolderID()) . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a>\n"); |
| 241 | $main->setErrorMessage("Either you do not have permission to view this document, or the document you have chosen no longer exists on the file system."); | 247 | $main->setErrorMessage("Either you do not have permission to view this document, or the document you have chosen no longer exists on the file system."); |
| 242 | $main->setCentralPayload($oPatternCustom); | 248 | $main->setCentralPayload($oPatternCustom); |
| 243 | $main->render(); | 249 | $main->render(); |