Commit 4bd50314fdd9a0357bd759d1c730556266931e6b
1 parent
7c2228c4
(#2813) refactored and tidied
incorporated addDocField link git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2506 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
39 additions
and
73 deletions
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/listDocFieldsBL.php
| @@ -8,57 +8,22 @@ | @@ -8,57 +8,22 @@ | ||
| 8 | * | 8 | * |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | - require_once("../../../../../config/dmsDefaults.php"); | 11 | +require_once("../../../../../config/dmsDefaults.php"); |
| 12 | +require_once("$default->fileSystemRoot/lib/users/User.inc"); | ||
| 13 | +require_once("$default->fileSystemRoot/lib/security/permission.inc"); | ||
| 14 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 15 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | ||
| 16 | +require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 17 | +require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 18 | +require_once("listDocFieldsUI.inc"); | ||
| 19 | +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/administration/adminUI.inc"); | ||
| 12 | 20 | ||
| 13 | -if (checkSession()) { | ||
| 14 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); | ||
| 15 | - require_once("listDocFieldsUI.inc"); | ||
| 16 | - require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); | ||
| 17 | - require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | ||
| 18 | - require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | ||
| 19 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | ||
| 20 | - require_once("$default->fileSystemRoot/lib/security/permission.inc"); | ||
| 21 | - require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 22 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 23 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc"); | ||
| 24 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | ||
| 25 | - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | ||
| 26 | - require_once("$default->fileSystemRoot/presentation/Html.inc"); | ||
| 27 | - | ||
| 28 | - | 21 | +if (checkSession()) { |
| 29 | $oPatternCustom = & new PatternCustom(); | 22 | $oPatternCustom = & new PatternCustom(); |
| 30 | - | ||
| 31 | -if(checkSession()) { | ||
| 32 | - global $default; | ||
| 33 | - | ||
| 34 | - $oPatternCustom->addHtml(renderHeading("Document Fields List")); // Create the Heading | ||
| 35 | - | ||
| 36 | - $main->setFormAction($_SERVER['PHP_SELF']); | ||
| 37 | - | ||
| 38 | - $sQuery = "SELECT id as DocFieldID, name as DocFieldName, data_type, is_generic, has_lookup, " . | ||
| 39 | - "'Edit', 'Delete', 'Edit Lookups' " . | ||
| 40 | - "FROM " . $default->owl_fields_table . " " . | ||
| 41 | - "ORDER BY name"; | ||
| 42 | - | ||
| 43 | - $aColumns = array("DocFieldName", "data_type", "is_generic", "has_lookup","Edit", "Delete", "Edit Lookups" ); | ||
| 44 | - $aColumnNames = array("Name", "Data type", "Generic?", "Lookup?", "Edit", "Delete", "Edit Lookups"); | ||
| 45 | - $aColumnTypes = array(1,1,2,2,3,3,3); | ||
| 46 | - $aDBColumnArray = array("DocFieldID"); | ||
| 47 | - $aQueryStringVariableNames = array("fDocFieldID"); | ||
| 48 | - | ||
| 49 | - $aHyperLinkURL = array( 4=> "$default->rootUrl/control.php?action=editDocField", | ||
| 50 | - 5=> "$default->rootUrl/control.php?action=removeDocField", | ||
| 51 | - 6=> "$default->rootUrl/control.php?action=editDocFieldLookups"); | ||
| 52 | - | ||
| 53 | - $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 54 | - $oSearchResults->setDisplayColumnHeadings(true); | ||
| 55 | - $htmlTables = $oSearchResults->render() ; | ||
| 56 | - | ||
| 57 | - $oPatternCustom->addHtml($htmlTables); | ||
| 58 | - | ||
| 59 | - } // end of if checksession | ||
| 60 | - | 23 | + $oPatternCustom->setHtml(getPage($fGroupID)); |
| 24 | + require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); | ||
| 61 | $main->setCentralPayload($oPatternCustom); | 25 | $main->setCentralPayload($oPatternCustom); |
| 62 | - $main->render(); | 26 | + $main->setFormAction($_SERVER['PHP_SELF']); |
| 27 | + $main->render(); | ||
| 63 | } | 28 | } |
| 64 | -?> | 29 | -?> |
| 30 | +?> | ||
| 65 | \ No newline at end of file | 31 | \ No newline at end of file |
presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/listDocFieldsUI.inc
| @@ -8,35 +8,36 @@ | @@ -8,35 +8,36 @@ | ||
| 8 | * | 8 | * |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -function getSubmit() { | ||
| 12 | - global $default; | ||
| 13 | - $sToRender = "<input type=\"image\" src =\"$default->graphicsUrl/widgets/select.gif\" value=\"submit\" border=\"0\"/>\n"; | ||
| 14 | - return $sToRender; | ||
| 15 | -} | ||
| 16 | - | ||
| 17 | -function getPageButtons($oThread){ | 11 | +function getFields() { |
| 18 | global $default; | 12 | global $default; |
| 19 | 13 | ||
| 20 | - $sToRender .= "<table width=100%><tr>\n"; | ||
| 21 | - $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n"; | ||
| 22 | - $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n"; | ||
| 23 | - | ||
| 24 | - $sToRender .= "</tr></table>\n"; | 14 | + $sQuery = "SELECT id as DocFieldID, name as DocFieldName, data_type, is_generic, has_lookup, " . |
| 15 | + "'Edit', 'Delete', 'Edit Lookups' " . | ||
| 16 | + "FROM " . $default->owl_fields_table . " " . | ||
| 17 | + "ORDER BY name"; | ||
| 25 | 18 | ||
| 26 | - return $sToRender ; | 19 | + $aColumns = array("DocFieldName", "data_type", "is_generic", "has_lookup","Edit", "Delete", "Edit Lookups" ); |
| 20 | + $aColumnNames = array("Name", "Data type", "Generic?", "Lookup?", "Edit", "Delete", "Edit Lookups"); | ||
| 21 | + $aColumnTypes = array(1,1,2,2,3,3,3); | ||
| 22 | + $aDBColumnArray = array("DocFieldID"); | ||
| 23 | + $aQueryStringVariableNames = array("fDocFieldID"); | ||
| 24 | + | ||
| 25 | + $aHyperLinkURL = array( 4=> "$default->rootUrl/control.php?action=editDocField", | ||
| 26 | + 5=> "$default->rootUrl/control.php?action=removeDocField", | ||
| 27 | + 6=> "$default->rootUrl/control.php?action=editDocFieldLookups"); | ||
| 28 | + | ||
| 29 | + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames); | ||
| 30 | + $oSearchResults->setDisplayColumnHeadings(true); | ||
| 31 | + return $oSearchResults->render() ; | ||
| 27 | } | 32 | } |
| 28 | 33 | ||
| 29 | -// If there are no threads to view for a document | ||
| 30 | -function getViewFailPage($sMessage) | ||
| 31 | -{ | 34 | +function getPage() { |
| 32 | global $default; | 35 | global $default; |
| 33 | - | ||
| 34 | - if (strlen($sMessage)>0){ | ||
| 35 | - $sToRender = $sMessage; | ||
| 36 | - } | ||
| 37 | - else $sToRender = "Current document has no discussion. Press the ADD button to start a discussion."; | ||
| 38 | - | 36 | + $sToRender .= renderHeading("Current Document Fields"); |
| 37 | + | ||
| 38 | + // add user link | ||
| 39 | + $sToRender .= getAddLink("addDocField", "Add A Document Field"); | ||
| 40 | + $sToRender .= getFields(); | ||
| 39 | return $sToRender; | 41 | return $sToRender; |
| 40 | } | 42 | } |
| 41 | - | ||
| 42 | ?> | 43 | ?> |
| 43 | \ No newline at end of file | 44 | \ No newline at end of file |