turn attributes of type date into timestamps before searching

This commit is contained in:
Uwe Steinmann 2023-04-25 12:28:05 +02:00
parent d69921c709
commit e3ce931cbd

View File

@ -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;