From 200bd06eaa07ab44b4b504e24ca15079a7339ea3 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 21 Jan 2025 10:47:34 +0100 Subject: [PATCH] partially fixed output of search form when attribute groups exist --- views/bootstrap/class.Search.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index c7c042a58..d5ec347e1 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -704,12 +704,14 @@ $(document).ready(function() { foreach($attrdefs as $attrdefarr) { $attrdef = $attrdefarr['attrdef']; if(!in_array($attrdef->getID(), $attrdefids)) { - ?> - - getName()); ?>: - printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?> - - getType() == SeedDMS_Core_AttributeDefinition::type_date) { + $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from')); + $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to')); + } elseif(in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]) && !$attrdef->getValueSet()) { + $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? $attributes[$attrdef->getID()]['from'] : '', 'attributes', true, 'from')); + $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? $attributes[$attrdef->getID()]['to'] : '', 'attributes', true, 'to')); + } else + $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true)); $attrdefids[] = $attrdef->getID(); } else { ?> @@ -723,6 +725,14 @@ $(document).ready(function() { } } } elseif($attrdefs) { + + // Seach options for documents and folders {{{ + /* First check if any of the folder/document filters are set. If it is, + * open the accordion. + */ + $openfilterdlg = false; + $hasattrs = false; + if($attrdefs) { foreach($attrdefs as $attrdef) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { /* Do not check dates because they always have 'from' and 'to' element