Commit 60041e62658b5235cc1d9ff3b3de635c239fc202
1 parent
9d1a9330
update ui to display folder creator
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1745 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
36 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| @@ -46,6 +46,8 @@ function renderBrowseTypeSelect($sBrowseType) { | @@ -46,6 +46,8 @@ function renderBrowseTypeSelect($sBrowseType) { | ||
| 46 | (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> Document Type\n</span>"; | 46 | (($sBrowseType=="documentType") ? " checked=\"checked\"" : "") . "/> Document Type\n</span>"; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | +// <category display helper methods> | ||
| 50 | + | ||
| 49 | /** | 51 | /** |
| 50 | * Displays the passed category path as a link | 52 | * Displays the passed category path as a link |
| 51 | * | 53 | * |
| @@ -78,6 +80,11 @@ function displayCategoryLink($sCategoryName) { | @@ -78,6 +80,11 @@ function displayCategoryLink($sCategoryName) { | ||
| 78 | } | 80 | } |
| 79 | } | 81 | } |
| 80 | 82 | ||
| 83 | +/** | ||
| 84 | + * Displays the results for category browsing | ||
| 85 | + * | ||
| 86 | + * @param array the category browse results | ||
| 87 | + */ | ||
| 81 | function renderCategoryResults($aResults) { | 88 | function renderCategoryResults($aResults) { |
| 82 | $sToRender = ""; | 89 | $sToRender = ""; |
| 83 | 90 | ||
| @@ -95,6 +102,9 @@ function renderCategoryResults($aResults) { | @@ -95,6 +102,9 @@ function renderCategoryResults($aResults) { | ||
| 95 | return $sToRender; | 102 | return $sToRender; |
| 96 | } | 103 | } |
| 97 | 104 | ||
| 105 | +// </category display helper methods> | ||
| 106 | + | ||
| 107 | +// <document type display helper methods> | ||
| 98 | /** | 108 | /** |
| 99 | * Displays the passed document type path as a link | 109 | * Displays the passed document type path as a link |
| 100 | * | 110 | * |
| @@ -123,7 +133,11 @@ function displayDocumentTypeLink($aDocumentType) { | @@ -123,7 +133,11 @@ function displayDocumentTypeLink($aDocumentType) { | ||
| 123 | $aDocumentType["name"]); | 133 | $aDocumentType["name"]); |
| 124 | } | 134 | } |
| 125 | 135 | ||
| 126 | - | 136 | +/** |
| 137 | + * Displays the results for document type browsing | ||
| 138 | + * | ||
| 139 | + * @param array the document type browse results | ||
| 140 | + */ | ||
| 127 | function renderDocumentTypeResults($aResults) { | 141 | function renderDocumentTypeResults($aResults) { |
| 128 | $sToRender = ""; | 142 | $sToRender = ""; |
| 129 | 143 | ||
| @@ -140,6 +154,8 @@ function renderDocumentTypeResults($aResults) { | @@ -140,6 +154,8 @@ function renderDocumentTypeResults($aResults) { | ||
| 140 | } | 154 | } |
| 141 | return $sToRender; | 155 | return $sToRender; |
| 142 | } | 156 | } |
| 157 | +// </document type display helper methods> | ||
| 158 | + | ||
| 143 | 159 | ||
| 144 | /** | 160 | /** |
| 145 | * Displays the headings for the displayed document details and enables | 161 | * Displays the headings for the displayed document details and enables |
| @@ -184,6 +200,11 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | @@ -184,6 +200,11 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | ||
| 184 | return $sToRender; | 200 | return $sToRender; |
| 185 | } | 201 | } |
| 186 | 202 | ||
| 203 | +/** | ||
| 204 | + * Displays the folders in the browse results | ||
| 205 | + * | ||
| 206 | + * @param array the browse result objects | ||
| 207 | + */ | ||
| 187 | function renderFolderResults($aResults) { | 208 | function renderFolderResults($aResults) { |
| 188 | global $default; | 209 | global $default; |
| 189 | $sToRender = ""; | 210 | $sToRender = ""; |
| @@ -191,8 +212,9 @@ function renderFolderResults($aResults) { | @@ -191,8 +212,9 @@ function renderFolderResults($aResults) { | ||
| 191 | // now loop through the rest of the folders and display links | 212 | // now loop through the rest of the folders and display links |
| 192 | if (count($aResults["folders"]) > 1) { | 213 | if (count($aResults["folders"]) > 1) { |
| 193 | for ($i=1; $i<count($aResults["folders"]); $i++) { | 214 | for ($i=1; $i<count($aResults["folders"]); $i++) { |
| 194 | - $sRow = displayFolderLink($aResults["folders"][$i]); | ||
| 195 | - $sToRender .= "<tr><td colspan=\"5\" nowrap width=\"100%\" bgcolor=\"" . getColour($i) . "\">" . $sRow . "</td></tr>\n"; | 215 | + $sFolderLink = displayFolderLink($aResults["folders"][$i]); |
| 216 | + $oCreator = User::get($aResults["folders"][$i]->getCreatorID()); | ||
| 217 | + $sToRender .= "<tr bgcolor=\"" . getColour($i) . "\"><td colspan=\"2\" nowrap width=\"100%\">" . $sFolderLink . "</td><td>" . $oCreator->getName() . "</td><td colspan=\"2\"></td></tr>\n"; | ||
| 196 | } | 218 | } |
| 197 | } else { | 219 | } else { |
| 198 | $sToRender .= "<tr><td>This folder contains no sub folders</td></tr>"; | 220 | $sToRender .= "<tr><td>This folder contains no sub folders</td></tr>"; |
| @@ -203,6 +225,14 @@ function renderFolderResults($aResults) { | @@ -203,6 +225,14 @@ function renderFolderResults($aResults) { | ||
| 203 | return $sToRender; | 225 | return $sToRender; |
| 204 | } | 226 | } |
| 205 | 227 | ||
| 228 | +/** | ||
| 229 | + * Displays the documents in the browse results | ||
| 230 | + * | ||
| 231 | + * @param array the browse result objects | ||
| 232 | + * @param string the message to display if there are no documents | ||
| 233 | + * @param string the message to display if the current user doesn't have permission to view the documents | ||
| 234 | + * @param boolean whether to display the complete path to the document or not | ||
| 235 | + */ | ||
| 206 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { | 236 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { |
| 207 | // loop through the files and display links | 237 | // loop through the files and display links |
| 208 | if (count($aResults["documents"]) > 0) { | 238 | if (count($aResults["documents"]) > 0) { |
| @@ -269,7 +299,9 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | @@ -269,7 +299,9 @@ function renderPage($aResults, $sBrowseType, $sSortBy, $sSortDirection) { | ||
| 269 | return $sToRender; | 299 | return $sToRender; |
| 270 | } | 300 | } |
| 271 | 301 | ||
| 272 | - | 302 | +/** |
| 303 | + * Candy striping helper method | ||
| 304 | + */ | ||
| 273 | function getColour($iColourCount) { | 305 | function getColour($iColourCount) { |
| 274 | return ($iColourCount%2 == 0) ? "F5F6EE" : "FFFFFF"; | 306 | return ($iColourCount%2 == 0) ? "F5F6EE" : "FFFFFF"; |
| 275 | } | 307 | } |