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').")", getMLText("creation_date")." (".getMLText('to').")",
$this->getDateChooser(!empty($createenddate) ? getReadableDate($createenddate) : null, "created[to]", $this->params['session']->getLanguage()) $this->getDateChooser(!empty($createenddate) ? getReadableDate($createenddate) : null, "created[to]", $this->params['session']->getLanguage())
); );
$this->contentContainerEnd();
if($attrdefgrps) { if($attrdefgrps) {
$attrdefids = array(); $attrdefids = array();
foreach($attrdefgrps as $attrdefgrp) { foreach($attrdefgrps as $attrdefgrp) {
@ -651,12 +652,14 @@ $(document).ready(function() {
foreach($attrdefs as $attrdefarr) { foreach($attrdefs as $attrdefarr) {
$attrdef = $attrdefarr['attrdef']; $attrdef = $attrdefarr['attrdef'];
if(!in_array($attrdef->getID(), $attrdefids)) { if(!in_array($attrdef->getID(), $attrdefids)) {
?> if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
<tr> $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from'));
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td> $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('to').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'));
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?></td> } elseif(in_array($attrdef->getType(), [SeedDMS_Core_AttributeDefinition::type_int, SeedDMS_Core_AttributeDefinition::type_float]) && !$attrdef->getValueSet()) {
</tr> $this->formField(htmlspecialchars($attrdef->getName().' ('.getMLText('from').')'), $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? $attributes[$attrdef->getID()]['from'] : '', 'attributes', true, 'from'));
<?php $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(); $attrdefids[] = $attrdef->getID();
} else { } else {
?> ?>
@ -670,7 +673,6 @@ $(document).ready(function() {
} }
} }
} elseif($attrdefs) { } elseif($attrdefs) {
$this->contentContainerEnd();
// Seach options for documents and folders {{{ // Seach options for documents and folders {{{
/* First check if any of the folder/document filters are set. If it is, /* First check if any of the folder/document filters are set. If it is,