Commit 98ee5504 authored by mku's avatar mku

ZP-49 #comment only search in a required folder #time 1h 30m

git-svn-id: https://z-push.org/svn/z-push/trunk@1307 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 7122fe83
...@@ -1138,10 +1138,20 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1138,10 +1138,20 @@ class BackendZarafa implements IBackend, ISearchProvider {
$searchRestriction = $this->getSearchRestriction($cpo->GetSearchFreeText()); $searchRestriction = $this->getSearchRestriction($cpo->GetSearchFreeText());
$searchRange = explode('-', $cpo->GetSearchRange()); $searchRange = explode('-', $cpo->GetSearchRange());
$searchFolderId = $cpo->GetSearchFolderid(); $searchFolderId = $cpo->GetSearchFolderid();
$searchFolders = array();
// search only in required folders
if (!empty($searchFolderId)) {
$searchFolderEntryId = mapi_msgstore_entryidfromsourcekey($this->store, hex2bin($searchFolderId));
$searchFolders[] = $searchFolderEntryId;
}
// if no folder was required then search in the entire store
else {
$tmp = mapi_getprops($this->store, array(PR_ENTRYID,PR_DISPLAY_NAME,PR_IPM_SUBTREE_ENTRYID));
$searchFolders[] = $tmp[PR_IPM_SUBTREE_ENTRYID];
}
$items = array(); $items = array();
$tmp = mapi_getprops($this->store, array(PR_ENTRYID,PR_DISPLAY_NAME,PR_IPM_SUBTREE_ENTRYID)); mapi_folder_setsearchcriteria($searchFolder, $searchRestriction, $searchFolders, RECURSIVE_SEARCH);
mapi_folder_setsearchcriteria($searchFolder, $searchRestriction, array($tmp[PR_IPM_SUBTREE_ENTRYID]), RECURSIVE_SEARCH);
$table = mapi_folder_getcontentstable($searchFolder); $table = mapi_folder_getcontentstable($searchFolder);
$searchStart = time(); $searchStart = time();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment