diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
index 1c2ef9f..663e16c 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
@@ -31,7 +31,7 @@ if (checkSession()) {
if (isset($fAddComment)) { // User wishes to add a comment
if ($fDocumentID > 0) { // The document ID is positive
$main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID");
- $oPatternCustom->setHtml(getAddComment($fDocumentID,$sSubject,$sBody));
+ $oPatternCustom->setHtml(getAddComment($fDocumentID,$sSubject,$sBody, $fCommentID, 1));
}
else { // And invalid Document ID was sent
$main->setErrorMessage("The Document id cannot be lss than 0. ID is invalid.");
@@ -99,7 +99,7 @@ if (checkSession()) {
}else { // the user has not entered BOTH a subject and a text body
$main->setErrorMessage("The subject line and/or body may be empty" . $NewCommentSubject . "#" . $NewComment);
$main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID");
- $oPatternCustom->addHtml(getAddComment($fDocumentID,$_POST["NewCommentSubject"],$_POST["NewComment"]));
+ $oPatternCustom->addHtml(getAddComment($fDocumentID,$_POST["NewCommentSubject"],$_POST["NewComment"], $fCommentID, 1));
} // end of IF for Subject and Body test
} else if (isset($fReplyComment)){ // if user is replying to existing comment
@@ -122,11 +122,11 @@ if (checkSession()) {
$sReply = "Re: ";
}else { $sReply = ""; }
- $oPatternCustom->addHtml(getAddComment($fDocumentID, $sReply . $oComment->getSubject() , urldecode($sReplyBody) ));
+ $oPatternCustom->addHtml(getAddComment($fDocumentID, $sReply . $oComment->getSubject() , urldecode($sReplyBody), $fCommentID, "-1" ));
} else if (isset($fNewThread)){ // Start adding a new Thread
$main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID&fNewThread=1");
- $oPatternCustom->addHtml(getAddComment($fDocumentID, $CommentSubject , $Comment ));
+ $oPatternCustom->addHtml(getAddComment($fDocumentID, $CommentSubject , $Comment, $fCommentID, "1"));
} else { // If no discussion exists
$main->setErrorMessage("Error: No discussion thread available");
diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
index f89aa3d..7ccd2ca 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
@@ -62,15 +62,19 @@ function renderDocumentPath($iDocumentID) {
* @param $sSubject -> a Subject text
* @param $sBody -> a Body text
*/
-function getAddComment($fDocumentID, $sSubject, $sBody) {
+function getAddComment($fDocumentID, $sSubject, $sBody, $iCommentID, $fNewComment = null) {
global $default;
$sHeading = "Add a Comment";
$sToRender .= renderHeading($sHeading);
$sToRender .= renderDocumentPath($fDocumentID);
$sToRender .= "
\n";
diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
index 6e88031..482f249 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
@@ -13,8 +13,8 @@ function getPageButtons($oThread){
global $default;
$sToRender .= "\n";
//$sToRender .= "getDocumentID() . "&fAddComment=1") . "\">
graphicsUrl/widgets/addcomment.gif\" border=\"0\" />\n";
@@ -118,7 +118,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) {
$sToRender .= "Views: " . $oThread->getNumberOfViews() . " | ";
$sToRender .= " | ";
$sToRender .= "Replies: " . $oThread->getNumberOfReplies() . " | ";
- $sToRender .= "getDocumentID() . "&fAddComment=1") . "\"> graphicsUrl/widgets/addcomment.gif\" border=\"0\" />";
+ $sToRender .= " | getDocumentID() . "&fAddComment=1&fCommentID=" . $oComment->getID()) . "\"> graphicsUrl/widgets/addcomment.gif\" border=\"0\" />";
$sToRender .= " graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" > | ";
$sToRender .= "
\n";
$sToRender .= "\n";
@@ -156,7 +156,7 @@ function getCommentBody($oComment, $iDocumentID, $oUser) {
$sToRender .= "