From 3b48541ef08bc729e01c23fdca07d8269fd9c245 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 6 May 2026 13:52:18 +0200 Subject: [PATCH] remove duplicate code due to merge errors --- views/bootstrap/class.Search.php | 55 +++----------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 6f2810c4e..eb453c7a3 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -722,42 +722,6 @@ $(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($attrdefgrps) { - $attrdefids = array(); - foreach($attrdefgrps as $attrdefgrp) { - if($attrdefs = $attrdefgrp->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all), SeedDMS_Core_AttributeDefinitionGroup::show_search)) { - echo "".htmlspecialchars($attrdefgrp->getName()).""; - foreach($attrdefs as $attrdefarr) { - $attrdef = $attrdefarr['attrdef']; - if(!in_array($attrdef->getID(), $attrdefids)) { - if($attrdef->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 { - ?> - - getName()); ?> - getID()]) ? $attributes[$attrdef->getID()] : ''; ?> - - 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, '', true)); - } + } else + $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true, '', true)); } } } - } elseif($attrdefs) { - foreach($attrdefs as $attrdef) { - if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { - if($attrdef->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')); - } else - $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true)); - } - } + $content = ob_get_clean(); + $this->printAccordion(getMLText('filter_for_folders'), $content, $openfilterdlg); } - $content = ob_get_clean(); - $this->printAccordion(getMLText('filter_for_folders'), $content, $openfilterdlg); // }}} $this->formSubmit(" ".getMLText('search'));