Commit 392e00be52f91bbc9549eb8c810fd4eb4c94a3e1
1 parent
c5796736
Negative numbers are now rendered as _1 for the form widgets - handle
that. Deal with suffixes after the base form widget name. Use LEFT JOIN instead of INNER JOIN onto the document_fields_link table as the INNER form will lose documents without document fields. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3142 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
4 deletions
presentation/lookAndFeel/knowledgeTree/search/advancedSearchBL.php
| ... | ... | @@ -31,11 +31,15 @@ require_once("../../../../config/dmsDefaults.php"); |
| 31 | 31 | KTUtil::extractGPC('fForSearch', 'fSearchString', 'fShowSection', 'fStartIndex', 'fToSearch'); |
| 32 | 32 | |
| 33 | 33 | function searchCriteria ($var) { |
| 34 | - return preg_match('/^bmd(-?\d+)/', $var); | |
| 34 | + return preg_match('/^bmd(_?\d+)/', $var); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | function criteriaNumber ($var) { |
| 38 | - return preg_replace('/^bmd(-?\d+)/', '\\1', $var); | |
| 38 | + $res = preg_replace('/^bmd(_?\d+)\D.*/', '\\1', $var); | |
| 39 | + if ($res !== false) { | |
| 40 | + $res = strtr($res, '_', '-'); | |
| 41 | + } | |
| 42 | + return $res; | |
| 39 | 43 | } |
| 40 | 44 | |
| 41 | 45 | function getAdvancedSearchResults($aOrigReq, $iStartIndex) { |
| ... | ... | @@ -81,8 +85,8 @@ SELECT |
| 81 | 85 | FROM |
| 82 | 86 | $default->documents_table AS D |
| 83 | 87 | INNER JOIN $default->folders_table AS F ON D.folder_id = F.id |
| 84 | - INNER JOIN $default->document_fields_link_table AS DFL ON DFL.document_id = D.id | |
| 85 | - INNER JOIN $default->document_fields_table AS DF ON DF.id = DFL.document_field_id | |
| 88 | + LEFT JOIN $default->document_fields_link_table AS DFL ON DFL.document_id = D.id | |
| 89 | + LEFT JOIN $default->document_fields_table AS DF ON DF.id = DFL.document_field_id | |
| 86 | 90 | INNER JOIN $default->search_permissions_table AS SDUL ON SDUL.document_id = D.id |
| 87 | 91 | INNER JOIN $default->status_table AS SL on D.status_id=SL.id |
| 88 | 92 | WHERE | ... | ... |