Commit f057f80e12ba84397b9654167bb26ec5a4f0acda

Authored by nbm
1 parent 5c815434

Get document id back from the oDocument object


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5518 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 3 additions and 2 deletions
view.php
@@ -93,14 +93,15 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -93,14 +93,15 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
93 $this->oPage->addError('No document was requested. Please <a href="' . KTBrowseUtil::getBrowseBaseUrl() . '">browse</a> for one.'); 93 $this->oPage->addError('No document was requested. Please <a href="' . KTBrowseUtil::getBrowseBaseUrl() . '">browse</a> for one.');
94 return $this->do_error(); 94 return $this->do_error();
95 } 95 }
96 - $document_data["document_id"] = $document_id;  
97 -  
98 // try get the document. 96 // try get the document.
99 $oDocument =& Document::get($document_id); 97 $oDocument =& Document::get($document_id);
100 if (PEAR::isError($oDocument)) { 98 if (PEAR::isError($oDocument)) {
101 $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . KTBrowseUtil::getBrowseBaseUrl() . '">browse</a> for one.'); 99 $this->oPage->addError('The document you attempted to retrieve is invalid. Please <a href="' . KTBrowseUtil::getBrowseBaseUrl() . '">browse</a> for one.');
102 return $this->do_error(); 100 return $this->do_error();
103 } 101 }
  102 + $document_id = $oDocument->getId();
  103 + $document_data["document_id"] = $oDocument->getId();
  104 +
104 105
105 if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) { 106 if (!KTBrowseUtil::inAdminMode($this->oUser, $oDocument->getFolderId())) {
106 if ($oDocument->getStatusID() == ARCHIVED) { 107 if ($oDocument->getStatusID() == ARCHIVED) {