partially fixed output of search form when attribute groups exist

This commit is contained in:
Uwe Steinmann 2025-01-21 10:47:34 +01:00
parent 1ee5fb6601
commit c00c0996d2

View File

@ -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)) {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?></td>
</tr>
<?php
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 {
?>
@ -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,