Commit 67597995af71b03896031b068a4a2de195832f6e

Authored by omar
1 parent 237e470c

*** empty log message ***


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1775 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
@@ -75,10 +75,13 @@ if (checkSession()) { @@ -75,10 +75,13 @@ if (checkSession()) {
75 if($oComment->getID() > 0) { 75 if($oComment->getID() > 0) {
76 $oThread = DiscussionThread::get($iThreadID); 76 $oThread = DiscussionThread::get($iThreadID);
77 $oThread->setLastCommentID($oComment->getID()); 77 $oThread->setLastCommentID($oComment->getID());
78 - if ($oThread->getFirstComment() == -1){ // if it is a new Thread 78 + if ($oThread->getFirstCommentID() == -1){ // if it is a new Thread
79 $oThread->setFirstCommentID($oComment->getID()); 79 $oThread->setFirstCommentID($oComment->getID());
80 } 80 }
81 - $oThread->setNumberOfViews(); 81 + if($_SESSION['Discussion' . $iDocumentID][0]->bViews != true ){
  82 + $oThread->setNumberOfViews();
  83 + $_SESSION['Discussion' . $iDocumentID][0]->bViews = true;
  84 + }
82 $oThread->setNumberOfReplies(); 85 $oThread->setNumberOfReplies();
83 if ($oThread->Update()) { 86 if ($oThread->Update()) {
84 $oPatternCustom->addHtml(getSubmitSuccessPage($iDocumentID)); 87 $oPatternCustom->addHtml(getSubmitSuccessPage($iDocumentID));
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
@@ -67,12 +67,12 @@ function getAddComment($fDocumentID, $sSubject, $sBody) { @@ -67,12 +67,12 @@ function getAddComment($fDocumentID, $sSubject, $sBody) {
67 $sHeading = "Add a Comment"; 67 $sHeading = "Add a Comment";
68 $sToRender .= renderHeading($sHeading); 68 $sToRender .= renderHeading($sHeading);
69 $sToRender .= renderDocumentPath($fDocumentID); 69 $sToRender .= renderDocumentPath($fDocumentID);
70 - $sToRender .= "<table width=\"100%\" border=0><tr><td></td>\n";  
71 - $sToRender .= "<td align=right><input type=\"submit\" style=\"BORDER-RIGHT: 0px groove; BORDER-TOP: 0px groove; BACKGROUND-IMAGE: url($default->graphicsUrl/widgets/submit.gif); BORDER-LEFT: 0px groove; WIDTH: 45px; BORDER-BOTTOM: 0px groove; HEIGHT: 18; BACKGROUND-COLOR: white\" width=\"45\" height=\"20\" value=\" \" width=\"100\"></td></tr>\n"; 70 + $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n";
  71 + $sToRender .= "<td align=right><input onmouseover=\"this.style.cursor='hand'\" type=\"submit\" style=\"BORDER-RIGHT: 0px groove; BORDER-TOP: 0px groove; BACKGROUND-IMAGE: url($default->graphicsUrl/widgets/submit.gif); BORDER-LEFT: 0px groove; WIDTH: 45px; BORDER-BOTTOM: 0px groove; HEIGHT: 18; BACKGROUND-COLOR: white\" width=\"45\" height=\"20\" value=\" \" width=\"100\"></td></tr>\n";
72 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td>\n"; 72 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td>\n";
73 $sToRender .= "<input type=\"text\" style=\"width:100%\" name=\"NewCommentSubject\" id=\"NewCommentSubject\" value=\"$sSubject\"></td></tr>\n"; 73 $sToRender .= "<input type=\"text\" style=\"width:100%\" name=\"NewCommentSubject\" id=\"NewCommentSubject\" value=\"$sSubject\"></td></tr>\n";
74 $sToRender .= "<tr><td valign=\"top\"><b>Body</b></td><td><textarea style=\"width:100%\" rows=\"21\" name=\"NewComment\" id=\"NewComment\" style=\"FONT-STYLE: normal; FONT-FAMILY: sans-serif; FONT-VARIANT: normal\">$sBody</textarea></td></tr></table>\n"; 74 $sToRender .= "<tr><td valign=\"top\"><b>Body</b></td><td><textarea style=\"width:100%\" rows=\"21\" name=\"NewComment\" id=\"NewComment\" style=\"FONT-STYLE: normal; FONT-FAMILY: sans-serif; FONT-VARIANT: normal\">$sBody</textarea></td></tr></table>\n";
75 - $sToRender .= "</table>"; 75 +
76 76
77 return $sToRender; 77 return $sToRender;
78 78
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
@@ -44,10 +44,10 @@ if(checksession) { @@ -44,10 +44,10 @@ if(checksession) {
44 $oPatternCustom->addHtml(getViewComment($i+1,$oThread,$oComment,$oUser)); 44 $oPatternCustom->addHtml(getViewComment($i+1,$oThread,$oComment,$oUser));
45 } 45 }
46 // On opening, increment the number of views of current thread & update database 46 // On opening, increment the number of views of current thread & update database
47 - if($_SESSION['Discussion'][0]->bViews !=true ){ 47 + if($_SESSION['Discussion' . $fDocumentID][0]->bViews !=true ){
48 $oThread->setNumberOfViews(); 48 $oThread->setNumberOfViews();
49 if($oThread->Update() == false) $oPatternCustom->addHtml("Failed to update. Please Contact Database Administrator in this regard") ; 49 if($oThread->Update() == false) $oPatternCustom->addHtml("Failed to update. Please Contact Database Administrator in this regard") ;
50 - $_SESSION['Discussion'][0]->bViews = true; 50 + $_SESSION['Discussion' . $fDocumentID][0]->bViews = true;
51 } 51 }
52 } else { $oPatternCustom->setHtml(getViewFailPage("")) ;} 52 } else { $oPatternCustom->setHtml(getViewFailPage("")) ;}
53 } else { // No current thread, option to create one 53 } else { // No current thread, option to create one
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
@@ -28,8 +28,8 @@ function getNewThreadOption($fDocumentID) { @@ -28,8 +28,8 @@ function getNewThreadOption($fDocumentID) {
28 $sToRender .= "No discussion thread is currently available.<br><br>"; 28 $sToRender .= "No discussion thread is currently available.<br><br>";
29 $sToRender .= "Would you like to create a new Discussion thread for this document?"; 29 $sToRender .= "Would you like to create a new Discussion thread for this document?";
30 $sToRender .= "&nbsp;&nbsp;&nbsp;"; 30 $sToRender .= "&nbsp;&nbsp;&nbsp;";
31 - $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $fDocumentID . "&fNewThread=1") . "\"><img src=\"$default->graphicsUrl/widgets/new.gif\" border=\"0\" /></a> &nbsp;";  
32 - $sToRender .= "<a href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $fDocumentID) . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\" /></a>"; 31 + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $fDocumentID . "&fNewThread=1") . "\"><img src=\"$default->graphicsUrl/widgets/new.gif\" border=\"0\"></a>";
  32 + $sToRender .= "<a href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $fDocumentID) . "\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" border=\"0\"></a>";
33 33
34 return $sToRender; 34 return $sToRender;
35 } 35 }
@@ -109,13 +109,11 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { @@ -109,13 +109,11 @@ function getCommentBody($oComment, $iDocumentID, $oUser) {
109 109
110 $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n"; 110 $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n";
111 $sToRender .= "<td align=right>\n"; 111 $sToRender .= "<td align=right>\n";
112 - $sToRender .= "<input type=\"submit\" style=\"BORDER-RIGHT: 0px groove; BORDER-TOP: 0px groove; BACKGROUND-IMAGE: url($default->graphicsUrl/widgets/reply.gif); BORDER-LEFT: 0px groove; WIDTH: 40px; BORDER-BOTTOM: 0px groove; HEIGHT: 18; BACKGROUND-COLOR: white\" height=\"20\" value=\" \" width=\"200\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; 112 + $sToRender .= "<input onmouseover=\"this.style.cursor='hand'\" type=\"submit\" style=\"BORDER-RIGHT: 0px groove; BORDER-TOP: 0px groove; BACKGROUND-IMAGE: url($default->graphicsUrl/widgets/reply.gif); BORDER-LEFT: 0px groove; WIDTH: 40px; BORDER-BOTTOM: 0px groove; HEIGHT: 18; BACKGROUND-COLOR: white\" height=\"20\" value=\" \" width=\"200\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
113 $sToRender .= "</td></tr>\n"; 113 $sToRender .= "</td></tr>\n";
114 $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; 114 $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">";
115 $sToRender .= "<input name=\"CommentSubject\" id=\"CommentSubject\" style=\"background-color:#F5F6EE;BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 100%; BORDER-RIGHT-WIDTH: 0px\" readOnly width=0 value=\"" . $oComment->getSubject() . "\">"; 115 $sToRender .= "<input name=\"CommentSubject\" id=\"CommentSubject\" style=\"background-color:#F5F6EE;BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 100%; BORDER-RIGHT-WIDTH: 0px\" readOnly width=0 value=\"" . $oComment->getSubject() . "\">";
116 - $sToRender .= "</td><td><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font>&nbsp;&nbsp;&nbsp;</td></tr><tr><td colspan=3 valign=top>";  
117 - //$sToRender .= "<TEXTAREA readOnly name=\"Comment\" id=\"Comment\" style=\"BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 0px; SCROLLBAR-SHADOW-COLOR: white; SCROLLBAR-3DLIGHT-COLOR: white; SCROLLBAR-ARROW-COLOR: white; SCROLLBAR-DARKSHADOW-COLOR: white; SCROLLBAR-BASE-COLOR: white; BORDER-RIGHT-WIDTH: 0px;FONT-FAMILY: sans-serif;\" rows=40 cols=96> ";  
118 - //$sToRender .= "<TEXTAREA readOnly name=\"Comment\" id=\"Comment\" style=\"BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 0px; SCROLLBAR-SHADOW-COLOR: white; SCROLLBAR-3DLIGHT-COLOR: white; SCROLLBAR-ARROW-COLOR: white; SCROLLBAR-DARKSHADOW-COLOR: white; SCROLLBAR-BASE-COLOR: white; BORDER-RIGHT-WIDTH: 0px;FONT-FAMILY: sans-serif;\" rows=40 cols=96> "; 116 + $sToRender .= "</td><td><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font>&nbsp;&nbsp;&nbsp;</td></tr><tr><td colspan=3 valign=top>";
119 $sToRender .= "<TEXTAREA readOnly name=\"Comment\" id=\"Comment\" rows=40 cols=100 style=\"BORDER-WIDTH: 0px;FONT-FAMILY: sans-serif;\"> "; 117 $sToRender .= "<TEXTAREA readOnly name=\"Comment\" id=\"Comment\" rows=40 cols=100 style=\"BORDER-WIDTH: 0px;FONT-FAMILY: sans-serif;\"> ";
120 $sToRender .= urldecode($oComment->getBody()); 118 $sToRender .= urldecode($oComment->getBody());
121 $sToRender .= "</textarea></td>"; 119 $sToRender .= "</textarea></td>";
presentation/lookAndFeel/knowledgeTree/documentmanagement/viewUI.inc
@@ -163,6 +163,7 @@ function displayActionButtons($oDocument, $bEdit) { @@ -163,6 +163,7 @@ function displayActionButtons($oDocument, $bEdit) {
163 } 163 }
164 $sToRender .= "<td><a onClick=\"alert('This will download a copy of the document and is not the same as Checking Out a document- changes to this downloaded file will not be managed in the DMS.'); return true;\" href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForDownload=1") . "\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n"; 164 $sToRender .= "<td><a onClick=\"alert('This will download a copy of the document and is not the same as Checking Out a document- changes to this downloaded file will not be managed in the DMS.'); return true;\" href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $oDocument->getID() . "&fForDownload=1") . "\"><img src=\"$default->graphicsUrl/widgets/download.gif\" border=\"0\" /></a></td>\n";
165 $sToRender .= "<td><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/discussion.gif\" border=\"0\" /></a></td>\n"; 165 $sToRender .= "<td><a href=\"" . generateControllerLink("viewDiscussion", "fDocumentID=" . $oDocument->getID() . "&fForDiscussion=1") . "\"><img src=\"$default->graphicsUrl/widgets/discussion.gif\" border=\"0\" /></a></td>\n";
  166 +
166 return $sToRender; 167 return $sToRender;
167 } 168 }
168 169