From c00c0996d219f5d4b3133e0514a48dac670c0915 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 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index ec0b6ce36..635428ab9 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -643,6 +643,7 @@ $(document).ready(function() { getMLText("creation_date")." (".getMLText('to').")", $this->getDateChooser(!empty($createenddate) ? getReadableDate($createenddate) : null, "created[to]", $this->params['session']->getLanguage()) ); + $this->contentContainerEnd(); if($attrdefgrps) { $attrdefids = array(); foreach($attrdefgrps as $attrdefgrp) { @@ -651,12 +652,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 { ?> @@ -670,7 +673,6 @@ $(document).ready(function() { } } } elseif($attrdefs) { - $this->contentContainerEnd(); // Seach options for documents and folders {{{ /* First check if any of the folder/document filters are set. If it is,