Commit 05731a4e79620fc7e1dcce717c90adf52f039264

Authored by michael
1 parent add091c6

#3426 provisionally added folder and document counts


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2767 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
@@ -212,7 +212,7 @@ function renderFolderResults($aResults, $bTemplateBrowsing = false) { @@ -212,7 +212,7 @@ function renderFolderResults($aResults, $bTemplateBrowsing = false) {
212 $sToRender .= "<td valign=\"bottom\">" . ($oCreator ? $oCreator->getName() : "&nbsp;") . "</td>"; 212 $sToRender .= "<td valign=\"bottom\">" . ($oCreator ? $oCreator->getName() : "&nbsp;") . "</td>";
213 // modified date (TODO: add to db) 213 // modified date (TODO: add to db)
214 $sToRender .= "<td valign=\"bottom\">&nbsp;</td>"; 214 $sToRender .= "<td valign=\"bottom\">&nbsp;</td>";
215 - // document type (??: display one of the mapped document types?) 215 + // document type (??: display one of the mapped document types? which one?)
216 $sToRender .= "<td valign=\"bottom\">&nbsp;</td>"; 216 $sToRender .= "<td valign=\"bottom\">&nbsp;</td>";
217 $sToRender .= "</tr>\n"; 217 $sToRender .= "</tr>\n";
218 } 218 }
@@ -308,6 +308,18 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa @@ -308,6 +308,18 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa
308 } 308 }
309 309
310 /** 310 /**
  311 + * #3426
  312 + * Appends folder and document counts to the last folder path
  313 + */
  314 +function appendCounts($aFolderPath, $iFolderCount, $iDocumentCount) {
  315 + // append to the last path component and return
  316 + $aFolderPath[count($aFolderPath)-1] = $aFolderPath[count($aFolderPath)-1] .
  317 + " ($iFolderCount folder" . ($iFolderCount > 1 ? "s" : "") .
  318 + ", $iDocumentCount document" . ($iDocumentCount > 1 ? "s" : "") . ")";
  319 + return $aFolderPath;
  320 +}
  321 +
  322 +/**
311 * Displays the browse page- lists folders and documents 323 * Displays the browse page- lists folders and documents
312 * 324 *
313 * @param array the browse results to display 325 * @param array the browse results to display
@@ -326,7 +338,10 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection, $bTempla @@ -326,7 +338,10 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection, $bTempla
326 338
327 $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">"; 339 $sToRender .= "<table border=\"0\" cellpadding=\"5\" width=\"100%\"><tr><td bgcolor=\"$sTDBGColour\">";
328 switch ($sBrowseType) { 340 switch ($sBrowseType) {
329 - case "folder" : $sToRender .= displayFolderPathLink(Folder::getFolderPathAsArray($aResults["folders"][0]->getID()), Folder::getFolderPathNamesAsArray($aResults["folders"][0]->getID())); break; 341 + case "folder" : $sToRender .= displayFolderPathLink(Folder::getFolderPathAsArray($aResults["folders"][0]->getID()),
  342 + appendCounts(Folder::getFolderPathNamesAsArray($aResults["folders"][0]->getID()),
  343 + count($aResults["folders"])-1,
  344 + count($aResults["documents"]))); break;
330 case "category" : $sToRender .= displayCategoryPathLink($aResults["categories"]); break; 345 case "category" : $sToRender .= displayCategoryPathLink($aResults["categories"]); break;
331 case "documentType" : $sToRender .= displayDocumentTypePathLink($aResults["documentTypes"]); break; 346 case "documentType" : $sToRender .= displayDocumentTypePathLink($aResults["documentTypes"]); break;
332 } 347 }