Commit 2e2058071e89f17137f1c8f9e36fb41fb1b46e0c

Authored by Michael Joseph
1 parent 37f36e9a

only display the check in button if the current user has the document checked ou…

…t.  display download and back buttons after document has been checked out


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1307 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -183,8 +183,8 @@ function getEditPage($oDocument) {
183 183 $sToRender .= "<td><a href=\"" . generateControllerLink("deleteDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/delete.gif\" border=\"0\" /></a></td>\n";
184 184 $sToRender .= "<td><a href=\"" . generateControllerLink("viewHistory", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/history.gif\" border=\"0\" /></a></td>\n";
185 185  
186   - // display the check in button if the document is checked out
187   - if ($oDocument->getIsCheckedOut()) {
  186 + // display the check in button if the document is checked out and you checked the document out
  187 + if ($oDocument->getIsCheckedOut() && ($oDocument->getCheckedOutUserID() == $_SESSION["userID"])) {
188 188 $sToRender .= "<td><a href=\"" . generateControllerLink("checkInDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/checkin.gif\" border=\"0\" /></a></td>\n";
189 189 // otherwise display the check out button
190 190 } else {
... ... @@ -287,6 +287,10 @@ function getCheckOutEditPage($oDocument, $bCheckedOut = false) {
287 287 $sToRender .= "\t<tr>\n";
288 288 if ($bCheckedOut) {
289 289 $sToRender .= "\t\t<td>" . wrapInTable("You have now checked out this document. No one else can make updates to the document while you have it checked out. Click the Download button to get the latest version of the file. Please check it back in, as soon as you finish working on it.") . "</td>\n";
  290 + $sToRender .= "\t</tr>";
  291 + $sToRender .= "\t<tr>\n";
  292 + $sToRender .= "<td><a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID() . "&fForDownload=1\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a>\n";
  293 + $sToRender .= "<a href=\"$default->rootUrl/control.php?action=viewDocument&fDocumentID=" . $oDocument->getID() . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a></td>\n";
290 294 } else {
291 295 $sToRender .= "\t\t<td>" . wrapInTable(renderCheckOutPage($oDocument)) . "</td>\n";
292 296 }
... ...