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,7 +11,7 @@
11 require_once("../../../../config/dmsDefaults.php"); 11 require_once("../../../../config/dmsDefaults.php");
12 12
13 if (checkSession()) { 13 if (checkSession()) {
14 - require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc"); 14 +// require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCreate.inc");
15 require_once("viewDiscussionUI.inc"); 15 require_once("viewDiscussionUI.inc");
16 require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc"); 16 require_once("$default->fileSystemRoot/presentation/lookAndFeel/knowledgeTree/foldermanagement/folderUI.inc");
17 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); 17 require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc");
@@ -20,8 +20,8 @@ if (checkSession()) { @@ -20,8 +20,8 @@ if (checkSession()) {
20 require_once("$default->fileSystemRoot/lib/security/permission.inc"); 20 require_once("$default->fileSystemRoot/lib/security/permission.inc");
21 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc"); 21 require_once("$default->fileSystemRoot/presentation/webpageTemplate.inc");
22 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc"); 22 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternCustom.inc");
23 - //require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListFromQuery.inc");  
24 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc"); 23 require_once("$default->fileSystemRoot/lib/visualpatterns/PatternBrowsableSearchResults.inc");
  24 + //require_once("$default->fileSystemRoot/lib/visualpatterns/PatternTableSqlQuery.inc");
25 require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc"); 25 require_once("$default->fileSystemRoot/lib/discussions/DiscussionThread.inc");
26 require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc"); 26 require_once("$default->fileSystemRoot/lib/discussions/DiscussionComment.inc");
27 require_once("$default->fileSystemRoot/presentation/Html.inc"); 27 require_once("$default->fileSystemRoot/presentation/Html.inc");
@@ -39,7 +39,31 @@ if(checkSession()) { @@ -39,7 +39,31 @@ if(checkSession()) {
39 $sAllCommentID = $oThread->getAllCommentID(); 39 $sAllCommentID = $oThread->getAllCommentID();
40 $arrAllCommentID = explode(",", $sAllCommentID); 40 $arrAllCommentID = explode(",", $sAllCommentID);
41 $iNumMax = $oThread->getNumberOfReplies(); 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 $sQuery = "SELECT 1 as ForView, subject, username, date, discussion_comments.id as com_id, discussion_threads.document_id as doc_id " . 67 $sQuery = "SELECT 1 as ForView, subject, username, date, discussion_comments.id as com_id, discussion_threads.document_id as doc_id " .
44 "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 " . 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 "WHERE discussion_threads.id = " . $iThreadID . 69 "WHERE discussion_threads.id = " . $iThreadID .
@@ -59,13 +83,15 @@ if(checkSession()) { @@ -59,13 +83,15 @@ if(checkSession()) {
59 if (!isset($fStartIndex)) { $iStartIndex = 0 ;} 83 if (!isset($fStartIndex)) { $iStartIndex = 0 ;}
60 else { $iStartIndex = $fStartIndex ;} 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 $oSearchResults->setStartIndex($iStartIndex); 89 $oSearchResults->setStartIndex($iStartIndex);
64 $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1"); 90 $oSearchResults->setQueryString("&fDocumentID=$fDocumentID&fForDiscussion=1");
65 $sToRender .= renderHeading("Document Discussion Thread"); 91 $sToRender .= renderHeading("Document Discussion Thread");
66 $sToRender .= renderDocumentPath($oThread->getDocumentID()); 92 $sToRender .= renderDocumentPath($oThread->getDocumentID());
67 $oPatternCustom->addHtml($sToRender); 93 $oPatternCustom->addHtml($sToRender);
68 - $oPatternCustom->addHtml(getPageButtons($oThread)); 94 + $oPatternCustom->addHtml(getPageButtons($oThread));
69 $oPatternCustom->addHtml($oSearchResults->render()); 95 $oPatternCustom->addHtml($oSearchResults->render());
70 96
71 // On opening, increment the number of views of current thread & update database 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,8 +17,6 @@ function getPageButtons($oThread){
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"; 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 $sToRender .= "</tr></table>\n"; 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 return $sToRender ; 21 return $sToRender ;
24 } 22 }