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,7 +153,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
153 // fixme check perms 153 // fixme check perms
154 154
155 $this->oDocument =& $oDocument; 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 $this->oPage->setBreadcrumbDetails(_("history")); 158 $this->oPage->setBreadcrumbDetails(_("history"));
158 $this->addPortlets("History"); 159 $this->addPortlets("History");
159 160
@@ -219,11 +220,17 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -219,11 +220,17 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
219 $this->oPage->title = _("Document History") . " : " . $oDocument->getName(); 220 $this->oPage->title = _("Document History") . " : " . $oDocument->getName();
220 $oTemplating = new KTTemplating; 221 $oTemplating = new KTTemplating;
221 $oTemplate = $oTemplating->loadTemplate("kt3/document/metadata_history"); 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 $aTemplateData = array( 228 $aTemplateData = array(
223 "context" => $this, 229 "context" => $this,
224 "document_id" => $document_id, 230 "document_id" => $document_id,
225 "document" => $oDocument, 231 "document" => $oDocument,
226 "versions" => $aVersions, 232 "versions" => $aVersions,
  233 + 'downloadaction' => $oAction,
227 ); 234 );
228 return $oTemplate->render($aTemplateData); 235 return $oTemplate->render($aTemplateData);
229 } 236 }
@@ -253,7 +260,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher { @@ -253,7 +260,8 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
253 return $this->do_error(); 260 return $this->do_error();
254 } 261 }
255 $this->oDocument =& $oDocument; 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 $this->oPage->setBreadcrumbDetails(_("compare versions")); 265 $this->oPage->setBreadcrumbDetails(_("compare versions"));
258 266
259 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion'); 267 $comparison_version = KTUtil::arrayGet($_REQUEST, 'fComparisonVersion');