remove duplicate code due to merge errors

This commit is contained in:
Uwe Steinmann 2026-05-06 13:52:18 +02:00
parent 0556d8825c
commit 3b48541ef0

View File

@ -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 "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp->getName())."</b></td></tr>";
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 {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php echo isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : ''; ?></td>
</tr>
<?php
}
}
}
}
} 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.
@ -1031,25 +995,14 @@ $(document).ready(function() {
$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, '', 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("<i class=\"fa fa-search\"></i> ".getMLText('search'));