Commit 918dfd4b58ce873097d4a64f249d526e2635af23

Authored by Neil Blakey-Milner
1 parent 13c98079

Pass the download action down to the version history.

Make the document name a link to the document view page on version and
transaction history.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4451 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/view.php
... ... @@ -153,7 +153,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
153 153 // fixme check perms
154 154  
155 155 $this->oDocument =& $oDocument;
156   - $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument));
  156 + $aOptions = array("final" => false);
  157 + $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
157 158 $this->oPage->setBreadcrumbDetails(_("history"));
158 159 $this->addPortlets("History");
159 160  
... ... @@ -219,11 +220,17 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
219 220 $this->oPage->title = _("Document History") . " : " . $oDocument->getName();
220 221 $oTemplating = new KTTemplating;
221 222 $oTemplate = $oTemplating->loadTemplate("kt3/document/metadata_history");
  223 +
  224 + $aActions = KTDocumentActionUtil::getDocumentActionsByNames(array('ktcore.actions.document.view'));
  225 + $oAction = $aActions[0];
  226 + $oAction->setDocument($this->oDocument);
  227 +
222 228 $aTemplateData = array(
223 229 "context" => $this,
224 230 "document_id" => $document_id,
225 231 "document" => $oDocument,
226 232 "versions" => $aVersions,
  233 + 'downloadaction' => $oAction,
227 234 );
228 235 return $oTemplate->render($aTemplateData);
229 236 }
... ... @@ -253,7 +260,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
253 260 return $this->do_error();
254 261 }
255 262 $this->oDocument =& $oDocument;
256   - $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument));
  263 + $aOptions = array("final" => false);
  264 + $this->aBreadcrumbs = array_merge($this->aBreadcrumbs, KTBrowseUtil::breadcrumbsForDocument($oDocument, $aOptions));
257 265 $this->oPage->setBreadcrumbDetails(_("compare versions"));
258 266  
259 267 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion');
... ...