Commit 3e3d2787de5c5a82c054edfb31256c83d6ccb661
1 parent
3967e259
added heading and corrected bug #1610
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1497 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
23 additions
and
9 deletions
presentation/lookAndFeel/knowledgeTree/search/standardSearchUI.inc
| ... | ... | @@ -8,8 +8,18 @@ |
| 8 | 8 | * @package presentation.lookAndFeel.documentmanagement |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +function renderHeading() { | |
| 12 | + global $default; | |
| 13 | + $sSectionName = $default->siteMap->getSectionName(substr($_SERVER["PHP_SELF"], strlen($default->rootUrl), strlen($_SERVER["PHP_SELF"]))); | |
| 14 | + $sColor = $default->siteMap->getSectionColour($sSectionName, "th"); | |
| 15 | + $sToRender .= "<tr align=\"left\"><th class=\"sectionHeading\" bgcolor=\"$sColor\"><font color=\"ffffff\">Standard Search</font></th></tr>\n"; | |
| 16 | + $sToRender .= "<tr/>\n"; | |
| 17 | + $sToRender .= "<tr/>\n"; | |
| 18 | + return $sToRender; | |
| 19 | +} | |
| 20 | + | |
| 11 | 21 | function getPage($sSearchText, $sBrowseType, $iFolderID, $iDocumentID, $sCategoryName, $iDocType, $sFolderIDs, $iStartIndex, $sSQLSearchString, $bSearchByDocument = false) { |
| 12 | - return getSearchResults($sFolderIDs, $sSQLSearchString, $iStartIndex, $bSearchByDocument) . getSearchVariablesHtml($sSearchText, $sBrowseType, $iFolderID, $iDocumentID, $sCategoryName, $iDocType); | |
| 22 | + return "<table width=\"600\">" . renderHeading() . "</table>" . getSearchResults($sFolderIDs, $sSQLSearchString, $iStartIndex, $bSearchByDocument) . getSearchVariablesHtml($sSearchText, $sBrowseType, $iFolderID, $iDocumentID, $sCategoryName, $iDocType); | |
| 13 | 23 | } |
| 14 | 24 | |
| 15 | 25 | function getSearchResults($sIDs,$sSQLSearchString, $iStartIndex, $bSearchByDocument = false) { |
| ... | ... | @@ -18,22 +28,26 @@ function getSearchResults($sIDs,$sSQLSearchString, $iStartIndex, $bSearchByDocum |
| 18 | 28 | "FROM $default->owl_documents_table AS D INNER JOIN $default->owl_folders_table AS F ON D.folder_id = F.id " . |
| 19 | 29 | "INNER JOIN $default->owl_document_words_table AS DWL ON DWL.document_id = D.id " . |
| 20 | 30 | "INNER JOIN $default->owl_words_lookup_table AS WL ON WL.id = DWL.word_id "; |
| 21 | - if ($bSearchByDocument) { | |
| 22 | - $sQuery .= "WHERE D.id IN ($sIDs) "; | |
| 23 | - } else { | |
| 24 | - $sQuery .= "WHERE F.id IN ($sIDs) "; | |
| 25 | - } | |
| 26 | - $sQuery .= "AND ($sSQLSearchString)"; | |
| 31 | + if (strlen($sIDs) > 0) { | |
| 32 | + if ($bSearchByDocument) { | |
| 33 | + $sQuery .= "WHERE D.id IN ($sIDs) "; | |
| 34 | + } else { | |
| 35 | + $sQuery .= "WHERE F.id IN ($sIDs) "; | |
| 36 | + } | |
| 37 | + $sQuery .= "AND ($sSQLSearchString)"; | |
| 38 | + } else { | |
| 39 | + $sQuery .= "WHERE ($sSQLSearchString)"; | |
| 40 | + } | |
| 41 | + | |
| 27 | 42 | $sQuery .= "ORDER BY D.name ASC"; |
| 28 | 43 | |
| 29 | 44 | $aColumns = array("folder_image_url", "document_name"); |
| 30 | 45 | $aColumnTypes = array(4,3); |
| 31 | - $aColumnHeaders = array("","Document"); | |
| 46 | + $aColumnHeaders = array("<font color=\"ffffff\">Folder</font>","<font color=\"ffffff\">Document</font>"); | |
| 32 | 47 | $aLinkURLs = array("$default->rootUrl/control.php?action=browse","$default->rootUrl/control.php?action=viewDocument"); |
| 33 | 48 | $aDBQueryStringColumns = array("document_id","folder_id"); |
| 34 | 49 | $aQueryStringVariableNames = array("fDocumentID", "fFolderID"); |
| 35 | 50 | |
| 36 | - | |
| 37 | 51 | $oPatternBrowse = & new PatternBrowseableSearchResults($sQuery, 10, $aColumns, $aColumnTypes, $aColumnHeaders, $aLinkURLs, $aDBQueryStringColumns, $aQueryStringVariableNames); |
| 38 | 52 | $oPatternBrowse->setStartIndex($iStartIndex); |
| 39 | 53 | return $oPatternBrowse->render(); | ... | ... |