diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
index 678b370..9bbeddf 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
@@ -75,10 +75,13 @@ if (checkSession()) {
if($oComment->getID() > 0) {
$oThread = DiscussionThread::get($iThreadID);
$oThread->setLastCommentID($oComment->getID());
- if ($oThread->getFirstComment() == -1){ // if it is a new Thread
+ if ($oThread->getFirstCommentID() == -1){ // if it is a new Thread
$oThread->setFirstCommentID($oComment->getID());
}
- $oThread->setNumberOfViews();
+ if($_SESSION['Discussion' . $iDocumentID][0]->bViews != true ){
+ $oThread->setNumberOfViews();
+ $_SESSION['Discussion' . $iDocumentID][0]->bViews = true;
+ }
$oThread->setNumberOfReplies();
if ($oThread->Update()) {
$oPatternCustom->addHtml(getSubmitSuccessPage($iDocumentID));
diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
index 182ac14..bbb845a 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
@@ -67,12 +67,12 @@ function getAddComment($fDocumentID, $sSubject, $sBody) {
$sHeading = "Add a Comment";
$sToRender .= renderHeading($sHeading);
$sToRender .= renderDocumentPath($fDocumentID);
- $sToRender .= "
";
+
return $sToRender;
diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
index afca899..3c81423 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
@@ -44,10 +44,10 @@ if(checksession) {
$oPatternCustom->addHtml(getViewComment($i+1,$oThread,$oComment,$oUser));
}
// On opening, increment the number of views of current thread & update database
- if($_SESSION['Discussion'][0]->bViews !=true ){
+ if($_SESSION['Discussion' . $fDocumentID][0]->bViews !=true ){
$oThread->setNumberOfViews();
if($oThread->Update() == false) $oPatternCustom->addHtml("Failed to update. Please Contact Database Administrator in this regard") ;
- $_SESSION['Discussion'][0]->bViews = true;
+ $_SESSION['Discussion' . $fDocumentID][0]->bViews = true;
}
} else { $oPatternCustom->setHtml(getViewFailPage("")) ;}
} else { // No current thread, option to create one
diff --git a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
index 3484609..334653f 100644
--- a/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
+++ b/presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
@@ -28,8 +28,8 @@ function getNewThreadOption($fDocumentID) {
$sToRender .= "No discussion thread is currently available.
";
$sToRender .= "Would you like to create a new Discussion thread for this document?";
$sToRender .= " ";
- $sToRender .= "
graphicsUrl/widgets/new.gif\" border=\"0\" /> ";
- $sToRender .= "
graphicsUrl/widgets/cancel.gif\" border=\"0\" />";
+ $sToRender .= "
graphicsUrl/widgets/new.gif\" border=\"0\">";
+ $sToRender .= "
graphicsUrl/widgets/cancel.gif\" border=\"0\">";
return $sToRender;
}
@@ -109,13 +109,11 @@ function getCommentBody($oComment, $iDocumentID, $oUser) {
$sToRender .= "