mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
turn attributes of type date into timestamps before searching
This commit is contained in:
parent
d69921c709
commit
e3ce931cbd
|
@ -200,6 +200,26 @@ if($fullsearch) {
|
|||
else
|
||||
$attributes = array();
|
||||
|
||||
foreach($attributes as $an=>&$av) {
|
||||
if(substr($an, 0, 5) == 'attr_') {
|
||||
$tmp = explode('_', $an);
|
||||
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
|
||||
switch($attrdef->getType()) {
|
||||
/* Turn dates into timestamps */
|
||||
case SeedDMS_Core_AttributeDefinition::type_date:
|
||||
foreach(['from', 'to'] as $kk)
|
||||
if(!empty($av[$kk])) {
|
||||
if(!is_numeric($av[$kk])) {
|
||||
$av[$kk] = makeTsFromDate($av[$kk]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//print_r($attributes);exit;
|
||||
// Check to see if the search has been restricted to a particular sub-tree in
|
||||
// the folder hierarchy.
|
||||
$startFolder = null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user