mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 21:51:32 +00:00
extend search() by searching in attributes
This commit is contained in:
parent
4c267fdb0c
commit
b1d8a77b2a
|
@ -541,7 +541,7 @@ class SeedDMS_Core_DMS {
|
||||||
* @param offset integer index of first item in result set
|
* @param offset integer index of first item in result set
|
||||||
* @param logicalmode string either AND or OR
|
* @param logicalmode string either AND or OR
|
||||||
* @param searchin array() list of fields to search in
|
* @param searchin array() list of fields to search in
|
||||||
* 1 = keywords, 2=name, 3=comment
|
* 1 = keywords, 2=name, 3=comment, 4=attributes
|
||||||
* @param startFolder object search in the folder only (null for root folder)
|
* @param startFolder object search in the folder only (null for root folder)
|
||||||
* @param owner object search for documents owned by this user
|
* @param owner object search for documents owned by this user
|
||||||
* @param status array list of status
|
* @param status array list of status
|
||||||
|
@ -616,6 +616,24 @@ class SeedDMS_Core_DMS {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check to see if the search has been restricted to a particular
|
||||||
|
// attribute.
|
||||||
|
$searchAttributes = array();
|
||||||
|
if ($attributes) {
|
||||||
|
foreach($attributes as $attrdefid=>$attribute) {
|
||||||
|
if($attribute) {
|
||||||
|
$attrdef = $this->getAttributeDefinition($attrdefid);
|
||||||
|
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document) {
|
||||||
|
if($attrdef->getValueSet())
|
||||||
|
$searchAttributes[] = "`tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value`='".$attribute."'";
|
||||||
|
else
|
||||||
|
$searchAttributes[] = "`tblFolderAttributes`.`attrdef`=".$attrdefid." AND `tblFolderAttributes`.`value` like '%".$attribute."%'";
|
||||||
|
} elseif($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Is the search restricted to documents created between two specific dates?
|
// Is the search restricted to documents created between two specific dates?
|
||||||
$searchCreateDate = "";
|
$searchCreateDate = "";
|
||||||
if ($creationstartdate) {
|
if ($creationstartdate) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user