Commit 767d86554b5c053046d8a49aaf92b1652ee5c4d5
1 parent
b89b8402
added more access control for move document
corrected expression for archiving document git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2300 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
5 additions
and
2 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
| @@ -358,7 +358,10 @@ function displayActionButtons($oDocument, $bEdit) { | @@ -358,7 +358,10 @@ function displayActionButtons($oDocument, $bEdit) { | ||
| 358 | } | 358 | } |
| 359 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("viewHistory", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/history.gif\" border=\"0\" /></a></td></tr>\n"; | 359 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("viewHistory", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/history.gif\" border=\"0\" /></a></td></tr>\n"; |
| 360 | if ($bEdit) { | 360 | if ($bEdit) { |
| 361 | - $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("moveDocument", "fFolderID=" . $oDocument->getFolderID() . "&fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/move.gif\" border=\"0\" /></a></td></tr>\n"; | 361 | + // documents in collaboration and checked out documents can't be moved |
| 362 | + if (!$oDocument->getIsCheckedOut() && (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID()))) { | ||
| 363 | + $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("moveDocument", "fFolderID=" . $oDocument->getFolderID() . "&fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/move.gif\" border=\"0\" /></a></td></tr>\n"; | ||
| 364 | + } | ||
| 362 | } | 365 | } |
| 363 | 366 | ||
| 364 | // display the unsubscribe button if the user is subscribed to the document | 367 | // display the unsubscribe button if the user is subscribed to the document |
| @@ -370,7 +373,7 @@ function displayActionButtons($oDocument, $bEdit) { | @@ -370,7 +373,7 @@ function displayActionButtons($oDocument, $bEdit) { | ||
| 370 | } | 373 | } |
| 371 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/docactions/discussion.gif\" border=\"0\" /></a></td></tr>\n"; | 374 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/docactions/discussion.gif\" border=\"0\" /></a></td></tr>\n"; |
| 372 | // only display the archive button for available documents | 375 | // only display the archive button for available documents |
| 373 | - if (!$oDocument->getIsCheckedOut() || !$oDocument->hasCollaboration() || (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID()))) { | 376 | + if (!$oDocument->getIsCheckedOut() && !$oDocument->hasCollaboration() && (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID()))) { |
| 374 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/archive.gif\" border=\"0\" /></a></td></tr>\n"; | 377 | $sToRender .= "<tr><td align=\"left\"><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/archive.gif\" border=\"0\" /></a></td></tr>\n"; |
| 375 | } | 378 | } |
| 376 | $sToRender .= "<td align=\"left\"><a href=\"" . generateControllerLink("createDependantDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/dependentdoc.gif\" border=\"0\" /></a></td>\n"; | 379 | $sToRender .= "<td align=\"left\"><a href=\"" . generateControllerLink("createDependantDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/docactions/dependentdoc.gif\" border=\"0\" /></a></td>\n"; |