Commit 70ad715bff6645b848bbcb03d576d28aeb85f7eb
1 parent
e047e824
Initial revision. Document view page
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@451 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
81 additions
and
0 deletions
presentation/lookAndFeel/knowledgeTree/documentmanagement/documentViewBL.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* documentViewUI.php | |
| 4 | +* Contains the business logic required to build the document view page. | |
| 5 | +* Will use documentViewUI.php for HTML | |
| 6 | +* | |
| 7 | +* Variables expected: | |
| 8 | +* o $fDocumentID Primary key of document to view | |
| 9 | +* | |
| 10 | +* | |
| 11 | +* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 12 | +* @date 21 January 2003 | |
| 13 | +* @package presentation.lookAndFeel.knowledgeTree.documentManager | |
| 14 | +*/ | |
| 15 | + | |
| 16 | + | |
| 17 | +require_once("../../../../config/dmsDefaults.php"); | |
| 18 | +require_once("$default->owl_fs_root/lib/security/permission.inc"); | |
| 19 | +require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc"); | |
| 20 | +require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc"); | |
| 21 | +require_once("$default->owl_fs_root/lib/visualpatterns/PatternListFromQuery.inc"); | |
| 22 | +require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentViewUI.php"); | |
| 23 | + | |
| 24 | +//if (checkSession()) { | |
| 25 | + $oDocument = & Document::get(12); | |
| 26 | + renderDocumentMetaData($oDocument); | |
| 27 | +/*} else { | |
| 28 | + echo "You do not have permission for this page"; | |
| 29 | +}*/ | |
| 30 | + | |
| 31 | +?> | ... | ... |
presentation/lookAndFeel/knowledgeTree/documentmanagement/documentViewUI.php
0 → 100644
| 1 | +<?php | |
| 2 | +/** | |
| 3 | +* documentViewUI.php | |
| 4 | +* Contains HTML information required to build the document view page. | |
| 5 | +* Will be used by documentViewBL.php | |
| 6 | +* | |
| 7 | +* Variables expected: | |
| 8 | +* o $fDocumentID Primary key of document to view | |
| 9 | +* | |
| 10 | +* | |
| 11 | +* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 12 | +* @date 21 January 2003 | |
| 13 | +* @package presentation.lookAndFeel.knowledgeTree.documentManager | |
| 14 | +*/ | |
| 15 | + | |
| 16 | +function renderDocumentPath($oDocument) { | |
| 17 | + $sDocumentPath = Folder::getFolderDisplayPath($oDocument->getFolderID()) . " > " . $oDocument->getName(); | |
| 18 | + echo "<table border=1><tr><td>$sDocumentPath</td></tr></table>\n"; | |
| 19 | +} | |
| 20 | + | |
| 21 | +function renderDocumentGenericMetaData($oDocument) { | |
| 22 | + echo "<table border=1>\n"; | |
| 23 | +} | |
| 24 | + | |
| 25 | +function renderDocumentMetaData($oDocument) { | |
| 26 | + $sQuery = "SELECT D.name AS name, DT.datetime AS created_date, D.modified as last_modified, U.name as initiator, DFL.value as authors, CONCAT(CONCAT(D.major_version, \".\"), D.minor_version) AS version, WDSL.name AS status, DFL2.value AS category " . | |
| 27 | + "FROM documents AS D INNER JOIN document_fields_link AS DFL on D.id = DFL.document_id " . | |
| 28 | + "INNER JOIN users AS U on D.creator_id = U.id " . | |
| 29 | + "INNER JOIN document_transactions AS DT on DT.document_id = D.id " . | |
| 30 | + "INNER JOIN document_fields AS DF ON DF.id = DFL.document_field_id " . | |
| 31 | + "INNER JOIN document_transaction_types_lookup AS DTTL ON DTTL.id = DT.transaction_id " . | |
| 32 | + "INNER JOIN document_fields_link AS DFL2 ON DFL2.document_id = D.id " . | |
| 33 | + "INNER JOIN document_fields AS DF2 ON DF2.id = DFL2.document_field_id " . | |
| 34 | + "INNER JOIN web_documents AS WD ON WD.document_id = D.ID " . | |
| 35 | + "INNER JOIN web_documents_status_lookup AS WDSL ON WD.status_id = WDSL.id " . | |
| 36 | + "WHERE D.id = " . $oDocument->getID() . " " . | |
| 37 | + "AND DF.name LIKE 'Author' " . | |
| 38 | + "AND DF2.name LIKE 'Category' " . | |
| 39 | + "AND DTTL.name LIKE 'Create'"; | |
| 40 | + | |
| 41 | + $aColumns = array("name", "created_date", "last_modified", "initiator", "authors", "version", "status", "category"); | |
| 42 | + $aColumnNames = array("Document title", "Date created", "Last updated", "Document initiator", "Author(s)", "Version", "Status", "Category"); | |
| 43 | + $aColumnTypes = array(1,1,1,1,1,1,1,1); | |
| 44 | + | |
| 45 | + $oPatternListFromQuery = & new PatternListFromQuery($sQuery, $aColumns, $aColumnNames, $aColumnTypes); | |
| 46 | + $oPatternListFromQuery->setTableHeading("Generic Meta Data"); | |
| 47 | + echo $oPatternListFromQuery->render(); | |
| 48 | + | |
| 49 | +} | |
| 50 | +?> | ... | ... |