Commit 64042f24b563a40e65ad47288eb28c215e0d44bf

Authored by omar
1 parent 5ed07cf9

no longer has browsing buttons( NN 4.7 compatible)


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2070 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionBL.php
... ... @@ -11,7 +11,7 @@
11 11 require_once("../../../../config/dmsDefaults.php");
12 12  
13 13 if (checkSession()) {
14   - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc");
  14 +// require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc");
15 15 require_once("viewDiscussionUI.inc");
16 16 require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
17 17 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
... ... @@ -20,8 +20,8 @@ if (checkSession()) {
20 20 require_once("$default->fileSystemRoot/lib/security/permission.inc");
21 21 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
22 22 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
23   - //require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");
24 23 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc");
  24 + //require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
25 25 require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc");
26 26 require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc");
27 27 require_once("$default->fileSystemRoot/presentation/Html.inc");
... ... @@ -39,7 +39,31 @@ if(checkSession()) {
39 39 $sAllCommentID = $oThread->getAllCommentID();
40 40 $arrAllCommentID = explode(",", $sAllCommentID);
41 41 $iNumMax = $oThread->getNumberOfReplies();
42   -
  42 + //$$$$$$$$$$$$$$$444
  43 +
  44 + /*$sQuery = "SELECT 1 as ForView, subject, username, date, discussion_comments.id as com_id, discussion_threads.document_id as doc_id " .
  45 + "FROM (discussion_comments INNER JOIN users ON discussion_comments.user_id = users.id) INNER JOIN discussion_threads ON discussion_threads.id = discussion_comments.thread_id " .
  46 + "WHERE discussion_threads.id = " . $iThreadID .
  47 + " ORDER BY date DESC";
  48 +
  49 + $aColumns = array("subject", "username", "date");
  50 + $aColumnNames = array("Subject", "User", "Date");
  51 + $aColumnTypes = array(3,1,1);
  52 +
  53 + $aDBColumnArray = array("ForView", "com_id", "doc_id");
  54 + $aQueryStringVariableNames = array("ForView", "com_id", "doc_id");
  55 +
  56 + $aHyperLinkURL = array( 0=> $_SERVER['PHP_SELF']);
  57 +
  58 + $oSearchResults = & new PatternTableSqlQuery($sQuery, $aColumns, $aColumnTypes, $aColumnNames, "100%", $aHyperLinkURL,$aDBColumnArray,$aQueryStringVariableNames);
  59 +
  60 + $sToRender .= renderHeading("Document Discussion Thread");
  61 + $sToRender .= renderDocumentPath($oThread->getDocumentID());
  62 + $oPatternCustom->addHtml($sToRender);
  63 + $oPatternCustom->addHtml(getPageButtons($oThread));
  64 + $oPatternCustom->addHtml($oSearchResults->render());*/
  65 + //$$$$$$$$$$$$$$44
  66 +
43 67 $sQuery = "SELECT 1 as ForView, subject, username, date, discussion_comments.id as com_id, discussion_threads.document_id as doc_id " .
44 68 "FROM (discussion_comments INNER JOIN users ON discussion_comments.user_id = users.id) INNER JOIN discussion_threads ON discussion_threads.id = discussion_comments.thread_id " .
45 69 "WHERE discussion_threads.id = " . $iThreadID .
... ... @@ -59,13 +83,15 @@ if(checkSession()) {
59 83 if (!isset($fStartIndex)) { $iStartIndex = 0 ;}
60 84 else { $iStartIndex = $fStartIndex ;}
61 85  
62   - $oSearchResults = & new PatternBrowseableSearchResults ($sQuery, 13, $aColumns, $aColumnTypes, $aColumnNames, $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars);
  86 +
  87 +
  88 + $oSearchResults = & new PatternBrowseableSearchResults ($sQuery, $oThread->getNumberOfReplies(), $aColumns, $aColumnTypes, $aColumnNames, $aHyperLinkURL, $aQueryStringCols, $aQueryStringVars);
63 89 $oSearchResults->setStartIndex($iStartIndex);
64 90 $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1");
65 91 $sToRender .= renderHeading("Document Discussion Thread");
66 92 $sToRender .= renderDocumentPath($oThread->getDocumentID());
67 93 $oPatternCustom->addHtml($sToRender);
68   - $oPatternCustom->addHtml(getPageButtons($oThread));
  94 + $oPatternCustom->addHtml(getPageButtons($oThread));
69 95 $oPatternCustom->addHtml($oSearchResults->render());
70 96  
71 97 // On opening, increment the number of views of current thread & update database
... ...
presentation/lookAndFeel/knowledgeTree/discussions/viewDiscussionUI.inc
... ... @@ -17,8 +17,6 @@ function getPageButtons($oThread){
17 17 $sToRender .= "<td align=right width=10><a href=\"" . generateControllerLink("viewDocument", "fDocumentID=" . $oThread->getDocumentID() . "&fAddComment=1") . "\"><img src=\"$default->graphicsUrl/widgets/back.gif\" border=\"0\" /></a></td>\n";
18 18  
19 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 20  
23 21 return $sToRender ;
24 22 }
... ...