Commit b8256b910c53311513259c8912e73e3f1ced15c2

Authored by nbm
1 parent a3272e1a

Consistently use form variables prefixed with 'f' for passing values.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3187 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
@@ -58,11 +58,11 @@ function getAddComment($iDocumentID, $sSubject, $sBody, $iCommentID, $iNewCommen @@ -58,11 +58,11 @@ function getAddComment($iDocumentID, $sSubject, $sBody, $iCommentID, $iNewCommen
58 $sToRender .= "<input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"" . KTHtml::getSubmitButton() . "\" border=0></td>"; 58 $sToRender .= "<input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"" . KTHtml::getSubmitButton() . "\" border=0></td>";
59 if ($iNewComment>0) { // If user is creating a new comment 59 if ($iNewComment>0) { // If user is creating a new comment
60 $sToRender .= "<td width=\"10\" valign=top><a href=\"" . generateControllerLink("viewDiscussion", "fForDiscussion=1&fDocumentID=$iDocumentID") . "\"><img src=\"" . KTHtml::getCancelButton() . "\" border=0 ></a></td></tr>\n"; 60 $sToRender .= "<td width=\"10\" valign=top><a href=\"" . generateControllerLink("viewDiscussion", "fForDiscussion=1&fDocumentID=$iDocumentID") . "\"><img src=\"" . KTHtml::getCancelButton() . "\" border=0 ></a></td></tr>\n";
61 - $sToRender .= "<input type=\"hidden\" name=\"iNewComment\" value=\"1\"/>"; 61 + $sToRender .= "<input type=\"hidden\" name=\"fNewComment\" value=\"1\"/>";
62 } else { // If the user is replying to a comment 62 } else { // If the user is replying to a comment
63 $sToRender .= "<input type=\"hidden\" name=\"fInReplyTo\" value=\"$iCommentID\"/>"; 63 $sToRender .= "<input type=\"hidden\" name=\"fInReplyTo\" value=\"$iCommentID\"/>";
64 $sToRender .= "<input type=\"hidden\" name=\"fThreadID\" value=\"". $iThreadID . "\"/>"; 64 $sToRender .= "<input type=\"hidden\" name=\"fThreadID\" value=\"". $iThreadID . "\"/>";
65 - $sToRender .= "<td width=\"10\" valign=top><a href=\"" . generateControllerLink("viewComment", "fViewComment=1&iDocumentID=$iDocumentID&iCommentID=$iCommentID") . "\"><img src=\"" . KTHtml::getCancelButton() . "\" border=0 ></a></td></tr>\n"; 65 + $sToRender .= "<td width=\"10\" valign=top><a href=\"" . generateControllerLink("viewComment", "fViewComment=1&fDocumentID=$iDocumentID&fCommentID=$iCommentID") . "\"><img src=\"" . KTHtml::getCancelButton() . "\" border=0 ></a></td></tr>\n";
66 } 66 }
67 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n"; 67 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n";
68 $sToRender .= "<input type=\"text\" style=\"width:385\" name=\"fSubject\" value=\"$sSubject\"></td></tr>\n"; 68 $sToRender .= "<input type=\"text\" style=\"width:385\" name=\"fSubject\" value=\"$sSubject\"></td></tr>\n";
presentation/lookAndFeel/knowledgeTree/discussions/viewCommentBL.php
@@ -35,17 +35,19 @@ require_once(&quot;$default-&gt;fileSystemRoot/lib/discussions/DiscussionThread.inc&quot;); @@ -35,17 +35,19 @@ require_once(&quot;$default-&gt;fileSystemRoot/lib/discussions/DiscussionThread.inc&quot;);
35 require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); 35 require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc");
36 require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc"); 36 require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/documentmanagement/documentUI.inc");
37 require_once("$default->fileSystemRoot/presentation/Html.inc"); 37 require_once("$default->fileSystemRoot/presentation/Html.inc");
  38 +
  39 +KTUtil::extractGPC('fCommentID', 'fDocumentID', 'fThreadID');
38 40
39 if (checkSession()) { 41 if (checkSession()) {
40 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); 42 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
41 $oPatternCustom = & new PatternCustom(); 43 $oPatternCustom = & new PatternCustom();
42 44
43 // validate input parameters 45 // validate input parameters
44 - if (isset($iCommentID) && isset($iDocumentID)) {  
45 - $oComment = DiscussionComment::get($iCommentID); 46 + if (isset($fCommentID) && isset($fDocumentID)) {
  47 + $oComment = DiscussionComment::get($fCommentID);
46 $oUser = User::get($oComment->getUserID()); 48 $oUser = User::get($oComment->getUserID());
47 $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php?fDocumentID=$iDocumentID&fCommentID=$iCommentID&fReplyComment=1"); 49 $main->setFormAction("$default->rootUrl/presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php?fDocumentID=$iDocumentID&fCommentID=$iCommentID&fReplyComment=1");
48 - $oPatternCustom->setHtml(getCommentBody($oComment,$iDocumentID,$oUser,$iThreadID)); 50 + $oPatternCustom->setHtml(getCommentBody($oComment,$fDocumentID,$oUser,$fThreadID));
49 } else { 51 } else {
50 $main->setErrorMessage(_("You didn't specify a comment to view")); 52 $main->setErrorMessage(_("You didn't specify a comment to view"));
51 } 53 }