Commit 5c83ea9681096d1a7ece2214e1906c5a7a8a7cf1
1 parent
f92a7feb
allow restoration of archived documents by admin
allow restoration request by users git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2083 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
18 additions
and
9 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
| ... | ... | @@ -51,6 +51,7 @@ require_once("$default->fileSystemRoot/lib/web/WebDocument.inc"); |
| 51 | 51 | |
| 52 | 52 | require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc"); |
| 53 | 53 | |
| 54 | +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/archiving/restoreArchivedDocumentUI.inc"); | |
| 54 | 55 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc"); |
| 55 | 56 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc"); |
| 56 | 57 | require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); |
| ... | ... | @@ -259,9 +260,15 @@ if (checkSession()) { |
| 259 | 260 | $oPatternCustom->setHtml(getViewPage($oDocument)); |
| 260 | 261 | } |
| 261 | 262 | } else if ($oDocument->isArchived()) { |
| 262 | - // cancel | |
| 263 | - $oPatternCustom->setHtml("<a href=\"" . generateControllerLink("browse", "fFolderID=" . $oDocument->getFolderID()) . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a>\n"); | |
| 264 | 263 | $main->setErrorMessage("This document has been archived."); |
| 264 | + | |
| 265 | + // allow admins to restore the document | |
| 266 | + if (Permission::userIsSystemAdministrator() || Permission::userIsUnitAdministrator()) { | |
| 267 | + $oPatternCustom->setHtml(getRestoreArchivedDocumentPage($oDocument)); | |
| 268 | + } else { | |
| 269 | + // and ordinary users to request that the document be restored | |
| 270 | + $oPatternCustom->setHtml(getRequestRestoreDocumentPage($oDocument)); | |
| 271 | + } | |
| 265 | 272 | } |
| 266 | 273 | $main->setCentralPayload($oPatternCustom); |
| 267 | 274 | $main->setFormAction("$default->rootUrl/control.php?action=modifyDocument&fDocumentID=" . $oDocument->getID()); | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| ... | ... | @@ -234,7 +234,7 @@ function getEditPage($oDocument) { |
| 234 | 234 | $sToRender .= "<td>\n"; |
| 235 | 235 | |
| 236 | 236 | $sToRender .= "\t<table border = 0>\n"; |
| 237 | - $sToRender .= "\t<tr width>\n"; | |
| 237 | + $sToRender .= "\t<tr>\n"; | |
| 238 | 238 | $sToRender .= "\t\t<td>" . renderDocumentData($oDocument) . "</td>\n"; |
| 239 | 239 | $sToRender .= "\t</tr>\n"; |
| 240 | 240 | $sToRender .= "\t<tr>\n"; |
| ... | ... | @@ -344,7 +344,7 @@ function getViewPage($oDocument) { |
| 344 | 344 | $sToRender .= "<tr>\n"; |
| 345 | 345 | $sToRender .= "<td>\n"; |
| 346 | 346 | $sToRender .= "\t<table border = 0 width = 280>\n"; |
| 347 | - $sToRender .= "\t<tr width>\n"; | |
| 347 | + $sToRender .= "\t<tr>\n"; | |
| 348 | 348 | $sToRender .= "\t\t<td>" . renderDocumentData($oDocument) . "</td>\n"; |
| 349 | 349 | $sToRender .= "\t</tr>\n"; |
| 350 | 350 | $sToRender .= "\t<tr>\n"; |
| ... | ... | @@ -395,7 +395,7 @@ function getCheckOutEditPage($oDocument, $bCheckedOut = false) { |
| 395 | 395 | $sToRender .= "<tr>\n"; |
| 396 | 396 | $sToRender .= "<td>\n"; |
| 397 | 397 | $sToRender .= "\t<table border = 0 width = 280>\n"; |
| 398 | - $sToRender .= "\t<tr width>\n"; | |
| 398 | + $sToRender .= "\t<tr>\n"; | |
| 399 | 399 | $sToRender .= "\t\t<td>" . renderDocumentData($oDocument) . "</td>\n"; |
| 400 | 400 | $sToRender .= "\t</tr>\n"; |
| 401 | 401 | $sToRender .= "\t<tr>\n"; |
| ... | ... | @@ -443,7 +443,7 @@ function getCheckInEditPage($oDocument) { |
| 443 | 443 | $sToRender .= "<tr>\n"; |
| 444 | 444 | $sToRender .= "<td>\n"; |
| 445 | 445 | $sToRender .= "\t<table border = 0 width = 280>\n"; |
| 446 | - $sToRender .= "\t<tr width>\n"; | |
| 446 | + $sToRender .= "\t<tr>\n"; | |
| 447 | 447 | $sToRender .= "\t\t<td>" . renderDocumentData($oDocument) . "</td>\n"; |
| 448 | 448 | $sToRender .= "\t</tr>\n"; |
| 449 | 449 | $sToRender .= "\t<tr>\n"; |
| ... | ... | @@ -480,7 +480,7 @@ function getWebPublishPage($oDocument) { |
| 480 | 480 | $sToRender .= "<tr>\n"; |
| 481 | 481 | $sToRender .= "<td>\n"; |
| 482 | 482 | $sToRender .= "\t<table border = 0 width = 280>\n"; |
| 483 | - $sToRender .= "\t<tr width>\n"; | |
| 483 | + $sToRender .= "\t<tr>\n"; | |
| 484 | 484 | $sToRender .= "\t\t<td>" . renderDocumentData($oDocument) . "</td>\n"; |
| 485 | 485 | $sToRender .= "\t</tr>\n"; |
| 486 | 486 | $sToRender .= "\t<tr>\n"; |
| ... | ... | @@ -522,8 +522,10 @@ function getWebPublishPage($oDocument) { |
| 522 | 522 | return $sToRender; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | +/** | |
| 526 | + * Wraps html in a bordered table | |
| 527 | + */ | |
| 525 | 528 | function wrapInTable($sHtml) { |
| 526 | 529 | return "\n\t\t\t<table border = 1, width = 100%><tr><td>$sHtml</td></tr></table>\n"; |
| 527 | 530 | } |
| 528 | - | |
| 529 | -?> | |
| 531 | +?> | |
| 530 | 532 | \ No newline at end of file | ... | ... |