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,6 +4,7 @@ require_once("../../../../config/dmsDefaults.php"); | ||
| 4 | require_once("$default->fileSystemRoot/lib/browse/BrowserFactory.inc"); | 4 | require_once("$default->fileSystemRoot/lib/browse/BrowserFactory.inc"); |
| 5 | require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); | 5 | require_once("$default->fileSystemRoot/lib/browse/Browser.inc"); |
| 6 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentType.inc"); | 6 | require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentType.inc"); |
| 7 | +require_once("$default->fileSystemRoot/lib/documentmanagement/DocumentTransaction.inc"); | ||
| 7 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | 8 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 8 | require_once("$default->uiDirectory/documentmanagement/browseUI.inc"); | 9 | require_once("$default->uiDirectory/documentmanagement/browseUI.inc"); |
| 9 | require_once("$default->fileSystemRoot/presentation/Html.inc"); | 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,16 +17,6 @@ require_once("$default->uiDirectory/foldermanagement/addFolderUI.inc"); | ||
| 17 | * @package presentation.lookAndFeel.knowledgeTree.documentmanagement | 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 | * Generates radio button selects for document browse by type | 21 | * Generates radio button selects for document browse by type |
| 32 | * Javascript refreshes the form when it changes | 22 | * Javascript refreshes the form when it changes |
| @@ -95,20 +85,20 @@ function renderCategoryResults($aResults) { | @@ -95,20 +85,20 @@ function renderCategoryResults($aResults) { | ||
| 95 | // category name | 85 | // category name |
| 96 | $sToRender .= "<td>" . displayCategoryLink($aResults["categories"][$i]) . "</td>"; | 86 | $sToRender .= "<td>" . displayCategoryLink($aResults["categories"][$i]) . "</td>"; |
| 97 | // blank filename | 87 | // blank filename |
| 98 | - $sToRender .= "<td></td>"; | 88 | + $sToRender .= "<td> </td>"; |
| 99 | // creator name | 89 | // creator name |
| 100 | - $sToRender .= "<td></td>"; | 90 | + $sToRender .= "<td> </td>"; |
| 101 | // modified date | 91 | // modified date |
| 102 | - $sToRender .= "<td></td>"; | 92 | + $sToRender .= "<td> </td>"; |
| 103 | // document type | 93 | // document type |
| 104 | - $sToRender .= "<td></td>"; | 94 | + $sToRender .= "<td> </td>"; |
| 105 | 95 | ||
| 106 | $sToRender .= "</tr>\n"; | 96 | $sToRender .= "</tr>\n"; |
| 107 | } | 97 | } |
| 108 | } else { | 98 | } else { |
| 109 | // else the first entry is the category name, so display the documents in the category | 99 | // else the first entry is the category name, so display the documents in the category |
| 110 | // with full paths | 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 | return $sToRender; | 103 | return $sToRender; |
| 114 | } | 104 | } |
| @@ -160,19 +150,19 @@ function renderDocumentTypeResults($aResults) { | @@ -160,19 +150,19 @@ function renderDocumentTypeResults($aResults) { | ||
| 160 | // document type name | 150 | // document type name |
| 161 | $sToRender .= "<td>" . displayDocumentTypeLink($aResults["documentTypes"][$i]) . "</td>"; | 151 | $sToRender .= "<td>" . displayDocumentTypeLink($aResults["documentTypes"][$i]) . "</td>"; |
| 162 | // blank filename | 152 | // blank filename |
| 163 | - $sToRender .= "<td></td>"; | 153 | + $sToRender .= "<td> </td>"; |
| 164 | // creator name | 154 | // creator name |
| 165 | - $sToRender .= "<td></td>"; | 155 | + $sToRender .= "<td> </td>"; |
| 166 | // modified date | 156 | // modified date |
| 167 | - $sToRender .= "<td></td>"; | 157 | + $sToRender .= "<td> </td>"; |
| 168 | // document type | 158 | // document type |
| 169 | - $sToRender .= "<td></td>"; | 159 | + $sToRender .= "<td> </td>"; |
| 170 | $sToRender .= "</tr>\n"; | 160 | $sToRender .= "</tr>\n"; |
| 171 | } | 161 | } |
| 172 | } else { | 162 | } else { |
| 173 | // else the first entry is the document type name, so display the documents in the document type | 163 | // else the first entry is the document type name, so display the documents in the document type |
| 174 | // with full paths | 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 | return $sToRender; | 167 | return $sToRender; |
| 178 | } | 168 | } |
| @@ -200,13 +190,13 @@ function renderFolderResults($aResults) { | @@ -200,13 +190,13 @@ function renderFolderResults($aResults) { | ||
| 200 | // folder name | 190 | // folder name |
| 201 | $sToRender .= "<td>" . $sFolderLink . "</td>"; | 191 | $sToRender .= "<td>" . $sFolderLink . "</td>"; |
| 202 | // blank filename (??: folder description?) | 192 | // blank filename (??: folder description?) |
| 203 | - $sToRender .= "<td></td>"; | 193 | + $sToRender .= "<td> </td>"; |
| 204 | // creator name | 194 | // creator name |
| 205 | - $sToRender .= "<td>" . $oCreator->getName() . "</td>"; | 195 | + $sToRender .= "<td>" . ($oCreator ? $oCreator->getName() : " ") . "</td>"; |
| 206 | // modified date (TODO: add to db) | 196 | // modified date (TODO: add to db) |
| 207 | - $sToRender .= "<td></td>"; | 197 | + $sToRender .= "<td> </td>"; |
| 208 | // document type (??: display one of the mapped document types?) | 198 | // document type (??: display one of the mapped document types?) |
| 209 | - $sToRender .= "<td></td>"; | 199 | + $sToRender .= "<td> </td>"; |
| 210 | $sToRender .= "</tr>\n"; | 200 | $sToRender .= "</tr>\n"; |
| 211 | } | 201 | } |
| 212 | } else { | 202 | } else { |
| @@ -271,6 +261,8 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | @@ -271,6 +261,8 @@ function renderSortHeadings($sSortBy, $sSortDirection) { | ||
| 271 | * @param boolean whether to display the complete path to the document or not | 261 | * @param boolean whether to display the complete path to the document or not |
| 272 | */ | 262 | */ |
| 273 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { | 263 | function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessage, $bDisplayFullPath = false) { |
| 264 | + global $default; | ||
| 265 | + | ||
| 274 | $iFolderCount = count($aResults["folders"]) - 1; | 266 | $iFolderCount = count($aResults["folders"]) - 1; |
| 275 | // loop through the files and display links | 267 | // loop through the files and display links |
| 276 | if (count($aResults["documents"]) > 0) { | 268 | if (count($aResults["documents"]) > 0) { |
| @@ -280,8 +272,9 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | @@ -280,8 +272,9 @@ function renderDocumentList($aResults, $sNoDocumentsMessage, $sNoPermissionMessa | ||
| 280 | $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td>" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; | 272 | $sToRender .= "<tr bgcolor=\"" . getColour($i+$iFolderCount) . "\" width=\"100%\"><td>" . displayDocumentLink($aResults["documents"][$i], $bDisplayFullPath) . "</td>"; |
| 281 | $sToRender .= "<td>" . $aResults["documents"][$i]->getFileName() . "</td>"; | 273 | $sToRender .= "<td>" . $aResults["documents"][$i]->getFileName() . "</td>"; |
| 282 | $oCreator = User::get($aResults["documents"][$i]->getCreatorID()); | 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 | $oDocumentType = DocumentType::get($aResults["documents"][$i]->getDocumentTypeID()); | 278 | $oDocumentType = DocumentType::get($aResults["documents"][$i]->getDocumentTypeID()); |
| 286 | if ($oDocumentType) { | 279 | if ($oDocumentType) { |
| 287 | $sToRender .= "<td>" . $oDocumentType->getName() . "</td>"; | 280 | $sToRender .= "<td>" . $oDocumentType->getName() . "</td>"; |