Commit 02c88b9ebac73b245c5db680fa08629c143f7b72
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
Showing
4 changed files
with
9 additions
and
40 deletions
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
| @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/users/User.inc"); | @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/users/User.inc"); | ||
| 36 | require_once("$default->fileSystemRoot/lib/security/Permission.inc"); | 36 | require_once("$default->fileSystemRoot/lib/security/Permission.inc"); |
| 37 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | 37 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); |
| 38 | require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); //### | 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 | require_once("$default->fileSystemRoot/presentation/Html.inc"); | 41 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 41 | 42 | ||
| 42 | if(checkSession()) { | 43 | if(checkSession()) { |
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
| @@ -39,22 +39,6 @@ function getSubmitSuccessPage($iDocumentID){ | @@ -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 | * Display the ADD COMMENT page | 42 | * Display the ADD COMMENT page |
| 59 | * | 43 | * |
| 60 | * @param $fDocumentID -> a valid Document ID | 44 | * @param $fDocumentID -> a valid Document ID |
| @@ -66,7 +50,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody, $iCommentID, $fNewCommen | @@ -66,7 +50,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody, $iCommentID, $fNewCommen | ||
| 66 | 50 | ||
| 67 | $sHeading = "Add a Comment"; | 51 | $sHeading = "Add a Comment"; |
| 68 | $sToRender .= renderHeading($sHeading); | 52 | $sToRender .= renderHeading($sHeading); |
| 69 | - $sToRender .= renderDocumentPath($fDocumentID); | 53 | + $sToRender .= displayDocumentPath($fDocumentID); |
| 70 | $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n"; | 54 | $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n"; |
| 71 | $sToRender .= "<td align=right width=500>"; | 55 | $sToRender .= "<td align=right width=500>"; |
| 72 | $sToRender .= " "; | 56 | $sToRender .= " "; |
| @@ -100,7 +84,7 @@ function getCommentBody($sCommentBody, $sCommentSubject,$dDate,$iDocumentID, $sU | @@ -100,7 +84,7 @@ function getCommentBody($sCommentBody, $sCommentSubject,$dDate,$iDocumentID, $sU | ||
| 100 | $sHeading = "Document Comment"; | 84 | $sHeading = "Document Comment"; |
| 101 | 85 | ||
| 102 | $sToRender .= renderHeading($sHeading); | 86 | $sToRender .= renderHeading($sHeading); |
| 103 | - $sToRender .= renderDocumentPath($iDocumentID); | 87 | + $sToRender .= displayDocumentPath($iDocumentID); |
| 104 | $sToRender .= "<br> <b>Author: </b>$sUserName"; | 88 | $sToRender .= "<br> <b>Author: </b>$sUserName"; |
| 105 | $sToRender .= "<table width=\"96%\" border=\"1\"><tr>"; | 89 | $sToRender .= "<table width=\"96%\" border=\"1\"><tr>"; |
| 106 | $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>"; | 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("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | @@ -36,7 +36,8 @@ require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); | ||
| 36 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); | 36 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); |
| 37 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc"); | 37 | require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc"); |
| 38 | require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); | 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 | require_once("$default->fileSystemRoot/presentation/Html.inc"); | 41 | require_once("$default->fileSystemRoot/presentation/Html.inc"); |
| 41 | 42 | ||
| 42 | if (checkSession()) { | 43 | if (checkSession()) { |
| @@ -70,7 +71,7 @@ if (checkSession()) { | @@ -70,7 +71,7 @@ if (checkSession()) { | ||
| 70 | 71 | ||
| 71 | $oSearchResults = & new PatternTableSqlQuery ($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars); | 72 | $oSearchResults = & new PatternTableSqlQuery ($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars); |
| 72 | $sToRender .= renderHeading("Document Discussion Thread"); | 73 | $sToRender .= renderHeading("Document Discussion Thread"); |
| 73 | - $sToRender .= renderDocumentPath($oThread->getDocumentID()); | 74 | + $sToRender .= displayDocumentPath($oThread->getDocumentID()); |
| 74 | $oPatternCustom->addHtml($sToRender); | 75 | $oPatternCustom->addHtml($sToRender); |
| 75 | $oPatternCustom->addHtml(getPageButtons($oThread)); | 76 | $oPatternCustom->addHtml(getPageButtons($oThread)); |
| 76 | $oPatternCustom->addHtml($oSearchResults->render()); | 77 | $oPatternCustom->addHtml($oSearchResults->render()); |
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
| @@ -66,23 +66,6 @@ function getNewThreadOption($fDocumentID) { | @@ -66,23 +66,6 @@ function getNewThreadOption($fDocumentID) { | ||
| 66 | return $sToRender; | 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 | * Views the list of comments for a document | 70 | * Views the list of comments for a document |
| 88 | * Prints out 1 comment | 71 | * Prints out 1 comment |
| @@ -110,7 +93,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) { | @@ -110,7 +93,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) { | ||
| 110 | $sHeading = "Document Discussion Comments"; | 93 | $sHeading = "Document Discussion Comments"; |
| 111 | 94 | ||
| 112 | $sToRender .= renderHeading($sHeading ); | 95 | $sToRender .= renderHeading($sHeading ); |
| 113 | - $sToRender .= renderDocumentPath($oThread->getDocumentID()); | 96 | + $sToRender .= displayDocumentPath($oThread->getDocumentID()); |
| 114 | $sToRender .= "<table border=0 width=100%><tr>"; | 97 | $sToRender .= "<table border=0 width=100%><tr>"; |
| 115 | $sToRender .= "<td width=100><b>Views: </b> " . $oThread->getNumberOfViews() . "</td>"; | 98 | $sToRender .= "<td width=100><b>Views: </b> " . $oThread->getNumberOfViews() . "</td>"; |
| 116 | $sToRender .= "<td width=20></td>"; | 99 | $sToRender .= "<td width=20></td>"; |
| @@ -148,7 +131,7 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { | @@ -148,7 +131,7 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { | ||
| 148 | $sHeading = "Document Comment"; | 131 | $sHeading = "Document Comment"; |
| 149 | 132 | ||
| 150 | $sToRender .= renderHeading($sHeading); | 133 | $sToRender .= renderHeading($sHeading); |
| 151 | - $sToRender .= renderDocumentPath($iDocumentID); | 134 | + $sToRender .= displayDocumentPath($iDocumentID); |
| 152 | $aBody = explode("\n",$oComment->getBody()); | 135 | $aBody = explode("\n",$oComment->getBody()); |
| 153 | $sBody = ""; | 136 | $sBody = ""; |
| 154 | $numChars = 160; // number of chars in a line | 137 | $numChars = 160; // number of chars in a line |