Commit 2566701fa9a6f0b36b14e18cc3330d87d18e3806
1 parent
a0d89143
Solved some replying issues: ie. The Re: that keeps showing 4 each reply
and better text body is commented out better. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1895 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
22 additions
and
3 deletions
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
| ... | ... | @@ -105,8 +105,24 @@ if (checkSession()) { |
| 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 | 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 | + $oComment = DiscussionComment::get($fCommentID); | |
| 109 | + $oUser = User::get($oComment->getUserID()); | |
| 110 | + | |
| 111 | + $sReplyBody = $oComment->getBody(); | |
| 112 | + | |
| 113 | + $sReplyBodyHeader .= "\n\n\n>------ Original Message ------"; | |
| 114 | + $sReplyBodyHeader .= "\n>User: " . $oUser->getName(); | |
| 115 | + $sReplyBodyHeader .= "\n>Date: " . $oComment->getDate(); | |
| 116 | + $sReplyBodyHeader .= "\n>Subject: " . $oComment->getSubject(); | |
| 117 | + $sReplyBodyHeader .= "\n>---------------------------------------"; | |
| 118 | + | |
| 119 | + $sReplyBody = $sReplyBodyHeader . "\n>" . str_replace("%0D%0A" ,"%0D%0A>", $sReplyBody); // Put in ">" as indentation for the reply | |
| 120 | + | |
| 121 | + if (strpos($oComment->getSubject(), "Re:") != " "){ | |
| 122 | + $sReply = "Re: "; | |
| 123 | + }else { $sReply = ""; } | |
| 124 | + | |
| 125 | + $oPatternCustom->addHtml(getAddComment($fDocumentID, $sReply . $oComment->getSubject() , urldecode($sReplyBody) )); | |
| 110 | 126 | |
| 111 | 127 | } else if (isset($fNewThread)){ // Start adding a new Thread |
| 112 | 128 | $main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID&fNewThread=1"); | ... | ... |
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
| ... | ... | @@ -70,7 +70,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody) { |
| 70 | 70 | $sToRender .= renderDocumentPath($fDocumentID); |
| 71 | 71 | $sToRender .= "<table width=\"100%\" border=\"0\" cellpadding=0 ><tr><td></td>\n"; |
| 72 | 72 | $sToRender .= "<td align=right width=100%><input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"$default->graphicsUrl/widgets/submit.gif\"></td>"; |
| 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"; | |
| 73 | + $sToRender .= "<td width=\"10\"><img src=\"$default->graphicsUrl/widgets/cancel.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n"; | |
| 74 | 74 | $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n"; |
| 75 | 75 | $sToRender .= "<input type=\"text\" style=\"width:385\" name=\"NewCommentSubject\" id=\"NewCommentSubject\" value=\"$sSubject\"></td></tr>\n"; |
| 76 | 76 | $sToRender .= "<tr><td valign=\"top\"><b>Body</b></td><td colspan=2><textarea cols=60 rows=\"21\" name=\"NewComment\" id=\"NewComment\" style=\"FONT-STYLE: normal; FONT-FAMILY: sans-serif; FONT-VARIANT: normal\">$sBody</textarea></td></tr></table>\n"; | ... | ... |
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
| ... | ... | @@ -62,6 +62,9 @@ if(checkSession()) { |
| 62 | 62 | $oSearchResults = & new PatternBrowseableSearchResults ($sQuery, 13, $aColumns, $aColumnTypes, $aColumnNames, $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars); |
| 63 | 63 | $oSearchResults->setStartIndex($iStartIndex); |
| 64 | 64 | $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1"); |
| 65 | + $sToRender .= renderHeading("Document Discussion Thread"); | |
| 66 | + $sToRender .= renderDocumentPath($oThread->getDocumentID()); | |
| 67 | + $oPatternCustom->addHtml($sToRender); | |
| 65 | 68 | $oPatternCustom->addHtml(getPageButtons($oThread)); |
| 66 | 69 | $oPatternCustom->addHtml($oSearchResults->render()); |
| 67 | 70 | ... | ... |