Commit 07b40b8d59dff6f0cb2fb096f391653cea1eafa4

Authored by Brad Shuttleworth
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
browse.php
... ... @@ -234,7 +234,7 @@ class BrowseDispatcher extends KTStandardDispatcher {
234 234 $collection->setColumnOptions('ktcore.columns.selection', array(
235 235 'rangename' => 'selection',
236 236 'show_folders' => true,
237   - 'show_document' => true,
  237 + 'show_documents' => true,
238 238 ));
239 239  
240 240 $oTemplating =& KTTemplating::getSingleton();
... ...
lib/browse/DocumentCollection.inc.php
... ... @@ -304,15 +304,15 @@ class AdvancedCollection {
304 304 $this->batchStart = $this->batchPage * $this->batchSize;
305 305  
306 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 310 // sorting
311 311 $this->sort_column = KTUtil::arrayGet($aOptions, 'sort_on', "ktcore.columns.title");
312 312 $this->sort_order = KTUtil::arrayGet($aOptions, 'sort_order', 'asc');
313 313  
314 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 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 431 // assume we have not documents. This impacts "where" our documents start.
432 432 //
433 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 439 $folders_to_get = 0;
436 440  
437 441 if ($this->batchStart < $this->folderCount) {
... ...
plugins/ktcore/KTColumns.inc.php
... ... @@ -59,7 +59,12 @@ class AdvancedTitleColumn extends AdvancedColumn {
59 59  
60 60 function buildFolderLink($aDataRow) {
61 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 68 } else {
64 69 return KTBrowseUtil::getUrlForFolder($aDataRow['folder']);
65 70 }
... ... @@ -244,8 +249,8 @@ class AdvancedSelectionColumn extends AdvancedColumn {
244 249 function setOptions($aOptions) {
245 250 AdvancedColumn::setOptions($aOptions);
246 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 256 function renderHeader($sReturnURL) {
... ... @@ -299,7 +304,7 @@ class AdvancedSingleSelectionColumn extends AdvancedSelectionColumn {
299 304  
300 305 // only include the _f or _d IF WE HAVE THE OTHER TYPE.
301 306 function renderData($aDataRow) {
302   - $localname = $this->name;
  307 + $localname = $this->rangename;
303 308  
304 309 if (($aDataRow["type"] === "folder") && ($this->show_folders)) {
305 310 if ($this->show_documents) {
... ...