Commit a418b206deb42e7338138ccb25aaf95d4002111c
1 parent
38495c80
Made compatible with Netscape (TEXTarea problem solved)
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1832 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
14 additions
and
13 deletions
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
| ... | ... | @@ -104,7 +104,9 @@ if (checkSession()) { |
| 104 | 104 | |
| 105 | 105 | } else if (isset($fReplyComment)){ // if user is replying to existing comment |
| 106 | 106 | $main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID"); |
| 107 | - $oPatternCustom->addHtml(getAddComment($fDocumentID,"Re: " . $CommentSubject , "\n\n\n[Start Text Body]\n\n" . $Comment . "\n\n[End Text Body]")); | |
| 107 | + | |
| 108 | + $oComment = DiscussionComment::get($fCommentID); | |
| 109 | + $oPatternCustom->addHtml(getAddComment($fDocumentID,"Re: " . $oComment->getSubject() , "\n\n\n[Start Text Body]\n\n" . urldecode( $oComment->getBody()) . "\n\n[End Text Body]")); | |
| 108 | 110 | |
| 109 | 111 | } else if (isset($fNewThread)){ // Start adding a new Thread |
| 110 | 112 | $main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID&fNewThread=1"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
| ... | ... | @@ -68,8 +68,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody) { |
| 68 | 68 | $sHeading = "Add a Comment"; |
| 69 | 69 | $sToRender .= renderHeading($sHeading); |
| 70 | 70 | $sToRender .= renderDocumentPath($fDocumentID); |
| 71 | - $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n"; | |
| 72 | - //$sToRender .= "<td align=right width=100%><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>"; | |
| 71 | + $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n"; | |
| 73 | 72 | $sToRender .= "<td align=right width=100%><input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"$default->graphicsUrl/widgets/submit.gif\"></td>"; |
| 74 | 73 | $sToRender .= "<td width=\"10\"><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n"; |
| 75 | 74 | $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n"; | ... | ... |
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
| ... | ... | @@ -109,7 +109,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) { |
| 109 | 109 | $sToRender .= "</tr></table><br>\n"; |
| 110 | 110 | $sToRender .= "<table border=\"0\" width=\"100%\">\n"; |
| 111 | 111 | $sToRender .= "<tr><td></td>\n"; |
| 112 | - $sToRender .= "<td><b> Subject</b></td>\n"; | |
| 112 | + $sToRender .= "<td><b> Subject</b></td>\n"; | |
| 113 | 113 | $sToRender .= "<td><b>Author</b></td>\n"; |
| 114 | 114 | $sToRender .= "<td><b>Date</b></td>\n"; |
| 115 | 115 | $sToRender .= "</tr>\n"; |
| ... | ... | @@ -117,7 +117,7 @@ function getViewComment($iNum,$oThread,$oComment,$oUser) { |
| 117 | 117 | |
| 118 | 118 | $sToRender .= "<tr><td>$iNum </td><td style=\"background-color:$BGcolor\" width=450><a style=\"width:94%\" href=\"" . $_SERVER['PHP_SELF'] . "?fViewComment=1&iCommentID=" . $oComment->getID() . "&iDocumentID=" . $oThread->getDocumentID() . "\" title=\"" . $oComment->getSubject() . "\">" . substr($oComment->getSubject(),0,$iSubjectChars ) . $dotdot . "</a></td>\n"; |
| 119 | 119 | $sToRender .= "<td style=\"background-color:$UserBGcolor\" width=\"100\" title=\"$oUser->getUserName()\">" . substr($oUser->getUserName(),0,10) . $Userdotdot . "</td>\n"; |
| 120 | - $sToRender .= "<td style=\"background-color:$BGcolor\" width=\"70\">" . $oComment->getDate() . "<td></tr>\n"; | |
| 120 | + $sToRender .= "<td style=\"background-color:$BGcolor\" width=\"80\">" . $oComment->getDate() . "<td></tr>\n"; | |
| 121 | 121 | |
| 122 | 122 | // If this is the last subject line then close the table |
| 123 | 123 | if ($iNum == ($oThread->getNumberOfReplies())) { $sToRender .= "\n</table>\n\n";} |
| ... | ... | @@ -140,16 +140,16 @@ function getCommentBody($oComment, $iDocumentID, $oUser) { |
| 140 | 140 | $sToRender .= renderDocumentPath($iDocumentID); |
| 141 | 141 | |
| 142 | 142 | $sToRender .= "<br><table width=100% border=0><tr ><td colspan=2><b>Author: </b>" . $oUser->getUserName() . "</td>\n"; |
| 143 | - $sToRender .= "<td align=right>\n"; | |
| 144 | - //$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\">"; | |
| 145 | - $sToRender .= "<input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"$default->graphicsUrl/widgets/reply.gif\">"; | |
| 143 | + $sToRender .= "<td align=right>\n"; | |
| 144 | + $sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $iDocumentID . "&fReplyComment=1&fCommentID=" . $oComment->getID()) . "\"><img src=\"$default->graphicsUrl/widgets/reply.gif\" border=\"0\" /></a>"; | |
| 146 | 145 | $sToRender .= "</td><td width=30><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n"; |
| 147 | - $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 148 | - $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;width=80%\" readOnly value=\"" . $oComment->getSubject() . "\">"; | |
| 146 | + $sToRender .= "<tr><td width=\"1\" style=\"background-color:#F5F6EE;\" valign=\"top\"><b>Subject: </b></td><td width=405 style=\"background-color:#F5F6EE;\">"; | |
| 147 | + $sToRender .= "<a>" . $oComment->getSubject() . "</a>"; | |
| 149 | 148 | $sToRender .= "</td><td colspan=2><b>Date: </b><font color=\"#056DCE\">" . $oComment->getDate() . "</font> </td></tr><tr><td colspan=4 valign=top>"; |
| 150 | - $sToRender .= "<TEXTAREA readOnly name=\"Comment\" id=\"Comment\" rows=40 cols=100 style=\"BORDER-WIDTH: 0px;FONT-FAMILY: sans-serif;\"> "; | |
| 151 | - $sToRender .= urldecode($oComment->getBody()); | |
| 152 | - $sToRender .= "</textarea></td>"; | |
| 149 | + $sToRender .= "<DIV> "; | |
| 150 | + $sToRender .= str_replace("%0D%0A","<br>",str_replace("+", " ",$oComment->getBody())); // Div Views as HTML | |
| 151 | + $sToRender .= "</DIV></td>"; | |
| 152 | + | |
| 153 | 153 | $sToRender .= "</tr></table> "; |
| 154 | 154 | |
| 155 | 155 | return $sToRender; | ... | ... |