Commit 03f6338aeee23c5dcb3d85ecb44d3dd20e220830
1 parent
eb87e9b1
fixed #2682
removed commented out heading changed browse last modified to created git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2266 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
20 additions
and
26 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseBL.php
| ... | ... | @@ -4,6 +4,7 @@ require_once("../../../../config/dmsDefaults.php"); |
| 4 | 4 | require_once("$default->fileSystemRoot/lib/browse/BrowserFactory.inc"); |
| 5 | 5 | require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); |
| 6 | 6 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentType.inc"); |
| 7 | +require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); | |
| 7 | 8 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 8 | 9 | require_once("$default->uiDirectory/documentmanagement/browseUI.inc"); |
| 9 | 10 | require_once("$default->fileSystemRoot/presentation/Html.inc"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/browseUI.inc
| ... | ... | @@ -17,16 +17,6 @@ require_once("$default->uiDirectory/foldermanagement/addFolderUI.inc"); |
| 17 | 17 | * @package presentation.lookAndFeel.knowledgeTree.documentmanagement |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -/*function renderHeading($sHeading) { | |
| 21 | - global $default; | |
| 22 | - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 23 | - $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); | |
| 24 | - $sToRender = "<table border=\"0\" width=\"600\">\n"; | |
| 25 | - $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">$sHeading</font></th></tr>\n"; | |
| 26 | - $sToRender .= "</table>\n"; | |
| 27 | - return $sToRender; | |
| 28 | -}*/ | |
| 29 | - | |
| 30 | 20 | /** |
| 31 | 21 | * Generates radio button selects for document browse by type |
| 32 | 22 | * Javascript refreshes the form when it changes |
| ... | ... | @@ -95,20 +85,20 @@ function renderCategoryResults($aResults) { |
| 95 | 85 | // category name |
| 96 | 86 | $sToRender .= "<td>" . displayCategoryLink($aResults["categories"][$i]) . "</td>"; |
| 97 | 87 | // blank filename |
| 98 | - $sToRender .= "<td></td>"; | |
| 88 | + $sToRender .= "<td> </td>"; | |
| 99 | 89 | // creator name |
| 100 | - $sToRender .= "<td></td>"; | |
| 90 | + $sToRender .= "<td> </td>"; | |
| 101 | 91 | // modified date |
| 102 | - $sToRender .= "<td></td>"; | |
| 92 | + $sToRender .= "<td> </td>"; | |
| 103 | 93 | // document type |
| 104 | - $sToRender .= "<td></td>"; | |
| 94 | + $sToRender .= "<td> </td>"; | |
| 105 | 95 | |
| 106 | 96 | $sToRender .= "</tr>\n"; |
| 107 | 97 | } |
| 108 | 98 | } else { |
| 109 | 99 | // else the first entry is the category name, so display the documents in the category |
| 110 | 100 | // with full paths |
| 111 | - $sToRender .= renderDocumentList($aResults, "This category contains no documents", "You don't have access to the documents in this category", true); | |
| 101 | + $sToRender .= renderDocumentList($aResults, "This category contains no documents", "You don't have access to the documents in this category"); | |
| 112 | 102 | } |
| 113 | 103 | return $sToRender; |
| 114 | 104 | } |
| ... | ... | @@ -160,19 +150,19 @@ function renderDocumentTypeResults($aResults) { |
| 160 | 150 | // document type name |
| 161 | 151 | $sToRender .= "<td>" . displayDocumentTypeLink($aResults["documentTypes"][$i]) . "</td>"; |
| 162 | 152 | // blank filename |
| 163 | - $sToRender .= "<td></td>"; | |
| 153 | + $sToRender .= "<td> </td>"; | |
| 164 | 154 | // creator name |
| 165 | - $sToRender .= "<td></td>"; | |
| 155 | + $sToRender .= "<td> </td>"; | |
| 166 | 156 | // modified date |
| 167 | - $sToRender .= "<td></td>"; | |
| 157 | + $sToRender .= "<td> </td>"; | |
| 168 | 158 | // document type |
| 169 | - $sToRender .= "<td></td>"; | |
| 159 | + $sToRender .= "<td> </td>"; | |
| 170 | 160 | $sToRender .= "</tr>\n"; |
| 171 | 161 | } |
| 172 | 162 | } else { |
| 173 | 163 | // else the first entry is the document type name, so display the documents in the document type |
| 174 | 164 | // with full paths |
| 175 | - $sToRender .= renderDocumentList($aResults, "This document type contains no documents", "You don't have access to the documents in this document type", true); | |
| 165 | + $sToRender .= renderDocumentList($aResults, "This document type contains no documents", "You don't have access to the documents in this document type"); | |
| 176 | 166 | } |
| 177 | 167 | return $sToRender; |
| 178 | 168 | } |
| ... | ... | @@ -200,13 +190,13 @@ function renderFolderResults($aResults) { |
| 200 | 190 | // folder name |
| 201 | 191 | $sToRender .= "<td>" . $sFolderLink . "</td>"; |
| 202 | 192 | // blank filename (??: folder description?) |
| 203 | - $sToRender .= "<td></td>"; | |
| 193 | + $sToRender .= "<td> </td>"; | |
| 204 | 194 | // creator name |
| 205 | - $sToRender .= "<td>" . $oCreator->getName() . "</td>"; | |
| 195 | + $sToRender .= "<td>" . ($oCreator ? $oCreator->getName() : " ") . "</td>"; | |
| 206 | 196 | // modified date (TODO: add to db) |
| 207 | - $sToRender .= "<td></td>"; | |
| 197 | + $sToRender .= "<td> </td>"; | |
| 208 | 198 | // document type (??: display one of the mapped document types?) |
| 209 | - $sToRender .= "<td></td>"; | |
| 199 | + $sToRender .= "<td> </td>"; | |
| 210 | 200 | $sToRender .= "</tr>\n"; |
| 211 | 201 | } |
| 212 | 202 | } else { |
| ... | ... | @@ -271,6 +261,8 @@ function renderSortHeadings($sSortBy, $sSortDirection) { |
| 271 | 261 | * @param boolean whether to display the complete path to the document or not |
| 272 | 262 | */ |
| 273 | 263 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { |
| 264 | + global $default; | |
| 265 | + | |
| 274 | 266 | $iFolderCount = count($aResults["folders"]) - 1; |
| 275 | 267 | // loop through the files and display links |
| 276 | 268 | if (count($aResults["documents"]) > 0) { |
| ... | ... | @@ -280,8 +272,9 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa |
| 280 | 272 | $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td>" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; |
| 281 | 273 | $sToRender .= "<td>" . $aResults["documents"][$i]->getFileName() . "</td>"; |
| 282 | 274 | $oCreator = User::get($aResults["documents"][$i]->getCreatorID()); |
| 283 | - $sToRender .= "<td>" . $oCreator->getName() . "</td>"; | |
| 284 | - $sToRender .= "<td>" . $aResults["documents"][$i]->getLastModifiedDate() . "</td>"; | |
| 275 | + $sToRender .= "<td>" . ($oCreator ? $oCreator->getName() : "") . "</td>"; | |
| 276 | + $aDocumentTransaction = DocumentTransaction::getList("transaction_id=1 AND document_id=" . $aResults["documents"][$i]->getID()); | |
| 277 | + $sToRender .= "<td>" . $aDocumentTransaction[0]->dDateTime . "</td>"; | |
| 285 | 278 | $oDocumentType = DocumentType::get($aResults["documents"][$i]->getDocumentTypeID()); |
| 286 | 279 | if ($oDocumentType) { |
| 287 | 280 | $sToRender .= "<td>" . $oDocumentType->getName() . "</td>"; | ... | ... |