Commit ef5261f85a6e2b9e1e6a9691752c0a3327e469a8

Authored by rob
1 parent 8efa54dc

Fixed search error


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1605 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/search/advancedSearchBL.php
@@ -106,13 +106,13 @@ function getChosenMetaDataTags() { @@ -106,13 +106,13 @@ function getChosenMetaDataTags() {
106 * Generate a string onsisting of all documents that match the search criteria 106 * Generate a string onsisting of all documents that match the search criteria
107 * and that the user is allowed to see 107 * and that the user is allowed to see
108 */ 108 */
109 -function getApprovedDocumentString($sMetaTagIDs, $sSQLSearchString) { 109 +function getApprovedDocumentString($sMetaTagIDs, $sSQLSearchString) {
110 global $default; 110 global $default;
111 $aApprovedDocumentIDs = array(); 111 $aApprovedDocumentIDs = array();
112 $sQuery = "SELECT DISTINCT D.id " . 112 $sQuery = "SELECT DISTINCT D.id " .
113 "FROM documents AS D INNER JOIN document_fields_link AS DFL ON DFL.document_id = D.id " . 113 "FROM documents AS D INNER JOIN document_fields_link AS DFL ON DFL.document_id = D.id " .
114 - "INNER JOIN document_fields AS DF ON DF.id = DFL.document_field_id " .  
115 - "WHERE DF.ID IN (1,2,3,4) " . 114 + "INNER JOIN document_fields AS DF ON DF.id = DFL.document_field_id " .
  115 + "WHERE DF.ID IN ($sMetaTagIDs) " .
116 "AND " . $sSQLSearchString; 116 "AND " . $sSQLSearchString;
117 117
118 $sql = $default->db; 118 $sql = $default->db;