Commit 07b40b8d59dff6f0cb2fb096f391653cea1eafa4
1 parent
288e08ad
fixes to general collection function.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5756 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
18 additions
and
9 deletions
browse.php
| @@ -234,7 +234,7 @@ class BrowseDispatcher extends KTStandardDispatcher { | @@ -234,7 +234,7 @@ class BrowseDispatcher extends KTStandardDispatcher { | ||
| 234 | $collection->setColumnOptions('ktcore.columns.selection', array( | 234 | $collection->setColumnOptions('ktcore.columns.selection', array( |
| 235 | 'rangename' => 'selection', | 235 | 'rangename' => 'selection', |
| 236 | 'show_folders' => true, | 236 | 'show_folders' => true, |
| 237 | - 'show_document' => true, | 237 | + 'show_documents' => true, |
| 238 | )); | 238 | )); |
| 239 | 239 | ||
| 240 | $oTemplating =& KTTemplating::getSingleton(); | 240 | $oTemplating =& KTTemplating::getSingleton(); |
lib/browse/DocumentCollection.inc.php
| @@ -304,15 +304,15 @@ class AdvancedCollection { | @@ -304,15 +304,15 @@ class AdvancedCollection { | ||
| 304 | $this->batchStart = $this->batchPage * $this->batchSize; | 304 | $this->batchStart = $this->batchPage * $this->batchSize; |
| 305 | 305 | ||
| 306 | // visibility | 306 | // visibility |
| 307 | - $this->bShowFolders = KTUtil::arrayGet($aOptions, 'show_folders', true); | ||
| 308 | - $this->bShowDocuments = KTUtil::arrayGet($aOptions, 'show_documents', true); | 307 | + $this->bShowFolders = KTUtil::arrayGet($aOptions, 'show_folders', true, false); |
| 308 | + $this->bShowDocuments = KTUtil::arrayGet($aOptions, 'show_documents', true, false); | ||
| 309 | 309 | ||
| 310 | // sorting | 310 | // sorting |
| 311 | $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', "ktcore.columns.title"); | 311 | $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', "ktcore.columns.title"); |
| 312 | $this->sort_order = KTUtil::arrayGet($aOptions, 'sort_order', 'asc'); | 312 | $this->sort_order = KTUtil::arrayGet($aOptions, 'sort_order', 'asc'); |
| 313 | 313 | ||
| 314 | // url options | 314 | // url options |
| 315 | - $this->returnURL = KTUtil::arrayGet($aOptions, 'return_url', $_SERVER['PHP_SELF']); | 315 | + $this->returnURL = KTUtil::arrayGet($aOptions, 'result_url', $_SERVER['PHP_SELF']); |
| 316 | 316 | ||
| 317 | $this->empty_message = KTUtil::arrayGet($aOptions, 'empty_message', _kt("No folders or documents in this location.")); | 317 | $this->empty_message = KTUtil::arrayGet($aOptions, 'empty_message', _kt("No folders or documents in this location.")); |
| 318 | } | 318 | } |
| @@ -431,7 +431,11 @@ class AdvancedCollection { | @@ -431,7 +431,11 @@ class AdvancedCollection { | ||
| 431 | // assume we have not documents. This impacts "where" our documents start. | 431 | // assume we have not documents. This impacts "where" our documents start. |
| 432 | // | 432 | // |
| 433 | $no_folders = true; | 433 | $no_folders = true; |
| 434 | - $documents_to_get = $this->batchSize; | 434 | + if ($this->bShowDocuments) { |
| 435 | + $documents_to_get = $this->batchSize; | ||
| 436 | + } else { | ||
| 437 | + $documents_to_get = 0; | ||
| 438 | + } | ||
| 435 | $folders_to_get = 0; | 439 | $folders_to_get = 0; |
| 436 | 440 | ||
| 437 | if ($this->batchStart < $this->folderCount) { | 441 | if ($this->batchStart < $this->folderCount) { |
plugins/ktcore/KTColumns.inc.php
| @@ -59,7 +59,12 @@ class AdvancedTitleColumn extends AdvancedColumn { | @@ -59,7 +59,12 @@ class AdvancedTitleColumn extends AdvancedColumn { | ||
| 59 | 59 | ||
| 60 | function buildFolderLink($aDataRow) { | 60 | function buildFolderLink($aDataRow) { |
| 61 | if (is_null(KTUtil::arrayGet($this->aOptions, 'direct_folder'))) { | 61 | if (is_null(KTUtil::arrayGet($this->aOptions, 'direct_folder'))) { |
| 62 | - return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow["folder"]->getId()); | 62 | + $dest = KTUtil::arrayGet($this->aOptions, 'folder_link'); |
| 63 | + if (empty($dest)) { | ||
| 64 | + return KTUtil::addQueryStringSelf('fFolderId='.$aDataRow["folder"]->getId()); | ||
| 65 | + } else { | ||
| 66 | + return KTUtil::addQueryString($dest, 'fFolderId='.$aDataRow["folder"]->getId()); | ||
| 67 | + } | ||
| 63 | } else { | 68 | } else { |
| 64 | return KTBrowseUtil::getUrlForFolder($aDataRow['folder']); | 69 | return KTBrowseUtil::getUrlForFolder($aDataRow['folder']); |
| 65 | } | 70 | } |
| @@ -244,8 +249,8 @@ class AdvancedSelectionColumn extends AdvancedColumn { | @@ -244,8 +249,8 @@ class AdvancedSelectionColumn extends AdvancedColumn { | ||
| 244 | function setOptions($aOptions) { | 249 | function setOptions($aOptions) { |
| 245 | AdvancedColumn::setOptions($aOptions); | 250 | AdvancedColumn::setOptions($aOptions); |
| 246 | $this->rangename = KTUtil::arrayGet($this->aOptions, 'rangename', $this->rangename); | 251 | $this->rangename = KTUtil::arrayGet($this->aOptions, 'rangename', $this->rangename); |
| 247 | - $this->show_folders = KTUtil::arrayGet($this->aOptions, 'show_folders', $this->show_folders); | ||
| 248 | - $this->show_documents = KTUtil::arrayGet($this->aOptions, 'show_documents', $this->show_documents); | 252 | + $this->show_folders = KTUtil::arrayGet($this->aOptions, 'show_folders', $this->show_folders, false); |
| 253 | + $this->show_documents = KTUtil::arrayGet($this->aOptions, 'show_documents', $this->show_documents, false); | ||
| 249 | } | 254 | } |
| 250 | 255 | ||
| 251 | function renderHeader($sReturnURL) { | 256 | function renderHeader($sReturnURL) { |
| @@ -299,7 +304,7 @@ class AdvancedSingleSelectionColumn extends AdvancedSelectionColumn { | @@ -299,7 +304,7 @@ class AdvancedSingleSelectionColumn extends AdvancedSelectionColumn { | ||
| 299 | 304 | ||
| 300 | // only include the _f or _d IF WE HAVE THE OTHER TYPE. | 305 | // only include the _f or _d IF WE HAVE THE OTHER TYPE. |
| 301 | function renderData($aDataRow) { | 306 | function renderData($aDataRow) { |
| 302 | - $localname = $this->name; | 307 | + $localname = $this->rangename; |
| 303 | 308 | ||
| 304 | if (($aDataRow["type"] === "folder") && ($this->show_folders)) { | 309 | if (($aDataRow["type"] === "folder") && ($this->show_folders)) { |
| 305 | if ($this->show_documents) { | 310 | if ($this->show_documents) { |