Commit 5210ab1dfbcbfd00f2e5ecf3cb4fd3a7fad6914e
1 parent
f0a9c611
make folders and docs persist the right vars.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5821 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
14 additions
and
11 deletions
lib/actions/documentaction.inc.php
| ... | ... | @@ -36,7 +36,7 @@ class KTDocumentAction extends KTStandardDispatcher { |
| 36 | 36 | var $_sShowPermission = "ktcore.permissions.read"; |
| 37 | 37 | var $_sDisablePermission; |
| 38 | 38 | var $bAllowInAdminMode = false; |
| 39 | - var $sHelpPage = 'ktcore/browse.html'; | |
| 39 | + var $sHelpPage = 'ktcore/browse.html'; | |
| 40 | 40 | |
| 41 | 41 | var $sSection = "view_details"; |
| 42 | 42 | |
| ... | ... | @@ -50,6 +50,8 @@ class KTDocumentAction extends KTStandardDispatcher { |
| 50 | 50 | $this->aBreadcrumbs = array( |
| 51 | 51 | array('action' => 'browse', 'name' => _kt('Browse')), |
| 52 | 52 | ); |
| 53 | + | |
| 54 | + $this->persistParams('fDocumentId'); | |
| 53 | 55 | |
| 54 | 56 | parent::KTStandardDispatcher(); |
| 55 | 57 | } |
| ... | ... | @@ -93,14 +95,14 @@ class KTDocumentAction extends KTStandardDispatcher { |
| 93 | 95 | if (!KTWorkflowUtil::actionEnabledForDocument($this->oDocument, $this->sName)) { |
| 94 | 96 | return false; |
| 95 | 97 | } |
| 96 | - // be nasty in archive/delete status. | |
| 97 | - $status = $this->oDocument->getStatusID(); | |
| 98 | - if (($status == DELETED) || ($status == ARCHIVED)) { return false; } | |
| 98 | + // be nasty in archive/delete status. | |
| 99 | + $status = $this->oDocument->getStatusID(); | |
| 100 | + if (($status == DELETED) || ($status == ARCHIVED)) { return false; } | |
| 99 | 101 | if ($this->bAllowInAdminMode) { |
| 100 | 102 | // check if this user is in admin mode |
| 101 | 103 | if (KTBrowseUtil::inAdminMode($this->oUser, $oFolder)) { |
| 102 | 104 | return true; |
| 103 | - } | |
| 105 | + } | |
| 104 | 106 | } |
| 105 | 107 | return KTPermissionUtil::userHasPermissionOnItem($this->oUser, $oPermission, $this->oDocument); |
| 106 | 108 | } |
| ... | ... | @@ -155,14 +157,14 @@ class KTDocumentAction extends KTStandardDispatcher { |
| 155 | 157 | function check() { |
| 156 | 158 | $this->oDocument =& $this->oValidator->validateDocument($_REQUEST['fDocumentId']); |
| 157 | 159 | |
| 158 | - if (!$this->_show()) { return false; } | |
| 159 | - | |
| 160 | + if (!$this->_show()) { return false; } | |
| 161 | + | |
| 160 | 162 | $aOptions = array("final" => false, |
| 161 | - "documentaction" => "viewDocument", | |
| 162 | - "folderaction" => "browse", | |
| 163 | + "documentaction" => "viewDocument", | |
| 164 | + "folderaction" => "browse", | |
| 163 | 165 | ); |
| 164 | 166 | $this->aBreadcrumbs = kt_array_merge($this->aBreadcrumbs, |
| 165 | - KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions)); | |
| 167 | + KTBrowseUtil::breadcrumbsForDocument($this->oDocument, $aOptions)); | |
| 166 | 168 | |
| 167 | 169 | $actions = KTDocumentActionUtil::getDocumentActionsForDocument($this->oDocument, $this->oUser, 'documentinfo'); |
| 168 | 170 | $oPortlet = new KTActionPortlet(sprintf(_kt('Info about "%s"'), $this->oDocument->getName())); | ... | ... |
lib/actions/folderaction.inc.php
| ... | ... | @@ -41,13 +41,14 @@ class KTFolderAction extends KTStandardDispatcher { |
| 41 | 41 | var $sSection = "browse"; |
| 42 | 42 | |
| 43 | 43 | function KTFolderAction($oFolder = null, $oUser = null, $oPlugin = null) { |
| 44 | + parent::KTStandardDispatcher(); | |
| 44 | 45 | $this->oFolder =& $oFolder; |
| 45 | 46 | $this->oUser =& $oUser; |
| 46 | 47 | $this->oPlugin =& $oPlugin; |
| 47 | 48 | $this->aBreadcrumbs = array( |
| 48 | 49 | array('action' => 'browse', 'name' => _kt('Browse')), |
| 49 | 50 | ); |
| 50 | - parent::KTStandardDispatcher(); | |
| 51 | + $this->persistParams(array('fFolderId')); | |
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | function setFolder(&$oFolder) { | ... | ... |