Commit 671f20542716cb71c9b783ad2ecb8e0d11edccd8

Authored by michael
1 parent 96fb83e7

only allow archiving if the document is available and not in collaboration


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2001 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
... ... @@ -13,18 +13,6 @@
13 13 * @package presentation.lookAndFeel.knowledgeTree.documentManager
14 14 */
15 15  
16   -/*function renderHeading() {
17   - global $default;
18   - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
19   - $sColor = $default->siteMap->getSectionColour($sSectionName, "th");
20   - $sToRender = "<table border=\"0\" width=\"600\">\n";
21   - $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">Document Detail</font></th></tr>\n";
22   - $sToRender .= "<tr/>\n";
23   - $sToRender .= "<tr/>\n";
24   - $sToRender .= "</table>\n";
25   - return $sToRender;
26   -}*/
27   -
28 16 function renderDocumentPath($oDocument) {
29 17 global $default;
30 18 $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
... ... @@ -221,7 +209,10 @@ function displayActionButtons($oDocument, $bEdit) {
221 209 }
222 210 $sToRender .= "<td><a onClick=\"alert('This will download a copy of the document and is not the same as Checking Out a document- changes to this downloaded file will not be managed in the DMS.'); return true;\" href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForDownload=1") . "\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n";
223 211 $sToRender .= "<td><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/discussion.gif\" border=\"0\" /></a></td>\n";
224   - $sToRender .= "<td><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/archive.gif\" border=\"0\" /></a></td>\n";
  212 + // only display the archive button for available documents
  213 + if (!$oDocument->getIsCheckedOut() || !$oDocument->hasCollaboration() || (!DocumentCollaboration::documentCollaborationStarted($oDocument->getID()))) {
  214 + $sToRender .= "<td><a href=\"" . generateControllerLink("archiveDocument", "fDocumentID=" . $oDocument->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/archive.gif\" border=\"0\" /></a></td>\n";
  215 + }
225 216  
226 217 return $sToRender;
227 218 }
... ... @@ -294,7 +285,7 @@ function getEditPage($oDocument) {
294 285 //if the current user is responsible for an active step in the collaboration process
295 286 $sToRender .= "\t\t<td><table border=\"0\"><tr>\n";
296 287 $sToRender .= "\t\t<td><b>You currently have an active role<br> in the collaboration process</b></td>\n";
297   - // collaboration cannot be started or approved/rejected unless the document is not checked out
  288 + // collaboration cannot be started or approved/rejected if the document is checked out
298 289 if (!$oDocument->getIsCheckedOut()) {
299 290 $sToRender .= "\t\t<td align=\"center\"><a onClick=\"return confirm('Are you sure you want to approve? You will not have access to this document until the collaboration process is complete (unless the document is rejected in a subsequent step)');\" href=" . $_SERVER['PHP_SELF'] . "?fDocumentID=" . $oDocument->getID() . "&fCollaborationStepComplete=1><img src=\"$default->graphicsUrl/widgets/approve.gif\" border=\"0\"/></a></td>\n";
300 291 $sToRender .= "\t\t<td align=\"center\"><a href=\"$default->rootUrl/control.php?action=collaborationStepReject&fDocumentID=$iDocumentID\"><img src=\"$default->graphicsUrl/widgets/reject.gif\" border=\"0\"/></a></td>\n";
... ...