diff --git a/lib/actions/documentaction.inc.php b/lib/actions/documentaction.inc.php index d9f73e9..553c224 100644 --- a/lib/actions/documentaction.inc.php +++ b/lib/actions/documentaction.inc.php @@ -36,7 +36,7 @@ class KTDocumentAction extends KTStandardDispatcher { var $_sShowPermission = "ktcore.permissions.read"; var $_sDisablePermission; var $bAllowInAdminMode = false; - var $sHelpPage = 'ktcore/browse.html'; + var $sHelpPage = 'ktcore/browse.html'; var $sSection = "view_details"; @@ -50,6 +50,8 @@ class KTDocumentAction extends KTStandardDispatcher { $this->aBreadcrumbs = array( array('action' => 'browse', 'name' => _kt('Browse')), ); + + $this->persistParams('fDocumentId'); parent::KTStandardDispatcher(); } @@ -93,14 +95,14 @@ class KTDocumentAction extends KTStandardDispatcher { if (!KTWorkflowUtil::actionEnabledForDocument($this->oDocument, $this->sName)) { return false; } - // be nasty in archive/delete status. - $status = $this->oDocument->getStatusID(); - if (($status == DELETED) || ($status == ARCHIVED)) { return false; } + // be nasty in archive/delete status. + $status = $this->oDocument->getStatusID(); + if (($status == DELETED) || ($status == ARCHIVED)) { return false; } if ($this->bAllowInAdminMode) { // check if this user is in admin mode if (KTBrowseUtil::inAdminMode($this->oUser, $oFolder)) { return true; - } + } } return KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument); } @@ -155,14 +157,14 @@ class KTDocumentAction extends KTStandardDispatcher { function check() { $this->oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); - if (!$this->_show()) { return false; } - + if (!$this->_show()) { return false; } + $aOptions = array("final" => false, - "documentaction" => "viewDocument", - "folderaction" => "browse", + "documentaction" => "viewDocument", + "folderaction" => "browse", ); $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, - KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions)); + KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions)); $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentinfo'); $oPortlet = new KTActionPortlet(sprintf(_kt('Info about "%s"'), $this->oDocument->getName())); diff --git a/lib/actions/folderaction.inc.php b/lib/actions/folderaction.inc.php index c0b8eec..7fbaf81 100644 --- a/lib/actions/folderaction.inc.php +++ b/lib/actions/folderaction.inc.php @@ -41,13 +41,14 @@ class KTFolderAction extends KTStandardDispatcher { var $sSection = "browse"; function KTFolderAction($oFolder = null, $oUser = null, $oPlugin = null) { + parent::KTStandardDispatcher(); $this->oFolder =& $oFolder; $this->oUser =& $oUser; $this->oPlugin =& $oPlugin; $this->aBreadcrumbs = array( array('action' => 'browse', 'name' => _kt('Browse')), ); - parent::KTStandardDispatcher(); + $this->persistParams(array('fFolderId')); } function setFolder(&$oFolder) {