Commit acd1f6ea2a19b41eed4bb99778ee82519988524c
1 parent
8567ba01
fix for KTS-404: Display Doc ID on document lists.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5651 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
20 additions
and
0 deletions
plugins/ktcore/KTColumns.inc.php
| ... | ... | @@ -375,4 +375,23 @@ class AdvancedDownloadColumn extends AdvancedColumn { |
| 375 | 375 | function getName() { return _kt('Download'); } |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | + | |
| 379 | +class DocumentIDColumn extends AdvancedColumn { | |
| 380 | + var $bSortable = false; | |
| 381 | + var $namespace = 'ktcore.columns.docid'; | |
| 382 | + | |
| 383 | + function DocumentIDColumn() { | |
| 384 | + $this->label = _kt("Document ID"); | |
| 385 | + } | |
| 386 | + | |
| 387 | + function renderData($aDataRow) { | |
| 388 | + // only _ever_ show this for documents. | |
| 389 | + if ($aDataRow["type"] === "folder") { | |
| 390 | + return ' '; | |
| 391 | + } | |
| 392 | + | |
| 393 | + return htmlentities($aDataRow['document']->getId(), ENT_NOQUOTES, 'UTF-8'); | |
| 394 | + } | |
| 395 | +} | |
| 396 | + | |
| 378 | 397 | ?> |
| 379 | 398 | \ No newline at end of file | ... | ... |
plugins/ktcore/KTCorePlugin.php
| ... | ... | @@ -100,6 +100,7 @@ class KTCorePlugin extends KTPlugin { |
| 100 | 100 | $this->registerColumn(_kt("Modification Date"), 'ktcore.columns.modificationdate', 'ModificationDateColumn', 'KTColumns.inc.php'); |
| 101 | 101 | $this->registerColumn(_kt("Creator"), 'ktcore.columns.creator', 'CreatorColumn', 'KTColumns.inc.php'); |
| 102 | 102 | $this->registerColumn(_kt("Download File"), 'ktcore.columns.download', 'AdvancedDownloadColumn', 'KTColumns.inc.php'); |
| 103 | + $this->registerColumn(_kt("Document ID"), 'ktcore.columns.docid', 'DocumentIDColumn', 'KTColumns.inc.php'); | |
| 103 | 104 | |
| 104 | 105 | $this->registerView(_kt("Browse Documents"), 'ktcore.views.browse'); |
| 105 | 106 | $this->registerView(_kt("Search"), 'ktcore.views.search'); | ... | ... |