Commit d265e5b26ba82d0183b6b1e8a773486aa1a14acf

Authored by rob
1 parent 9b4c84cd

Initial revision.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@553 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/documentmanagement/modifyBL.php 0 → 100644
  1 +<?php
  2 +/**
  3 +* Business logic data used to modify documents (will use modifyUI.inc)
  4 +*
  5 +* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  6 +* @date 24 January 2003
  7 +* @package presentation.lookAndFeel.knowledgeTree.documentmanagement
  8 +*
  9 +*/
  10 +
  11 +require_once("../../../../config/dmsDefaults.php");
  12 +
  13 +if (checkSession()) {
  14 +
  15 + require_once("$default->owl_fs_root/lib/security/permission.inc");
  16 + require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc");
  17 + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc");
  18 + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc");
  19 + require_once("$default->owl_fs_root/lib/visualpatterns/PatternEditableTableSqlQuery.inc");
  20 + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/documentmanagement/modifyUI.inc");
  21 + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
  22 + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc");
  23 + require_once("$default->owl_fs_root/presentation/Html.inc");
  24 +
  25 + $aDocumentDataArray;
  26 + settype($aDocumentDataArray, "array");
  27 +
  28 + $oDocument = & Document::get($fDocumentID);
  29 + echo $sToRender = "<html><head></head><body><form method=\"POST\" action=\"../store.php\" >\n";
  30 + echo renderEditableGenericMetaData($oDocument);
  31 + echo "<input type=submit value=\"Submit\" /></form></body></html>";
  32 + /*if (isset($fDocumentID)) {
  33 + require_once("$default->owl_fs_root/lib/security/permission.inc");
  34 + require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc");
  35 + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc");
  36 +
  37 + if (Permission::userHasDocumentReadPermission($fDocumentID)) {
  38 + require_once("$default->owl_fs_root/lib/security/permission.inc");
  39 + require_once("$default->owl_fs_root/lib/documentmanagement/Document.inc");
  40 + require_once("$default->owl_fs_root/lib/foldermanagement/Folder.inc");
  41 + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc");
  42 + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/documentmanagement/modifyUI.inc");
  43 + require_once("$default->owl_fs_root/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
  44 + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc");
  45 + require_once("$default->owl_fs_root/presentation/Html.inc");
  46 +
  47 + $oDocument = & Document::get($fDocumentID);
  48 +
  49 + $aDocumentDataArray;
  50 + settype($aDocumentDataArray, "array");
  51 +
  52 + $oPatternCustom = & new PatternCustom();
  53 + $oPatternCustom->setHtml(getPage($oDocument));
  54 + $main->setCentralPayload($oPatternCustom);
  55 + $main->render();
  56 + } else {
  57 + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc");
  58 + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc");
  59 +
  60 + $oPatternCustom = & new PatternCustom();
  61 + $oPatternCustom->setHtml("<p class=\"errorText\">Either you do not have permission to view this document,<br>" .
  62 + "or the document you have chosen no longer exists on the file sytem.</p>\n");
  63 + $main->setCentralPayload($oPatternCustom);
  64 + $main->render();
  65 + }
  66 + } else {
  67 + require_once("$default->owl_fs_root/presentation/webpageTemplate.inc");
  68 + require_once("$default->owl_fs_root/lib/visualpatterns/PatternCustom.inc");
  69 +
  70 + $oPatternCustom = & new PatternCustom();
  71 + $oPatternCustom->setHtml("<p class=\"errorText\">You have not chosen a document to view</p>\n");
  72 + $main->setCentralPayload($oPatternCustom);
  73 + $main->render();
  74 + }*/
  75 +}
  76 +
  77 +?>
... ...
presentation/lookAndFeel/knowledgeTree/documentmanagement/modifyUI.inc 0 → 100644
  1 +<?php
  2 +
  3 +/**
  4 +* Presentation data used to modify documents (will be used by modifyBL.inc)
  5 +*
  6 +* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  7 +* @date 24 January 2003
  8 +* @package presentation.lookAndFeel.knowledgeTree.documentmanagement
  9 +*
  10 +*/
  11 +
  12 +function renderDocumentPath($oDocument) {
  13 + $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID())) . " > " . $oDocument->getName();
  14 + return "<table border=1 width = 100%><tr><td>$sDocumentPath</td></tr></table>\n";
  15 +}
  16 +
  17 +/*function renderEditableDocumentData($oDocument, $aDocumentDataArray) {
  18 + global $default;
  19 + $sQuery = "SELECT D.name, D.modified, DTT.datetime AS created, U.name AS initiator, CONCAT(CONCAT(D.major_version, '.'), D.minor_version) AS version, WDSL.name AS status " .
  20 + "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_web_documents_table AS WD ON WD.document_id = D.ID " .
  21 + "INNER JOIN $default->owl_web_documents_status_table AS WDSL ON WD.status_id = WDSL.id " .
  22 + "INNER JOIN $default->owl_users_table AS U ON U.id = D.creator_id " .
  23 + "INNER JOIN $default->owl_document_transactions_table AS DTT ON DTT.document_id = D.id " .
  24 + "INNER JOIN $default->owl_transaction_types_table AS TT ON DTT.transaction_id = TT.id " .
  25 + "WHERE D.id = " . $oDocument->getID() . " " .
  26 + "AND TT.name LIKE 'Create'";
  27 +
  28 + $sql = new Owl_DB();
  29 + $sql->query($sQuery);
  30 + $sql->next_record();
  31 +
  32 + $sToRender = "<html><head></head><body><form action=\"handler\" onsubmit=\"return validateString(documents&name&1,'Please enter user name',3,100)\">\n";
  33 + $sToRender .= "<table width = 100%>";
  34 + $sToRender .= "<caption align = left><b>Generic Meta Data</caption>";
  35 +
  36 + $aDocumentDataArray[count($aDocumentDataArray)] = "document.name.". $oDocument->getID();
  37 + $sToRender .= "<tr>\n";
  38 + $sToRender .= "\t<td>Document title</td><td>" . textInput(("documents&name&". $oDocument->getID()), $sql->f("name")) . "</td>\n";
  39 + //$sToRender .= "\t<td>Document title</td><td>" . textInput("docname", $sql->f("name")) . "</td>\n";
  40 + $sToRender .= "</tr>\n";
  41 +
  42 + $sToRender .= "<tr>\n";
  43 + $sToRender .= "\t<td>Date created</td><td>" . $sql->f("created") . "</td>\n";
  44 + $sToRender .= "</tr>\n";
  45 +
  46 + $sToRender .= "<tr>\n";
  47 + $sToRender .= "\t<td>Last updated</td><td>" . $sql->f("last_modified") . "</td>\n";
  48 + $sToRender .= "</tr>\n";
  49 +
  50 + $sToRender .= "<tr>\n";
  51 + $sToRender .= "\t<td>Document initiator</td><td>" . $sql->f("initiator") . "</td>\n";
  52 + $sToRender .= "</tr>\n";
  53 +
  54 + $sToRender .= "</table>\n";
  55 +
  56 + $sToRender .= "<input type=submit value=\"Submit\" /></form></body></html>";
  57 + return $sToRender;
  58 +}*/
  59 +
  60 +/*function renderGenericMetaData() {
  61 + "SELECT DF.name,
  62 +}*/
  63 +
  64 +function renderEditableGenericMetaData($oDocument) {
  65 + global $default;
  66 + $sQuery = "SELECT DF.name AS name, DFL.value as value, DFL.id AS id " .
  67 + "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_document_fields_table AS DFL ON D.id = DFL.document_id " .
  68 + "INNER JOIN $default->owl_fields_table AS DF ON DF.id = DFL.document_field_id " .
  69 + "WHERE document_id = " . $oDocument->getID() . " " .
  70 + "AND DF.is_generic = 1";
  71 + $aColumns = array("name", "value");
  72 + $aColumnHeaders = array("Tag", "Value");
  73 + $aColumnTypes = array(1,1);
  74 + $aColumnEditable = array(0,1);
  75 + $oPatternTableSqlQuery = & new PatternEditableTableSqlQuery($sQuery, $default->owl_document_fields_table, "generic_meta_data", $aColumns, $aColumnTypes, $aColumnEditable, $aColumnHeaders, "90%");
  76 + $oPatternTableSqlQuery->setTableHeading("Generic Meta Data");
  77 + return $oPatternTableSqlQuery->render();
  78 +
  79 +}
  80 +
  81 +
  82 +
  83 +?>
... ...