Commit dabb8ea20cc21a321e2a3a3d27003afa7fe7b9ba

Authored by omar
1 parent fef3213d

Fixed add Comment Subject line problem


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1870 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/discussions/addCommentBL.php
@@ -47,7 +47,7 @@ if (checkSession()) { @@ -47,7 +47,7 @@ if (checkSession()) {
47 } 47 }
48 48
49 } else if (isset($fAddCommentSubmit)) { 49 } else if (isset($fAddCommentSubmit)) {
50 - if ($_POST["NewComment"] != "" and $_POST["NewCommentSubject"] != "") { 50 + if ($_POST["NewComment"] != "" && $_POST["NewCommentSubject"] != "") {
51 51
52 if (isset($fNewThread)){ // Create a New Thread for this document as it doesn't exist 52 if (isset($fNewThread)){ // Create a New Thread for this document as it doesn't exist
53 53
@@ -97,7 +97,7 @@ if (checkSession()) { @@ -97,7 +97,7 @@ if (checkSession()) {
97 }// End Of if for THREAD ID test 97 }// End Of if for THREAD ID test
98 98
99 }else { // the user has not entered BOTH a subject and a text body 99 }else { // the user has not entered BOTH a subject and a text body
100 - $main->setErrorMessage("The subject line and/or body may be empty"); 100 + $main->setErrorMessage("The subject line and/or body may be empty" . $NewCommentSubject . "#" . $NewComment);
101 $main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID"); 101 $main->setFormAction($_SERVER['PHP_SELF'] . "?fAddCommentSubmit=1&iDocumentID=$fDocumentID");
102 $oPatternCustom->addHtml(getAddComment($fDocumentID,$_POST["NewCommentSubject"],$_POST["NewComment"])); 102 $oPatternCustom->addHtml(getAddComment($fDocumentID,$_POST["NewCommentSubject"],$_POST["NewComment"]));
103 } // end of IF for Subject and Body test 103 } // end of IF for Subject and Body test
presentation/lookAndFeel/knowledgeTree/discussions/addCommentUI.inc
@@ -72,7 +72,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody) { @@ -72,7 +72,7 @@ function getAddComment($fDocumentID, $sSubject, $sBody) {
72 $sToRender .= "<td align=right width=100%><input onmouseover=\"this.style.cursor='hand'\" type=\"image\" src=\"$default->graphicsUrl/widgets/submit.gif\"></td>"; 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/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr>\n";
74 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n"; 74 $sToRender .= "<br><tr><td valign=\"top\" width=10><b>Subject</b></td><td colspan=2>\n";
75 - $sToRender .= "<input type=\"text\" style=\"width:385\" width= name=\"NewCommentSubject\" id=\"NewCommentSubject\" value=\"$sSubject\"></td></tr>\n"; 75 + $sToRender .= "<input type=\"text\" style=\"width:385\" name=\"NewCommentSubject\" id=\"NewCommentSubject\" value=\"$sSubject\"></td></tr>\n";
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"; 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";
77 77
78 return $sToRender; 78 return $sToRender;
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
@@ -62,7 +62,7 @@ if(checkSession()) { @@ -62,7 +62,7 @@ if(checkSession()) {
62 $oSearchResults = & new PatternBrowseableSearchResults ($sQuery, 13, $aColumns, $aColumnTypes, $aColumnNames, $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars); 62 $oSearchResults = & new PatternBrowseableSearchResults ($sQuery, 13, $aColumns, $aColumnTypes, $aColumnNames, $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars);
63 $oSearchResults->setStartIndex($iStartIndex); 63 $oSearchResults->setStartIndex($iStartIndex);
64 $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1"); 64 $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1");
65 - $oPatternCustom->addHtml(goBack()); 65 + $oPatternCustom->addHtml(getPageButtons($oThread));
66 $oPatternCustom->addHtml($oSearchResults->render()); 66 $oPatternCustom->addHtml($oSearchResults->render());
67 67
68 // On opening, increment the number of views of current thread & update database 68 // On opening, increment the number of views of current thread & update database
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
@@ -9,9 +9,18 @@ @@ -9,9 +9,18 @@
9 */ 9 */
10 10
11 11
12 -function goBack(){ 12 +function getPageButtons($oThread){
13 global $default; 13 global $default;
14 - return "<table width=100%><tr><td align=right><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" ></td></tr></table>"; 14 +
  15 + $sToRender .= "<table width=100%><tr>\n";
  16 + $sToRender .= "<td align=right width=100%><a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a></td>\n";
  17 + $sToRender .= "<td align=right width=10><img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" /></td>\n";
  18 +
  19 + $sToRender .= "</tr></table>\n";
  20 + //$sToRender .= "<a href=\"" . generateControllerLink("addComment", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/addcomment.gif\" border=\"0\" /></a>\n";
  21 + //$sToRender .= "<img src=\"$default->graphicsUrl/widgets/back.gif\" onmouseover=\"this.style.cursor='hand'\" onclick=\"javascript: history.go(-1);\" />\n";
  22 +
  23 + return $sToRender ;
15 } 24 }
16 25
17 // If there are no threads to view for a document 26 // If there are no threads to view for a document