Commit 02c88b9ebac73b245c5db680fa08629c143f7b72

Authored by michael
1 parent bfc090a2

#3425 changed to use common function in documentUI.inc


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2770 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
... ... @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/users/User.inc");
36 36 require_once("$default->fileSystemRoot/lib/security/Permission.inc");
37 37 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
38 38 require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); //###
39   -require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); //###
  39 +require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); //###
  40 +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc");
40 41 require_once("$default->fileSystemRoot/presentation/Html.inc");
41 42  
42 43 if(checkSession()) {
... ...
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
... ... @@ -39,22 +39,6 @@ function getSubmitSuccessPage($iDocumentID){
39 39 }
40 40  
41 41 /**
42   - * Renders the path for the document
43   - *
44   - * @param $fDocumentID -> a valid document ID
45   - */
46   -function renderDocumentPath($iDocumentID) {
47   - global $default;
48   -
49   - $oDocument = & Document::get($iDocumentID);
50   - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
51   - $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td");
52   - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > ";
53   - $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>";
54   - return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n";
55   -}
56   -
57   -/**
58 42 * Display the ADD COMMENT page
59 43 *
60 44 * @param $fDocumentID -> a valid Document ID
... ... @@ -66,7 +50,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody, $iCommentID, $fNewCommen
66 50  
67 51 $sHeading = "Add a Comment";
68 52 $sToRender .= renderHeading($sHeading);
69   - $sToRender .= renderDocumentPath($fDocumentID);
  53 + $sToRender .= displayDocumentPath($fDocumentID);
70 54 $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n";
71 55 $sToRender .= "<td align=right width=500>";
72 56 $sToRender .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
... ... @@ -100,7 +84,7 @@ function getCommentBody($sCommentBody, $sCommentSubject,$dDate,$iDocumentID, $sU
100 84 $sHeading = "Document Comment";
101 85  
102 86 $sToRender .= renderHeading($sHeading);
103   - $sToRender .= renderDocumentPath($iDocumentID);
  87 + $sToRender .= displayDocumentPath($iDocumentID);
104 88 $sToRender .= "<br>&nbsp;<b>Author: </b>$sUserName";
105 89 $sToRender .= "<table width=\"96%\" border=\"1\"><tr>";
106 90 $sToRender .= "<td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\"> <font color=#056DCE>$sCommentSubject</font></td>";
... ...
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
... ... @@ -36,7 +36,8 @@ require_once(&quot;$default-&gt;fileSystemRoot/lib/visualpatterns/PatternCustom.inc&quot;);
36 36 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc");
37 37 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
38 38 require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc");
39   -require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc");
  39 +require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc");
  40 +require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc");
40 41 require_once("$default->fileSystemRoot/presentation/Html.inc");
41 42  
42 43 if (checkSession()) {
... ... @@ -70,7 +71,7 @@ if (checkSession()) {
70 71  
71 72 $oSearchResults = & new PatternTableSqlQuery ($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars);
72 73 $sToRender .= renderHeading("Document Discussion Thread");
73   - $sToRender .= renderDocumentPath($oThread->getDocumentID());
  74 + $sToRender .= displayDocumentPath($oThread->getDocumentID());
74 75 $oPatternCustom->addHtml($sToRender);
75 76 $oPatternCustom->addHtml(getPageButtons($oThread));
76 77 $oPatternCustom->addHtml($oSearchResults->render());
... ...
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
... ... @@ -66,23 +66,6 @@ function getNewThreadOption($fDocumentID) {
66 66 return $sToRender;
67 67 }
68 68  
69   -
70   -/**
71   - * Renders the path for the document
72   - *
73   - * @param $fDocumentID -> a valid document ID
74   - */
75   -function renderDocumentPath($iDocumentID) {
76   - global $default;
77   -
78   - $oDocument = & Document::get($iDocumentID);
79   - $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"])));
80   - $sTDBGColour = $default->siteMap->getSectionColour($sSectionName, "td");
81   - $sDocumentPath = displayFolderPathLink(Folder::getFolderPathAsArray($oDocument->getFolderID()), Folder::getFolderPathNamesAsArray($oDocument->getFolderID()), "$default->rootUrl/control.php?action=browse") . " > ";
82   - $sDocumentPath .= "<a href=\"$default->rootUrl/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php?fDocumentID=" . $oDocument->getID() . "&fForInlineView=1\">" . $oDocument->getName() . "</a>";
83   - return "<table border=0 cellpadding=\"5\" width = 100%><tr><td bgcolor=\"$sTDBGColour\">$sDocumentPath</td></tr></table>\n";
84   -}
85   -
86 69 /**
87 70 * Views the list of comments for a document
88 71 * Prints out 1 comment
... ... @@ -110,7 +93,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) {
110 93 $sHeading = "Document Discussion Comments";
111 94  
112 95 $sToRender .= renderHeading($sHeading );
113   - $sToRender .= renderDocumentPath($oThread->getDocumentID());
  96 + $sToRender .= displayDocumentPath($oThread->getDocumentID());
114 97 $sToRender .= "<table border=0 width=100%><tr>";
115 98 $sToRender .= "<td width=100><b>Views: </b> " . $oThread->getNumberOfViews() . "</td>";
116 99 $sToRender .= "<td width=20></td>";
... ... @@ -148,7 +131,7 @@ function getCommentBody($oComment, $iDocumentID, $oUser) {
148 131 $sHeading = "Document Comment";
149 132  
150 133 $sToRender .= renderHeading($sHeading);
151   - $sToRender .= renderDocumentPath($iDocumentID);
  134 + $sToRender .= displayDocumentPath($iDocumentID);
152 135 $aBody = explode("\n",$oComment->getBody());
153 136 $sBody = "";
154 137 $numChars = 160; // number of chars in a line
... ...