mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 05:01:43 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
b03e759053
|
@ -208,6 +208,7 @@
|
||||||
- fixed error due to multiple declared function when controller method
|
- fixed error due to multiple declared function when controller method
|
||||||
RemoveFolder::run was called more than once
|
RemoveFolder::run was called more than once
|
||||||
- fix php error setting mandatory workflow when uploading documents via webdav
|
- fix php error setting mandatory workflow when uploading documents via webdav
|
||||||
|
- typeahead search for folders can search in subfolders
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.22
|
Changes in version 5.1.22
|
||||||
|
|
|
@ -157,6 +157,37 @@ switch($command) {
|
||||||
if($user) {
|
if($user) {
|
||||||
$query = $_GET['query'];
|
$query = $_GET['query'];
|
||||||
|
|
||||||
|
if(false !== ($pos = strpos($query, '/'))) {
|
||||||
|
$subquery = substr($query, 0, $pos);
|
||||||
|
$hits = $dms->search($subquery, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
|
||||||
|
if($hits) {
|
||||||
|
if(count($hits['folders']) == 1) {
|
||||||
|
$hit = $hits['folders'][0];
|
||||||
|
$basefolder = $dms->getFolder($hit->getID());
|
||||||
|
if($subquery = substr($query, $pos+1)) {
|
||||||
|
$hits = $dms->search($subquery, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$basefolder, $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
|
||||||
|
if($hits) {
|
||||||
|
$result = array();
|
||||||
|
foreach($hits['folders'] as $hit) {
|
||||||
|
$result[] = $hit->getID().'#'.$basefolder->getName().'/'.$hit->getName();
|
||||||
|
}
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode($result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$subfolders = $basefolder->getSubFolders();
|
||||||
|
$result = array();
|
||||||
|
foreach($subfolders as $subfolder) {
|
||||||
|
$result[] = $subfolder->getID().'#'.$basefolder->getName().'/'.$subfolder->getName();
|
||||||
|
}
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
echo json_encode($result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
|
$hits = $dms->search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=$dms->getRootFolder(), $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x2, $expirationstartdate=array(), $expirationenddate=array());
|
||||||
if($hits) {
|
if($hits) {
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user