Commit bafdf2ebde76596dc1661ef8a94509f6f3b907b5

Authored by Michael Joseph
1 parent 57147f29

(#2676) integrated triggering download on successful document checkout


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2377 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php
... ... @@ -191,8 +191,13 @@ if (checkSession()) {
191 191 $oPatternCustom->setHtml(getPage($oDocument, false));
192 192 }
193 193 $main->setDHTMLScrolling(false);
194   - $main->setOnLoadJavaScript("switchDiv('" . (isset($fShowSection) ? $fShowSection : "documentData") . "', 'document')");
195   -
  194 +
  195 + $sJavaScript = "switchDiv('" . (isset($fShowSection) ? $fShowSection : "documentData") . "', 'document');";
  196 + if ($fCheckedOut) {
  197 + $sCheckOutMessage = "You have now checked out this document. No one else can make updates to the document while you have it checked out. Save the document, make your changes and check it back in as soon as you finish working on it.";
  198 + $sJavaScript .= "redirectLink('$sCheckOutMessage', '" . generateControllerUrl("downloadDocument", "fDocumentID=$fDocumentID") . "')";
  199 + }
  200 + $main->setOnLoadJavaScript($sJavaScript);
196 201 } else if ($oDocument->isArchived()) {
197 202  
198 203 // allow admins to restore the document
... ...